@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,6 +1,6 @@
1
1
  ---
2
2
  name: model-tiering
3
- description: Use when choosing a model tier or segment for a subagent, deciding a role descriptor (segment + tier) in frontmatter, or escalating mid-flow. Covers the two-axis taxonomy (work-role segment × 7-rung capability ladder) — Opus/Sonnet/Haiku are Anthropic-default mappings; selection is provider-portable and data-driven. NOT for benchmarking models head-to-head on a task use `model-bakeoff`.
3
+ description: Recommend which model tier (e.g. Opus/Sonnet/Haiku) to use for a subagent or task. Use when the user asks "which model should I use", "is Sonnet enough or do I need Opus", or sets a segment+tier in agent frontmatter. Not for running multiple models head-to-head and scoring them (use `model-bakeoff`).
4
4
  user-invocable: false
5
5
  ---
6
6
 
@@ -26,25 +26,57 @@ Agents declare a `(segment, tier)` ROLE; the resolver (`scripts/model_resolver.p
26
26
 
27
27
  | Tier | Anthropic default | Role | Equivalents (advisory — verify benchmarks before swapping) |
28
28
  |---|---|---|---|
29
- | **Frontier** | Fable 5 | **Phase 2 Plan synthesis (frame goal, draft spec/ADRs, F-criteria, MECE partition) via the Advisor dispatch ladder when stakes-gated** `advisor` agent / peer host / already-Fable session; honestly-labeled inline-Opus fallback otherwise (`references/advisor-dispatch-ladder.md`). (Advisor v1 = Phase 2 only; Phase 1 Assess synthesis runs inline as today until v2.) AND verification judgment (plan-critic, scope-auditor, independent-auditor, fix-critique, fact-checker, security-reviewer, overfitting-reviewer, promotion-reviewer) | GPT-5.5 Thinking (or whichever tier scores above the prior Thinking-tier ceiling), future Claude tier above Opus; any model that benchmarks above the Thinking-tier contract on SWE-bench Verified AND ARC-AGI / GPQA Diamond |
30
- | **Thinking** | Opus 4.8 | Coordination — build-orchestrator, assessment-orchestrator — and the escalation target for execution (ambiguous spec, 2 consecutive failures, cross-file surprise) and audit/learnings synthesis when Frontier is unavailable | GPT-5 Thinking, Gemini 2.5 Pro; any model >= Opus 4.6 on SWE-bench Verified + Frontier-class on ARC-AGI / MMLU-Pro |
31
- | **Code** | Sonnet 5 | Application — apply rule to bounded input, scoped implementation, mechanical refactor, bounded domain assessment | GPT-5 Codex, qwen2.5-coder-32B (local); any model with SWE-bench Verified within ~5pt of the Code-tier default (last published Anthropic Sonnet figure: 4.6 ~79.6%; Sonnet 5 reaches prior Opus-tier coding/agentic quality per claude-api T1) |
32
- | **Pattern** | Haiku 4.5 | Recognition — regex/syntactic match, classification into known buckets, log scan, deterministic checklist | Haiku 4.6, GPT-5 Mini, llama3.2-3b (local); any small/fast model that handles structured pattern matching |
29
+ | **Frontier** | Opus 5 | **Phase 2 Plan synthesis via the Advisor dispatch ladder when stakes-gated**, plus every gating verification agent (`plan-critic`, `independent-auditor`, `security-reviewer`). Fable is the SECOND T1 entry, reached only via `scripts/frontier_gate.py` for planning on tightly-coupled repos | GPT-5.6 Sol; future models that clear the Thinking-tier contract and prior ceiling |
30
+ | **Thinking** | Opus 5 | Coordination and escalation, plus medium-risk verification (`scope-auditor`, `fact-checker`, `fix-critique`, `overfitting-reviewer`, `promotion-reviewer`) | GPT-5.6 Terra for routine orchestration; GPT-5.6 Sol for the Governance/Evaluation T2 cell and genuinely ambiguous escalation |
31
+ | **Code** | Sonnet 5 | Application — apply rule to bounded input, scoped implementation, mechanical refactor, bounded domain assessment | GPT-5.6 Terra, qwen2.5-coder-32B (local); any model within the Code-tier benchmark tolerance |
32
+ | **Pattern** | Haiku 4.5 | Recognition — regex/syntactic match, classification into known buckets, log scan, deterministic checklist | GPT-5.6 Luna, Haiku-class or local small/fast models that handle bounded structured work |
33
33
 
34
34
  **Rule of substitution:** tier A's swap target must score within tolerance of the default on the benchmark relevant to its role. For Code tier that's SWE-bench Verified ≥75% AND tool-use accuracy ≥85%; for Thinking tier that's SWE-bench ≥78% AND ARC-AGI / GPQA Diamond competitive; for Frontier tier that's clearing the Thinking-tier contract AND scoring above the prior-generation Thinking-tier ceiling on at least one of SWE-bench Verified / ARC-AGI / GPQA Diamond; for Pattern tier no benchmark — just "fast and cheap, doesn't hallucinate on bounded structured tasks."
35
35
 
36
36
  **Why Frontier sits above Thinking for plan + verification (and not for execution):** wrong plans and wrong verdicts compound — a bad plan dispatches N implementers into the wrong work, and a bad verdict ships a regression. The user's standing priority is Accuracy > Speed > Cost (`feedback_accuracy_speed_cost_priority.md`), so the planning and verification surfaces — where one miscall poisons everything downstream — pay the Frontier premium. Execution and coordination stay on Sonnet/Opus because they're either bounded application (Sonnet implementer applies a settled plan) or routing (Opus orchestrator chooses which subagent runs next, with deterministic gates as the safety net).
37
37
 
38
+ ## Harness amplifies, does not replace, model capability
39
+
40
+ A better harness (scaffold, tool-set, context budget, verify loop) lifts a weak model *up to* its capability ceiling — it does not push the model *past* it. Treat the harness as a large, routinely-undervalued multiplier, not a substitute for tier. The evidence:
41
+
42
+ - **Variance decomposition** over 25k+ agent runs / 8 domains attributes ~41.4% of outcome variance to base-model reasoning vs ~1.5% to scaffold (a ~28:1 ratio) — the ceiling is a model property.
43
+ - **SWE-agent** raised the *same* GPT-4 Turbo from 3.8% (RAG pipeline) to 12.5% (ACI scaffold) — a 3.3× harness lift, yet still only 12.5% *absolute*. A weak base stays absolutely unreliable on hard tasks no matter the harness.
44
+ - Internal dogfood corroboration: after a transport/parser fix unblocked a small local model's tool calls (0→8 parsed), the *model* ceiling remained — it still could not produce compiling Rust.
45
+
46
+ **Routing consequence (keep as-is):** route hard, open-ended reasoning UP to the frontier tier; route bounded, oracle-checkable work DOWN to local/small models. Do NOT invest harness effort expecting a small/local model to clear reasoning-heavy tasks — that is a ceiling failure, not a scaffold failure, and no amount of harness engineering fixes it. When a reliability failure appears (agent lies about success, doesn't follow through, unsafe action), route to harness/verify/guardrail fixes, not to a bigger prompt or a smaller-model-plus-better-scaffold gamble.
47
+
48
+ Source: `build-loop-memory/research/2026-07-06-ai-coding-fundamentals-and-harness-claims.md` (Claim 4 — "MIXED, leaning CHALLENGE on the strong form"; variance-decomposition + SWE-agent + internal ledger).
49
+
38
50
  ## Provider-swap recipe
39
51
 
40
52
  Build-loop's agent frontmatter uses Anthropic model aliases (`fable`, `opus`, `sonnet`, `haiku`) because Claude Code is the primary host. To run on a different provider:
41
53
 
42
54
  1. **Edit the INDEX, not each agent.** `model:` frontmatter is index-DERIVED (generated by `scripts/sync_agent_model_defaults.py`), so do not hand-edit it. To swap providers, reorder the preferred list / change the default for the `(segment, tier)` cell in `references/model-taxonomy.json` (or classify a new model once via `scripts/classify_model_tier.py`), then run `python3 scripts/sync_agent_model_defaults.py --apply` to regenerate every agent's `model:`. The role's `(segment, tier)` is the durable key; the tier determines the substitution target.
43
- 2. **Runtime override:** `.build-loop/config.json.modelOverrides` accepts `{ frontier: "<id>", thinking: "<id>", code: "<id>", pattern: "<id>" }`. The orchestrator resolves this through `scripts/model_overrides.py` before dispatching subagents (see `references/model-tier-mapping.md` for full schema). Configs without `frontier` resolve frontier → `fable` by default.
55
+ 2. **Runtime override:** `.build-loop/config.json.modelOverrides` accepts `{ frontier: "<id>", thinking: "<id>", code: "<id>", pattern: "<id>" }`. The orchestrator resolves this through `scripts/model_overrides.py` before dispatching subagents (see `references/model-tier-mapping.md` for full schema). Configs without `frontier` resolve frontier → the T1 default (`opus`).
44
56
  3. **Per-dispatch override:** any orchestrator dispatch may pass `model: <id>` in the subagent prompt to force that call.
45
57
 
46
58
  The role-and-task table below uses tier names. The Anthropic-default mapping in the right column is illustrative; substitute your equivalents at swap time.
47
59
 
60
+ ### Groq workload catalog (on demand)
61
+
62
+ When the task asks which Groq API model or system should run a downstream workload, read both `references/provider-catalogs/groq.md` and `references/provider-catalogs/groq-models.json`. The first contains dated decision guidance; the second is the machine-readable snapshot and freshness contract.
63
+
64
+ Keep this separate from host-agent reachability. A Groq catalog entry does not become an available Build Loop subagent model until a host adapter works and the model clears the role-specific benchmark. Reverify the catalog after its `review_after` date, on any deprecation change, and before production billing or capacity decisions because availability, pricing, rate limits, advertised throughput, and capability compatibility are dynamic.
65
+
66
+ ### GPT-5.6 Codex policy
67
+
68
+ - **Sol** is approved for planning synthesis and gating verification agents: `advisor`, `plan-critic`, `scope-auditor`, `independent-auditor`, `fix-critique`, `fact-checker`, `security-reviewer`, `overfitting-reviewer`, and `promotion-reviewer`.
69
+ - **Terra** is approved for ordinary orchestration, bounded implementation, domain assessment, advisory review, and Learn drafting. It is the Codex default for `build-orchestrator`, `assessment-orchestrator`, and `implementer`.
70
+ - **Luna** is approved for bounded recognition agents: `mock-scanner`, `recurring-pattern-detector`, and `transcript-pattern-miner`. Prefer a deterministic script when the rule is fully expressible.
71
+ - Start bounded coding and execution at Terra `high`; this is an advisory default and explicit per-dispatch effort remains valid. Start Luna at `low|medium` and Sol at `medium` (`high` for adversarial/security verdicts). Use `xhigh` only after evidence of a miss; reserve `max` and Ultra for rare cases with justified consequence or meaningful independent streams.
72
+ - The live resolver returns `preferred_effort` and `effort_guidance` with every agent resolution. Dispatchers must record requested versus actual effort and the verifier result before promoting a workload to `xhigh` or `max`.
73
+ - **Claude:** Sonnet, Opus, and Fable start at `high`; step to `xhigh` only after a verifier records a quality miss, then evaluate `max` only when the added quality warrants it. Haiku exposes no effort control, so keep it on bounded recognition work and escalate the model rather than inventing an effort retry.
74
+ - Escalate Luna→Terra when rule application appears; Terra→Sol when ambiguity, high consequence, or repeated verified failure appears. Model size never weakens least privilege, confirmation, sandboxing, or independent verification.
75
+
76
+ Source: OpenAI GPT-5.6 System Card (2026-07-09), retained in build-loop-memory with the full PDF and routing extract.
77
+
78
+ **Claude exception:** `scope-auditor`, `fact-checker`, `fix-critique`, `overfitting-reviewer`, and `promotion-reviewer` use Opus at medium effort. `plan-critic`, `independent-auditor`, and `security-reviewer` moved to Opus on 2026-07-28 (commit `5e0122a`) — Fable is no longer the default for any verification role. The Codex mapping remains Sol for every gating verification agent.
79
+
48
80
  ## Chat-triggered index maintenance (host-LLM-driven)
49
81
 
50
82
  The model index (`references/model-taxonomy.json`) is **user-editable and chat-maintainable**. When the user expresses model intent in conversation, recognize it and act on the index directly — this is host-LLM-driven per the repo's "host coding agent is the LLM" rule: you recognize the intent and run deterministic scripts; there is NO vendor API call and NO hard hook. (A `UserPromptSubmit` hook that pre-detects these phrasings is an OPTIONAL future hardening, not required — the LLM recognizing intent is the mechanism.)
@@ -83,7 +115,7 @@ Dispatch always resolves the role LIVE through `resolve_agent_model.py`, so an i
83
115
  | (prior-gen baseline) Sonnet 4.6 uses 70% fewer tokens than 4.5 on complex file ops with +38% accuracy | Anthropic Sonnet 4.6 announcement | ⚠️ T2, single-source; superseded by Sonnet 5's new tokenizer |
84
116
  | Pricing: Sonnet 5 $3/$15 per MTok ($2/$10 introductory through 2026-08-31) | claude-api skill cache 2026-06-24 (T1 — Anthropic) | ⚠️ verify before billing |
85
117
  | Pricing: Opus 4.8 $5/$25 per MTok input/output | Anthropic pricing page | ⚠️ verify before billing |
86
- | Pricing: Fable 5 $10/$50 per MTok input/output (1M context, capability tier above Opus 4.8) | claude-api skill cache 2026-05-26 (T1 — Anthropic) | ✅ T1 source, advisory until re-confirmed at next billing audit |
118
+ | Pricing: Fable 5 $10/$50 per MTok input/output (1M context; superseded as the T1 default by Opus 5 on 2026-07-28) | claude-api skill cache 2026-05-26 (T1 — Anthropic) | ✅ T1 source, advisory until re-confirmed at next billing audit |
87
119
 
88
120
  ## MECE primitive: cognitive type of the task
89
121
 
@@ -91,48 +123,58 @@ Before consulting the role table, classify the task by reasoning shape. The MECE
91
123
 
92
124
  | Reasoning shape | Model | What it means | Example tasks |
93
125
  |---|---|---|---|
94
- | **Planning + Verification synthesis** — frame the goal, draft the spec/ADRs, define F-criteria, MECE-partition the work, then later judge whether a plan, a commit, a fix, a claim, or a security/scope boundary actually holds | **Fable (Frontier)** | The "what to do" and "did it actually work" calls. Wrong calls poison every downstream dispatch. | Phase 2 Plan drafting (reaches Fable via the stakes-gated Advisor ladder; Phase 1 Assess synthesis stays inline until v2), plan-critic, scope-auditor, independent-auditor, fix-critique, fact-checker, security-reviewer, overfitting-reviewer, promotion-reviewer |
95
- | **Coordination + escalation synthesis** — route work between subagents, ladder severity, run causal-tree on stuck iterations, write audit/learnings | **Opus (Thinking)** | The "who runs next" + "why did the rule run out" calls. Deterministic gates backstop the routing. | build-orchestrator, assessment-orchestrator, severity ranking after critic findings, causal-tree after 2 consecutive failures, Phase 6 Learn audit synthesis (when no Frontier escalation needed) |
126
+ | **Planning + highest-consequence verification synthesis** — frame the goal and judge verdicts where a miss has the largest blast radius | **Opus (Frontier)** | Wrong calls poison every downstream dispatch. | Phase 2 Plan drafting, plan-critic, independent-auditor, security-reviewer |
127
+ | **Coordination + bounded verification synthesis** — route work, run causal trees, or judge a bounded surface with strong checks | **Opus (Thinking)** | Strong judgment backed by deterministic gates; also the T1 default since 2026-07-28. | build-orchestrator, assessment-orchestrator, scope-auditor, fact-checker, fix-critique, overfitting-reviewer, promotion-reviewer |
96
128
  | **Application** — apply a known rule, spec, or pattern to bounded input; produce an artifact that matches a contract | **Sonnet (Code)** | The "how" call when "what" is decided. Single-correct-answer derivable from a rule. | Implement a commit's owned files per spec, write tests for given F-criteria, mechanical simplify, bounded domain assessment (api/db/frontend/perf), design-contract reconciliation, ui-validator, retrospective-synthesizer, self-improvement-architect drafting |
97
129
  | **Recognition** — pure regex/syntactic match; classify into known buckets; no judgment | **Haiku (Pattern)** | No gradient — matches or doesn't. | Mock-data scan, log pattern detection, file inventory, cross-run pattern detection, deterministic checklist verification |
98
130
 
99
- **Decision tree:** "Does this task have a single-correct answer derivable from a rule applied to bounded input?" → Yes = Application/Sonnet. Else "Is the answer pure pattern-match?" → Yes = Recognition/Haiku. Else, Synthesis. Then ask: "Is this a planning decision (what to build) or a verification verdict (did it hold)?" → Yes = Frontier/Fable. Else (routing, escalation, audit-synthesis when no verdict is being rendered) = Thinking/Opus.
131
+ **Decision tree:** "Does this task have a single-correct answer derivable from a rule applied to bounded input?" → Yes = Application/Sonnet. Else "Is the answer pure pattern-match?" → Yes = Recognition/Haiku. Else, Synthesis. Then ask: "Is this a planning decision (what to build) or a verification verdict (did it hold)?" → Yes = Frontier (currently Opus; Fable only through `frontier_gate.py` on tightly-coupled planning). Else (routing, escalation, audit-synthesis when no verdict is being rendered) = Thinking/Opus.
100
132
 
101
133
  ## Default assignments
102
134
 
103
135
  | Task | Reasoning shape | Model | effort | Why |
104
136
  |------|------|-------|--------|-----|
105
- | Frame & plan: goal, ADRs, scope, F-criteria, MECE partition | Planning synthesis | Fable | medium | A wrong plan dispatches N implementers into the wrong work; user's standing priority Accuracy > Speed > Cost |
137
+ | Frame & plan: goal, ADRs, scope, F-criteria, MECE partition | Planning synthesis | Opus | medium | A wrong plan dispatches N implementers into the wrong work; user's standing priority Accuracy > Speed > Cost |
106
138
  | Plan-verify deterministic checklist | Recognition | (script) | — | No model; runs `plan_verify.py` |
107
- | Plan-critic adversarial review against rubric+checklist | Verification synthesis | Fable | high | Verification verdict — separation drives quality; verdict gates Phase 3 dispatch |
108
- | Scope auditor (Plan→Execute boundary): trace callers of every modified-API symbol; annotate `caller_audit:` per commit | Verification synthesis | Fable | medium | Cross-file call-path tracing AND a gating verdict on whether a commit is `internal_only`; verification compound risk |
109
- | Code execution — bounded chunk, spec clear | Application | Sonnet | medium | Default workhorse. Spec is settled; apply the rule |
139
+ | Plan-critic adversarial review against rubric+checklist | Verification synthesis | Opus | high | Verification verdict — separation drives quality; verdict gates Phase 3 dispatch |
140
+ | Scope auditor (Plan→Execute boundary): trace callers of every modified-API symbol; annotate `caller_audit:` per commit | Bounded verification synthesis | Opus | medium | Read-only caller tracing has a strong grep/plan oracle; Codex resolves Sol through Governance/Evaluation T2 |
141
+ | Code execution — bounded chunk, spec clear | Application | Sonnet | high | Default workhorse. First-pass correctness reduces rework; explicit effort may override this preference. |
110
142
  | Code execution — ambiguous spec or cross-file surprise mid-execution | Coordination synthesis | Opus | medium | Escalation target; interpretation cost cheaper than rework |
111
- | Independent-auditor adversarial pass (read-only diff vs rubric at chunk + build scope) | Verification synthesis | Fable | high | Verdict gates the build's outcome line; a missed regression in production-impacting work is the most expensive miss in the loop |
143
+ | Independent-auditor adversarial pass (read-only diff vs rubric at chunk + build scope) | Verification synthesis | Opus | high | Verdict gates the build's outcome line; a missed regression in production-impacting work is the most expensive miss in the loop |
112
144
  | Severity ranking + recommendation order (given findings) | Coordination synthesis | Opus | medium | Cross-finding routing; no per-finding verdict being rendered, the verdicts are upstream |
113
145
  | Mock data scanning | Recognition | Haiku | low | Regex only |
114
- | Fact-checking — trace metric → source, judge accuracy | Verification synthesis | Fable | medium | Final read on "is this number real" before report ships; user-trust verdict |
115
- | Fix-critique — pressure-test a proposed fix before "resolved" | Verification synthesis | Fable | medium | Verdict on whether the fix addresses root cause vs symptom; wrong verdict reopens the bug downstream |
116
- | Security-reviewer — adversarial OWASP/ATLAS pass | Verification synthesis | Fable | high | Verdict gates riskSurfaceChange dispatch; missed exposure is the most expensive verification miss |
117
- | Overfitting-reviewer — Goodhart / test-gaming verdict on optimize runs | Verification synthesis | Fable | medium | Verdict on whether optimization is genuine; cheap to wrong-call into a regression |
118
- | Promotion-reviewer — Phase 6 Learn experimental promotion verdict | Verification synthesis | Fable | medium | Gates the move from `experimental/` to `active/`; durable surface |
146
+ | Fact-checking — trace metric → source, judge accuracy | Bounded verification synthesis | Opus | medium | Source trace supplies an external oracle; Codex resolves Sol |
147
+ | Fix-critique — pressure-test a proposed fix before "resolved" | Bounded verification synthesis | Opus | medium | Counterfactual and regression evidence backstop the verdict; Codex resolves Sol |
148
+ | Security-reviewer — adversarial OWASP/ATLAS pass | Verification synthesis | Opus | high | Verdict gates riskSurfaceChange dispatch; missed exposure is the most expensive verification miss |
149
+ | Overfitting-reviewer — Goodhart / test-gaming verdict on optimize runs | Bounded verification synthesis | Opus | medium | Read-only experiment history and guard metrics provide the oracle; Codex resolves Sol |
150
+ | Promotion-reviewer — Phase 6 Learn experimental promotion verdict | Bounded advisory verification | Opus | medium | Advisory verdict remains subject to explicit promotion confirmation; Codex resolves Sol |
119
151
  | Simplify — apply known simplifications | Application | Sonnet | medium | Inline single-use helper, delete dead branch — bounded |
120
152
  | Debugging — symptom-to-known-pattern match | Application | Sonnet | high | Memory-first gate's "Application until the rule runs out" |
121
153
  | Debugging — causal-tree after 2 consecutive failures | Coordination synthesis | Opus | high | Synthesis takes over routing when rule-match exhausts |
122
- | Novel architecture decision | Planning synthesis | Fable | medium | Cross-file impact; wrong call compounds |
154
+ | Novel architecture decision | Planning synthesis | Opus | medium | Cross-file impact; wrong call compounds |
123
155
  | Writing user-facing prose (copy, microcopy, errors) | Coordination synthesis | Opus | medium | Tone, restraint, and nuance matter; no verification verdict being rendered |
124
156
  | Audit / learnings / Phase 6 audit synthesis | Coordination synthesis | Opus | medium | Cross-run routing; promotion-reviewer carries the gating verdict separately |
125
157
  | Recurring-pattern detection across runs[] | Recognition | Haiku | low | Pattern-match across structured logs |
126
158
 
127
159
  ### Deliberate exceptions (Sonnet retained for cost where the surface is high-frequency advisory)
128
160
 
129
- Two verification-shaped agents stay on Sonnet rather than escalating to Fable. The tension with round-2 evidence ("rubric-application = Sonnet is robust") is real; the user chose Fable for the rest of the verification surface anyway because the compound risk of a wrong verification verdict outweighs the per-call premium. Pins are defaults, not locks these can be overridden per dispatch or re-tiered after telemetry.
161
+ Two high-frequency advisory agents stay on Sonnet. Every verification agent bounded and gating alike now resolves to Opus. Pins are defaults, not locks and should be re-tiered when telemetry disagrees.
130
162
 
131
163
  | Agent | Pin | Why retained on Sonnet |
132
164
  |---|---|---|
133
165
  | `alignment-checker` | Sonnet | Called once per queue item during autonomous iterate (up to 25× per run). Advisory only — flags drift, doesn't gate. Cost dominates value at this fan-out frequency. |
134
166
  | `synthesis-critic` | Sonnet | Per-UI-commit WARN-only check. Advisory only — never gates. Frequency × non-gating shape means a cheaper tier is the right tradeoff. |
135
167
 
168
+ ### Database actions pin Frontier — standing user rule (2026-07-22)
169
+
170
+ **All database actions run at Frontier tier (currently Opus on the Anthropic mapping), overriding the Code-tier execution default.** DB mutations — migrations, schema changes, constraint/index DDL, data-plane rehearsals, repair/quarantine — are irreversible-leaning and high blast-radius, exactly the compounding-error class Frontier owns. Scope:
171
+
172
+ - **Assessment/diagnosis:** `database-assessor` role is `(generative_reasoning, frontier)` → resolves to Opus. Do not re-tier it down.
173
+ - **Execution:** any Phase 2 plan chunk whose owned files include migrations, `schema.prisma`/`schema.sql`, or DDL scripts is assigned Frontier in plan model-assignment, not the Sonnet implementer default. Label the assignment in the plan.
174
+ - **DB skills:** `data-plane-worktrees` and any database skill dispatch their executing subagent at Frontier tier (Agent `model` override / workflow `opts.model`).
175
+
176
+ This is a provider-portable *tier* pin (Frontier), not a hardcoded id; on hosts where a higher-ranked Frontier id is available the resolver may pick it, honoring Accuracy > Speed > Cost. Source: user standing rule, example-app-ai migration rehearsal (run-593729).
177
+
136
178
  ## Round 2 evidence (2026-05-07, example-app news-podcast iteration 2)
137
179
 
138
180
  n=2 dispatch-pattern A/B comparison on a 6-commit feature reversed the round-1 belief that Skill-path (Sonnet fan-out) is materially cheaper across the board:
@@ -152,11 +194,11 @@ Findings that updated the model tiering:
152
194
  3. **Inline-Opus is faster wall-clock** when there's no real parallelism to exploit. Fan-out parallelism is only a win when ≥3 chunks are truly independent.
153
195
  4. **Plan-critic on Sonnet caught 17 substantive findings** on a written spec — confirms "rubric-application = Sonnet" is robust.
154
196
 
155
- These findings informed the earlier rubric-application=Sonnet split for code review. The current org overrides that for the verification surface specifically the user chose Fable for verification because a missed verdict at this stage compounds, even though round-2 showed Sonnet rubric-application was substantively robust on a 17-finding plan-critic pass. The exceptions table above (alignment-checker, synthesis-critic) preserves the Sonnet split where the surface is high-frequency advisory and non-gating.
197
+ These findings supported a three-level verification split. The 2026-07-28 audit bakeoff collapsed the top two levels: Opus 5 was a strict superset of Fable across 3/3 adversarial-audit rounds, so gating and bounded verdicts both sit on Opus, with Sonnet keeping high-frequency advisory checks. The exceptions table preserves Sonnet where the surface is non-gating.
156
198
 
157
- ## Escalation triggers (Sonnet execution → Opus, NOT to Fable)
199
+ ## Escalation triggers (Sonnet execution → Opus)
158
200
 
159
- Execution escalates to **Opus**, not Fable. Fable is reserved for planning and verification; execution under genuine ambiguity is a coordination call (interpret the spec, route to a new chunk, decide whether to re-plan) that the orchestrator owns.
201
+ Execution escalates to **Opus** a coordination call the orchestrator owns. Fable is not an execution escalation target: it is reserved for super-complex multi-step work and for judging it, and is reached through `scripts/frontier_gate.py`, not by climbing the execution ladder. Several issues open at once is the signal that hands work to Fable; one hard task is not.
160
202
 
161
203
  - 2 consecutive failures on the same chunk after a retry at effort=high → respawn implementer at Opus
162
204
  - Spec is ambiguous and interpretation will materially change implementation → Opus
@@ -165,7 +207,7 @@ Execution escalates to **Opus**, not Fable. Fable is reserved for planning and v
165
207
  - Novel error pattern not found in `.build-loop/issues/` or debugging memory → Opus
166
208
  - Task produces user-visible prose where tone and restraint are load-bearing → Opus
167
209
 
168
- If the ambiguity surfaces a **planning** problem (the original plan no longer fits) rather than an execution problem, route back to Phase 2 Plan — Fable re-plans, then execution resumes on Sonnet/Opus.
210
+ If the ambiguity surfaces a **planning** problem (the original plan no longer fits) rather than an execution problem, route back to Phase 2 Plan — the Advisor re-plans at Frontier (Fable if `frontier_gate.py` says the repo is tightly coupled, else Opus), then execution resumes on Sonnet.
169
211
 
170
212
  ## Techniques that work
171
213
 
@@ -182,11 +224,30 @@ If the ambiguity surfaces a **planning** problem (the original plan no longer fi
182
224
  - **Chain of Density**. Summarization-specific technique; not applicable to code work.
183
225
  - **Best-of-N by default**. Only on hard chunks. Blanket best-of-N wastes tokens on easy tasks where effort=high is sufficient and cheaper.
184
226
 
227
+ ## Prompting profiles — how to prompt the rung you resolved
228
+
229
+ Model-tiering answers *which* model runs an agent. The `prompting_profiles` block in `references/model-taxonomy.json` answers *how to prompt it* — a separate axis, keyed by capability rung, carried on the same resolution path.
230
+
231
+ **Lookup:** `python3 scripts/resolve_agent_model.py <agent> --json` returns `prompting_profile` alongside `model` — no second call. From code, `model_taxonomy.prompting_profile(tier)` reads the same block directly.
232
+
233
+ | Rung | examples | constraint_posture | edge_case_handling | rationale | prompt_budget |
234
+ |---|---|---|---|---|---|
235
+ | T0 | omit | contextual | delegate | required | compressed |
236
+ | T1 | omit | contextual | delegate | required | compressed |
237
+ | T2 | minimal | contextual | delegate | required | standard |
238
+ | T3 | worked | mixed | enumerate-known | recommended | full |
239
+ | T4 | worked | directive-ok | enumerate-known | optional | full |
240
+ | T5 | worked | directive-ok | enumerate-known | optional | full |
241
+
242
+ Profile edits happen in `references/model-taxonomy.json`, not here — the same maintenance path as the model index itself; see §"Chat-triggered index maintenance" above.
243
+
244
+ The T0–T2 rows are source-verified against the Anthropic Claude Code team's 2026-07-21 published guidance; T3's `examples`/`edge_case_handling` are repo-measured and the rest of T3 is inferred; T4/T5 are weakly-evidenced placeholders (`confidence: weak`, `status_quo: true`) encoding current behavior, not a chosen posture.
245
+
185
246
  ## Cost math quick reference
186
247
 
187
248
  > ⚠️ **Advisory only.** The numbers below are directional heuristics based on single-source token-profile estimates and public pricing as of the skill's last update. They are **not** verified against real usage telemetry and should not be used as hard routing logic. Treat them as "this tier costs roughly this much more than that tier," not as commitments. Pricing, token profiles, and model output lengths all drift over time. Before using these ratios in any cost-minimization decision, pull actual usage data from the last 30 days of builds and re-derive the numbers for your workload.
188
249
 
189
- **Price ratios only** (T1, claude-api — per-MTok, in/out): Fable 5 $10/$50 · Opus 4.8 $5/$25 · Sonnet 5 $3/$15 ($2/$10 intro through 2026-08-31) · Haiku 4.5 $1/$5.
250
+ **Price ratios only** (T1, claude-api — per-MTok, in/out): Fable 5 $10/$50 · Opus 5 $5/$25 · Sonnet 5 $3/$15 ($2/$10 intro through 2026-08-31) · Haiku 4.5 $1/$5.
190
251
 
191
252
  | Pair (same task) | Price ratio | Basis |
192
253
  |---|---|---|
@@ -204,9 +265,9 @@ If the ambiguity surfaces a **planning** problem (the original plan no longer fi
204
265
 
205
266
  ## How the build-loop uses this
206
267
 
207
- **Fable plans (when stakes-gated) and verifies. Opus coordinates. Sonnet executes. Haiku recognizes.**
268
+ **Fable plans and handles the highest-consequence verification. Opus coordinates and handles bounded verification. Sonnet executes. Haiku recognizes.**
208
269
 
209
- Phase 2 Plan synthesis reaches **Fable** through the **Advisor dispatch ladder** when stakes-gating trips (`synthesisDensity > 5`, `riskSurfaceChange`, `stakes >= medium`, or `dispatch_tier: frontier`): the orchestrator dispatches the `advisor` agent (Rung 1), routes to a peer host (Rung 2), or — if its own session is already Fable — synthesizes inline at Frontier (Rung 0). When no trigger fires or no dispatch path is reachable, the orchestrator synthesizes the plan **inline on its own model (Opus)** and labels it honestly (Rung 3 = today's behavior; the floor equals current state). So "Fable plans" is the *guarantee on high-stakes plans*, with an honestly-labeled inline fallback otherwise — not unconditional. Full protocol: `references/advisor-dispatch-ladder.md`. The Advisor frames the goal, drafts the spec/ADRs, sets F-criteria, and MECE-partitions the work. The orchestrator (**Opus**, `build-orchestrator`, `assessment-orchestrator`) coordinates: it routes dispatches, runs deterministic gates, manages parallel fan-out, walks the Advisor ladder, and handles the escalation ladder. Phase 3 implementer subagents run on **Sonnet** at effort=high (default workhorse; xhigh on hard/code-heavy chunks) → external verification gate (tests/lint/types) → adversarial **Fable** verification surface (`plan-critic`, `scope-auditor`, `independent-auditor`, `fix-critique`, `fact-checker`, `security-reviewer`, `overfitting-reviewer`, `promotion-reviewer`). On a first execution-problem chunk failure, retry the same Sonnet 5 implementer at **effort=xhigh** (intermediate rung — near-Opus coding at lower cost) before paying for Opus; a strong-checkpoint finding or a 2nd consecutive failure after the xhigh retry escalates to **Opus** for judgment; if the failure traces back to a planning miss, route back to Fable to re-plan. See `agents/build-orchestrator.md §Escalation Triggers`. The **tier mapping** is the policy; the cost numbers above are advisory context, not the basis for overrides.
270
+ Phase 2 Plan synthesis reaches **Fable** through the **Advisor dispatch ladder** when stakes-gating trips. The orchestrator (**Opus**) coordinates; Phase 3 implementers run on **Sonnet** at high effort. Verification then splits by consequence: **Fable** for `plan-critic`, `independent-auditor`, and `security-reviewer`; **Opus** for `scope-auditor`, `fix-critique`, `fact-checker`, `overfitting-reviewer`, and `promotion-reviewer`; **Sonnet** for the advisory `alignment-checker` and `synthesis-critic`. On Codex, both governance verification cells resolve to GPT-5.6 Sol. Execution retries Sonnet at `xhigh` before escalating to Opus; planning misses route back to Fable.
210
271
 
211
272
  Haiku is only used for Phase 7B mock scanning and recurring-pattern detection across `runs[]`. Never for reasoning tasks.
212
273
 
@@ -214,7 +275,7 @@ Haiku is only used for Phase 7B mock scanning and recurring-pattern detection ac
214
275
 
215
276
  Not every agent should hard-pin its model. Use this rule:
216
277
 
217
- - **Pin** (`model: fable | opus | sonnet | haiku`) when the task has a clear right tier and cost/quality drift from user's session choice would be a bug. Examples: `plan-critic` / `independent-auditor` / `scope-auditor` / `fact-checker` / `fix-critique` / `security-reviewer` / `overfitting-reviewer` / `promotion-reviewer` (Fable verification verdicts gate downstream work), `mock-scanner` (Haiku, pattern matching only), `build-orchestrator` and `assessment-orchestrator` (Opus, coordination at plan/review boundaries), `implementer` (Sonnet, default execution workhorse).
278
+ - **Pin** (`model: fable | opus | sonnet | haiku`) when the task has a clear right tier and cost/quality drift from user's session choice would be a bug. `plan-critic`, `independent-auditor`, and `security-reviewer` pin Fable. `scope-auditor`, `fact-checker`, `fix-critique`, `overfitting-reviewer`, and `promotion-reviewer` pin Opus. `mock-scanner` pins Haiku; orchestrators pin Opus; `implementer` pins Sonnet.
218
279
  - **Inherit** (`model: inherit`) when user intent should flow through. The user's main-session choice is itself a cost/speed preference; respect it. Pair with a "recommended: X" note in this skill rather than forcing via frontmatter. Example: `root-cause-investigator` — recommended Opus on causal-tree work, but inherit honors whatever tier the user picked upstream.
219
280
  - **Override mechanism**: users can override any pin by passing `model:` when spawning the agent or by editing the frontmatter. Pins are defaults, not locks. The deliberate exceptions documented above (`alignment-checker`, `synthesis-critic` on Sonnet despite being verification-shaped) are exactly this kind of cost-vs-judgment pin and can be lifted if telemetry says so.
220
281
 
@@ -273,4 +334,4 @@ python3 ${CLAUDE_PLUGIN_ROOT}/scripts/model_overrides.py \
273
334
 
274
335
  Accepted tiers: `frontier` (default `fable`), `thinking` (default `opus`), `code` (default `sonnet`), `pattern` (default `haiku`). Configs without `frontier` resolve frontier → `fable` so older repos keep working without edits.
275
336
 
276
- Full contract and routing matrix: `~/dev/research/topics/llm/llm.build-loop-router-integration-2026-04.md`
337
+ Full contract and routing matrix: "LLM Build-Loop Router Integration" (private research note, 2026-04 — substance summarized here; the live routing matrix ships in-repo at `references/model-taxonomy.json`).
@@ -47,6 +47,8 @@ Actions exposed by `python3 scripts/native_driver.py action`:
47
47
 
48
48
  Element targeting uses an integer index path from the main window root (e.g. `0,2,1` = first child → third child → second child). The path is returned by every `scan` element under the `path` key, so the typical loop is `scan` → match by `identifier` / `title` → use that element's `path` for `action`.
49
49
 
50
+ `python3 scripts/native_driver.py launch` is the deterministic launch + pid-capture step: it starts an isolated instance of a `.app`/bundle id and returns the new pid to scope every subsequent `scan`/`action` call to. See "Single-instance PID-scoped verification mode" below.
51
+
50
52
  ## Files in this skill
51
53
 
52
54
  ```
@@ -54,7 +56,8 @@ skills/native-ax-driver/
54
56
  ├─ SKILL.md (this file)
55
57
  ├─ scripts/
56
58
  │ ├─ layout_fill.py (layout-fill / gap analyzer; stdlib only)
57
- └─ native_driver.py (Python launcher; stdlib only)
59
+ ├─ native_driver.py (Python launcher; stdlib only)
60
+ │ └─ test_native_driver.py (pure-helper tests; run with pytest)
58
61
  └─ swift/bl-ax-driver/
59
62
  ├─ Package.swift (Swift 5.9, macOS 13+)
60
63
  └─ Sources/main.swift (~535 LOC, AX implementation)
@@ -85,10 +88,40 @@ Exit codes: `0` AX granted · `2` AX missing · `1` osascript missing.
85
88
 
86
89
  If `2`, surface to Iterate as a blocker rather than retrying — the user has to grant permission once in System Settings; build-loop cannot do that itself.
87
90
 
91
+ ### Single-instance PID-scoped verification mode
92
+
93
+ **This is the documented standard for native UI verification whenever other instances of the target app may be running — including the user's own.** Do not skip verification in that situation, and do not target by `--app <name>` — `--app` matches by substring against every running process's name, so it can resolve to (and drive) the user's window instead of the isolated one being verified.
94
+
95
+ The Swift driver already scopes every AX call to one process: it resolves the target via `AXUIElementCreateApplication(pid)` (`swift/bl-ax-driver/Sources/main.swift:264`) and only ever walks that process's AX tree. `scan --pid <pid>` and `action --pid <pid>` were always safe to run alongside ambient instances — the missing piece was a deterministic way to launch a fresh, isolated instance and know for certain which pid is it. `launch` closes that gap:
96
+
97
+ 1. **Launch** an isolated instance under a private state dir, forcing a brand-new process (`open -n`) and (optionally) ignoring any saved window/scene state (`-F` via `--fresh`) so it never resumes into the user's prior session:
98
+
99
+ ```bash
100
+ python3 .../native_driver.py launch --app-path /Applications/MyApp.app \
101
+ --state-env-var ET_STATE_DIR --state-dir /tmp/myapp-verify-$$ --fresh
102
+ ```
103
+
104
+ 2. **Read the captured pid** from the JSON result — `launch` snapshots the running GUI pid set before launch and diffs it against the pid set after, so the returned pid is provably the new instance, never a guess. If the diff is ambiguous (zero or more than one new pid appeared), `success` is `false` and no pid is reported — treat that as a hard stop, not a fallback to name-matching:
105
+
106
+ ```json
107
+ {"success": true, "pid": 55210, "bundle_id": "com.example.myapp", "state_dir": "/tmp/myapp-verify-1234", "fresh": true, "error": null, "next": "drive AX scoped to this pid: native_driver.py scan --pid 55210 / action --pid 55210 ..."}
108
+ ```
109
+
110
+ 3. **Scan and drive using ONLY `--pid <captured>`** for the remainder of the verification pass — never `--app`:
111
+
112
+ ```bash
113
+ python3 .../native_driver.py scan --pid 55210
114
+ python3 .../native_driver.py action --pid 55210 --element-path 0,2,1 --action press
115
+ ```
116
+
117
+ Because AX targeting is pid-scoped end-to-end, every action in step 3 is confined to the launched instance's AX tree — the user's other windows, and any other ambient instances of the same app, are never touched. This is safe to run with ambient instances live.
118
+
119
+ `launch` flags: `--app-path` (path to a `.app`) or `--bundle-id` (mutually exclusive, one required); `--state-dir` + `--state-env-var` (set an env var to a private state directory before launch, e.g. an app-specific `ET_STATE_DIR`); `--fresh` (pass `-F` to `open`); `--arg` (repeatable, extra argv passed to the launched app after `--args`); `--timeout` (seconds to wait for the new pid to appear, default `10.0`). Exit codes: `0` success · `1` launch or pid-capture failed · `2` bad arguments.
120
+
88
121
  ### Scan a running app
89
122
 
90
123
  ```bash
91
- python3 .../native_driver.py scan --app "Secrets Vault" # by name (substring, case-insensitive)
124
+ python3 .../native_driver.py scan --app "MyApp" # by name (substring, case-insensitive)
92
125
  python3 .../native_driver.py scan --pid 44330 # by pid
93
126
  ```
94
127
 
@@ -169,8 +202,8 @@ Stdout JSON shape: `{"success": bool, "action": "press", "error": "AXPress faile
169
202
  `resolve` and `apps` work without AX permission — useful for the orchestrator to confirm a freshly-launched app has actually started before the AX-gated operations.
170
203
 
171
204
  ```bash
172
- python3 .../native_driver.py resolve --app "Secrets Vault"
173
- # {"pid": 44330, "name": "Secrets Vault", "bundleIdentifier": "com.secretsvault.app"}
205
+ python3 .../native_driver.py resolve --app "MyApp"
206
+ # {"pid": 44330, "name": "MyApp", "bundleIdentifier": "com.example.myapp"}
174
207
 
175
208
  python3 .../native_driver.py apps
176
209
  # [{"name": "Finder", "pid": 612, "bundleIdentifier": "com.apple.finder"}, ...]
@@ -189,7 +222,7 @@ python3 .../native_driver.py apps
189
222
  - **Web targets** — use `ui-validator` and the host browser/screenshot tooling; this skill won't help.
190
223
  - **iOS simulator** — the simulator runs on macOS, but interaction goes through `idb ui tap`, not direct AX (the simulator's AX surface is too noisy for path stability). See `reference_idb_sim_tap.md`.
191
224
  - **Drag-and-drop, hover-only effects, NSTrackingArea-driven UI** — these need real `CGEvent` mouse events. Out of scope. If the feature is critical, fix the AX surface in the app under test (add `.accessibilityAction { … }`) rather than synthesizing mouse events.
192
- - **App not yet running** — the driver does not launch apps. The orchestrator's pre-step must `open -b <bundleId>` (or `open <path/to/.app>`) and verify with `resolve` before driving.
225
+ - **App not yet running** — use `launch` (see "Single-instance PID-scoped verification mode" above) to start an isolated instance and capture its pid before driving, especially when other instances of the app may already be running. For a single-instance context where no ambient collision risk exists, a plain `open -b <bundleId>` (or `open <path/to/.app>`) followed by `resolve` also works.
193
226
 
194
227
  ## Failure modes & recovery
195
228