Repository navigation
Fix #1902: prompt sweep — broken commands, porch-approve contradiction, owner rulings, stale text - #1905
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g; subcommand --help no longer executes
A once phase (BUGFIX/AIR PR) can now declare consultation: {type, models}. Porch resolves
the lanes through resolveConsultationModels, the same resolver as a verify step, and
renders {{consult_commands}} / {{consult_verdicts}} into the phase prompt, so
.codev/config.json porch.consultation decides what the builder runs.
porch <command> --help / -h now prints help and returns. Before, porch done --help ran
porch done on the auto-detected project, checks included.
…ontradictions - BUGFIX/AIR: PR phase declares three pr reviewers (configurable); prompts take the consult lines from porch; builder runs porch approve with the human-approval flag; one commit format ([Bugfix #N] Fix:/Test:); fix-in-place; 300 lines is a guideline; escalation via afx send architect, not TOO_COMPLEX. - Dead signal machinery removed from prompts and JSON (signals, on_too_complex, unread defaults.consultation); phases finish with porch done. - SPIR/ASPIR: builder runs the consult commands porch emits; builder commits its own work; PR opens in the Review phase; gate lists include verify-approval; branch names; ASPIR gate wording, inline shared rules, restored builder-prompt rules. - MAINTAIN: own reviewer prompts; git rm for tracked removals; gate named; no hardcoded package path; codev/ copy synced; orphan templates removed. - RESEARCH: JSON and prose agree on three models; no --prompt + --prompt-file. - protocol-schema.json describes the shipped files; a test validates every one. - ID placeholders: <id>/<N>, not XXXX/NNN. - Spec 1280 deletion guard re-baselined under register entry R7, approved by the architect (main) 2026-11-16.
…he CLIs and owner rulings - Roles: gate lists per protocol; the builder runs porch approve with --a-human-explicitly-approved-this; fix-in-place in both roles; flaky tests in the review (PR body for BUGFIX/AIR); porch's post-merge message; integration review takes --issue; afx only from the main root; Fixes #N closes the issue. - Templates: builders write specs and plans (lifecycle, cheatsheet); gates from protocol.json; Tower on 4100; full protocol table; codev import; background tasks instead of & + wait; CLAUDE/AGENTS list porch, drop afx start and the afx spawn --help check; pr-overview without stdin or a filesystem-less mode. - Resources: integration review syntax, command reference (no afx ports or workspace -p/--remote, complete spawn flags, porch next/done), protocol-format documents consultation and consult_commands. - Root CLAUDE.md/AGENTS.md (identical): gates by protocol, branch names, builders write specs and plans, porch (next, done, status, approve).
…Is, identical in all four trees - porch: no porch run; next/done/verify/pending documented; full gate table; the builder runs porch approve with the human-approval flag; no TICK. - afx: PIR listed; --branch/--remote exist; --delay; afx inbox; afx self-refresh; addressing without the zero-padding claim; send reaches any agent; no TICK or --amends (eval 5 now exercises --branch/--remote). - consult: pir in the protocol list; --branch/--base/--model-id; protocol review types need --protocol except integration; background tasks instead of & + wait. - codev: doctor's real AI-model list. - afx, porch and consult join TOUCHED_SKILLS in the four-tree parity test; shipped skill hashes regenerated.
Asserts across both trees, the four skill trees, root CLAUDE/AGENTS and the command docs (PIR and RELEASE excluded) that the broken commands and contradictions #1902 named stay gone: integration pr, --prompt with --prompt-file, porch run, bare protocol review types, stdin --context, afx spawn --help as a check, trailing-& consult, porch approve without the flag, TICK, TOO_COMPLEX/signals, zero-padded ids, port blocks; plus BUGFIX/AIR/RESEARCH lane JSON and gate tables derived from protocol.json. 28 of its 29 checks fail against the pre-fix tree.
…ICK; thread log arch.md documented porch run as a live command and porch approve as human-only; conceptual-model listed TICK among Codev's protocols. Thread log records the fix phase: decisions, the porch --help surprise, R7, and verification.
Codex flagged the thread-log commit against the Fix:/Test: format. The rule never covered the other commits a BUGFIX branch carries (thread log, review follow-ups); every commit now starts with [Bugfix #N], with Fix:/Test: for the fix and the regression test and a short label (CMAP:, Thread:) for the rest.
Claude's review: nothing asserted that a prompt using {{consult_commands}} /
{{consult_verdicts}} belongs to a phase declaring consultation, so a future author could
ship a literal token. The sweep now checks every protocol phase (using porch's own
prompt lookup: build.prompt, else <phase>.md) and asserts it sees the BUGFIX/AIR PR
prompts, so the guard cannot pass vacuously.
…l flag porch status and the gate message printed 'To approve: porch approve <id> <gate>' without --a-human-explicitly-approved-this; an agent copying it gets a refusal. Both hints now carry the flag, and the sweep test checks every approve hint in porch source.
… gate requested
|
Thank you, this is a careful sweep. The porch change is the right size, the tests got stronger rather than weaker, and catching Independent integration reviews: codex REQUEST_CHANGES, claude COMMENT. For the record, the R7 approval is real: I gave it as architect main on 2026-11-16 UTC (claude's review queried the date). I would like five things folded in before merge:
Also: PR #1904 (PIR repair) changes Not asking for: the flaky-test wording (pre-existing rule in the builder role; I will raise it with the owner), RELEASE, INSTALL.md, or the |
…ll gate list; live docs swept Architect review of PR #1905: - builder.md had every builder announce 'Ready for cleanup' after a PR merge, while SPIR/ASPIR still need the worktree through verify. The row is now per protocol: cleanup right after the merge only for protocols with no verify phase; SPIR/ASPIR announce verify, then cleanup after verify-approval. - builder.md's gate list now names PIR, RESEARCH and EXPERIMENT too. The sweep checks every gate list (builder role, lifecycle, CLAUDE.md, porch skill) against protocol.json. - docs/faq.md showed 'porch run 42' and a flagless 'porch approve', and listed retired TICK; docs/tips.md showed a nonexistent 'afx ports' and an integration review without --issue. The sweep now covers live docs/ pages (release notes excluded); its trailing-& rule stays agent-only, since a human at a shell backgrounds with & + wait correctly.
…h; fail fast on an unrendered consult token Architect review of PR #1905: - The schema allowed enabled/parallel on a phase-level consultation, but normalizePhase reads only type and models, so enabled: false validated and was ignored. Dropped from the schema and from RESEARCH's two blocks (both were true, so nothing changes). At load, a false value is now an error naming porch.consultation as the place to turn reviewers off; a legacy true is a tolerated no-op, so older local copies keep loading. - A prompt still holding {{consult_commands}} / {{consult_verdicts}} after substitution now throws (a local protocol.json older than its prompt), instead of handing the builder a PR step with no reviewers. The #1455 fixture rendered the real BUGFIX pr.md against a phase without the block; it now carries the shipped one.
Conflict in porch/prompts.ts: both sides added a substituteVariables parameter (main: issue,
for {{issue.number}}; this branch: consultation). Kept both, consultation after issue, and
main's dotted-name regex now feeds this branch's unrendered-consult-token check.
…nning, not skipped Owner ruling (decision main-13, 'report'), relayed by the architect: a builder does not skip a flaky pre-existing test. It leaves it running, names it under Flaky Tests in the review (the PR body for BUGFIX/AIR) and tells the architect. Changed in both trees wherever the old skip-with-annotation rule appeared: builder role (plus a notification row), BUGFIX edge cases, SPIR review template, the SPIR/ASPIR/AIR/PIR pr-review checklists, PIR implement and review prompts. Four guarded baselines re-captured under register entry R8; the sweep asserts no agent-facing file, PIR included, says to skip a flaky test.
…s one written exception; RELEASE facts corrected Owner ruling (decision main-17, 'exception'), relayed by the architect: RELEASE keeps its direct commit and push to main. roles/architect.md (both trees) now names it as the one exception to 'don't commit to the default branch': the release commit and tag, made by the architect under RELEASE after the owner's go. RELEASE says the same at its commit step. Two stale RELEASE facts fixed: notes are docs/releases/vX.Y.Z-<codename>.md (git mv from UNRELEASED.md when the cycle kept one), and the codename table runs to 3.3 Luxor, filled from the docs/releases/ filenames and headings. 2.1 records no codename, so its row is blank. The sweep pins both facts to docs/releases/ and the architect exception.
…'s shipped consultation block The #1903 test (from main) renders every shipped PIR/AIR/BUGFIX prompt against a hand-built phase. BUGFIX/AIR pr.md use {{consult_commands}}, which porch now refuses to leave unrendered, so the fixture takes the phase's consultation block from the shipped protocol.json, as porch does.
Summary
This sweeps every prompt outside
protocols/pir/: roles, skills, templates and the non-PIR protocols, incodev-skeleton/,codev/and the repo-local skill trees. It fixes commands that fail when run as written, the contradiction over who runsporch approve, the three owner rulings, and the stale and contradictory text listed in the issue. Every claim was checked against the CLI source before editing.Fixes #1902
Root Cause
Prompts drifted from the CLIs and from each other:
porch run,--type integration pr <N>.signals,TOO_COMPLEX,on_too_complex, and the phaseconsultationblock in BUGFIX/AIR.porch approve.The C2 part is a code gap. Porch never read a once-phase
consultationblock, so the BUGFIX/AIR PR prompts hardcoded threeconsultlines and ignored.codev/config.jsonporch.consultation. This repo is configured for codex+claude, yet every BUGFIX builder here also ran gemini.Fix
Porch code (one small mechanism, per C2):
consultation: {type, models}. Porch resolves the lanes throughresolveConsultationModels, the same resolver a verify step uses, and renders{{consult_commands}}and{{consult_verdicts}}into the prompt. BUGFIX and AIR declare{type: pr, models: [gemini, codex, claude]}.protocol.json, past or present, has one.porch <cmd> --helpexecuted the command.porch done --helpranporch doneon the auto-detected project, checks and all.--help/-hafter a subcommand now prints help and returns.A. Commands that failed as written:
--type integration --issue <N>.--prompt.porch next/porch verifyinstead ofporch run.--protocolon every protocol review type.--contextor filesystem-less mode.afx spawn --protocol <name> --helpcheck is dropped; it exits 0 for any name.B. Who runs
porch approve: the builder runsporch approve <id> <gate> --a-human-explicitly-approved-thisafter the architect relays the human's decision. Fixed in the porch skill,bugfix/prompts/pr.md, both roles andlifecycle.md.C. Owner rulings:
D. Contradictions and stale text:
protocol.json.porch done+afx send architect.pr_existscheck requires it).builder/<protocol>-<id>.git rm, gate named, no hardcoded path,codev/synced, orphan templates removed.[Bugfix #N] Fix:/Test:), flaky tests,Fixes #N.templates/CLAUDE.md,architect.md, doctor list.<id>/<N>placeholders.protocol-schema.jsonrewritten to describe the shipped files.Spec 1280 deletion guard: it tripped on 10 prompts because of removals the issue requires. Re-baselined under register entry R7, which the architect (main) approved 2026-11-16. The guard is kept. Four more baselines were re-captured under R8 for the flaky-test ruling below.
Fold-ins from the
prgate review (architect, plus owner rulings main-13 and main-17):roles/builder.md: the post-merge message depends on the protocol. "Ready for cleanup" is sent right after the merge only for protocols with noverifyphase; SPIR/ASPIR send "Entering verify" and announce cleanup afterverify-approval. The gate list names every protocol's gates.consultationhas noenabled/parallelswitch: they are dropped from the schema and from RESEARCH's blocks (both weretrue, so nothing changes). Afalseis rejected at load; a legacytrueis tolerated so older local copies keep loading.{{consult_commands}}/{{consult_verdicts}}is still in a prompt after substitution (a localprotocol.jsonolder than its prompt). It caught the same skew in two test fixtures,#1455and#1903; both now carry the shipped block.docs/faq.mdanddocs/tips.mdfixed (porch run, flagless approve, retired TICK, nonexistentafx ports, integration review without--issue). Livedocs/pages are now a sweep root.roles/architect.mdnames the release commit and tag, made under RELEASE after the owner's go, as the one exception to "don't commit to the default branch". RELEASE's notes filename (vX.Y.Z-<codename>.md) and codename table (through 3.3 Luxor, fromdocs/releases/; 2.1 left blank because no codename is recorded) are fixed.Main merged in after PR #1904. The one conflict, in
porch/prompts.ts, kept both newsubstituteVariablesparameters (issue,consultation).Test Plan
bugfix-1902-prompt-sweep.test.tshas 29 checks over every agent-facing surface. 28 of them fail against a snapshot of the pre-fix tree; the 29th is a coverage sanity check.bugfix-1902-pr-consultation.test.ts: default lanes, config override, per-protocol override,none/parent, the rendered BUGFIX/AIR prompts, and malformed-block rejection.bugfix-1902-subcommand-help.test.ts.protocol-schema-validates.test.ts: all 18protocol.jsonfiles, PIR included read-only, plus the three schema copies identical.#1903fixture skew above, now fixed and passing. Two are the flaky session-manager tests listed below. CI covers the final head.CLAUDE.md≡AGENTS.md(byte-identical).porch run,TICK,TOO_COMPLEXandintegration pr: the only remaining hits are historical records (archives, lessons attributed to old TICK projects, audits, bench output, the 1280 register).--helpthrough this branch's binaries (32 invocations, all exit 0), covering porch next/done/status/check/gate/pending/approve/verify/rollback/init, consult, afx spawn/send/inbox (show, dismiss)/self-refresh/cleanup/interrupt/refresh/dev/setup/workspace start/tower connect/tower register/status/architect, and codev doctor/import/init/adopt/update. Each documented flag was grep-checked in the help text.consult --type integration pr 1→Unknown subcommand: pr;--prompt+--prompt-file→Cannot use both.porch nextfor this very PR phase rendersconsult -m codex …/consult -m claude …, which are this repo's configured lanes.Flaky Tests
Pre-existing tests that failed intermittently under machine load, unrelated to this PR. Per the owner's ruling, none was skipped. Each passed standalone:
bootstrap-docs.test.ts› "a missing, edited or older installed skill gets the packaged text inlined": 5000 ms timeout.session-manager.test.ts› "bounds a harness that exits 0 immediately", and (post-merge run) "respects maxRestarts limit" and "applies crashLoopFallback after repeated fast failures": process-timing assertions; 97/97 standalone.bugfix-1267-launch-loop.test.ts› "keeps resuming across a CRASH…" and "the switch to fresh is sticky…": 5000 ms timeouts.One
porch donetest check also failed intermittently, with output truncated, and passed on rerun.For the architect
codev/protocolsnow use{{consult_commands}}. Until the installed porch includes this change (local-installor the next release), builders here will see that token unrendered. Adopters are unaffected, because prompts and code ship together.INSTALL.mdis pre-v2 throughout (SPIDER, Ruler, TICK).resources/commands/*.mdtrees have drifted apart. I fixed what was broken in both but did not sync them.