Skip to content

feat(prd): add non-blocking compact hint to lead Stop gate - #103

Merged
fusengine merged 2 commits into
mainfrom
feat/prd-compact-hint
Sep 3, 2026
Merged

feat(prd): add non-blocking compact hint to lead Stop gate#103
fusengine merged 2 commits into
mainfrom
feat/prd-compact-hint

Conversation

@fusengine

Copy link
Copy Markdown
Owner

Summary

  • Lead Stop gate 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 the harness prd compact <task> command, in both native-response and context-response modes. No PRD write; compaction remains an explicit, agent-identity-bound command.
  • Corrects the 0.1.93 support matrix: it wrongly listed the lead Stop block as functional on claude-code. In the real marketplace wiring, claude-code's and Kimi's Stop hook of scope core always passes --sound stop, and src/cli/bin.ts exits 0 in maybePlaySound() 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 logic
  • test/runtime/prd/prd-stop-compact-hint.test.ts — new coverage
  • docs/prd.md, docs/adapters.md — matrix correction + new guard row
  • MEMORY/LESSON.md — session lessons
  • CHANGELOG.md, package.json — 0.1.94 bump (separate commit)

Test plan

  • bun test — 1569 pass, 1 skip, 0 fail
  • bunx tsc --noEmit — silent
  • bun run build — 103 files
  • bun test test/sim/ — 97/97

Breaking changes

None

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.
@fusengine
fusengine merged commit c8ba997 into main Sep 3, 2026
1 check passed
@fusengine
fusengine deleted the feat/prd-compact-hint branch September 3, 2026 12:08
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.

1 participant