feat(hooks): /goal SDLC discipline gate (closes #360, refs #359)#369
Merged
Conversation
PR #355 (v1.77.0) added skill-text guidance that `/goal` must state HIGH 95% confidence and bind to a DLC (`/sdlc`, `/gdlc`, `/ldlc`) before firing. The guidance worked at the meta level but had no runtime enforcement — exactly the failure mode the discipline gate documented (text-only guidance doesn't survive the failure mode it's trying to prevent). This adds `hooks/goal-confidence-check.sh` as a UserPromptSubmit hook that: 1. Matches `/goal <condition>` prompts (silent on `/goal` status + `/goal clear`). 2. Reads `transcript_path` from hook input (verified available on UserPromptSubmit per Anthropic hook docs at code.claude.com/docs/en/hooks), walks the JSONL to find the last assistant text message, and scans for HIGH-95% confidence patterns (`HIGH (95%`, `Confidence: HIGH`, `HIGH 95%`, etc.). 3. Greps the goal condition for a DLC binding (`/[a-z]+dlc`). 4. Emits LOUD warnings on either gap — non-blocking soft nudge (exit 0), same pattern as `model-effort-check.sh`. Registered in both channels: `cli/templates/settings.json` (npm/CLI) and `hooks/hooks.json` (plugin via ${CLAUDE_PLUGIN_ROOT}). Dedupes via `_find-sdlc-root.sh` helper so dual installs don't double-fire. Bundled paperwork: - `ROADMAP.md` adds the missing `## Research Parking Lot` section that the Demand-Signal-First entry gate references but was never created. Includes the maintenance rule (prune expired rows during quarterly triage). - `skills/sdlc/SKILL.md` adds a one-line enforcement cross-reference in the Long-Running Goals section. Trimmed adjacent prose to stay under the 5K token cap (#236). #359 triage (companion close): Of the 10 API changelog entries since 2026-04-16: 8 are clearly no-op for the wizard (MCP tunnels, SEC web search data, cache diagnostics, fast mode, AWS hosting, multiagent sessions, rate limits API, managed-agent memory — all orthogonal to SDLC enforcement). 2 are deprecations — verified zero usage in this repo: `context-1m-2025-08-07` (Sonnet 4.5/4 1M beta retired 2026-04-30; we use the separate `opus[1m]` alias) and `claude-3-haiku- 20240307` (Haiku 3 retired 2026-04-20; we never used it). #359 will be closed with the triage comment after merge. Verified locally: test-hooks 160/160 (4 new #360 tests + 156 existing), test-audit-session-load 10/10, test-cli 91/91, test-plugin all green, test-doc-consistency 41/41, test-self-update 153/153, test-setup-path 83/83.
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
PR #355 (v1.77.0) added skill-text guidance that
/goalmust state HIGH 95% confidence and bind to a DLC (/sdlc,/gdlc,/ldlc) before firing. The guidance worked at the meta level but had no runtime enforcement — exactly the failure mode the discipline gate documented ("text-only guidance doesn't survive the failure mode it's trying to prevent").This adds
hooks/goal-confidence-check.shas the runtime enforcement layer.What ships
hooks/goal-confidence-check.sh(NEW)/goal <condition>(silent on/goalstatus +/goal clear). Readstranscript_pathfrom hook input (verified available on UserPromptSubmit per code.claude.com/docs/en/hooks), walks the JSONL viajq -rsto find the last assistant text message, scans for HIGH-95% confidence patterns. Greps the goal condition for a DLC binding (/[a-z]+dlc). Emits LOUD warnings on either gap — non-blocking soft nudge (exit 0), same pattern asmodel-effort-check.sh. Dedupes via_find-sdlc-root.shso plugin + project copies don't double-fire.cli/templates/settings.jsonhooks/hooks.json${CLAUDE_PLUGIN_ROOT}).cli/init.jsFILESlist, executable flag set.skills/sdlc/SKILL.mdtests/test-hooks.shBundled paperwork
ROADMAP.md— Adds the missing## Research Parking Lotsection that the Demand-Signal-First entry gate references but was never created. Includes maintenance rule (prune expired rows during quarterly triage, log removals in commit message).Companion close: #359 triage
Of the 10 API changelog entries since 2026-04-16:
context-1m-2025-08-07(Sonnet 4.5/4 1M beta retired 2026-04-30) — we use the separateopus[1m]alias, not the deprecated beta headerclaude-3-haiku-20240307(Haiku 3 retired 2026-04-20) — never usedGreps confirm zero occurrences of either identifier. #359 will be closed with the triage comment after this PR merges.
Closes
Test plan
tests/test-hooks.sh— 160/160 (4 new [feature] /goal should enforce HIGH-95% confidence gate (not just document it) #360 tests + 156 existing)tests/test-audit-session-load.sh— 10/10 (SKILL.md under 5K cap)tests/test-cli.sh— all passingtests/test-plugin.sh— all passingtests/test-doc-consistency.sh— 41/41tests/test-self-update.sh— all passingtests/test-setup-path.sh— all passingvalidate