docs(cc-251): brief-authoring discipline for multi-file dispatches + close cc-250#145
Merged
Conversation
…close cc-250 CC-251 — 3 patterns added to prevent codex apply_patch debug-loop hang on > 4 files OR > 50 lines verbatim briefs: 1. **apply_patch retry-cap** (constraint text): HALT after 2nd consecutive verification failure on the same file; no 3rd retry. Codex has no internal retry-cap → without this, debug loop runs until dispatch timeout (1800s). 2. **Verbatim-as-attached-file** (pattern): write embedded content (override-policy paragraphs, BACKLOG rows, brief-template fragments) to /tmp/<task>-content/*.md BEFORE dispatch; brief references path + says "copy verbatim, do NOT paraphrase". Eliminates the hallucinate-when-retyping failure mode (CC-250 stderr observed `pass/fail print-format` → `print-format` — "pass/fail" dropped). 3. **`expected_head_sha` state pin** (schema field): 40-char sha in brief metadata + `git rev-parse HEAD == <sha>` self_verify check. Catches "wrong branch / branch advanced / file changed by another process" before any patch is attempted. Documented in: - `agents/project-pm.md` — "Multi-file brief discipline" prose added to the "Writing a brief for codex-executor" section - `docs/dispatch-brief.md` — `expected_head_sha` as Optional section with usage example - Memory `[[feedback_codex_brief_discipline]]` (separate repo) — retro evidence from CC-247/248 #142 + CC-250 #144 dispatch hangs For briefs touching > 8 files OR > 200 lines verbatim, ALSO split the dispatch into 2–3 smaller ones (each 2–4 files); split alone without the 3 patterns above doesn't fully prevent the hang. Also closes **CC-250** as a tail-cleanup (status flip + `pr:TBD` → `pr:#144` + body Outcome / See blocks; mirrors the pattern PR #144 brief explicitly deferred to a follow-up commit). MILESTONES.md M1 prerequisite sub-table flips CC-250 ⏳ → ✅ (#144) and adds CC-251 ⏳. Long-term resolution: CC-235 (tiered-lifecycle-gate) enforces split mechanically; CC-244 (typed pipeline) turns verbatim into schema fields; CC-215 (pmctl) may add `--expect-head <sha>` wrapper flag. Validator parity preserved at 30 (CC-228 baseline). No code change; discipline is brief-authoring time, not runtime. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR-gate critic [low]: intro states `> 50 lines` trigger but bullet 2 said `> 30 lines`. Standardize to 50 across both. Matches the memory copy at feedback_codex_brief_discipline.md (also updated 30→50). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.3.0 M1 prerequisite #2 (sister to CC-250). Documents 3 brief-authoring patterns derived from the CC-247/248 (#142) and CC-250 (#144) dispatch hang retros. No code change — discipline lands in
agents/project-pm.md+docs/dispatch-brief.md+ memory[[feedback_codex_brief_discipline]].Also tail-closes CC-250 (status flip 🔵→✅,
pr:TBD→pr:#144, body Outcome) — the closure pattern PR #144's brief explicitly deferred.3 patterns (trigger: brief touches > 4 files OR embeds > 50 lines verbatim)
apply_patchretry-cap/tmp/<task>-content/*.md; brief references path + says "copy verbatim, do NOT paraphrase"pass/fail print-format→print-format— "pass/fail" silently dropped)expected_head_shastate pingit rev-parse HEAD == <sha>self_verifyFor briefs > 8 files OR > 200 lines verbatim, also split the dispatch into 2–3 smaller ones. Discipline first, split second.
Files
agents/project-pm.mddocs/dispatch-brief.mdexpected_head_shaas Optional section with usage exampleBACKLOG.mdMILESTONES.mdMemory
feedback_codex_brief_discipline.md(separate repo, already committed) holds the retro evidence with CC-247/248 + CC-250 stderr excerpts.Verification
bash pm/scripts/validate.sh BACKLOG.md— parity 30 (CC-228 baseline)bash scripts/check-docs-freshness.sh— 0 blocking, 2 WARN (CC-249 pr:TBD spike-pending, CC-251 pr:TBD this PR — both expected)/pr-gate express— Final: GO, critic + qa-tester pass; one [low] critic finding (50-line vs 30-line threshold inconsistency) fixed in tail commitaa96696Long-term resolution
These 3 patterns are operator discipline; the structural fix:
spike→brief→handoverschema) turns verbatim into schema fields with automatic validation--expect-head <sha>wrapper flag for pattern 3 enforcementOut of scope
pmctl--expect-headwrapper — defer to CC-215🤖 Generated with Claude Code