open-design/packages
Patrick A c5e38bbe58
fix(prompts): remove 10-item cap from discovery TodoWrite plan (#2298)
* fix(daemon): remove 10-item cap from discovery TodoWrite plan prompt

The RULE 3 sentence in DISCOVERY_AND_PHILOSOPHY told the model to write
'a plan of 5–10 short imperative items'. That upper bound caused the agent
to cap every plan at exactly ten steps even when the task genuinely needed
more. The TodoWrite JSON schema imposes no maxItems constraint, so the cap
was entirely prompt-driven.

Replace '5–10 short imperative items' with 'short imperative items covering
the work'. TodoWrite intent, RULE 3 label, and planning-before-building
requirement all survive unchanged.

Red spec: apps/daemon/tests/prompts/discovery-todo-cap.test.ts

* fix(prompts): remove 10-item cap from contracts discovery copy and harden tests

[pass-6,7 BLOCKER] packages/contracts/src/prompts/discovery.ts still had
the old '5-10 short imperative items' wording. apps/web imports
composeSystemPrompt from @open-design/contracts (ProjectView.tsx:43),
so web-originated chat runs were still subject to the cap.

[pass-8 WARNING] discovery-todo-cap.test.ts did not cover the contracts
copy, leaving that path unguarded. Also no guard against semantically
equivalent re-introduction via 'at most / maximum / no more than'.

Changes:
- packages/contracts/src/prompts/discovery.ts: apply same wording fix as
  apps/daemon; add inline rationale comment
- apps/daemon/src/prompts/discovery.ts: add inline rationale comment
- apps/daemon/tests/prompts/discovery-todo-cap.test.ts: add 4th assertion
  blocking 'at most|maximum|no more than N item' re-introduction
- packages/contracts/tests/system-prompt.test.ts: add 5-assertion suite
  guarding the contracts copy and composed prompt output
2026-05-22 16:23:37 +08:00
..
agui-adapter chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
contracts fix(prompts): remove 10-item cap from discovery TodoWrite plan (#2298) 2026-05-22 16:23:37 +08:00
diagnostics feat(diagnostics): add one-click log export from Settings → About (#798) 2026-05-20 09:10:51 +08:00
host [codex] Polish home composer working-directory controls (#2468) 2026-05-21 00:22:46 +08:00
platform chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
plugin-runtime chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
registry-protocol chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
sidecar chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
sidecar-proto Add desktop updater UI flow (#2270) 2026-05-19 21:36:51 +08:00
AGENTS.md refactor desktop host bridge (#2246) 2026-05-19 18:27:05 +08:00