bloat: TDD CHECK nudge fires once per CC session (v1.70.0) - #315
Merged
Conversation
hooks/tdd-pretool-check.sh emitted a ~50-token JSON nudge ('TDD CHECK:
Are you writing IMPLEMENTATION before a FAILING TEST?') on every
Write/Edit/MultiEdit touching src/**. After the SDLC skill auto-invokes
(which already covers TDD RED/GREEN), the per-Edit nudge is duplicate
context. Typical SDLC session has 10-30 src Edits = ~0.5-1.5K wasted
tokens.
Same atomic-noclobber sentinel pattern proven in v1.69.0 (BASELINE gate),
applied to the TDD CHECK output. New sentinel at \$SDLC_WIZARD_CACHE_DIR/
tdd-shown-<session_id>. Non-src/ files still produce zero output and
crucially DO NOT consume the sentinel slot (Test 6).
Codex round 1 caught one P1 (new test file untracked at review time);
fixed by staging before round 2. Round 2 CERTIFIED 9/10.
ROADMAP #236 phase 2. Combined v1.69.0 + v1.70.0 saves ~13.5K tokens
on a 50-prompt + 20-Edit session.
BaseInfinity
added a commit
that referenced
this pull request
May 5, 2026
hooks/tdd-pretool-check.sh emitted a ~50-token JSON nudge ('TDD CHECK:
Are you writing IMPLEMENTATION before a FAILING TEST?') on every
Write/Edit/MultiEdit touching src/**. After the SDLC skill auto-invokes
(which already covers TDD RED/GREEN), the per-Edit nudge is duplicate
context. Typical SDLC session has 10-30 src Edits = ~0.5-1.5K wasted
tokens.
Same atomic-noclobber sentinel pattern proven in v1.69.0 (BASELINE gate),
applied to the TDD CHECK output. New sentinel at \$SDLC_WIZARD_CACHE_DIR/
tdd-shown-<session_id>. Non-src/ files still produce zero output and
crucially DO NOT consume the sentinel slot (Test 6).
Codex round 1 caught one P1 (new test file untracked at review time);
fixed by staging before round 2. Round 2 CERTIFIED 9/10.
ROADMAP #236 phase 2. Combined v1.69.0 + v1.70.0 saves ~13.5K tokens
on a 50-prompt + 20-Edit session.
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
Phase 2 of ROADMAP #236 functional-bloat audit.
hooks/tdd-pretool-check.shwas emitting a ~50-token JSON nudge on every Write/Edit/MultiEdit touchingsrc/**. After SDLC skill auto-invokes (already covers TDD RED/GREEN), per-Edit nudge is duplicate. Typical session has 10-30 src Edits = ~0.5-1.5K wasted tokens.Now gated on per-
session_idsentinel via the same atomic-noclobber pattern proven in v1.69.0 (BASELINE gate). New sentinel at$SDLC_WIZARD_CACHE_DIR/tdd-shown-<id>.Combined savings (v1.69.0 + v1.70.0): ~13.5K tokens on a 50-prompt + 20-Edit session.
Behavior matrix
Cross-model review
Codex round 1 caught 1 P1: new test file untracked at review time. Fixed by staging before round 2. Round 2 CERTIFIED 9/10.
Test plan
tests/test-tdd-pretool-fires-once.sh(new) — 9 casestests/test-hooks.sh— 154/154 pass (no regression)tests/test-baseline-fires-once.sh— 10/10 pass (v1.69.0 sibling untouched)tests/test-prompt-hook-fires-once.sh— 6/6 passtests/test-audit-session-load.sh— 9/9 pass (SKILL.md under 5K)tests/test-cli.sh— 78/78 passtests/test-plugin.sh— 25/25 passtests/test-doc-consistency.sh— 35/35 passtests/test-workflow-triggers.sh— 169/169 pass (CONTRIBUTING.md + ci.yml wiring verified locally)Files
hooks/tdd-pretool-check.sh— atomic-claim sentinel + jq-decoupled session_id extractiontests/test-tdd-pretool-fires-once.sh(new — 9 cases including 50-parallel concurrency, non-src/-doesn't-consume-sentinel, suppressed-fire-empty).github/workflows/ci.yml,CONTRIBUTING.md— wires new testCHANGELOG.md,SDLC.md,skills/update/SKILL.md,package.json,.claude-plugin/plugin.json+marketplace.json,CLAUDE_CODE_SDLC_WIZARD.md(1.69.0 → 1.70.0).reviews/preflight-*.md,.reviews/tdd-pretool-fires-once-001/round-{1,2}-review.md(force-added past.reviews/gitignore)