feat(prd): add non-blocking compact hint to lead Stop gate - #103
Merged
Conversation
When the coordinator's lead Stop fires with no unresolved cross-check violation and at least one task is fully validated (every agent, every sub-task) but not yet compacted, prdStopGate now emits a one-shot, non-blocking reminder naming the task(s) and the exact `harness prd compact <task>` command, in both native-response and context-response tracking modes. No PRD file is written by the hint itself: compaction stays an explicit command since it destroys the PRD's detailed form and its own hook runs under the identity of the agent that triggers it, not the coordinator's. Also corrects the support matrix published in 0.1.93: it listed the lead Stop block as functional on claude-code, which is false in the real deployment. claude-code's and Kimi's own marketplace Stop hook of scope `core` always passes `--sound stop`, and `src/cli/bin.ts` exits 0 in `maybePlaySound()` before stdin is ever read, so the gate is never reached on either target. docs/prd.md and docs/adapters.md now name that wiring cause and separate it from the gate itself, which is correct and verified whenever actually invoked.
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
Stopgate now emits a one-shot, non-blocking "ready to compact" hint when no cross-check violation is pending and at least one task is fully validated — names the task(s) and theharness prd compact <task>command, in both native-response and context-response modes. No PRD write; compaction remains an explicit, agent-identity-bound command.Stopblock as functional on claude-code. In the real marketplace wiring, claude-code's and Kimi'sStophook of scopecorealways passes--sound stop, andsrc/cli/bin.tsexits 0 inmaybePlaySound()before stdin is read — the gate is never reached on either target. Docs now name that wiring cause and separate it from the gate itself (correct and verified whenever actually invoked, e.g. on Codex).Changes
src/runtime/prd/prd-stop-gate.ts— compact hint logictest/runtime/prd/prd-stop-compact-hint.test.ts— new coveragedocs/prd.md,docs/adapters.md— matrix correction + new guard rowMEMORY/LESSON.md— session lessonsCHANGELOG.md,package.json— 0.1.94 bump (separate commit)Test plan
bun test— 1569 pass, 1 skip, 0 failbunx tsc --noEmit— silentbun run build— 103 filesbun test test/sim/— 97/97Breaking changes
None