@tyroneross/build-loop 0.36.1 → 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 +10 -4
  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 +55 -1
  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 +22 -9
  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,177 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Correction-aware lesson capture — three-tier design
4
-
5
- ## Why
6
-
7
- Two gaps in the prior capture stack:
8
-
9
- 1. **`scan_transcript_for_decisions.py` no-ops entirely without Ollama.**
10
- The script gates on `shutil.which("ollama")`; absent the binary, an
11
- entire session's worth of decisions is silently dropped.
12
- 2. **No lessons / feedback lane from live conversation.** The decisions
13
- scanner captures decisions only. A user correcting the assistant's
14
- just-taken action — the highest-signal lesson event in a session —
15
- had no trigger and no destination.
16
-
17
- The three-tier design closes both gaps without disrupting the existing
18
- decisions pipeline.
19
-
20
- ## Three tiers
21
-
22
- ### Tier 1 — Deterministic Stop-hook (always runs, no LLM)
23
-
24
- **Script:** `scripts/scan_corrections/`
25
- **Hook:** `hooks/hooks.json` Stop entry, fires alongside (not instead of)
26
- the decisions scanner.
27
-
28
- Detects three classes of high-signal patterns in USER turns:
29
-
30
- | Class | Patterns | Confidence |
31
- |---|---|---|
32
- | Correction | `revert that`, `don't X`, `undo`, `stop X`, `back that out`, `wrong approach` | `confirmed` (extra: `prior_assistant_acted: true` when assistant just used tools) |
33
- | Preference | `always X`, `never X`, `must X`, `default to X`, `we use X for Y`, `prefer X` | `confirmed` |
34
- | Tradeoff | `X instead of Y`, `actually X not Y`, `X over Y because Z` | `confirmed` |
35
-
36
- Scope routing: keywords like `across projects`, `globally`, `for all projects`,
37
- `as a rule`, `standing rule` flag the candidate as `scope: global` (otherwise
38
- `project`). Anti-false-positive: wh-question turns ending in `?` are skipped
39
- by hard-skip patterns; greetings/thanks/ok are skipped.
40
-
41
- Writes one `.build-loop/pending-lessons/<ts>-<kind>-<id>.md` per candidate
42
- with YAML frontmatter:
43
-
44
- ```yaml
45
- ---
46
- id: <16-char sha1>
47
- kind: correction|preference|tradeoff
48
- signal_type: <named pattern>
49
- confidence: confirmed
50
- scope: project|global
51
- turn_index: <int>
52
- captured_chars: <int>
53
- tier: 1-deterministic
54
- source: stop-hook
55
- captured_at: <iso8601>
56
- extras:
57
- prior_assistant_acted: true|false
58
- ---
59
-
60
- ## Quote
61
- > <verbatim user span>
62
-
63
- ## Context (±200 chars)
64
- ```
65
-
66
- Idempotent: `id_hash` is a SHA-1 of (kind, signal_type, normalized quote),
67
- so re-running the scanner on the same transcript does not duplicate files.
68
- Promoted/discarded subdirs are also checked for dedup.
69
-
70
- Fail-open contract: any exception logs to stderr and exits 0. The
71
- `.build-loop/.no-capture` opt-out short-circuits before any work.
72
- `SCAN_CORRECTIONS_BUDGET_S` (default 10s) caps wall-clock.
73
-
74
- ### Tier 2 — Optional Ollama accelerator (existing path, unchanged)
75
-
76
- **Script:** `scripts/scan_transcript_for_decisions.py` (the existing
77
- decisions scanner, untouched). When Ollama is installed AND the
78
- transcript is large enough to benefit from clustering, this path
79
- distills/dedups decisions and writes to
80
- `build-loop-memory/projects/<slug>/decisions/` (or `_review/` for
81
- quarantine).
82
-
83
- Tier 2 is **strictly optional**. The user installed Ollama on this
84
- machine, so it runs; on a fresh machine without Ollama, tier 1 alone
85
- guarantees capture and the session continues uninterrupted.
86
-
87
- ### Tier 3 — Host-agent refinement (the primary intelligence)
88
-
89
- **Script:** `scripts/surface_pending_lessons.py`
90
- **Consumed by:** the host coding agent (Claude Code in this build,
91
- Codex on a Codex host, etc.) at SessionStart.
92
-
93
- Per the user's standing "host-agent-is-the-LLM" rule, the host coding
94
- agent is the primary refinement layer. Each session, the host reads
95
- `.build-loop/pending-lessons/` (and optionally
96
- `build-loop-memory/projects/<slug>/decisions/_review/`), classifies each
97
- candidate, and promotes via:
98
-
99
- - `scripts/memory_writer.py` — for `kind=lesson|feedback|preference`
100
- (routes to `build-loop-memory/lessons/` for `scope=global` or
101
- `build-loop-memory/projects/<slug>/lessons/` for `scope=project`)
102
- - `scripts/write_decision/__main__.py` — for `kind=decision`
103
-
104
- Discarded candidates move into
105
- `.build-loop/pending-lessons/discarded/` (any file there is silently
106
- skipped on re-runs, so the discard is durable).
107
-
108
- The same surface also exposes the existing Ollama `_review/` quarantine
109
- when `--include-decisions-review` is set, so the host agent has one
110
- queue to drain.
111
-
112
- ## Store bridge (harness ↔ build-loop-memory)
113
-
114
- **Script:** `scripts/bridge_lesson_to_harness.py`
115
-
116
- Once a lesson lands in build-loop-memory (via tier-3 promotion or any
117
- other path), it can be mirrored into the harness auto-memory store the
118
- host coding agent auto-loads at session start
119
- (`~/.claude/projects/-Users-<u>/memory/`). The bridge:
120
-
121
- - Resolves a deterministic target basename `<kind>_<slug>.md` matching
122
- the harness convention
123
- - Augments the bridged copy's frontmatter with `bridged_from`,
124
- `bridged_at`, `source_store: build-loop-memory`
125
- - Appends a one-line entry to harness `MEMORY.md` under
126
- `## Bridged from build-loop-memory` (creates the section if absent;
127
- preserves other sections; dedup'd on target basename)
128
-
129
- Idempotent and reversible. Only `lesson | feedback | preference | convention | gotcha`
130
- types bridge; decisions stay in their own canonical store.
131
-
132
- ## Triggers — what fires when
133
-
134
- | Event | Tier | Effect |
135
- |---|---|---|
136
- | Session ends (Stop hook) | 1 | tier-1 scanner writes raw candidates to `.build-loop/pending-lessons/` |
137
- | Session ends (Stop hook) | 2 | tier-2 scanner (Ollama, if present) writes distilled decisions |
138
- | Session starts (host agent reads context-bootstrap) | 3 | pending-lessons queue count surfaces in queue summary; host agent runs `surface_pending_lessons.py` to refine |
139
- | Lesson promoted to build-loop-memory | — | `bridge_lesson_to_harness.py` mirrors to harness auto-memory |
140
-
141
- ## File layout summary
142
-
143
- ```
144
- scripts/
145
- scan_corrections/
146
- __init__.py
147
- detect.py — patterns + Candidate dataclass + JSONL parser
148
- __main__.py — Stop-hook CLI (tier 1)
149
- test_detect.py — 26 unit tests
150
- test_cli.py — 8 CLI integration tests
151
- surface_pending_lessons.py — tier 3 host-agent surface
152
- test_surface_pending_lessons.py — 10 tests
153
- bridge_lesson_to_harness.py — store bridge
154
- test_bridge_lesson_to_harness.py — 11 tests
155
- scan_transcript_for_decisions.py — UNCHANGED (tier 2)
156
-
157
- hooks/hooks.json — Stop hook now runs both scanners in parallel
158
-
159
- scripts/context_bootstrap.py — QUEUE_NAMES extended with "pending-lessons"
160
-
161
- .build-loop/pending-lessons/ — tier-1 candidate queue (this run)
162
- /promoted/ — host-agent promoted (silenced)
163
- /discarded/ — host-agent discarded (silenced)
164
- ```
165
-
166
- ## Non-goals + tradeoffs
167
-
168
- - **Not a replacement for `auto-decision-capture`.** That skill is for
169
- the host agent's in-session reasoning — explicit captures during the
170
- conversation. Tier-1 + tier-3 fire at session boundaries; the skill
171
- fires inline. They compose.
172
- - **Tier 1 is intentionally narrow.** Adding fuzzy patterns would
173
- produce false positives. The host agent (tier 3) is where ambiguous
174
- cases get judged — that's the design intent of "host-agent-is-the-LLM."
175
- - **Bridge runs on demand, not automatically.** A future enhancement
176
- could fire it via a post-promotion hook; the durable lesson lives in
177
- build-loop-memory either way, and the bridge is reversible.
@@ -1,101 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
- <!-- CONFIG: v1.0 | T2 | plugin(report-writeup) | Analytical | SCORE: 22/25 [A:5|C:4|Cs:5|D:4|Cp:4] -->
3
-
4
- # Experiment / data-analysis results — reusable template + guide
5
-
6
- One write-up shape for any analysis: A/B, DOE / full-factorial / fractional-factorial,
7
- regression, backtest, ablation, regression-test. Fill the blanks; delete the Method
8
- sub-lines that don't apply; never delete the honesty rails (n, direction legend,
9
- certainty, "not computed — why").
10
-
11
- ---
12
-
13
- ## The template (copy below this line)
14
-
15
- ```markdown
16
- # <test name> — results
17
- <!-- headline: DECISION: <build X / don't / inconclusive> · certainty: <high|medium|low> · n=<N> -->
18
-
19
- ## Objective
20
- - **Testing:** <the one thing under test>
21
- - **Why:** <the recurring problem or the decision this informs>
22
- - **Payoff if it succeeds (user-visible):** <what changes for the end user / consumer>
23
- - **Decision this unblocks:** <what we do differently on a pass vs a fail>
24
-
25
- ## What we did
26
- - **Analysis type:** <A/B | DOE full-factorial | fractional-factorial | regression | backtest | ablation | regression-test | other>
27
- - **Method (1 paragraph):** <how it ran, start to finish>
28
- - **Sample size n = <N>** (<unit: bugs / runs / requests / rows / sessions>) ← never omit
29
- - **Arms / factors** (keep the line that fits your type):
30
- - A/B: control = <...> · treatment(s) = <...>
31
- - DOE/factorial: factors × levels = <...> · runs = <...> · design = <full | fractional res IV | ...>
32
- - Regression: predictors = <...> · response = <...> · model = <OLS | logistic | ...>
33
- - Backtest: data + window = <...> · in/out-of-sample split = <...>
34
- - Ablation: component removed = <...> · baseline = <...>
35
- - **Held constant (confounds managed):** <model, environment, inputs, seed, …>
36
- - **Measurement:** <who/what scored, against what ground truth, and exactly how>
37
- - Blinding: <none | labels withheld | fully blinded> — <if you claim blinded, say what made it so; if a tell leaked, say so>
38
-
39
- ## Hypothesis
40
- - **Predicted:** <outcome> **because** <mechanism / prior reason>
41
- - **Pass means:** <what it implies> → **action:** <...>
42
- - **Fail means:** <what it implies> → **action:** <...>
43
- - **Pre-registered?** <yes + link | no> · decision rule fixed before running? <yes | no>
44
-
45
- ## Results
46
-
47
- **Metric legend — state direction for EVERY metric (this is mandatory):**
48
- | Metric | Measures | Direction | Scale |
49
- |--------|----------|-----------|-------|
50
- | <m1> | <...> | higher better / lower better | <0–2 · % · ms · count · $> |
51
- | <cost> | effort/latency/$ | lower better (only counts when quality ties or wins) | <calls · s · $> |
52
-
53
- **Data:**
54
- | <arm / run / config> | <m1> | <m2> | <cost> |
55
- |---|---|---|---|
56
- | <...> | | | |
57
-
58
- **Statistics — fill what you actually computed; for the rest write "not computed — <why>":**
59
- - **Effect size:** <metric: value (e.g. Δ, Cohen's d, lift %)> | not computed — <why>
60
- - **Statistical significance:** <test, p-value, CI> | **NOT COMPUTABLE — n=<N> too small (directional only)**
61
- - **Correlation:** <vars: r> | not computed — <why>
62
- - **Goodness of fit** (regression only): <R², adj-R², residual check> | n/a
63
- - **Winner / direction:** <which, on which metrics>
64
-
65
- ## Interpretation
66
- - **Certainty:** ✅ high | ⚠️ medium | ❓ low — <why, tied to n + method strength>
67
- - **What it shows / does NOT show:** <scope of the claim>
68
- - **Threats to validity / confounds:** <weak blinding (how), small n, self-selected subject, model substitution, single grader, …>
69
- - **Unknowns:** <what could not be verified>
70
- - **Honesty check:** every adjective here is earned by the method — no "fair / blind / significant / proven" unless the method above supports it.
71
-
72
- ## Next steps
73
- - [ ] **Implement winner:** <...> (or: do not implement — <why>)
74
- - [ ] **Stronger re-test:** <what raises certainty — larger n, cleaner blinding, a real significance test, second grader>
75
- - [ ] **New tests suggested:** <...>
76
- - [ ] **Risks to monitor after rollout:** <...>
77
- ```
78
-
79
- ---
80
-
81
- ## Usage guide
82
-
83
- 1. **Pick one Method sub-line** for your analysis type; delete the others. The honesty
84
- rails — `n`, the direction legend, the statistics block, certainty — stay regardless
85
- of type.
86
- 2. **Direction legend is not optional.** A table of numbers is unreadable without "higher
87
- or lower better" per metric. Cost metrics (calls, time, $) are lower-better but only
88
- count as a win when quality ties or improves (Accuracy > Speed > Cost).
89
- 3. **When stats don't apply, say so explicitly** — never leave significance/correlation/
90
- fit blank or imply them. Rules of thumb: significance/correlation need roughly n ≥ 8–10+
91
- to mean anything; below that write "directional only (n too small)". Regression fit
92
- (R²) is n/a unless you actually fit a model. DOE reports main effects + interactions,
93
- not p-values, unless replicated.
94
- 4. **Earn every adjective.** Do not write "fair", "blind", "robust", "significant", or
95
- "proven" unless the Method section shows what made it so. If blinding leaked (e.g. the
96
- treatment's output format was a tell), record it as a threat to validity — don't claim
97
- blindness.
98
- 5. **Headline = decision + certainty + n.** A decision-maker should get "build it / don't /
99
- inconclusive", how sure, and on how much data, from the first line.
100
- 6. **Pre-register when the result will drive a real decision** — commit Objective +
101
- Hypothesis + decision rule before running, so the verdict can't be retrofit.
@@ -1,72 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> -->
2
- <!-- SPDX-License-Identifier: Apache-2.0 -->
3
-
4
- # Independent Commit Auditor
5
-
6
- Single source of truth for build-loop commit/build-scope adversarial review. **Consolidated 2026-05-23** — replaces both the retired `commit-auditor` agent (chunk + build scope) and the earlier retired `sonnet-critic`. Operates on two surfaces sharing one context-gathering procedure and one verdict taxonomy:
7
-
8
- 1. **Boundary-gated hook (every commit).** A PreToolUse Bash hook in `hooks/hooks.json` invokes `scripts/audit_before_commit.py` whenever the Bash tool runs a command matching `git commit`. The orchestrator cannot skip it. Manual user commits, Codex commits, IDE commits, and build-loop commits all pass through it.
9
- 2. **Self-contextualizing.** The script gathers its own context from on-disk `.build-loop/intent.md`, `.build-loop/goal.md`, repo `CLAUDE.md` + `README.md`, the first PRD found (`docs/PRD.md` -> `docs/prd.md` -> `docs/prd/*.md` -> `.build-loop/prd.md`), canonical build-loop-memory constitution context, and the last 5 commit subjects. No upstream packet needed.
10
- 3. **LLM-grade dispatched agent.** The `independent-auditor` agent (`agents/independent-auditor.md`) is dispatched at Phase 3 chunk-close (chunk advisory) and Phase 4 Review-A (build scope). Same context procedure as the hook, plus diff range — emits a structured JSON envelope. Verdict rendered in conversation by the running Claude session.
11
-
12
- ## Four-verdict taxonomy
13
-
14
- - **yay (approve)** — packet aligns with intent + constitution; ship.
15
- - **nay (reject)** — packet contradicts intent or trips a constitution rule; do not land.
16
- - **suggest correction** — partial alignment; name file:line edits the implementer should make before re-committing.
17
- - **look again** — context insufficient to judge; name the missing artifact (PRD section, prior decision, test result) and gather it.
18
-
19
- ## When the hook fires
20
-
21
- Every Bash tool invocation whose command matches `\bgit\s+commit\b`. The hook timeout is 5000ms; the script is fast (no LLM call, no network). It runs at the Bash boundary, so it fires before the commit lands — the running session can short-circuit by not actually committing if the packet shows a contradiction.
22
-
23
- ## Exit codes
24
-
25
- | Code | Meaning | Caller behavior |
26
- |---|---|---|
27
- | 0 | Packet emitted, no deterministic block | Commit proceeds; running session renders a verdict in chat |
28
- | 2 | Deterministic block (secrets file staged, merge-conflict markers in diff) | Caller / hook framework signals the commit should not proceed |
29
- | 1 | Reserved | — |
30
-
31
- Deterministic blocks are zero-judgment hard fails (filenames matching `*.pem` / `id_rsa*` / `id_ed25519*`, `.env*` files with credential-shaped content, or `<<<<<<< HEAD` / `=======` / `>>>>>>>` markers in the staged diff).
32
-
33
- ## Bypass
34
-
35
- Emergency commits can bypass the audit by setting `BUILDLOOP_AUDIT_BYPASS=1` in the environment:
36
-
37
- ```bash
38
- BUILDLOOP_AUDIT_BYPASS=1 git commit -m "emergency hotfix"
39
- ```
40
-
41
- Each bypass is logged to `~/.build-loop/audit-bypass.log` with timestamp + cwd + reason. Bypasses are valid but visible — Phase 6 Learn can mine the log for chronic-bypass patterns.
42
-
43
- ## Dispatched-agent surface
44
-
45
- For LLM-grade judgment on a specific commit or commit range, dispatch `Agent(subagent_type="build-loop:independent-auditor", ...)`. The agent uses the same context-gathering procedure as the script and renders a structured JSON envelope (with explicit `context_seen` flags and `missing_artifacts[]`). The agent is Sonnet-tier; use it for per-chunk advisory, cross-chunk reviews, and Phase 4 Review-A build-scope critique.
46
-
47
- ## Dispatch ladder & `auditor_status` — the LLM auditor is never silently skipped (GAP-1)
48
-
49
- `Agent(subagent_type=...)` only works from a context that HAS the Agent tool. When the build-loop **orchestrator itself runs as a nested subagent** (dispatched via the Agent tool as `build-loop:build-orchestrator`, or running per-commit mode), the harness blocks sub-subagents — so that orchestrator **cannot** dispatch this agent. The historical defect (2026-06-06 IBR retro): the nested orchestrator silently fell back to inline self-reasoning and reported "independent-auditor ran inline", which rubber-stamped a HIGH cookie-leak + 2 MEDIUM findings that a real dispatch later caught. **Inline self-audit is not the independent auditor.**
50
-
51
- There are exactly **three honest ways a real auditor verdict enters `judge_decisions[]`**, and one honest "didn't run" signal:
52
-
53
- | `auditor_status` | How the verdict was produced | `judge_id` written |
54
- |---|---|---|
55
- | `ran:dispatched-agent` | `Agent(subagent_type="build-loop:independent-auditor")` — Agent tool present (top-level / Mode A) | `independent-auditor` |
56
- | `ran:peer-host(<host>)` | Auditor run as a peer process (rally channel / `codex exec`) — used when the orchestrator is nested but a peer host is reachable (Bash survives nesting) | `independent-auditor` |
57
- | (hook) | The PreToolUse boundary hook `scripts/audit_before_commit.py` | `independent-auditor-hook` |
58
- | `not-run:parent-must-dispatch` / `cross-vendor-deferred` | No Agent tool AND no peer host could execute. **No `independent-auditor`-labeled verdict is written.** | — |
59
-
60
- **Never-masquerade rule:** do not write a `judge_id` containing `independent-auditor` for inline orchestrator reasoning. If neither a dispatched agent, a peer-host process, nor the hook produced a verdict, the only honest record is `auditor_status: not-run:parent-must-dispatch` in the orchestrator's return envelope — never a fabricated verdict. A `not-run` run is **not review-complete**: the dispatching parent (which has the Agent tool) owes the audit before Report. Full ladder + parent-dispatch contract in `phase-4-review.md` §"Sub-step A"; the structural backstop is `scripts/write_run_entry` (`review_completeness_error` → exit 3 on a `scope=build` code-touching `pass` that lacks a real auditor verdict).
61
-
62
- ## How the running session should interpret a packet
63
-
64
- When a Bash `git commit` returns with the packet appended to stderr:
65
-
66
- 1. **Read the packet sections** (Intent, Goal, PRD reference, Trajectory, etc.).
67
- 2. **Pick a verdict** explicitly in your next assistant message — the user (and any audit-trail tooling) needs to see the verdict named, not implied.
68
- 3. **If `yay`**, no further action — the commit is in.
69
- 4. **If `nay` or `suggest correction`**, do not push. State which finding triggered the verdict and either revert (`git reset HEAD~1`) or make the suggested edits and amend.
70
- 5. **If `look again`**, gather the missing artifact (read the PRD section, dispatch the escalation agent, etc.) and re-render the verdict.
71
-
72
- The verdict belongs in the running session's transcript so future readers (and Phase 6 Learn) can see what the auditor saw and what the operator did with it.
@@ -1,257 +0,0 @@
1
- <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
-
3
- # Intent Capability Pack
4
-
5
- Use this pack on every build. It keeps decentralized subagent work aligned to the app's purpose, the user's actual job, and the update's intent.
6
-
7
- ## North Star
8
-
9
- Every build starts by capturing:
10
-
11
- - **App/repo purpose**: what this product is for and who it serves.
12
- - **Primary users**: the people or roles affected by this change.
13
- - **Core jobs**: the tasks users perform most often or rely on most.
14
- - **Update intent**: why this change matters now.
15
- - **User value**: how the change makes the product faster, clearer, more accurate, more trustworthy, more useful, or easier to navigate.
16
- - **Non-goals**: what this build should not add, expose, or complicate.
17
-
18
- Write the result to `.build-loop/intent.md` and mirror the compact version into `.build-loop/state.json.intent`.
19
-
20
- ### Commander's-intent posture (WP-F, all OPTIONAL — LLM-inferred, confirm-on-ambiguity)
21
-
22
- North Star captures who/what; **posture** captures the tradeoff stance that drives
23
- autonomous forks when the agent loses comms (the Marine-Corps commander's-intent
24
- analog: purpose + key tasks + end state, so a subordinate who can't ask still
25
- chooses correctly). A walkie-talkie app for generals-on-ops, for kids, and for
26
- traders share North Star *fields* but differ entirely in *what to optimize when
27
- forced to choose*. All fields are OPTIONAL and LLM-inferred from the ask; confirm
28
- only on genuine ambiguity (reuse the restatement protocol — never `AskUserQuestion`,
29
- never a gate). Mirror into `state.json.intent.posture`.
30
-
31
- - **audience** + **stakes** — one line each (who the change serves; what a failure
32
- costs). `stakes` ∈ {low, medium, high}.
33
- - **priority_order** — the ranked tie-breaker the agent applies when two viable
34
- paths conflict. FIXED VOCAB (ordered subset of
35
- `security / reliability / speed / cost / simplicity / polish`) plus a free-text
36
- `notes` escape for expressiveness. The fixed vocab aids weak-LLM recall; `notes`
37
- carries anything the vocab can't.
38
- - **acceptable_tradeoffs** — what is OK to cut under pressure.
39
- - **non_goals** — what is never cut. At `stakes: high`, a `non_goals` entry that
40
- names a REAL risk is a candidate to **graduate to a constitution invariant** — but
41
- only once it is **promoted into the project constitution** (`projects/<slug>/constitution.md`),
42
- where the LLM enforces it as a hard line. Until promoted, it stays advisory like the
43
- rest of the posture. There is no separate deterministic gate that reads `non_goals`
44
- directly (`grep non_goals scripts/` is intentionally empty); enforcement rides the
45
- constitution, not a parallel mechanism. See the tiered charter below.
46
-
47
- `priority_order` wires into the `alignment-checker` as the Phase-2-fork and
48
- Phase-5-queue-drain tie-breaker: not just "matches intent?" but "which viable path
49
- does THIS user's priority order prefer?" — advisory data the LLM weighs, never a gate.
50
-
51
- ### Tiered intent — `stakes` is the depth dial (WP-F/F2)
52
-
53
- - **Per-run intent** (ephemeral, `.build-loop/intent.md`): restated ask + this
54
- change's posture. Unchanged lifecycle.
55
- - **Project charter** (persistent): stable North Star + posture + invariants + key
56
- architecture decisions. ACCRETES via promotion — a fact promotes to durable when
57
- user-confirmed OR stable/unchallenged across N runs; stays `inferred` until then;
58
- carries the falsifier that would unseat it (doctrine rule 8). Storage + sync:
59
- `scripts/charter.py` (canonical `build-loop-memory/projects/<slug>/charter.md`;
60
- repo mirror `.build-loop/charter.md` with a `canonical:` pointer + content hash;
61
- one writer = the run, from canonical; user hand-edit of the mirror promotes to
62
- canonical `authored_by: user` on next run via hash-mismatch detection).
63
- - **Depth scales by `stakes`**: low → intent line only (skills/agents/toys — do NOT
64
- force a charter, that's the anti-pattern); medium → thin charter (web/mobile);
65
- high → full charter, and risk-naming `non_goals` become candidates to promote into
66
- the constitution as invariants (where the LLM enforces them). The promotion is the
67
- enforcement; no `non_goals`-specific gate exists outside the constitution.
68
- - **PRD stance**: opt-in upfront via `start-prd`; accretion is the default; never
69
- required. A PRD, when present, PREFILLS the charter richer — input, not a gate.
70
-
71
- Enforcement philosophy (binding): all advisory. The one stronger-than-advisory path
72
- is **constitution promotion** — a risk-naming `non_goals` at `stakes: high` graduates
73
- to a hard invariant only when it is written into `projects/<slug>/constitution.md`,
74
- which the LLM treats as a binding line. Per `feedback_deterministic_only_for_known_risks` —
75
- posture/charter depth is the dial; the LLM weighs, never a gate. The constitution, not
76
- a `non_goals`-specific script, carries any graduated invariant (no dormant determinism
77
- claim — there is no `non_goals` enforcement code to wire up).
78
-
79
- ## Intent restatement protocol (always-on)
80
-
81
- Run this protocol on every build, judged by the orchestrator LLM — never a regex, never a detector script, never a binary gate. Depth scales with ambiguity, not a threshold. The behavior is intrinsic to Phase 1; no separate skill, script, or routing step gates it.
82
-
83
- ### Step A — One-line concrete restatement (always)
84
-
85
- Read the user's goal text and the surrounding context. Write a single sentence restating the most likely concrete interpretation to `.build-loop/intent.md` under a `## Restated intent` heading. For a concrete unambiguous goal, this is the entire protocol — write the line and move on. No options, no assumption-tagging, no exploration detour. The auto-execute fast path is unaffected.
86
-
87
- Heuristics the LLM uses (judgment, not a checklist):
88
-
89
- - Does the goal name a file path, function, schema field, route, command, or other concrete deliverable? → restate once and proceed.
90
- - Could two reasonable readers infer materially different work? → continue to Step B.
91
- - Does the goal use investigative or hedging language ("explore", "look into", "something like", "brainstorm", "design from scratch") without a concrete target? → continue to Step B.
92
-
93
- The judgment is one pass, fast, and does not block. When in doubt about whether ambiguity is "real," do the lighter version (Step A only) and tag assumptions inline so downstream work can correct.
94
-
95
- ### Step B — Options + tradeoffs when ambiguity is genuine
96
-
97
- When the LLM judges genuine ambiguity (Step A heuristics fail), extend `.build-loop/intent.md` with:
98
-
99
- ```md
100
- ## Approach options
101
- 1. **<short label>** — <≤2 sentences on what + tradeoff>
102
- 2. **<short label>** — <≤2 sentences on what + tradeoff>
103
- 3. **<short label>** — (optional third — stop at 3)
104
-
105
- ## Recommended path
106
- <one sentence naming option 1/2/3 and the reason>
107
-
108
- ## Scope cuts considered
109
- - <thing the orchestrator believes can be cut without losing user value>
110
- - <second if present>
111
- ```
112
-
113
- Lead with the recommended option. Avoid speculative "we could also" lists. Keep to 1–3 options — the goal is to narrow, not to enumerate.
114
-
115
- The reference file `skills/build-loop/references/intent-exploration-prompts.md` carries four template patterns (vague-verb, branching-or, creative-open, hedge-phrase) the LLM can consult when shaping options for common ambiguity shapes. Load on demand only when the goal matches one of those shapes.
116
-
117
- ### Step C — Tagged assumptions (always when Step B fires; optional in Step A)
118
-
119
- For every leap the restatement made that isn't grounded in the repo or the user's prompt, append a `TAG:ASSUMED` line under a `## Open assumptions (TAG:ASSUMED)` heading naming the assumption + the evidence that would close it. Examples:
120
-
121
- - `TAG:ASSUMED — user wants the smallest concrete restatement; would close by user pinning a specific deliverable.`
122
- - `TAG:ASSUMED — "explore" means "survey + recommend"; would close by repo showing prior similar work pattern.`
123
-
124
- Tagged assumptions are the audit trail. The user reads them in the run report and can override on the next dispatch.
125
-
126
- ### Step D — Mirror compact summary to state.json
127
-
128
- Mirror the result to `.build-loop/state.json.intent`:
129
-
130
- ```json
131
- {
132
- "restated_intent": "<one sentence>",
133
- "approach_options": ["<label>", "<label>"], // optional; empty when Step A alone fired
134
- "assumptions": ["<line>", "<line>"], // optional; empty when no leaps were made
135
- "confidence": "high" | "medium" | "low", // LLM judgment, not a script
136
- "run_id": "<current run_id>" // Step E: the run this intent was written for
137
- }
138
- ```
139
-
140
- ### Step E — Run-id freshness stamp (per-run staleness guard)
141
-
142
- `intent.md` lives in `.build-loop/` and survives across runs in the same workdir, so a
143
- resumed or back-to-back run finds the PRIOR run's intent on disk. The "auto-execute fast
144
- path" (Step A: "write the line and move on" for a concrete goal) can be misread as
145
- "the present file already satisfies the protocol", so the rewrite gets skipped and the
146
- stale intent describes prior work — the exact bl-intent-refresh-per-run failure (the
147
- A–H consolidation run listed as a non-goal what WP-A shipped).
148
-
149
- Two cheap, deterministic moves close it:
150
-
151
- 1. **Stamp on write.** Whenever Phase 1 (re)writes `intent.md`, embed the current
152
- `run_id` as an HTML comment so the prose never has to carry it:
153
- `<!-- intent_run_id: <run_id> -->` (helper: `intent_freshness.stamp_marker(run_id)`).
154
- Mirror `run_id` into `state.json.intent.run_id`.
155
- 2. **Check at Phase 1 start.** Run
156
- `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/intent_freshness.py --workdir "$PWD" --json`.
157
- A `stale` (stamp ≠ current run) or `unstamped` verdict means the on-disk intent is
158
- from a prior run — re-run Steps A–D and re-stamp. The check is **advisory** and exit-0
159
- always: a run-id *mismatch* is an objective structural fact (equality, not a content
160
- judgment), so detecting it respects "never a content gate" — only the refresh (the LLM
161
- rewriting the prose) is judgment. Surface the verdict line in the run report; never
162
- `AskUserQuestion`, never `## Held`, never block.
163
-
164
- This is detection-by-structure + refresh-by-LLM: it does not re-introduce the retired
165
- regex that judged intent *content*; it only answers "does this file belong to this run?".
166
-
167
- ### Hard guarantees (non-negotiable)
168
-
169
- - **Never `AskUserQuestion`.** Intent capture is autonomous. The user reads the restatement + assumptions in the run report and can correct on the next dispatch.
170
- - **Never `## Held`.** Advisory output only. Phase 2 Plan proceeds with whatever Step A or A+B produced.
171
- - **Never blocks Phase 1.** A goal that is too ambiguous to restate concretely still gets restated as the best-effort interpretation + assumptions tagged. The flow proceeds.
172
- - **Fail-safe.** Any error in this protocol (file write fails, intent.md missing) is logged as one line and the build continues. No exit-non-zero path exists here.
173
- - **Auto-execute fast path preserved.** A concrete unambiguous goal produces the one-line restatement only. Zero added cost for Step B/C. No skill dispatch, no script call, no detection layer.
174
- - **Fork-on-uncertainty consumes the output.** When Step B fired AND `confidence == "medium"|"low"` AND Phase 2 surfaces 2+ viable approaches differing only on implementation tradeoffs, the orchestrator's existing fork-on-uncertainty rule fans out worktrees per approach. The protocol provides the options; the existing rule consumes them.
175
-
176
- ### Why intrinsic, not gated
177
-
178
- The prior shape used a regex script to decide whether to run an exploration skill. That regex false-fired on ordinary prose ("auth fails or times out", "returns 200 or 404") and forced exploration detours on concrete goals — violating the no-friction fast-path contract. The LLM judges ambiguity better than a regex can. This protocol is the application of the "host agent is the LLM" principle to intent capture.
179
-
180
- ## Intent Packet
181
-
182
- Every subagent prompt must include this packet:
183
-
184
- ```md
185
- North star: <one sentence>
186
- Update intent: <one sentence>
187
- Primary user/workflow: <who does what>
188
- This task fits by: <how this subtask advances the build>
189
- User-value rule: <speed | accuracy | trust | navigation | scalability | reduced choice burden | other>
190
- Decision constraints:
191
- - No fake data or mock responses in production/user decision paths.
192
- - No dead controls, dead navigation, decorative options, or UI promises without working behavior.
193
- - Prefer the simplest approach that preserves user value and long-term scalability.
194
- - Use a more complex approach only when the simpler approach harms user experience, correctness, extensibility, or performance.
195
- Evidence required: <tests, build, visual check, data trace, performance check, etc.>
196
- ```
197
-
198
- ## Decision Rules
199
-
200
- - **Real value beats apparent progress**. A UI that looks complete but hides mock data is worse than an honest incomplete state.
201
- - **Basics must be excellent**. Core flows, data accuracy, loading, empty states, error states, navigation, and primary actions matter more than secondary features.
202
- - **Every visible element needs intent**. Each button, label, option, nav item, chart, and message must help the user act, understand, decide, or recover.
203
- - **One clear primary action by default**. Multiple hero or primary buttons need a strong reason. If choices create confusion, reduce them.
204
- - **No non-working promises**. Do not ship listed options, nav items, filters, actions, charts, or integrations that do nothing or return placeholders.
205
- - **Simplicity is not shortcutting**. Prefer the smallest durable solution. Choose additional complexity only when it materially improves user value, reliability, scalability, or future optionality.
206
- - **End-to-end data integrity matters**. If users make decisions from search, charts, metrics, recommendations, or summaries, trace those outputs to real sources.
207
-
208
- ## UI Standard: Beauty in the Basics
209
-
210
- For UI work, the baseline is intentional, useful, and polished:
211
-
212
- - **Hierarchy**: the screen makes the next best action obvious.
213
- - **Copy**: text is specific, truthful, and necessary. Remove generic filler.
214
- - **Controls**: controls have working behavior, appropriate affordance, and accessible labels.
215
- - **Navigation**: navigation reflects real destinations and common workflows.
216
- - **Choices**: option count is constrained to what users can meaningfully use.
217
- - **States**: loading, empty, error, success, disabled, and permission states are designed, not incidental.
218
- - **Data displays**: charts, tables, search results, and metrics show real data or a clear unavailable state.
219
- - **Performance**: avoid visual or data-flow choices that make common tasks slower without clear value.
220
- - **Scalability**: layouts and data models should tolerate realistic growth without immediate redesign.
221
-
222
- ## User-Impact Issue Rule
223
-
224
- When build-loop discovers a bug or issue while working:
225
-
226
- 1. Ask whether it impacts users by checking:
227
- - Does it make the app slower or faster?
228
- - Does it make information less or more accurate?
229
- - Does it affect trust, data integrity, security, or recovery from failure?
230
- - Does it make core workflows easier or harder to navigate?
231
- - Does it add unnecessary choices or remove useful optionality?
232
- - Does it create short-term code that blocks scalable future work?
233
- 2. If yes and the fix is local to the current build, add it to the plan and fix it automatically.
234
- 3. If yes but the fix is too large or risky, log it to `.build-loop/issues/` with user impact, proposed fix, and why it was deferred.
235
- 4. If no, log only when it is likely to affect future maintenance.
236
-
237
- ## Review Gates
238
-
239
- Review must check:
240
-
241
- - **Intent fidelity**: the implementation advances the north star and update intent.
242
- - **User value**: the result improves at least one declared user-value rule.
243
- - **UI intentionality**: visible elements are meaningful, working, and not excessive.
244
- - **Data integrity**: production/user decision paths do not use fake, random, or placeholder data.
245
- - **Simplicity and scalability**: the solution is the simplest durable approach that protects user experience.
246
-
247
- ## Source Basis
248
-
249
- This pack operationalizes human-centered design and usability principles from:
250
-
251
- - [ISO 9241-210:2019](https://www.iso.org/standard/77520.html): human-centered design across the interactive-system life cycle.
252
- - [NIST summary of ISO human-centered design](https://www.nist.gov/itl/iad/visualization-and-usability-group/human-factors-human-centered-design): explicit users/tasks/environments, iterative evaluation, whole user experience, and multidisciplinary perspective.
253
- - [GOV.UK Service Manual: understand users and their needs](https://www.gov.uk/service-manual/service-standard/point-1-understand-user-needs): understand full context, validate assumptions, and avoid building the wrong thing.
254
- - [GOV.UK Service Manual: learning about users and their needs](https://www.gov.uk/service-manual/user-centred-design/user-needs): design around real user needs and keep needs traceable to user stories.
255
- - [W3C WCAG 2.2 Understanding](https://www.w3.org/WAI/WCAG22/understanding/): accessible interfaces should be perceivable, operable, understandable, and robust.
256
- - [Apple Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/): hierarchy, harmony, consistency, accessibility, platform patterns, and common components.
257
- - [Nielsen Norman Group usability heuristics](https://www.nngroup.com/articles/ten-usability-heuristics/): visibility, match to real world, user control, consistency, error prevention, recognition, flexibility, minimalist design, recovery, and help.