Skip to content

fix: explain heading cutoffs in spawn brief refusals - #6101

Open
AnPod wants to merge 3 commits into
kunchenguid:mainfrom
AnPod:cursor/spawn-heading-refusal-c60d
Open

AnPod wants to merge 3 commits into
kunchenguid:mainfrom
AnPod:cursor/spawn-heading-refusal-c60d

Conversation

@AnPod

@AnPod AnPod commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Fix issue #5073: when spawn refuses a brief whose '## Captain's intent' or '## Firstmate spec' section is present but parses empty, the error now names the unfenced same-level heading that ended the subsection and says nested headings must be ### or deeper. An indented sibling contract heading (' ## Firstmate spec', up to three leading spaces) is compared after that indent is removed, so it stays the sibling heading instead of a cutoff that tells the author to change heading level.

What Changed

  • Name the unfenced same-level heading that makes a Captain's intent or Firstmate spec subsection parse empty, and advise using ### or deeper for nested headings.
  • Recognize sibling contract headings with up to three leading spaces without suggesting they need a deeper heading level.
  • Add regression coverage for cutoff diagnostics, indented siblings, deeper and fenced headings, and headings after nonempty body text.

Risk Assessment

✅ Low: The change adds a bounded refusal diagnostic while preserving parsing and validation behavior, and correctly excludes indented sibling contract headings.

Testing

All 15 live CLI checks passed, covering cutoff diagnostics, indentation boundaries, parser exclusions, and refusal side effects. Captured product error messages; cleaned up the disposable environment.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Spawn refuses empty contract sections, names each terminating heading, and recommends ### or deeper ✅ pass live Live spawn refusal transcripts: spec-cutoff, intent-cutoff, both-cutoff
Sibling contract headings with zero through three leading spaces retain the ordinary empty-section error ✅ pass live Live spawn refusal transcripts: sibling-spec-0 through sibling-spec-3 and sibling-intent-0 through sibling-intent-3
Deeper headings, fenced headings, and headings after body text pass content validation and reach the subsequent address guard ✅ pass live Live spawn refusal transcripts: nested, fenced, later
A level-one section boundary retains the ordinary empty-section refusal ✅ pass live Live spawn refusal transcripts: level-one
Refused spawns leave no task metadata or generated launch brief ✅ pass live Live spawn refusal transcripts and driver assertions across all cases
Evidence: Live spawn refusal transcripts

Source: Live spawn refusal transcripts

$ bin/fm-spawn.sh spec-cutoff <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/spec-cutoff/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn; ## Firstmate spec (ended at `## Scope`) parsed empty because a subsection body ends at the next unfenced heading of the same or higher level; put the body text before any such heading, and use ### or deeper for a heading that should stay inside the subsection
Observed expectations: PASS

$ bin/fm-spawn.sh intent-cutoff <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/intent-cutoff/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn; ## Captain's intent (ended at `## Ask`) parsed empty because a subsection body ends at the next unfenced heading of the same or higher level; put the body text before any such heading, and use ### or deeper for a heading that should stay inside the subsection
Observed expectations: PASS

$ bin/fm-spawn.sh both-cutoff <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/both-cutoff/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn; ## Captain's intent (ended at `## Ask`) and ## Firstmate spec (ended at `   ## Scope`) parsed empty because a subsection body ends at the next unfenced heading of the same or higher level; put the body text before any such heading, and use ### or deeper for a heading that should stay inside the subsection
Observed expectations: PASS

$ bin/fm-spawn.sh sibling-spec-0 <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/sibling-spec-0/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

$ bin/fm-spawn.sh sibling-intent-0 <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/sibling-intent-0/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

$ bin/fm-spawn.sh sibling-spec-1 <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/sibling-spec-1/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

$ bin/fm-spawn.sh sibling-intent-1 <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/sibling-intent-1/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

$ bin/fm-spawn.sh sibling-spec-2 <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/sibling-spec-2/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

$ bin/fm-spawn.sh sibling-intent-2 <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/sibling-intent-2/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

$ bin/fm-spawn.sh sibling-spec-3 <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/sibling-spec-3/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

$ bin/fm-spawn.sh sibling-intent-3 <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/sibling-intent-3/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

$ bin/fm-spawn.sh nested <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/nested/brief.md ## Captain's intent has an operator-address line: Captain: Fix pager.; write the captain's actual words without a Captain label or address before spawn, since the heading already records provenance
Observed expectations: PASS

$ bin/fm-spawn.sh fenced <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/fenced/brief.md ## Captain's intent has an operator-address line: Captain: Fix pager.; write the captain's actual words without a Captain label or address before spawn, since the heading already records provenance
Observed expectations: PASS

$ bin/fm-spawn.sh later <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/later/brief.md ## Captain's intent has an operator-address line: Captain: Fix pager.; write the captain's actual words without a Captain label or address before spawn, since the heading already records provenance
Observed expectations: PASS

$ bin/fm-spawn.sh level-one <disposable-project> claude --mode direct-PR --yolo off
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n
error: ~/.no-mistakes/worktrees/ba40ea07ff34/01M4304YVDGZMQMD3QPG6WNREG/.spawn-lab-buuxjp9n/data/level-one/brief.md must contain nonempty ## Captain's intent and ## Firstmate spec subsections (or a nonempty legacy # Task body) before spawn
Observed expectations: PASS

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Spawn refuses empty contract sections, names each terminating heading, and recommends ### or deeper ✅ pass live Live spawn refusal transcripts: spec-cutoff, intent-cutoff, both-cutoff
Sibling contract headings with zero through three leading spaces retain the ordinary empty-section error ✅ pass live Live spawn refusal transcripts: sibling-spec-0 through sibling-spec-3 and sibling-intent-0 through sibling-intent-3
Deeper headings, fenced headings, and headings after body text pass content validation and reach the subsequent address guard ✅ pass live Live spawn refusal transcripts: nested, fenced, later
A level-one section boundary retains the ordinary empty-section refusal ✅ pass live Live spawn refusal transcripts: level-one
Refused spawns leave no task metadata or generated launch brief ✅ pass live Live spawn refusal transcripts and driver assertions across all cases
  • Inspected the base-to-target change and existing focused regression cases.
  • Created a disposable marked home using bin/fm-lab-home.sh create and initialized an isolated project.
  • Executed 15 real bin/fm-spawn.sh &lt;id&gt; &lt;project&gt; claude --mode direct-PR --yolo off calls; asserted exit status, diagnostic messages, and absence of launch artifacts.
  • Captured CLI transcripts and removed the disposable home.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds diagnostic messaging for empty task subsections.

The PR appears safe to merge; no actionable new issue was identified.

Reviews (2) · Last reviewed commit: "no-mistakes(document): Clarify heading b..."

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: First stamp this fetch. Diff reviewed vs tip e2668de04ab3670ea50c1f9ad5fd66de8e01be90.

HEAD e6fd510c855573aeeaf04c568e654375cd66159c. MERGEABLE/UNSTABLE. Author AnPod not blocked. Fixes #5073 verified (issue OPEN; spawn refusal silent on same-level heading cutoff).

Tip vs main (own diff): fm_brief_heading_parse gains terminator mode; fm_brief_task_heading_cutoff_clause names the unfenced same-level heading that emptied ## Captain's intent / ## Firstmate spec; spawn appends that clause to the existing nonempty-subsection refusal. Indented sibling contract headings (≤3 spaces) stay siblings, not cutoffs. Unconfigured path: same briefs still refuse; only the error text is richer — no new default-on surface.

Contract-class: restore — strengthens an existing refusal path's honesty (VISION: strengthens a refusal path). Not new-default (no new wake/observer/Bearings/bootstrap). Issue restore/ready-for-pr labels do not decide class; tip-vs-main does.

VISION.md per-rule

  1. One captain, one interface — aligns (legible refusal).
  2. Authority explicit — n/a (no new autonomy).
  3. Scripts/agents — aligns (scripted parse/refusal).
  4. Restart non-event — n/a.
  5. Delegation with spine — aligns (clearer spawn contract refusal).
  6. Fleet outlives vendor — n/a.
  7. Scope — aligns (command-layer brief validation).

Blocker: Attestation MISSING — no ## Pipeline / no-mistakes attestation in body; NM check 36532037200 FAILURE ("This PR was not raised through no-mistakes"). Behavior CI 36532037105 fully green. Please raise/re-push via git push no-mistakes so attestation MATCHES tip, then we can relook for auto-merge.

Firstmate flag no. Workflow approvals this pass: none (fork CI already ran).

cursoragent and others added 3 commits October 4, 2026 10:23
…tion

A level-2 subsection that opens with another unfenced ## heading parses as
empty, and spawn only said the subsections must be nonempty. Keep that
refusal as one message and name the heading that ended the section, plus
that nested headings must be ### or deeper.

Co-authored-by: AnPod <[email protected]>
Spawn's empty-section note compared the ending heading to the exact
contract strings, so up to three leading spaces made an indented sibling
look like a nested heading. Trim that indent before the comparison.

Co-authored-by: AnPod <[email protected]>
@AnPod
AnPod force-pushed the cursor/spawn-heading-refusal-c60d branch from e6fd510 to fa0060d Compare October 4, 2026 08:26
@AnPod AnPod changed the title Explain spawn refusal when a same-level heading empties a brief section fix: explain heading cutoffs in spawn brief refusals Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants