@tyroneross/build-loop 0.36.0 → 0.43.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.
Files changed (270) hide show
  1. package/.agents/plugins/marketplace.json +2 -2
  2. package/.claude-plugin/marketplace.json +3 -3
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/.cursor/rules/build-loop-surface.mdc +12 -11
  6. package/.cursor/rules/skill-index.mdc +33 -0
  7. package/AGENTS.md +213 -34
  8. package/README.md +99 -31
  9. package/agents/advisor.md +4 -4
  10. package/agents/alignment-checker.md +2 -2
  11. package/agents/architecture-scout.md +4 -4
  12. package/agents/build-orchestrator.md +38 -36
  13. package/agents/database-assessor.md +11 -5
  14. package/agents/design-contract-specialist.md +8 -8
  15. package/agents/fact-checker.md +13 -3
  16. package/agents/fix-critique.md +2 -2
  17. package/agents/independent-auditor.md +60 -7
  18. package/agents/leak-scanner.md +82 -0
  19. package/agents/overfitting-reviewer.md +2 -2
  20. package/agents/plan-critic.md +1 -1
  21. package/agents/promotion-reviewer.md +5 -5
  22. package/agents/retrospective-synthesizer.md +138 -35
  23. package/agents/scope-auditor.md +82 -11
  24. package/agents/security-reviewer.md +56 -2
  25. package/agents/self-improvement-architect.md +17 -3
  26. package/agents/transcript-pattern-miner.md +5 -5
  27. package/agents/ui-validator.md +1 -1
  28. package/bin/build-loop-debugger.js +143 -0
  29. package/bin/build-loop-install.js +1 -4
  30. package/bin/build-loop-load-probe.js +345 -0
  31. package/codex-skills/build-loop/SKILL.md +28 -6
  32. package/commands/feedback.md +37 -0
  33. package/dist/src/interactive-verifier.d.ts +1 -14
  34. package/dist/src/interactive-verifier.d.ts.map +1 -1
  35. package/dist/src/interactive-verifier.js +6 -113
  36. package/dist/src/interactive-verifier.js.map +1 -1
  37. package/dist/src/quality.d.ts +5 -0
  38. package/dist/src/quality.d.ts.map +1 -0
  39. package/dist/src/quality.js +81 -0
  40. package/dist/src/quality.js.map +1 -0
  41. package/dist/src/storage.d.ts.map +1 -1
  42. package/dist/src/storage.js +37 -3
  43. package/dist/src/storage.js.map +1 -1
  44. package/docs/agent-surface-policy.md +35 -31
  45. package/docs/memory-setup.md +19 -0
  46. package/hooks/git/pre-push +65 -4
  47. package/hooks/hooks.json +95 -38
  48. package/hooks/pre-commit +20 -1
  49. package/hooks/pre-edit-rally-point.sh +10 -3
  50. package/hooks/session-start-codex-hook-trust.sh +30 -0
  51. package/hooks/session-start-git-hooks.sh +3 -1
  52. package/hooks/session-start-rally-point.sh +52 -4
  53. package/hooks/session-start-worktree-gc.sh +47 -94
  54. package/hooks/stop-transcript-sweep.sh +173 -0
  55. package/hooks/test_closeout.sh +14 -2
  56. package/package.json +8 -7
  57. package/scripts/README.md +1 -1
  58. package/scripts/_paths.py +65 -0
  59. package/scripts/groundwork_exchange.py +1012 -0
  60. package/scripts/install_memory.py +33 -1
  61. package/scripts/lessons_index/ingest.py +13 -2
  62. package/scripts/lessons_index/query.py +36 -13
  63. package/scripts/memory_context/__init__.py +108 -14
  64. package/scripts/memory_graph/__init__.py +5 -1
  65. package/scripts/project_resolver.py +42 -36
  66. package/scripts/sync_plugin_cache.py +37 -2
  67. package/skills/agent-rally-point/SKILL.md +46 -0
  68. package/skills/api-registry-bridge/SKILL.md +1 -1
  69. package/skills/architecture/dead/SKILL.md +1 -1
  70. package/skills/architecture/impact/SKILL.md +1 -1
  71. package/skills/architecture/review/SKILL.md +1 -1
  72. package/skills/architecture/rules/SKILL.md +3 -3
  73. package/skills/architecture/scan/SKILL.md +1 -1
  74. package/skills/architecture/trace/SKILL.md +1 -1
  75. package/skills/attribution-standard/SKILL.md +6 -6
  76. package/skills/auto-decision-capture/SKILL.md +31 -2
  77. package/skills/auto-finding-capture/SKILL.md +28 -1
  78. package/skills/build-loop/SKILL.md +131 -23
  79. package/skills/build-loop/fallbacks.md +16 -21
  80. package/skills/build-loop/phases/ui-validation.md +2 -2
  81. package/skills/build-loop/references/advisor-dispatch-ladder.md +1 -1
  82. package/skills/build-loop/references/apple-native-planning.md +1 -1
  83. package/skills/build-loop/references/autonomous-and-per-commit-modes.md +11 -5
  84. package/skills/build-loop/references/autonomy-dashboard.md +115 -0
  85. package/skills/build-loop/references/capability-routing.md +24 -2
  86. package/skills/build-loop/references/coordination.md +24 -6
  87. package/skills/build-loop/references/experiment-results-template.md +15 -3
  88. package/skills/build-loop/references/leadership.md +1 -1
  89. package/skills/build-loop/references/memory.md +14 -3
  90. package/skills/build-loop/references/modular-systems-pack.md +8 -0
  91. package/skills/build-loop/references/output-style.md +86 -0
  92. package/skills/build-loop/references/phase-1-assess.md +102 -2
  93. package/skills/build-loop/references/phase-2-plan.md +9 -1
  94. package/skills/build-loop/references/phase-3-execute.md +5 -2
  95. package/skills/build-loop/references/phase-4-review.md +85 -8
  96. package/skills/build-loop/references/phase-5-iterate.md +76 -8
  97. package/skills/build-loop/references/phase-6-learn.md +10 -17
  98. package/skills/build-loop/references/privileged-request-broker.md +254 -0
  99. package/skills/build-loop/references/resource-aware-execution.md +183 -0
  100. package/skills/build-loop/references/self-recursive-dev.md +2 -2
  101. package/skills/build-loop/references/status-output-format.md +207 -0
  102. package/skills/build-loop/references/verify-dispatch.md +56 -2
  103. package/skills/building-with-deepagents/SKILL.md +1 -1
  104. package/skills/claim-scope/SKILL.md +185 -0
  105. package/skills/color-engine/SKILL.md +103 -0
  106. package/skills/color-engine/_core.py +464 -0
  107. package/skills/color-engine/color_engine.py +175 -0
  108. package/skills/cost-rca/SKILL.md +61 -0
  109. package/skills/data-plane-worktrees/SKILL.md +139 -0
  110. package/skills/data-plane-worktrees/agents/openai.yaml +4 -0
  111. package/skills/database-practice/SKILL.md +200 -0
  112. package/skills/database-practice/references/diagnostic-queries.sql +126 -0
  113. package/skills/database-practice/references/vector-and-graph-tuning.md +208 -0
  114. package/skills/database-practice/scripts/db_table_map.py +1244 -0
  115. package/skills/database-practice/scripts/test_db_table_map.py +514 -0
  116. package/skills/debug-loop/SKILL.md +36 -6
  117. package/skills/debugging-memory/SKILL.md +32 -430
  118. package/skills/debugging-memory/references/pattern-extraction.md +4 -4
  119. package/skills/debugging-memory/references/search.md +32 -120
  120. package/skills/debugging-memory/references/store.md +32 -126
  121. package/skills/debugging-memory/references/subagent-integration.md +1 -1
  122. package/skills/decision-queue/SKILL.md +251 -0
  123. package/skills/decision-queue/assets/template.html +1242 -0
  124. package/skills/decision-queue/references/example-large-queue-batching.md +164 -0
  125. package/skills/decision-queue/scripts/regen_template_constants.py +160 -0
  126. package/skills/defenseclaw-bridge/SKILL.md +2 -2
  127. package/skills/defenseclaw-bridge/references/dc-config-mapping.md +2 -9
  128. package/skills/drain-proposals/SKILL.md +53 -0
  129. package/skills/focused-loop-builder/SKILL.md +31 -0
  130. package/skills/focused-loop-builder/references/spec-format.md +27 -0
  131. package/skills/handoff/SKILL.md +169 -8
  132. package/skills/ibr-bridge/SKILL.md +4 -1
  133. package/skills/knowledge/SKILL.md +26 -14
  134. package/skills/knowledge/references/review-mode.md +2 -3
  135. package/skills/knowledge/templates/madr-minimal.md +1 -1
  136. package/skills/mcp-builder/SKILL.md +1 -1
  137. package/skills/model-bakeoff/SKILL.md +48 -10
  138. package/skills/model-tiering/SKILL.md +92 -31
  139. package/skills/native-ax-driver/SKILL.md +38 -5
  140. package/skills/native-ax-driver/scripts/native_driver.py +278 -22
  141. package/skills/native-ax-driver/scripts/test_native_driver.py +227 -0
  142. package/skills/optimize/SKILL.md +1 -1
  143. package/skills/plugin-builder/SKILL.md +48 -1
  144. package/skills/plugin-builder/references/build-loop-phase-guidance.md +3 -4
  145. package/skills/plugin-builder/references/distribution.md +13 -2
  146. package/skills/plugin-builder/references/plugin-hygiene-lessons.md +2 -2
  147. package/skills/plugin-tests/SKILL.md +2 -2
  148. package/skills/recursive-retrospective/SKILL.md +1 -1
  149. package/skills/repo-closeout/SKILL.md +17 -0
  150. package/skills/repo-closeout/agents/openai.yaml +4 -0
  151. package/skills/repo-maintenance/SKILL.md +179 -0
  152. package/skills/repo-maintenance/agents/openai.yaml +4 -0
  153. package/skills/repo-maintenance/references/pre-public-hygiene.md +134 -0
  154. package/skills/repo-maintenance/references/repository-taxonomy.md +161 -0
  155. package/skills/repo-maintenance/references/safety-protocol.md +106 -0
  156. package/skills/repo-maintenance/references/stack-profiles.md +138 -0
  157. package/skills/repo-maintenance/scripts/audit_repo_maintenance.py +1198 -0
  158. package/skills/repo-maintenance/scripts/test_audit_repo_maintenance.py +506 -0
  159. package/skills/repository-intelligence/SKILL.md +189 -0
  160. package/skills/repository-intelligence/agents/openai.yaml +4 -0
  161. package/skills/repository-intelligence/references/assessment-rubric.md +88 -0
  162. package/skills/repository-intelligence/scripts/repository_inventory.py +347 -0
  163. package/skills/research/SKILL.md +12 -2
  164. package/skills/root-cause-analysis/SKILL.md +1 -1
  165. package/skills/runtime-parity-verification/SKILL.md +36 -1
  166. package/skills/security-methodology/SKILL.md +23 -10
  167. package/skills/security-methodology/references/agentic-handoff-templates.md +220 -0
  168. package/skills/security-methodology/references/cross-source-matrix.md +1 -1
  169. package/skills/security-methodology/references/owasp-agentic-top-10.md +1 -1
  170. package/skills/security-scan/SKILL.md +55 -15
  171. package/skills/self-improve/SKILL.md +70 -50
  172. package/skills/silent-assumptions/SKILL.md +341 -0
  173. package/skills/silent-assumptions/references/elicitation-detectors.md +342 -0
  174. package/skills/spec-writing/SKILL.md +128 -24
  175. package/skills/spec-writing/scripts/check_checklist.py +114 -15
  176. package/skills/ui-design/SKILL.md +6 -4
  177. package/skills/ui-design/references/color-engine.md +132 -0
  178. package/skills/ui-design/references/design-preferences-from-owned-apps.md +8 -8
  179. package/skills/ui-design/references/ui-guidance-sources.md +1 -1
  180. package/skills/ui-design/references/universal-design-principles.alt.md +2 -2
  181. package/plugin-artifacts/codex/.codex-plugin/plugin.json +0 -41
  182. package/plugin-artifacts/codex/AGENTS.md +0 -560
  183. package/plugin-artifacts/codex/BUILD-ARTIFACT.md +0 -5
  184. package/plugin-artifacts/codex/LICENSE +0 -202
  185. package/plugin-artifacts/codex/README.md +0 -313
  186. package/plugin-artifacts/codex/assets/build-loop-plugin-icon.png +0 -0
  187. package/plugin-artifacts/codex/docs/agent-surface-policy.md +0 -63
  188. package/plugin-artifacts/codex/references/advisor-dispatch-ladder.md +0 -62
  189. package/plugin-artifacts/codex/references/agent-role-taxonomy.md +0 -135
  190. package/plugin-artifacts/codex/references/autonomous-and-per-commit-modes.md +0 -161
  191. package/plugin-artifacts/codex/references/autonomy-config.md +0 -231
  192. package/plugin-artifacts/codex/references/backlog-system.md +0 -285
  193. package/plugin-artifacts/codex/references/capability-routing.md +0 -231
  194. package/plugin-artifacts/codex/references/codex-subagents.md +0 -106
  195. package/plugin-artifacts/codex/references/coordination-file-template.md +0 -181
  196. package/plugin-artifacts/codex/references/coordination-rules.md +0 -552
  197. package/plugin-artifacts/codex/references/dogfood-reload-checkpoint.md +0 -112
  198. package/plugin-artifacts/codex/references/halt-and-ask-protocol.md +0 -102
  199. package/plugin-artifacts/codex/references/implementer-envelope-schema.md +0 -302
  200. package/plugin-artifacts/codex/references/intent-capability-pack.md +0 -257
  201. package/plugin-artifacts/codex/references/intent-exploration-prompts.md +0 -96
  202. package/plugin-artifacts/codex/references/leadership.md +0 -72
  203. package/plugin-artifacts/codex/references/memory-systems.md +0 -261
  204. package/plugin-artifacts/codex/references/memory.md +0 -313
  205. package/plugin-artifacts/codex/references/model-tier-mapping.md +0 -296
  206. package/plugin-artifacts/codex/references/modular-systems-pack.md +0 -96
  207. package/plugin-artifacts/codex/references/phase-1-assess.md +0 -249
  208. package/plugin-artifacts/codex/references/phase-2-plan.md +0 -86
  209. package/plugin-artifacts/codex/references/phase-3-execute.md +0 -49
  210. package/plugin-artifacts/codex/references/phase-4-review.md +0 -341
  211. package/plugin-artifacts/codex/references/phase-5-iterate.md +0 -72
  212. package/plugin-artifacts/codex/references/phase-6-learn.md +0 -58
  213. package/plugin-artifacts/codex/references/recent-design-structures.md +0 -274
  214. package/plugin-artifacts/codex/references/research-trigger-policy.md +0 -140
  215. package/plugin-artifacts/codex/references/runtime-smoke-triggers.md +0 -42
  216. package/plugin-artifacts/codex/references/self-review.md +0 -234
  217. package/plugin-artifacts/codex/references/single-writer-commit-protocol.md +0 -90
  218. package/plugin-artifacts/codex/references/task-capture-policy.md +0 -68
  219. package/plugin-artifacts/codex/references/ui-io-contract.md +0 -116
  220. package/plugin-artifacts/codex/references/ui-spotcheck-protocol.md +0 -65
  221. package/plugin-artifacts/codex/references/verify-dispatch.md +0 -85
  222. package/plugin-artifacts/codex/skills/build-loop/SKILL.md +0 -381
  223. package/plugin-artifacts/codex/skills/build-loop/detect-plugins.mjs +0 -82
  224. package/plugin-artifacts/codex/skills/build-loop/eval-guide.md +0 -65
  225. package/plugin-artifacts/codex/skills/build-loop/fallbacks.md +0 -549
  226. package/plugin-artifacts/codex/skills/build-loop/phases/fact-check.md +0 -42
  227. package/plugin-artifacts/codex/skills/build-loop/phases/ui-validation.md +0 -267
  228. package/plugin-artifacts/codex/skills/build-loop/references/advisor-dispatch-ladder.md +0 -62
  229. package/plugin-artifacts/codex/skills/build-loop/references/apple-native-planning.md +0 -439
  230. package/plugin-artifacts/codex/skills/build-loop/references/autonomous-and-per-commit-modes.md +0 -161
  231. package/plugin-artifacts/codex/skills/build-loop/references/capability-routing.md +0 -231
  232. package/plugin-artifacts/codex/skills/build-loop/references/codex-subagents.md +0 -106
  233. package/plugin-artifacts/codex/skills/build-loop/references/coordination.md +0 -161
  234. package/plugin-artifacts/codex/skills/build-loop/references/correction-aware-capture.md +0 -177
  235. package/plugin-artifacts/codex/skills/build-loop/references/experiment-results-template.md +0 -101
  236. package/plugin-artifacts/codex/skills/build-loop/references/independent-auditor.md +0 -72
  237. package/plugin-artifacts/codex/skills/build-loop/references/intent-capability-pack.md +0 -257
  238. package/plugin-artifacts/codex/skills/build-loop/references/intent-exploration-prompts.md +0 -96
  239. package/plugin-artifacts/codex/skills/build-loop/references/leadership.md +0 -72
  240. package/plugin-artifacts/codex/skills/build-loop/references/memory.md +0 -313
  241. package/plugin-artifacts/codex/skills/build-loop/references/modular-systems-pack.md +0 -96
  242. package/plugin-artifacts/codex/skills/build-loop/references/output-style.md +0 -222
  243. package/plugin-artifacts/codex/skills/build-loop/references/pay-it-forward-arch.md +0 -98
  244. package/plugin-artifacts/codex/skills/build-loop/references/phase-1-assess.md +0 -249
  245. package/plugin-artifacts/codex/skills/build-loop/references/phase-2-plan.md +0 -86
  246. package/plugin-artifacts/codex/skills/build-loop/references/phase-3-execute.md +0 -49
  247. package/plugin-artifacts/codex/skills/build-loop/references/phase-4-review.md +0 -341
  248. package/plugin-artifacts/codex/skills/build-loop/references/phase-5-iterate.md +0 -72
  249. package/plugin-artifacts/codex/skills/build-loop/references/phase-6-learn.md +0 -58
  250. package/plugin-artifacts/codex/skills/build-loop/references/recent-design-structures.md +0 -274
  251. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/ASSESSMENT.md +0 -85
  252. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/STANDALONE_TEST_RUN.md +0 -149
  253. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/01-simple-bugfix.md +0 -32
  254. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/02-ui-build-with-iteration.md +0 -48
  255. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/03-multi-failure-escalation.md +0 -60
  256. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/04-ui-build-ibr-absent.md +0 -51
  257. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/05-refactor-navgator-absent.md +0 -71
  258. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/06-recurring-bug-debugger-absent.md +0 -52
  259. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/trace-comparison.md +0 -202
  260. package/plugin-artifacts/codex/skills/build-loop/references/self-recursive-dev.md +0 -77
  261. package/plugin-artifacts/codex/skills/build-loop/references/self-review.md +0 -234
  262. package/plugin-artifacts/codex/skills/build-loop/references/ui-io-contract.md +0 -116
  263. package/plugin-artifacts/codex/skills/build-loop/references/verify-dispatch.md +0 -85
  264. package/plugin-artifacts/codex/skills/build-loop/scanners/audit-design-rules.mjs +0 -476
  265. package/plugin-artifacts/codex/skills/build-loop/scanners/require-visual-evidence.mjs +0 -239
  266. package/plugin-artifacts/codex/skills/build-loop/templates/backlog-item.md +0 -35
  267. package/plugin-artifacts/codex/skills/build-loop/templates/codex-worker-prompt.md +0 -100
  268. package/plugin-artifacts/codex/skills/build-loop/templates/ui-subagent-prompt.md +0 -179
  269. package/plugin-artifacts/codex/skills/build-loop/templates/ux-fix-plan.md +0 -40
  270. package/scripts/build_codex_plugin_artifact.py +0 -321
