Skip to content

fix(create-spec): show the contract before the lock prompt - #62

Open
sellke wants to merge 3 commits into
mainfrom
claude/sweet-pike-a83e04
Open

sellke wants to merge 3 commits into
mainfrom
claude/sweet-pike-a83e04

Conversation

@sellke

@sellke sellke commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Summary

In Phase 13 UAT (hygiene Scenario 29), a live /create-spec run on Claude Code 2.1.308 drafted the contract only in its reasoning and then showed the Contract Decision prompt. The maintainer locked a contract they never saw. This PR requires the contract to be printed before the lock prompt, makes the prompt fit Claude Code's 4-option limit, and rewrites the discovery question rule to say what it is for.

Changes

  • Visible contract: Step 1.4b starts with a precondition: the full contract is already printed as a visible message, whether or not the session is in Plan Mode. The --from-prototype and --from-issue paths print their contract too, and their Step 3s require the Step 1.4b lock.
  • Contract Decision: four options. "More questions" folds into "edit", and the free-text "Other" goes there as well.
  • Discovery rule: Step 1.3 starts with "One question at a time:":
    • Ask a question alone when its answer could change what you ask next.
    • Independent, bounded choices may share one AskQuestion prompt, each led by a recommendation.
    • The maintainer chose this rule on 2026-10-22. cae0ced (a strict one-question-per-prompt rule) is replaced by 8a59b4b.
  • Checks: eval-command-structure.py gains a lead kind (a step starts with a **<label>:** paragraph), with five create-spec rows, a self-test, and tests.
  • Overage: create-spec.md repinned from 13,602 to 14,445 bytes (+843), as disclosed in each commit.
  • UAT plan: hygiene Scenario 29's expected results now match the new rules.

Spec Reference

  • Bug: .writ/issues/bugs/2026-10-22-create-spec-can-lock-an-unseen-contract.md
  • Spec: .writ/specs/2026-10-20-shipped-command-hygiene/ (Scenario 29)

Test Results

uv run pytest, the bash tests in scripts/tests/, and bash scripts/eval.sh pass on 8a59b4b (run by the fix session).

Live: Scenario 29 run 2, on 3fdbbbf, printed all seven contract sections before a 4-option lock prompt, and the package passed every check. The maintainer marked it Pass under the reworded discovery rule. The final rule text (8a59b4b) has not been re-run live.

Drift Report

No spec drift. This fixes a Phase 13 regression: the cut log recorded the conversation-rule change as "format only".

Review Notes

No pre-landing review performed. Merge this before #61, whose Phase 13 closure record cites this PR.

🤖 Generated with Claude Code

sellke and others added 3 commits October 22, 2026 11:36
A live /create-spec run on Claude Code drafted the contract only in its
reasoning, then showed the Contract Decision prompt, so the user locked a
contract they never saw.

- Step 1.4b opens with a precondition: the full contract is already
  printed as a visible message, in Plan Mode or not. Both --from Step 2s
  say to print it; both --from Step 3s open with a precondition that the
  lock happened at Step 1.4b.
- Contract Decision drops to four options: "more questions" folds into
  "edit", and any free-text reply (a platform's automatic "Other") routes
  there. Fits Claude Code's AskUserQuestion cap without adapter mapping.
- eval-command-structure.py gains a `precondition` kind (a step's first
  paragraph is **Precondition:**, ahead of any fenced prompt) with three
  create-spec rows, a self-test, and tests.
- create-spec.md overage repinned 13602 -> 14065, disclosed.
- Hygiene UAT Scenario 29 step 4 now expects the visible contract and
  four options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A live re-run of hygiene UAT Scenario 29 on 3fdbbbf put three discovery
questions in one AskUserQuestion call. The Phase 13 cut had reduced the
pre-cut "Ask ONE focused question at a time" bullet to a clause inside
the run-in Conversation rules paragraph.

- Step 1.3 opens with "**One question per prompt:**": one question per
  Plan Mode message, or per AskQuestion call (AskUserQuestion on Claude
  Code) with a single `questions` entry; never bundled; the next only
  after the answer. The clause moves out of Conversation rules.
- The --from-prototype and --from-issue Step 1s open with the same rule,
  since they replace Phase 1 and did not inherit it.
- eval-command-structure.py: the `precondition` kind from 3fdbbbf becomes
  a general `lead` kind ("<heading> | <label>": each matching step opens
  with a **<label>:** paragraph). Five create-spec rows: two for the
  discovery rule, three for the existing preconditions. Self-test and
  tests updated.
- create-spec.md overage repinned 14065 -> 14632 (+567 bytes), disclosed.
- Scenario 29 Expected Result: each discovery prompt carries one question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rompt

Replaces the strict rule from cae0ced with the maintainer's wording. A
question whose answer could change the next one is still asked alone.
Independent, bounded choices with a known option space may now share
one AskQuestion prompt.

- Step 1.3 opens with "**One question at a time:**": when a question's
  answer could change what you ask next, ask it alone; re-analyze, and
  re-scan the code if relevant, before the next; independent bounded
  choices (for example output format, empty-state behavior, test
  approach) may share one AskQuestion prompt, each led by a
  recommendation. Conversation rules keeps "start on the highest-impact
  unknown".
- The --from-prototype and --from-issue Step 1s now point to Step 1.3
  instead of restating the strict rule.
- The two `lead` rows and their tests use the new label.
- create-spec.md overage repinned 14632 -> 14445 (-187 bytes), disclosed.
- Scenario 29 Step 3 now expects one question per prompt when answers
  depend on each other, with independent bounded choices allowed to
  share a prompt. The strict expected-result line is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sellke sellke added the bug Something isn't working label Oct 22, 2026
sellke added a commit that referenced this pull request Oct 22, 2026
Hygiene S29 was re-run on the fix branch (PR #62). The contract now prints
before the lock prompt, and the package passes every check. The maintainer
marked it Pass under the reworded discovery rule: independent bounded
choices may share one prompt. Final UAT: 173 of 176 pass, 1 fail (names S9),
2 not runnable without OpenClaw.

Neither S29 run entered Plan Mode, which ADR-001 asks for during discovery.
Filed as an improvement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sellke added a commit that referenced this pull request Oct 22, 2026
/verify-spec --product found that both mission.md and roadmap.md still
called Phase 13 unreleased and pending UAT. The /plan-product --reconcile
pass that followed:

- marks Phase 13 closed 2026-10-22, released in v0.43.0
- adds its condensed-history row
- marks success criterion 2 met from the first CI runs (39678517441 green,
  39795856168 red as designed)
- records UAT as 173 of 176: names S9 tracked as an issue, S12/S13 need
  OpenClaw, S29's regression fixed in PR #62

No new ADR. mission-lite.md and context.md regenerated. Merge PR #62 first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sellke added a commit that referenced this pull request Oct 22, 2026
PR #62 does every item in the issue's Expected Outcome: the contract is
printed before the lock prompt, the prompt has four options, and hygiene
S29 passes on a re-run. The maintainer chose not to write a spec for
work that is already done. The Plan Mode gap stays open as its own issue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant