agentic-sdlc-wizard 1.69.0 → 1.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@
13
13
  "name": "sdlc-wizard",
14
14
  "source": ".",
15
15
  "description": "SDLC enforcement for AI agents — TDD, planning, self-review, CI shepherd",
16
- "version": "1.69.0",
16
+ "version": "1.70.0",
17
17
  "author": {
18
18
  "name": "Stefan Ayala"
19
19
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdlc-wizard",
3
- "version": "1.69.0",
3
+ "version": "1.70.0",
4
4
  "description": "SDLC enforcement for AI agents — TDD, planning, self-review, CI shepherd",
5
5
  "author": {
6
6
  "name": "Stefan Ayala",
package/CHANGELOG.md CHANGED
@@ -4,6 +4,34 @@ All notable changes to the SDLC Wizard.
4
4
 
5
5
  > **Note:** This changelog is for humans to read. Don't manually apply these changes - just run the wizard ("Check for SDLC wizard updates") and it handles everything automatically.
6
6
 
7
+ ## [1.70.0] - 2026-05-05
8
+
9
+ ### Token-bloat fix: TDD CHECK nudge fires once per CC session
10
+
11
+ `hooks/tdd-pretool-check.sh` was emitting 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.
12
+
13
+ Now gated on per-`session_id` sentinel under `$SDLC_WIZARD_CACHE_DIR/tdd-shown-<id>`, atomic-claimed via subshell `set -C` (noclobber). Same pattern as v1.69.0 BASELINE gate.
14
+
15
+ ### Behavior
16
+
17
+ - **First src/ edit of a CC session** → TDD CHECK emits as before.
18
+ - **Subsequent src/ edits (same session_id)** → TDD CHECK suppressed.
19
+ - **New CC session (different session_id)** → TDD CHECK re-emits.
20
+ - **Non-src/ files** → no output (existing behavior, regardless of sentinel). Editing README first does NOT consume the sentinel slot — TDD CHECK still fires on first src/ edit afterward.
21
+ - **No session_id in stdin** (legacy CC, direct shell tests) → emits every src/ edit (back-compat preserved).
22
+ - **N parallel src/ edits with same session_id** → exactly 1 TDD CHECK emit (atomic claim).
23
+
24
+ ### Files
25
+
26
+ - `hooks/tdd-pretool-check.sh` — atomic-claim sentinel + jq-decoupled session_id extraction.
27
+ - `tests/test-tdd-pretool-fires-once.sh` (new — 9 cases including 50-parallel concurrency, non-src/ doesn't consume sentinel, suppressed-fire-empty assertion).
28
+ - `.github/workflows/ci.yml`, `CONTRIBUTING.md` — wire new test into validate job + contributor checklist.
29
+ - `CHANGELOG.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).
30
+
31
+ ### Notes
32
+
33
+ ROADMAP #236 functional-bloat audit, phase 2. Phase 1 (v1.69.0) trimmed the BASELINE block (~12K tokens/session). Phase 2 trims the per-Edit nudge. Combined savings on a 50-prompt + 20-Edit session: ~13.5K tokens. Audit method continues — measure cost × frequency, judge value, don't blind-delete. Other always-on hooks (`model-effort-check`, `precompact-seam-check`, `token-spike-check`) remain silent at healthy state and are not bloat.
34
+
7
35
  ## [1.69.0] - 2026-05-04
8
36
 
9
37
  ### Token-bloat fix: BASELINE block fires once per CC session
@@ -2976,7 +2976,7 @@ If deployment fails or post-deploy verification catches issues:
2976
2976
 
2977
2977
  **SDLC.md:**
2978
2978
  ```markdown
2979
- <!-- SDLC Wizard Version: 1.69.0 -->
2979
+ <!-- SDLC Wizard Version: 1.70.0 -->
2980
2980
  <!-- Setup Date: [DATE] -->
2981
2981
  <!-- Completed Steps: step-0.1, step-0.2, step-0.4, step-1, step-2, step-3, step-4, step-5, step-6, step-7, step-8, step-9 -->
2982
2982
  <!-- Git Workflow: [PRs or Solo] -->
@@ -4055,7 +4055,7 @@ Walk through updates? (y/n)
4055
4055
  Store wizard state in `SDLC.md` as metadata comments (invisible to readers, parseable by Claude):
4056
4056
 
4057
4057
  ```markdown
4058
- <!-- SDLC Wizard Version: 1.69.0 -->
4058
+ <!-- SDLC Wizard Version: 1.70.0 -->
4059
4059
  <!-- Setup Date: 2026-01-24 -->
4060
4060
  <!-- Completed Steps: step-0.1, step-0.2, step-1, step-2, step-3, step-4, step-5, step-6, step-7, step-8, step-9 -->
4061
4061
  <!-- Git Workflow: PRs -->
@@ -17,13 +17,59 @@ TOOL_INPUT=$(cat)
17
17
  # Extract the file path being edited (requires jq)
18
18
  FILE_PATH=$(echo "$TOOL_INPUT" | jq -r '.tool_input.file_path // empty')
19
19
 
20
+ # session_id extraction is jq-independent (same pattern as sdlc-prompt-check.sh
21
+ # v1.69.0 — Codex round 1 P1 from that PR proved jq-coupling silently disabled
22
+ # the gate when jq was missing/broken). UUIDs are simple strings, no escapes.
23
+ SESSION_ID=$(printf '%s' "$TOOL_INPUT" \
24
+ | grep -o '"session_id"[[:space:]]*:[[:space:]]*"[^"]*"' \
25
+ | head -1 \
26
+ | sed 's/.*"\([^"]*\)"$/\1/')
27
+
20
28
  # CUSTOMIZE: Change this pattern to match YOUR source directory
21
29
  # Examples: "/src/", "/app/", "/lib/", "/packages/", "/server/"
22
30
  if [[ "$FILE_PATH" == *"/src/"* ]]; then
23
- # Output additionalContext that Claude will read
24
- cat << 'EOF'
31
+ # Token-bloat fix (v1.70.0): nudge fires once per CC session. Once Claude
32
+ # has the SDLC skill auto-invoked (covers TDD RED/GREEN), the per-Edit
33
+ # nudge becomes duplicate context — typical session has 10-30 src Edits
34
+ # = ~0.5-1.5K wasted tokens. Same atomic-noclobber claim pattern as
35
+ # sdlc-prompt-check.sh BASELINE gate.
36
+ #
37
+ # No-session_id stdin (legacy CC, direct shell tests) → emit every fire,
38
+ # preserving back-compat with existing tests in test-hooks.sh that don't
39
+ # pass session_id.
40
+ SHOULD_EMIT=1
41
+ if [ -n "$SESSION_ID" ]; then
42
+ CACHE_DIR="${SDLC_WIZARD_CACHE_DIR:-$HOME/.cache/sdlc-wizard}"
43
+ SAFE_SID=$(printf '%s' "$SESSION_ID" | tr -cd 'A-Za-z0-9._-')
44
+ if [ -n "$SAFE_SID" ]; then
45
+ SENTINEL="$CACHE_DIR/tdd-shown-${SAFE_SID}"
46
+ mkdir -p "$CACHE_DIR" 2>/dev/null || true
47
+ # Atomic claim: subshell `set -C` makes `: > path` create-or-fail.
48
+ # Conditional tree:
49
+ # - claim succeeds → emit (we won the race)
50
+ # - claim fails AND file exists → suppress (someone else won)
51
+ # - claim fails AND file missing → cache unwritable; fall back
52
+ # to emit so user never loses cold-start nudge.
53
+ if (set -C; : > "$SENTINEL") 2>/dev/null; then
54
+ SHOULD_EMIT=1
55
+ elif [ -f "$SENTINEL" ]; then
56
+ SHOULD_EMIT=0
57
+ else
58
+ SHOULD_EMIT=1
59
+ fi
60
+ fi
61
+ fi
62
+
63
+ if [ "$SHOULD_EMIT" -eq 1 ]; then
64
+ # Output additionalContext that Claude will read
65
+ cat << 'EOF'
25
66
  {"hookSpecificOutput": {"hookEventName": "PreToolUse", "additionalContext": "TDD CHECK: Are you writing IMPLEMENTATION before a FAILING TEST? If yes, STOP. Write the test first (TDD RED), then implement (TDD GREEN)."}}
26
67
  EOF
68
+ # Prune sentinels older than 7d so cache doesn't grow forever.
69
+ if [ -n "$SESSION_ID" ] && [ -n "$SAFE_SID" ]; then
70
+ find "$CACHE_DIR" -name 'tdd-shown-*' -type f -mtime +7 -delete 2>/dev/null || true
71
+ fi
72
+ fi
27
73
  fi
28
74
 
29
75
  # No output = allow the tool to proceed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-sdlc-wizard",
3
- "version": "1.69.0",
3
+ "version": "1.70.0",
4
4
  "description": "SDLC enforcement for Claude Code — hooks, skills, and wizard setup in one command",
5
5
  "bin": {
6
6
  "sdlc-wizard": "cli/bin/sdlc-wizard.js"
@@ -93,10 +93,11 @@ Parse CHANGELOG entries between the user's installed version and latest. Present
93
93
 
94
94
  ```
95
95
  Installed: 1.42.0
96
- Latest: 1.69.0
96
+ Latest: 1.70.0
97
97
 
98
98
  What changed:
99
- - [1.69.0] token-bloat fix — `hooks/sdlc-prompt-check.sh` BASELINE block (the ~250-token "TodoWrite FIRST / STATE CONFIDENCE / AUTO-INVOKE" reminder) now fires once per CC `session_id` instead of every prompt. Saves ~12K tokens/session for any user with >3 prompts. SETUP-not-complete + EFFORT-bump warnings still fire every prompt (dynamic state). Sentinel pruned at 7d. No-session-id stdin keeps current behavior (legacy CC + tests).
99
+ - [1.70.0] token-bloat fix phase 2 — `hooks/tdd-pretool-check.sh` TDD CHECK JSON nudge (the per-`Write/Edit` "Are you writing IMPLEMENTATION before a FAILING TEST?" reminder) now fires once per CC `session_id` instead of every src/ edit. Saves ~0.5-1.5K tokens/session (10-30 src Edits × ~50 tok). Same atomic-noclobber claim pattern as v1.69.0 BASELINE gate. Non-src/ edits don't consume the sentinel slot.
100
+ - [1.69.0] token-bloat fix phase 1 — `hooks/sdlc-prompt-check.sh` BASELINE block (the ~250-token "TodoWrite FIRST / STATE CONFIDENCE / AUTO-INVOKE" reminder) now fires once per CC `session_id`. Saves ~12K tokens/session. SETUP-not-complete + EFFORT-bump warnings still fire every prompt (dynamic state).
100
101
  - [1.68.0–1.65.0] roadmap hygiene — five paperwork closes: #97 Anthropic Policy NO-GO + AAR-paper validating parallel; #99 AutoGPT NO-GO; #95 Nous NO-GO; #243 token-history liveness verified; #210 Node-24 false-green; #235 Thoughtworks AI Evals NO-GO. **6/6 external-product audits NO-GO** (continues #76, #77). Research write-ups in `.reviews/research-*.md`.
101
102
  - [1.64.0] XDLC ecosystem cross-references — README, wizard doc, and ROADMAP now cross-reference all three sibling packages (`agentic-sdlc-wizard`, `codex-sdlc-wizard`, `claude-gdlc-wizard`). New "Ecosystem (Sibling Projects)" section in README. 3 new doc-consistency tests prevent drift.
102
103
  - [1.63.0] cache-cost observability closeout (#204 absorbed by #220) — `tests/test-token-spike.sh` gains explicit cache-miss regression test + negative-control test. SDLC skill + wizard doc gain "Cache-Cost Surprises" sections covering 10-20× silent cost blowups (mid-session CLAUDE.md edits, idle pruning, upstream cache bugs) and detection via `hooks/token-spike-check.sh`'s `costly_tokens` metric.