@@ -1,32 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Scenario 1: Simple bugfix
4
-
5
- ## Setup
6
-
7
- - **Project**: mid-size Next.js app, no NavGator, no claude-code-debugger installed
8
- - **Goal**: "Fix the `TypeError: Cannot read properties of undefined (reading 'email')` in `src/api/users.ts:42`"
9
- - **Scope**: 1-2 files, ~15 lines
10
- - **Criteria**:
11
- 1. Tests pass (`npm test`)
12
- 2. Lint clean (`npm run lint`)
13
- 3. No new type errors (`tsc --noEmit`)
14
-
15
- ## Expected failure modes at test time
16
-
17
- None — single-file fix, plan reveals the bug is an unchecked optional. Implementer fixes on first try.
18
-
19
- ## What should fire
20
-
21
- - Critic (A) — scope drift check on the diff
22
- - Validate (B) — tests + lint + type check
23
- - Fact-Check (D) — no rendered data, mock scan clean
24
- - Report (F) — scorecard written
25
-
26
- ## What should NOT fire
27
-
28
- - Iterate (no failures)
29
- - Memory-first gate (debugger not installed)
30
- - NavGator sub-steps (NavGator not installed)
31
- - Optimize (no mechanical metric)
32
- - Learn (no prior runs)
@@ -1,48 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Scenario 2: UI build with one iteration cycle
4
-
5
- ## Setup
6
-
7
- - **Project**: Next.js + IBR installed + claude-code-debugger installed (via `availablePlugins`)
8
- - **Goal**: "Add a dashboard card showing total active users with a sparkline of the last 7 days"
9
- - **Scope**: 3 files (`DashboardCard.tsx`, `useActiveUsers.ts`, `dashboard.module.css`), ~120 lines
10
- - **Criteria**:
11
- 1. Tests pass
12
- 2. IBR scan verdict: PASS (no Calm Precision violations)
13
- 3. Lint/type check clean
14
- 4. No mock data in production paths
15
-
16
- ## Expected failure mode at test time
17
-
18
- First Review pass: Validate (sub-step B) sees the IBR scan flag a `gestalt` violation (the card has individual borders on list items). Routes to Iterate.
19
-
20
- ## What should fire
21
-
22
- **First Review:**
23
- - Critic (A) — reviews diff, probably clean
24
- - Validate (B) — tests pass, but IBR scan flags Gestalt violation → FAIL. Memory-first gate queries debugger for similar UI pattern; verdict `NO_MATCH` (first time).
25
- - Route to Iterate
26
-
27
- **Iterate (attempt 1):**
28
- - Debugger-bridge Iterate step — no evidence_gap, no prior-failure escalation yet
29
- - Diagnose: "individual borders on list items"
30
- - Fix plan: consolidate into single outer border, add dividers
31
- - Execute fix (targeted)
32
- - Loop back to Review
33
-
34
- **Second Review:**
35
- - Critic — skipped (same files, no new scope drift risk)
36
- - Validate (B) — IBR scan PASS this time
37
- - Optimize (C) — skipped (no mechanical metric)
38
- - Fact-Check (D) — no rendered metrics, mock scan clean
39
- - Simplify (E) — trim any over-abstracted helpers
40
- - Report (F) — scorecard written; debugger `store` called with the Gestalt fix; `outcome` N/A (no prior memory to evaluate)
41
-
42
- **Learn (6)**: skipped if < 3 prior runs, else scans `runs[]`.
43
-
44
- ## What should NOT fire
45
-
46
- - NavGator bridges (not installed)
47
- - Logging-tracer-bridge repair path (no silent failure)
48
- - More than 1 iteration cycle
@@ -1,60 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Scenario 3: Multi-failure stuck iteration with logging-tracer rescue
4
-
5
- ## Setup
6
-
7
- - **Project**: Node.js backend + NavGator installed + claude-code-debugger installed
8
- - **Goal**: "Add rate limiting to `/api/search` endpoint — 100 req/min per IP, Redis-backed"
9
- - **Scope**: 4 files, ~200 lines, touches middleware, Redis client, tests
10
- - **Criteria**:
11
- 1. Integration tests pass
12
- 2. Rate-limit correctness (custom assertion: burst of 101 requests → first 100 succeed, 101st returns 429)
13
- 3. Lint/type clean
14
- 4. NavGator rules pass (no new layer violations)
15
-
16
- ## Expected failure trajectory
17
-
18
- **First Review:**
19
- - Critic (A) clean
20
- - Validate (B): criterion 2 (rate-limit correctness) FAILS with test output: `assertion failed: expected 429, got 500`. No stack trace, no error message — the server returned 500 but the test didn't capture the cause. Memory-first gate synthesizes "500 on 101st request, no stack". `read_logs` MCP returns 0 entries (project is silent — `console.log` only). `evidence_gap: true` flagged.
21
- - Fact-Check (D) and later sub-steps skipped due to B fail
22
- - Route to Iterate
23
-
24
- **Iterate attempt 1:**
25
- - Debugger-bridge Iterate sees `evidence_gap: true` from previous attempt
26
- - Invokes logging-tracer-bridge with `{phase: "iterate", action: "repair"}`. Ephemeral mechanism A: wraps new `trace(...)` calls in the Redis client behind `DEBUG_TRACE=1` env gate.
27
- - Re-runs criterion 2 with `DEBUG_TRACE=1 npm test`. Now stderr captures: `Redis connection dropped after 98 ops, reconnect latency > 1s, causes burst to fail at 98 not 100`.
28
- - Now a real root cause. Fix plan: add connection keep-alive + retry wrapper.
29
- - Execute fix.
30
-
31
- **Second Review:**
32
- - Validate: criterion 2 now passes. But criterion 3 (lint) fails — the retry wrapper introduced `any` types.
33
- - Route to Iterate.
34
-
35
- **Iterate attempt 2:**
36
- - Same criterion? No, different (lint vs rate-limit). No debugger escalation triggered (not 2 same-root-cause).
37
- - Fix types.
38
- - Execute.
39
-
40
- **Third Review:**
41
- - Validate all pass.
42
- - Optimize (C): has mechanical metric (test runtime), runs 3-5 iterations. One win: -12% test time after connection pooling tuned.
43
- - Fact-Check (D): NavGator rules check — new `database-isolation` violation? No, Redis already in allowed db layer. Clean.
44
- - Simplify (E): remove an unused retry-count parameter.
45
- - Report (F): scorecard PASS with notes. Debugger `store` called for the Redis burst bug. Logging-tracer instrumentation reverted per "ephemeral by default" (no user approval sought to keep). NavGator `dead` orphan scan: 1 new resolved orphan (the keep-alive wrapper is now wired in).
46
-
47
- ## What should fire vs NOT
48
-
49
- **Fires:**
50
- - Critic, Validate, Fact-Check, Simplify, Report across two final-Review passes
51
- - Logging-tracer repair (evidence_gap trigger)
52
- - NavGator sub-steps (Assess blast-radius + Review-D rules + Report dead scan)
53
- - Debugger gate + store; outcome N/A (no prior KNOWN_FIX applied)
54
- - Optimize (C) — mechanical metric exists
55
- - 2 Iterate attempts
56
-
57
- **Does NOT fire:**
58
- - Parallel `/assess` domain assessors (not 2+ same-root-cause failures on one criterion)
59
- - `debug-loop` causal-tree (not 3+ same-criterion failures)
60
- - Learn (skipped unless `runs[] >= 3`)
@@ -1,51 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Scenario 4: UI build, IBR absent (exercises `fallbacks.md#web-ui`)
4
-
5
- ## Setup
6
-
7
- - **Project**: Next.js app, no IBR installed, no claude-code-debugger, no NavGator
8
- - **Goal**: "Add a settings-panel nav item with active-state indicator"
9
- - **Files to touch**: `src/components/SettingsNav.tsx` (new), `src/styles/nav.module.css` (new)
10
- - **Criteria**:
11
- 1. Tests pass
12
- 2. Lint/type check clean
13
- 3. UI meets Calm Precision principles (a11y, touch targets, handlers)
14
- 4. No mock data
15
-
16
- ## Pre-fallback behavior (before commit 76f9a26)
17
-
18
- **Review sub-step B Validate**:
19
- - `availablePlugins.ibr` is false
20
- - Bridge: (no bridge existed — IBR path skipped silently)
21
- - Criterion 3 (Calm Precision): orchestrator had `fallbacks.md#web-ui` available but no explicit instruction to paste it into the validation subagent. Default behavior: subagent does a best-effort review without structured guidance.
22
- - Output: "Criterion 3 reviewed informally; recommend installing IBR for deep verification." No specific findings.
23
- - Verdict: **soft pass** — nothing concrete flagged, but nothing verified either.
24
-
25
- ## Post-fallback behavior (after commit 76f9a26)
26
-
27
- **Review sub-step B Validate**:
28
- - `availablePlugins.ibr` is false AND build touched UI files (`*.tsx`, `*.module.css`)
29
- - Orchestrator pastes `fallbacks.md#web-ui` into the validation subagent prompt
30
- - Subagent runs the 10 grep checks against the diff:
31
- - Check 5 (icon-only buttons missing aria-label) matches: `<button><ChevronIcon /></button>` in SettingsNav.tsx:24
32
- - Check 6 (status as background pill) matches: `bg-blue-500 text-white` on the active-state indicator in nav.module.css — suspicious, could be a signal-to-noise violation
33
- - Check 3 (button missing onClick/submit) clean
34
- - Check 7 (hardcoded hex) clean
35
- - Remaining 6 checks clean
36
- - Findings written to Review-F with paths + line numbers
37
- - Verdict: **fail** on criterion 3 with 2 concrete findings → routes to Iterate
38
- - Flag in report: `⚠️ static-analysis only — install IBR for computed-CSS verification`
39
-
40
- ## Concrete delta
41
-
42
- | Aspect | Pre-fallback | Post-fallback |
43
- |---|---|---|
44
- | Criterion 3 result | Soft pass ("recommend install") | Fail with 2 specific file:line findings |
45
- | Orchestrator action | None | Route to Iterate, fix aria-label + reconsider pill |
46
- | User visibility | "IBR would have found issues" | "File X line Y is missing aria-label" |
47
- | False positives | 0 (no findings emitted) | 1-2 possible (pill check is heuristic) |
48
- | Time to catch | Post-deploy user bug report | Phase 4 Review, before merge |
49
- | Install IBR? | Recommended | Still recommended for computed-CSS verification |
50
-
51
- **Net**: fallback catches real bugs that would otherwise ship. False-positive tolerance is acceptable because findings are file:line-specific and the user can trivially dismiss.
@@ -1,71 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Scenario 5: Large refactor, NavGator absent (exercises `fallbacks.md#architecture`)
4
-
5
- ## Setup
6
-
7
- - **Project**: Node.js + Next.js monorepo, no NavGator, no debugger, no IBR
8
- - **Goal**: "Rename `User.email` → `User.primaryEmail` across the codebase"
9
- - **Expected scope**: ~40 files across db models, API routes, frontend components
10
- - **Criteria**:
11
- 1. Tests pass
12
- 2. Type check clean
13
- 3. No orphan references to old field name (grep audit)
14
-
15
- ## Pre-fallback behavior
16
-
17
- **Assess (Phase 1)**:
18
- - `.navgator/architecture/index.json` doesn't exist
19
- - navgator-bridge `Pre-flight`: "NO_NAVGATOR" → emit "NavGator: no architecture snapshot found" → skip
20
- - `.build-loop/state.json.navgator` not written
21
- - Phase 2 Plan proceeds blind: no blast-radius data, scoping based on goal text only
22
-
23
- **Plan (Phase 2)**:
24
- - Breaks work by grep of current field usage: finds ~40 files
25
- - No signal about layer crossings or hotspots
26
- - Dispatches one subagent per directory cluster
27
-
28
- **Review-D Fact-Check** (after Execute):
29
- - No NavGator rules check (bridge skipped silently pre-fallback)
30
- - Other gates (fact-checker, mock-scanner) run normally
31
- - Scorecard PASS if tests + types clean
32
-
33
- **Risk**: the rename touches `src/db/User.ts` + `src/components/Profile.tsx` directly without going through `src/api/` — a potential `frontend-direct-db` violation is **not detected**.
34
-
35
- ## Post-fallback behavior
36
-
37
- **Assess (Phase 1)**:
38
- - navgator-bridge `Pre-flight`: "NO_NAVGATOR" → runs `fallbacks.md#architecture`
39
- - Executes the grep/git commands:
40
- - Check 1 (changed files): ~40 files enumerated
41
- - Check 2 (layer classification): 12 db / 8 backend / 18 frontend / 2 test
42
- - Check 3 (1-hop dependents): for each changed file, grep import paths
43
- - Check 4 (hotspot churn): top-10 includes `src/db/User.ts` and `src/lib/auth.ts` — both touched
44
- - Check 5 (circular-import): defer to type check
45
- - Risk flags:
46
- - ≥3 layers crossed (db + backend + frontend) → "high blast radius"
47
- - `src/db/User.ts` is a top-5 hotspot → "concentration risk"
48
- - `src/db/User.ts` imported directly from `src/components/Profile.tsx` without going through API → "possible frontend-direct-db layer violation"
49
- - Writes to `.build-loop/state.json.architecture.standalone` with these flags
50
-
51
- **Plan (Phase 2)**:
52
- - Reads the standalone state. Sees blast radius + layer violation flag.
53
- - Splits work into 3 chunks with explicit integration tests between them (normally would have been one monolithic PR).
54
- - Adds a plan task: "Introduce API layer between Profile.tsx and User model before renaming" — the layer violation would have shipped without this.
55
-
56
- **Review-F report**:
57
- - Includes `⚠️ architecture analysis via static fallback — install NavGator for AST-aware dependency graph + rule enforcement`
58
- - Flags the possible layer violation as an observed concern
59
-
60
- ## Concrete delta
61
-
62
- | Aspect | Pre-fallback | Post-fallback |
63
- |---|---|---|
64
- | Assess architecture output | Nothing | Layer counts + hotspots + risk flags |
65
- | Layer violation detection | Missed | Flagged (frontend-direct-db pattern) |
66
- | Plan scoping | Monolithic subagent dispatch | Chunked with integration checkpoints |
67
- | Cost if violation ships | Future bug + refactor | Caught pre-commit |
68
- | Analysis quality | None | Directional — false positives possible, but useful |
69
- | Install NavGator? | Silent loss | Explicit report note |
70
-
71
- **Net**: fallback converts a silent gap into a surfaced risk. Heuristic rather than authoritative (NavGator would be exact), but 10× better than nothing.
@@ -1,52 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Scenario 6: Recurring bug, debugger absent (exercises `fallbacks.md#bug-memory`)
4
-
5
- ## Setup
6
-
7
- - **Project**: Node.js backend, no claude-code-debugger, no NavGator, no IBR
8
- - **Prior state**: `.build-loop/issues/2026-03-18-redis-reconnect.md` exists from a prior build, recording a Redis connection reset bug with fix notes
9
- - **Goal**: "Add a batch-process job that pushes to Redis in a loop"
10
- - **Criteria**: standard tests + lint + type
11
-
12
- ## First failure (during Review-B Validate)
13
-
14
- Integration test fails: `Error: Connection is closed` when the batch hits 50 items. Same error class as the prior recorded bug, different call site.
15
-
16
- ## Pre-fallback behavior
17
-
18
- **Review-B memory-first gate**:
19
- - `availablePlugins.claudeCodeDebugger` is false
20
- - debugger-bridge Pre-flight: "Debugger memory: not installed. Using inline debug fallback." → skip with generic message
21
- - Verdict: none — falls through to standard Iterate with no memory context
22
- - Orchestrator begins from scratch: reproduce, isolate, hypothesize
23
- - Eventually rediscovers the same Redis-disconnect root cause. Cost: 2-3 Iterate attempts, ~6-10 min wall clock.
24
-
25
- ## Post-fallback behavior
26
-
27
- **Review-B memory-first gate**:
28
- - debugger-bridge Pre-flight: runs `fallbacks.md#bug-memory`
29
- - Extracts tokens from symptom: `Error`, `Connection`, `closed`, `batch`, `Redis`
30
- - Greps `.build-loop/issues/`, `feedback.md`, `.bookmark/` for each token
31
- - `.build-loop/issues/2026-03-18-redis-reconnect.md` matches 4 tokens (`Error`, `Connection`, `closed`, `Redis`)
32
- - Verdict: `LOCAL_HIT_PARTIAL` (≥2 tokens co-occur in the same file)
33
- - Orchestrator reads the prior issue file: includes a recorded fix (add keep-alive config, retry wrapper)
34
- - Iterate plan: adapt the prior fix to this call site. No direct-apply (the new call path is different), but informed starting point.
35
- - Iterate attempt 1 succeeds on first try.
36
-
37
- ## Concrete delta
38
-
39
- | Aspect | Pre-fallback | Post-fallback |
40
- |---|---|---|
41
- | Memory lookup | Disabled | Enabled via local file grep |
42
- | Verdict granularity | None | 4 states mirroring upstream shape |
43
- | Iterate attempts to resolve | 2-3 | 1 |
44
- | Cross-session learning | None even within this project | Yes, per-project (no cross-project) |
45
- | Prior fix notes surfaced | No — rediscovered from scratch | Yes — read and adapted |
46
- | Install debugger? | Strong recommend for cross-project | Still recommend for classifier + cross-project memory |
47
-
48
- **Net**: fallback cuts recurring-bug resolution time roughly in half on projects with any prior `.build-loop/issues/` history. The upstream debugger adds cross-project memory and a classifier; the fallback has neither but captures most of the per-project value.
49
-
50
- ## Where the fallback gives up
51
-
52
- When the project has no prior `.build-loop/issues/` files, there's nothing to grep. Fallback returns `LOCAL_NO_MATCH` and orchestrator proceeds normally. This is correct behavior — no false-positive reuse of unrelated prior issues.
@@ -1,202 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Old 9-Phase vs New 5-Phase Trace Comparison
4
-
5
- For each scenario, the linear sequence of orchestrator actions. "→" = sequential; indentation = sub-step.
6
-
7
- ## Scenario 1: Simple bugfix (no failures, no plugins installed)
8
-
9
- ### Old 9-phase
10
-
11
- ```
12
- Phase 1 ASSESS → detect tooling, no plugins, load memory
13
- Phase 2 DEFINE → write goal.md with 3 criteria
14
- Phase 3 PLAN → 1-task plan
15
- Phase 4 EXECUTE → sonnet implementer dispatched
16
- Phase 4.5 CRITIC → sonnet-critic on diff: pass
17
- Phase 4.7 OPTIMIZE → skipped (no mechanical metric)
18
- Phase 5 VALIDATE → 3 graders, all pass; memory-first gate skipped (no debugger)
19
- Phase 6 ITERATE → skipped (all passed)
20
- Phase 7 FACT CHECK → fact-checker + mock-scanner parallel; clean
21
- Phase 8 REPORT → scorecard, append runs[], store (no debugger — noop)
22
- Phase 8.5 SIMPLIFY → trim diff
23
- Phase 9 REVIEW → skipped (runs[] < 3)
24
- ```
25
- **Headings touched**: 9. **Transitions**: 9 (each phase logs a header).
26
-
27
- ### New 5-phase
28
-
29
- ```
30
- Phase 1 Assess → detect tooling, no plugins, write goal.md with 3 criteria
31
- Phase 2 Plan → 1-task plan
32
- Phase 3 Execute → sonnet implementer dispatched
33
- Phase 4 Review
34
- 4A Critic → sonnet-critic on diff: pass
35
- 4B Validate → 3 graders, all pass
36
- 4C Optimize → skipped
37
- 4D Fact-Check → fact-checker + mock-scanner parallel; clean
38
- 4E Simplify → trim diff
39
- 4F Report → scorecard, append runs[]
40
- Phase 5 Iterate → skipped
41
- Phase 6 Learn → skipped (runs[] < 3)
42
- ```
43
- **Headings touched**: 5 phases + 6 sub-steps. **Transitions**: 5 top-level.
44
-
45
- ### Fidelity check
46
-
47
- | Old artifact | New location | Preserved? |
48
- |---|---|---|
49
- | Phase 1 state summary | Phase 1 Assess output | ✅ |
50
- | Phase 2 goal.md | Phase 1 Assess (define sub-section) | ✅ — same file |
51
- | Phase 3 plan | Phase 2 Plan | ✅ |
52
- | Phase 4 diff | Phase 3 Execute | ✅ |
53
- | Phase 4.5 critic output | Review 4A | ✅ — same agent |
54
- | Phase 5 scorecard | Review 4B evidence | ✅ |
55
- | Phase 7 fact-check report | Review 4D | ✅ — same gates |
56
- | Phase 8 scorecard file | Review 4F | ✅ — same path `.build-loop/evals/YYYY-MM-DD-<topic>.md` |
57
- | Phase 8.5 simplified diff | Review 4E | ✅ |
58
- | state.json.runs[] append | Review 4F | ✅ — same schema |
59
-
60
- **Result**: zero regression. New flow produces all old artifacts.
61
-
62
- ---
63
-
64
- ## Scenario 2: UI build with one iteration (IBR + debugger installed)
65
-
66
- ### Old 9-phase
67
-
68
- ```
69
- Phase 1 ASSESS → detect IBR + debugger. Debugger list MCP: 0 recent. IBR capture UI baseline.
70
- Phase 2 DEFINE → 4 criteria
71
- Phase 3 PLAN → 3-task plan
72
- Phase 4 EXECUTE → sonnet implementers
73
- Phase 4.5 CRITIC → pass
74
- Phase 4.7 OPTIMIZE → skipped
75
- Phase 5 VALIDATE → tests pass, IBR scan FAILS (Gestalt violation on card)
76
- └ memory-first gate → NO_MATCH → fallthrough
77
- Phase 6 ITERATE → diagnose "individual borders"; fix plan; execute fix
78
- Phase 5 VALIDATE (re-run) → all 4 criteria pass
79
- Phase 7 FACT CHECK → clean
80
- Phase 8 REPORT → scorecard, runs[] append, store(Gestalt fix)
81
- Phase 8.5 SIMPLIFY → trim
82
- Phase 9 REVIEW → runs[] count check
83
- ```
84
- **Transitions**: 9+1 (Phase 5 re-enters after Iterate) = 10 top-level.
85
-
86
- ### New 5-phase
87
-
88
- ```
89
- Phase 1 Assess → detect IBR + debugger. Debugger list MCP: 0 recent. IBR capture UI baseline. Write goal.md with 4 criteria.
90
- Phase 2 Plan → 3-task plan
91
- Phase 3 Execute → sonnet implementers
92
- Phase 4 Review (first pass)
93
- 4A Critic → pass
94
- 4B Validate → tests pass, IBR scan FAILS (Gestalt violation)
95
- └ memory-first gate → NO_MATCH → route to Iterate
96
- (4C-4F skipped, failure routed)
97
- Phase 5 Iterate (attempt 1)
98
- └ debugger-bridge Iterate → no evidence_gap, no escalation trigger
99
- └ diagnose: "individual borders"
100
- └ fix plan + execute
101
- Phase 4 Review (second pass, final)
102
- 4A Critic → skipped (same files)
103
- 4B Validate → all 4 pass
104
- 4C Optimize → skipped
105
- 4D Fact-Check → clean
106
- 4E Simplify → trim
107
- 4F Report → scorecard, runs[] append, debugger store(Gestalt fix), outcome N/A
108
- Phase 6 Learn → runs[] count check
109
- ```
110
- **Transitions**: 5 top-level (Review fires twice but as the same heading).
111
-
112
- ### Fidelity check
113
-
114
- All artifacts preserved. One behavior change:
115
- - **Old**: `Phase 5 VALIDATE` re-runs just failed criteria after Iterate.
116
- - **New**: `Review 4B Validate` re-runs just failed criteria after Iterate (same behavior). Critic 4A skipped on re-runs — this is new and intentional; avoids burning tokens re-reviewing an unchanged scope. Documented in SKILL.md.
117
-
118
- **Result**: zero regression; one optimization (skip Critic on re-runs).
119
-
120
- ---
121
-
122
- ## Scenario 3: Multi-failure with logging-tracer rescue (NavGator + debugger)
123
-
124
- ### Old 9-phase
125
-
126
- ```
127
- Phase 1 ASSESS → detect NavGator + debugger. navgator-bridge.phase1 writes blast radius. debugger list: 2 prior. observability: "silent" (project uses console.log).
128
- Phase 2 DEFINE → 4 criteria
129
- Phase 3 PLAN → 4-task plan
130
- Phase 4 EXECUTE → sonnet implementers
131
- Phase 4.5 CRITIC → pass
132
- Phase 4.7 OPTIMIZE → defer (post-validation)
133
- Phase 5 VALIDATE → tests fail, criterion 2 assertion 429 vs 500; read_logs empty → evidence_gap: true; memory-first NO_MATCH
134
- Phase 6 ITERATE (1) → sees evidence_gap → logging-tracer-bridge repair (Mechanism A, DEBUG_TRACE gate)
135
- → re-validate with trace: real cause Redis disconnect
136
- → fix plan + execute
137
- Phase 5 VALIDATE → criterion 2 passes; criterion 3 (lint) fails
138
- Phase 6 ITERATE (2) → different root cause, no escalation
139
- → fix types
140
- Phase 5 VALIDATE → all pass
141
- Phase 4.7 OPTIMIZE → runs (mechanical metric exists): test runtime -12%
142
- Phase 7 FACT CHECK → fact + mock + NavGator rules; clean
143
- Phase 8 REPORT → scorecard, runs[] append, store(Redis bug), outcome N/A, NavGator dead: 1 resolved orphan
144
- Phase 8.5 SIMPLIFY → trim retry-count arg
145
- Phase 9 REVIEW → runs[] < 3, skip
146
- ```
147
- **Transitions**: 9 + 2 Phase 5 re-entries + 1 Phase 4.7 delayed = ~12.
148
-
149
- ### New 5-phase
150
-
151
- ```
152
- Phase 1 Assess → NavGator + debugger detected; blast radius; debugger list (2); observability=silent; goal.md + 4 criteria
153
- Phase 2 Plan → 4-task plan
154
- Phase 3 Execute → sonnet implementers
155
- Phase 4 Review (first pass)
156
- 4A Critic → pass
157
- 4B Validate → criterion 2 FAIL; read_logs empty; evidence_gap: true; NO_MATCH → Iterate
158
- Phase 5 Iterate (attempt 1)
159
- └ evidence_gap detected → logging-tracer-bridge repair (Mechanism A)
160
- └ re-validate trigger criterion with DEBUG_TRACE=1 → informative output
161
- └ diagnose: Redis disconnect → fix plan → execute
162
- Phase 4 Review (second pass)
163
- 4A skipped (same files)
164
- 4B Validate → criterion 2 pass, criterion 3 (lint) FAIL → Iterate
165
- Phase 5 Iterate (attempt 2)
166
- └ different criterion, no escalation
167
- └ fix types → execute
168
- Phase 4 Review (third pass, final)
169
- 4A skipped
170
- 4B Validate → all 4 pass
171
- 4C Optimize → mechanical metric (test runtime): runs, -12%
172
- 4D Fact-Check → fact + mock + NavGator rules; clean
173
- 4E Simplify → trim retry-count arg
174
- 4F Report → scorecard, runs[] append, debugger store(Redis bug), NavGator dead: 1 resolved orphan, logging-tracer instrumentation reverted (no keep-in-diff approval sought)
175
- Phase 6 Learn → runs[] < 3, skip
176
- ```
177
- **Transitions**: 5 top-level (Review fires 3x, Iterate 2x).
178
-
179
- ### Fidelity check
180
-
181
- All artifacts preserved. Behavior differences:
182
-
183
- 1. **Old Phase 4.7 Optimize** ran pre-Validate deferred to post-Validate. New 4C runs **inside** Review, after Validate passes. Same effective ordering.
184
- 2. **Old Phase 7 NavGator rules** was Gate C of Phase 7. New 4D NavGator rules is one of three parallel gates in sub-step D. Same.
185
- 3. **Old Phase 8 orphan scan** ran after scorecard. New 4F orphan scan runs as part of Report. Same artifacts.
186
- 4. **Old Phase 8.5 Simplify** ran after Report. New 4E Simplify runs **before** Report. Semantic change: Report now reflects the simplified diff, not the pre-simplified diff. Arguably better — the scorecard matches what actually ships. Document in SKILL.md as intentional.
187
-
188
- **Result**: zero regression. One semantic improvement (scorecard reflects simplified diff).
189
-
190
- ---
191
-
192
- ## Summary verdict
193
-
194
- | Check | Result |
195
- |---|---|
196
- | Every old artifact has a new-flow equivalent | ✅ |
197
- | No silent phase elimination | ✅ (everything rehoused as sub-step) |
198
- | Intentional behavior changes documented | ✅ (Critic-skip on re-run, Simplify-before-Report) |
199
- | Transition count reduced | ✅ (9 → 5 top-level headings) |
200
- | Flow comprehensibility | Better (one Review heading, sub-steps clearly ordered) |
201
-
202
- **No regressions detected across 3 scenarios.** PR #4 safe to merge on this criterion.
@@ -1,77 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
- # Self-recursive build-loop dev (dogfooding)
3
-
4
- A run is **self-recursive** when the build-loop working tree IS the loaded runtime. That's the signal that arms per-commit mode and the self-modification safety machinery — without it, both stay dormant.
5
-
6
- ## How to load the working tree as the live runtime
7
-
8
- Recommended: pass the working tree directly to Claude Code at session start.
9
-
10
- ```sh
11
- claude --plugin-dir ~/dev/git-folder/build-loop
12
- ```
13
-
14
- `--plugin-dir` takes session precedence over any cached marketplace copy, and Claude Code sets `CLAUDE_PLUGIN_ROOT` to that directory. The detector reads it. No symlink, no `~/.claude/` mutation.
15
-
16
- Convenience alias (optional, in `~/.zshrc` or `~/.bashrc`):
17
-
18
- ```sh
19
- alias claude-bl='claude --plugin-dir ~/dev/git-folder/build-loop'
20
- ```
21
-
22
- Use the alias when you intend to dogfood build-loop changes; use plain `claude` for normal work that should run against the released cache version.
23
-
24
- ## Why not symlink into `~/.claude/plugins/`
25
-
26
- Marketplace plugins are installed by **copy**, not symlink, into `~/.claude/plugins/cache/<marketplace>/<name>/<version>/`. A manual symlink there is fragile:
27
-
28
- - Auto-update GC removes orphans after 7 days.
29
- - A version bump replaces the cache directory and clobbers the symlink.
30
- - `~/.claude/` is a per-user config surface — drift between machines breaks reproducibility.
31
-
32
- The detector still walks the symlink layout as a **fallback** so existing setups keep working, but it is not the recommended path.
33
-
34
- ## How detection works
35
-
36
- `scripts/detect_self_recursive.py` (called from Phase 1 Assess) checks signals in precedence:
37
-
38
- 1. **`--runtime-root <path>` arg** (Phase 1 passes `"$CLAUDE_PLUGIN_ROOT"`). `self_recursive = (realpath(runtime_root) == realpath(workdir))`. Method = `runtime_root_arg`.
39
- 2. **`CLAUDE_PLUGIN_ROOT` env var** when the arg is absent. Same check. Method = `plugin_root_env`.
40
- 3. **`__file__` self-location** — `Path(__file__).resolve().parents[1]` gives the plugin root of the running script copy (the script lives at `<plugin_root>/scripts/<name>.py`). If that resolves to `workdir`, this is ground truth — env-independent, because `CLAUDE_PLUGIN_ROOT` is not propagated to Bash-tool subprocesses. Mismatch falls through (heuristic, not operator assertion). Method = `self_location`.
41
- 4. **Legacy fallback** — walk `~/.claude/plugins/` for a symlink resolving to the workdir. Method = `cache_symlink`.
42
-
43
- Both manifest (`.claude-plugin/plugin.json` with a `name`) and `.git/` must be present in the workdir regardless of method.
44
-
45
- When an explicit signal (arg or env) is present and **does not** match the workdir, detection returns `self_recursive: false` with `reason_if_false: no_runtime_link` — the explicit signal has answered the question and we do not fall through to the symlink walk.
46
-
47
- Output JSON keys: `self_recursive`, `plugin_name`, `runtime_symlink_path`, `working_copy_branch`, `working_copy_sha`, `reason_if_false`, `detection_method`.
48
-
49
- ## Restart-boundary caveat
50
-
51
- Changing how build-loop is loaded (cache → `--plugin-dir`, or vice versa) takes effect **only at a fresh Claude Code session**. Do not switch mid-session: the live cache copy continues to serve your skills/agents until restart, and switching can GC the in-use cache and break the current session (`Agent not found` mid-run). Deploy plugin updates at a restart boundary; the same rule applies here.
52
-
53
- ## Dogfood reload checkpoint
54
-
55
- When a self-recursive stage changes skills, agents, commands, hooks, MCP,
56
- Rally, memory/research, plugin manifests, or the self-recursive detector, the
57
- next stage must prove it is using the updated runtime. Use
58
- `references/dogfood-reload-checkpoint.md` and
59
- `scripts/dogfood_reload_checkpoint.py`:
60
-
61
- 1. Finish and validate the runtime-changing stage.
62
- 2. Create the checkpoint and post its path/instructions to Rally.
63
- 3. Restart or reload each participating terminal.
64
- 4. ACK with runtime root, runtime commit, reload method, and Rally status.
65
- 5. Continue only after all expected tools ACK, or after an explicit fallback
66
- decision records the stale/unmanaged terminal.
67
-
68
- ## Quick verification
69
-
70
- After launching with `--plugin-dir`, from inside the working tree:
71
-
72
- ```sh
73
- python3 "$CLAUDE_PLUGIN_ROOT/scripts/detect_self_recursive.py" \
74
- --workdir "$PWD" --runtime-root "$CLAUDE_PLUGIN_ROOT" --json
75
- ```
76
-
77
- Expect `"self_recursive": true` and `"detection_method": "runtime_root_arg"`. Phase 1 surfaces the same in `.build-loop/state.json.selfRecursive`.