bloat: BASELINE block fires once per CC session (v1.69.0) - #314
Merged
Conversation
hooks/sdlc-prompt-check.sh emitted a ~250-token static SDLC BASELINE block on every UserPromptSubmit. After the SDLC skill auto-invokes, that block is duplicate context — ~12K tokens/session wasted for any user with >3 prompts. Now gated on a per-session_id sentinel under \$SDLC_WIZARD_CACHE_DIR/baseline-shown-<id>, atomic-claimed via subshell 'set -C' (noclobber) so N parallel fires emit exactly once. Pruned at 7d. SETUP-not-complete + EFFORT-bump warnings still fire every prompt. No-session_id stdin keeps current emit-every-fire behavior (legacy CC + direct shell tests). Codex round 1 caught two P1s, both fixed: (a) concurrency race in naive 'check then write-after-emit' pattern; (b) session_id extraction was jq-coupled — now uses grep+sed so the gate works without jq. Round 2 CERTIFIED 9/10. Regression tests: 50-parallel + restricted- PATH-no-jq. Discovered during ROADMAP #236 functional-bloat audit. Audit method: measure cost x frequency, judge value — not blind delete-and-see. Other hooks audited (model-effort-check, precompact-seam-check, token-spike-check) earned their keep — silent at healthy state.
test-workflow-triggers.sh asserts CONTRIBUTING.md lists every test script that CI runs. Adding the new test was missed in the v1.69.0 commit.
BaseInfinity
added a commit
that referenced
this pull request
May 5, 2026
* bloat: BASELINE block fires once per CC session (v1.69.0) hooks/sdlc-prompt-check.sh emitted a ~250-token static SDLC BASELINE block on every UserPromptSubmit. After the SDLC skill auto-invokes, that block is duplicate context — ~12K tokens/session wasted for any user with >3 prompts. Now gated on a per-session_id sentinel under \$SDLC_WIZARD_CACHE_DIR/baseline-shown-<id>, atomic-claimed via subshell 'set -C' (noclobber) so N parallel fires emit exactly once. Pruned at 7d. SETUP-not-complete + EFFORT-bump warnings still fire every prompt. No-session_id stdin keeps current emit-every-fire behavior (legacy CC + direct shell tests). Codex round 1 caught two P1s, both fixed: (a) concurrency race in naive 'check then write-after-emit' pattern; (b) session_id extraction was jq-coupled — now uses grep+sed so the gate works without jq. Round 2 CERTIFIED 9/10. Regression tests: 50-parallel + restricted- PATH-no-jq. Discovered during ROADMAP #236 functional-bloat audit. Audit method: measure cost x frequency, judge value — not blind delete-and-see. Other hooks audited (model-effort-check, precompact-seam-check, token-spike-check) earned their keep — silent at healthy state. * ci: list test-baseline-fires-once.sh in CONTRIBUTING.md test-workflow-triggers.sh asserts CONTRIBUTING.md lists every test script that CI runs. Adding the new test was missed in the v1.69.0 commit.
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
hooks/sdlc-prompt-check.shBASELINE block (~250 tokens) was firing on everyUserPromptSubmit— pure duplication after the SDLC skill auto-invokes. ~12K tokens/session wasted for users with >3 prompts.session_idsentinel under$SDLC_WIZARD_CACHE_DIR/baseline-shown-<id>, atomic-claimed via subshellset -C(noclobber). N parallel fires emit exactly once. SETUP-not-complete + EFFORT-bump warnings still fire every prompt (dynamic state).model-effort-check,precompact-seam-check,token-spike-check) audited and earned their keep — silent at healthy state.Behavior matrix
SETUP NOT COMPLETEwarningEFFORT BUMP REQUIREDnudgeCross-model review
Codex round 1 (gpt-5.5 xhigh) caught 2 P1s:
(set -C; : > sentinel)claim.grep | head | sedso the gate works without jq. Prompt parsing still uses jq (multi-line content).Round 2: CERTIFIED 9/10, no blocking findings. Round-1/round-2 reviews archived under
.reviews/baseline-fires-once-001/.Test plan
tests/test-baseline-fires-once.sh(new) — 10 cases, 8/8 baseline + 2 P1 regressions: 50-parallel concurrency + restricted-PATH-no-jqtests/test-hooks.sh— 154/154 pass (no regression)tests/test-prompt-hook-fires-once.sh— 6/6 pass (ROADMAP fix(#226): honest labeling for judge-CI vs true N-trial CI #224 instrumentation regression including byte-identical assertion)tests/test-audit-session-load.sh— 9/9 pass (skills/update/SKILL.mdstill under 5K-token threshold after changelog entry)tests/test-cli.sh— 78/78 passtests/test-plugin.sh— 25/25 passtests/test-doc-consistency.sh— 35/35 passFiles
hooks/sdlc-prompt-check.sh— atomic-claim sentinel + jq-decoupled session_id extractiontests/test-baseline-fires-once.sh(new — 10 cases).github/workflows/ci.yml— wires new test into validate jobCHANGELOG.md,SDLC.md,skills/update/SKILL.md,package.json,.claude-plugin/plugin.json+marketplace.json,CLAUDE_CODE_SDLC_WIZARD.md(1.68.0 → 1.69.0).reviews/preflight-baseline-fires-once-001.md,.reviews/baseline-fires-once-001/round-{1,2}-review.md(force-added past.reviews/gitignore for repo history)