@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.
- package/.agents/plugins/marketplace.json +2 -2
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor/rules/build-loop-surface.mdc +12 -11
- package/.cursor/rules/skill-index.mdc +33 -0
- package/AGENTS.md +213 -34
- package/README.md +99 -31
- package/agents/advisor.md +4 -4
- package/agents/alignment-checker.md +2 -2
- package/agents/architecture-scout.md +4 -4
- package/agents/build-orchestrator.md +38 -36
- package/agents/database-assessor.md +10 -4
- package/agents/design-contract-specialist.md +8 -8
- package/agents/fact-checker.md +13 -3
- package/agents/fix-critique.md +2 -2
- package/agents/independent-auditor.md +60 -7
- package/agents/leak-scanner.md +82 -0
- package/agents/overfitting-reviewer.md +2 -2
- package/agents/plan-critic.md +1 -1
- package/agents/promotion-reviewer.md +5 -5
- package/agents/retrospective-synthesizer.md +138 -35
- package/agents/scope-auditor.md +82 -11
- package/agents/security-reviewer.md +55 -1
- package/agents/self-improvement-architect.md +17 -3
- package/agents/transcript-pattern-miner.md +5 -5
- package/agents/ui-validator.md +1 -1
- package/bin/build-loop-debugger.js +143 -0
- package/bin/build-loop-install.js +1 -4
- package/bin/build-loop-load-probe.js +345 -0
- package/codex-skills/build-loop/SKILL.md +28 -6
- package/commands/feedback.md +37 -0
- package/dist/src/interactive-verifier.d.ts +1 -14
- package/dist/src/interactive-verifier.d.ts.map +1 -1
- package/dist/src/interactive-verifier.js +6 -113
- package/dist/src/interactive-verifier.js.map +1 -1
- package/dist/src/quality.d.ts +5 -0
- package/dist/src/quality.d.ts.map +1 -0
- package/dist/src/quality.js +81 -0
- package/dist/src/quality.js.map +1 -0
- package/dist/src/storage.d.ts.map +1 -1
- package/dist/src/storage.js +37 -3
- package/dist/src/storage.js.map +1 -1
- package/docs/agent-surface-policy.md +35 -31
- package/docs/memory-setup.md +19 -0
- package/hooks/git/pre-push +65 -4
- package/hooks/hooks.json +95 -38
- package/hooks/pre-commit +20 -1
- package/hooks/pre-edit-rally-point.sh +10 -3
- package/hooks/session-start-codex-hook-trust.sh +30 -0
- package/hooks/session-start-git-hooks.sh +3 -1
- package/hooks/session-start-rally-point.sh +52 -4
- package/hooks/session-start-worktree-gc.sh +47 -94
- package/hooks/stop-transcript-sweep.sh +173 -0
- package/hooks/test_closeout.sh +14 -2
- package/package.json +8 -7
- package/scripts/README.md +1 -1
- package/scripts/_paths.py +65 -0
- package/scripts/groundwork_exchange.py +1012 -0
- package/scripts/install_memory.py +33 -1
- package/scripts/lessons_index/ingest.py +13 -2
- package/scripts/lessons_index/query.py +36 -13
- package/scripts/memory_context/__init__.py +108 -14
- package/scripts/memory_graph/__init__.py +5 -1
- package/scripts/project_resolver.py +42 -36
- package/scripts/sync_plugin_cache.py +37 -2
- package/skills/agent-rally-point/SKILL.md +46 -0
- package/skills/api-registry-bridge/SKILL.md +1 -1
- package/skills/architecture/dead/SKILL.md +1 -1
- package/skills/architecture/impact/SKILL.md +1 -1
- package/skills/architecture/review/SKILL.md +1 -1
- package/skills/architecture/rules/SKILL.md +3 -3
- package/skills/architecture/scan/SKILL.md +1 -1
- package/skills/architecture/trace/SKILL.md +1 -1
- package/skills/attribution-standard/SKILL.md +6 -6
- package/skills/auto-decision-capture/SKILL.md +31 -2
- package/skills/auto-finding-capture/SKILL.md +28 -1
- package/skills/build-loop/SKILL.md +131 -23
- package/skills/build-loop/fallbacks.md +16 -21
- package/skills/build-loop/phases/ui-validation.md +2 -2
- package/skills/build-loop/references/advisor-dispatch-ladder.md +1 -1
- package/skills/build-loop/references/apple-native-planning.md +1 -1
- package/skills/build-loop/references/autonomous-and-per-commit-modes.md +11 -5
- package/skills/build-loop/references/autonomy-dashboard.md +115 -0
- package/skills/build-loop/references/capability-routing.md +24 -2
- package/skills/build-loop/references/coordination.md +24 -6
- package/skills/build-loop/references/experiment-results-template.md +15 -3
- package/skills/build-loop/references/leadership.md +1 -1
- package/skills/build-loop/references/memory.md +14 -3
- package/skills/build-loop/references/modular-systems-pack.md +8 -0
- package/skills/build-loop/references/output-style.md +86 -0
- package/skills/build-loop/references/phase-1-assess.md +102 -2
- package/skills/build-loop/references/phase-2-plan.md +9 -1
- package/skills/build-loop/references/phase-3-execute.md +5 -2
- package/skills/build-loop/references/phase-4-review.md +85 -8
- package/skills/build-loop/references/phase-5-iterate.md +76 -8
- package/skills/build-loop/references/phase-6-learn.md +10 -17
- package/skills/build-loop/references/privileged-request-broker.md +254 -0
- package/skills/build-loop/references/resource-aware-execution.md +183 -0
- package/skills/build-loop/references/self-recursive-dev.md +2 -2
- package/skills/build-loop/references/status-output-format.md +207 -0
- package/skills/build-loop/references/verify-dispatch.md +56 -2
- package/skills/building-with-deepagents/SKILL.md +1 -1
- package/skills/claim-scope/SKILL.md +185 -0
- package/skills/color-engine/SKILL.md +103 -0
- package/skills/color-engine/_core.py +464 -0
- package/skills/color-engine/color_engine.py +175 -0
- package/skills/cost-rca/SKILL.md +61 -0
- package/skills/data-plane-worktrees/SKILL.md +139 -0
- package/skills/data-plane-worktrees/agents/openai.yaml +4 -0
- package/skills/database-practice/SKILL.md +200 -0
- package/skills/database-practice/references/diagnostic-queries.sql +126 -0
- package/skills/database-practice/references/vector-and-graph-tuning.md +208 -0
- package/skills/database-practice/scripts/db_table_map.py +1244 -0
- package/skills/database-practice/scripts/test_db_table_map.py +514 -0
- package/skills/debug-loop/SKILL.md +36 -6
- package/skills/debugging-memory/SKILL.md +32 -430
- package/skills/debugging-memory/references/pattern-extraction.md +4 -4
- package/skills/debugging-memory/references/search.md +32 -120
- package/skills/debugging-memory/references/store.md +32 -126
- package/skills/debugging-memory/references/subagent-integration.md +1 -1
- package/skills/decision-queue/SKILL.md +251 -0
- package/skills/decision-queue/assets/template.html +1242 -0
- package/skills/decision-queue/references/example-large-queue-batching.md +164 -0
- package/skills/decision-queue/scripts/regen_template_constants.py +160 -0
- package/skills/defenseclaw-bridge/SKILL.md +2 -2
- package/skills/defenseclaw-bridge/references/dc-config-mapping.md +2 -9
- package/skills/drain-proposals/SKILL.md +53 -0
- package/skills/focused-loop-builder/SKILL.md +31 -0
- package/skills/focused-loop-builder/references/spec-format.md +27 -0
- package/skills/handoff/SKILL.md +169 -8
- package/skills/ibr-bridge/SKILL.md +4 -1
- package/skills/knowledge/SKILL.md +26 -14
- package/skills/knowledge/references/review-mode.md +2 -3
- package/skills/knowledge/templates/madr-minimal.md +1 -1
- package/skills/mcp-builder/SKILL.md +1 -1
- package/skills/model-bakeoff/SKILL.md +48 -10
- package/skills/model-tiering/SKILL.md +92 -31
- package/skills/native-ax-driver/SKILL.md +38 -5
- package/skills/native-ax-driver/scripts/native_driver.py +278 -22
- package/skills/native-ax-driver/scripts/test_native_driver.py +227 -0
- package/skills/optimize/SKILL.md +1 -1
- package/skills/plugin-builder/SKILL.md +48 -1
- package/skills/plugin-builder/references/build-loop-phase-guidance.md +3 -4
- package/skills/plugin-builder/references/distribution.md +13 -2
- package/skills/plugin-builder/references/plugin-hygiene-lessons.md +2 -2
- package/skills/plugin-tests/SKILL.md +2 -2
- package/skills/recursive-retrospective/SKILL.md +1 -1
- package/skills/repo-closeout/SKILL.md +17 -0
- package/skills/repo-closeout/agents/openai.yaml +4 -0
- package/skills/repo-maintenance/SKILL.md +179 -0
- package/skills/repo-maintenance/agents/openai.yaml +4 -0
- package/skills/repo-maintenance/references/pre-public-hygiene.md +134 -0
- package/skills/repo-maintenance/references/repository-taxonomy.md +161 -0
- package/skills/repo-maintenance/references/safety-protocol.md +106 -0
- package/skills/repo-maintenance/references/stack-profiles.md +138 -0
- package/skills/repo-maintenance/scripts/audit_repo_maintenance.py +1198 -0
- package/skills/repo-maintenance/scripts/test_audit_repo_maintenance.py +506 -0
- package/skills/repository-intelligence/SKILL.md +189 -0
- package/skills/repository-intelligence/agents/openai.yaml +4 -0
- package/skills/repository-intelligence/references/assessment-rubric.md +88 -0
- package/skills/repository-intelligence/scripts/repository_inventory.py +347 -0
- package/skills/research/SKILL.md +12 -2
- package/skills/root-cause-analysis/SKILL.md +1 -1
- package/skills/runtime-parity-verification/SKILL.md +36 -1
- package/skills/security-methodology/SKILL.md +22 -9
- package/skills/security-methodology/references/agentic-handoff-templates.md +220 -0
- package/skills/security-methodology/references/cross-source-matrix.md +1 -1
- package/skills/security-methodology/references/owasp-agentic-top-10.md +1 -1
- package/skills/security-scan/SKILL.md +55 -15
- package/skills/self-improve/SKILL.md +70 -50
- package/skills/silent-assumptions/SKILL.md +341 -0
- package/skills/silent-assumptions/references/elicitation-detectors.md +342 -0
- package/skills/spec-writing/SKILL.md +128 -24
- package/skills/spec-writing/scripts/check_checklist.py +114 -15
- package/skills/ui-design/SKILL.md +6 -4
- package/skills/ui-design/references/color-engine.md +132 -0
- package/skills/ui-design/references/design-preferences-from-owned-apps.md +8 -8
- package/skills/ui-design/references/ui-guidance-sources.md +1 -1
- package/skills/ui-design/references/universal-design-principles.alt.md +2 -2
- package/plugin-artifacts/codex/.codex-plugin/plugin.json +0 -41
- package/plugin-artifacts/codex/AGENTS.md +0 -560
- package/plugin-artifacts/codex/BUILD-ARTIFACT.md +0 -5
- package/plugin-artifacts/codex/LICENSE +0 -202
- package/plugin-artifacts/codex/README.md +0 -313
- package/plugin-artifacts/codex/assets/build-loop-plugin-icon.png +0 -0
- package/plugin-artifacts/codex/docs/agent-surface-policy.md +0 -63
- package/plugin-artifacts/codex/references/advisor-dispatch-ladder.md +0 -62
- package/plugin-artifacts/codex/references/agent-role-taxonomy.md +0 -135
- package/plugin-artifacts/codex/references/autonomous-and-per-commit-modes.md +0 -161
- package/plugin-artifacts/codex/references/autonomy-config.md +0 -231
- package/plugin-artifacts/codex/references/backlog-system.md +0 -285
- package/plugin-artifacts/codex/references/capability-routing.md +0 -231
- package/plugin-artifacts/codex/references/codex-subagents.md +0 -106
- package/plugin-artifacts/codex/references/coordination-file-template.md +0 -181
- package/plugin-artifacts/codex/references/coordination-rules.md +0 -552
- package/plugin-artifacts/codex/references/dogfood-reload-checkpoint.md +0 -112
- package/plugin-artifacts/codex/references/halt-and-ask-protocol.md +0 -102
- package/plugin-artifacts/codex/references/implementer-envelope-schema.md +0 -302
- package/plugin-artifacts/codex/references/intent-capability-pack.md +0 -257
- package/plugin-artifacts/codex/references/intent-exploration-prompts.md +0 -96
- package/plugin-artifacts/codex/references/leadership.md +0 -72
- package/plugin-artifacts/codex/references/memory-systems.md +0 -261
- package/plugin-artifacts/codex/references/memory.md +0 -313
- package/plugin-artifacts/codex/references/model-tier-mapping.md +0 -296
- package/plugin-artifacts/codex/references/modular-systems-pack.md +0 -96
- package/plugin-artifacts/codex/references/phase-1-assess.md +0 -249
- package/plugin-artifacts/codex/references/phase-2-plan.md +0 -86
- package/plugin-artifacts/codex/references/phase-3-execute.md +0 -49
- package/plugin-artifacts/codex/references/phase-4-review.md +0 -341
- package/plugin-artifacts/codex/references/phase-5-iterate.md +0 -72
- package/plugin-artifacts/codex/references/phase-6-learn.md +0 -58
- package/plugin-artifacts/codex/references/recent-design-structures.md +0 -274
- package/plugin-artifacts/codex/references/research-trigger-policy.md +0 -140
- package/plugin-artifacts/codex/references/runtime-smoke-triggers.md +0 -42
- package/plugin-artifacts/codex/references/self-review.md +0 -234
- package/plugin-artifacts/codex/references/single-writer-commit-protocol.md +0 -90
- package/plugin-artifacts/codex/references/task-capture-policy.md +0 -68
- package/plugin-artifacts/codex/references/ui-io-contract.md +0 -116
- package/plugin-artifacts/codex/references/ui-spotcheck-protocol.md +0 -65
- package/plugin-artifacts/codex/references/verify-dispatch.md +0 -85
- package/plugin-artifacts/codex/skills/build-loop/SKILL.md +0 -381
- package/plugin-artifacts/codex/skills/build-loop/detect-plugins.mjs +0 -82
- package/plugin-artifacts/codex/skills/build-loop/eval-guide.md +0 -65
- package/plugin-artifacts/codex/skills/build-loop/fallbacks.md +0 -549
- package/plugin-artifacts/codex/skills/build-loop/phases/fact-check.md +0 -42
- package/plugin-artifacts/codex/skills/build-loop/phases/ui-validation.md +0 -267
- package/plugin-artifacts/codex/skills/build-loop/references/advisor-dispatch-ladder.md +0 -62
- package/plugin-artifacts/codex/skills/build-loop/references/apple-native-planning.md +0 -439
- package/plugin-artifacts/codex/skills/build-loop/references/autonomous-and-per-commit-modes.md +0 -161
- package/plugin-artifacts/codex/skills/build-loop/references/capability-routing.md +0 -231
- package/plugin-artifacts/codex/skills/build-loop/references/codex-subagents.md +0 -106
- package/plugin-artifacts/codex/skills/build-loop/references/coordination.md +0 -161
- package/plugin-artifacts/codex/skills/build-loop/references/correction-aware-capture.md +0 -177
- package/plugin-artifacts/codex/skills/build-loop/references/experiment-results-template.md +0 -101
- package/plugin-artifacts/codex/skills/build-loop/references/independent-auditor.md +0 -72
- package/plugin-artifacts/codex/skills/build-loop/references/intent-capability-pack.md +0 -257
- package/plugin-artifacts/codex/skills/build-loop/references/intent-exploration-prompts.md +0 -96
- package/plugin-artifacts/codex/skills/build-loop/references/leadership.md +0 -72
- package/plugin-artifacts/codex/skills/build-loop/references/memory.md +0 -313
- package/plugin-artifacts/codex/skills/build-loop/references/modular-systems-pack.md +0 -96
- package/plugin-artifacts/codex/skills/build-loop/references/output-style.md +0 -222
- package/plugin-artifacts/codex/skills/build-loop/references/pay-it-forward-arch.md +0 -98
- package/plugin-artifacts/codex/skills/build-loop/references/phase-1-assess.md +0 -249
- package/plugin-artifacts/codex/skills/build-loop/references/phase-2-plan.md +0 -86
- package/plugin-artifacts/codex/skills/build-loop/references/phase-3-execute.md +0 -49
- package/plugin-artifacts/codex/skills/build-loop/references/phase-4-review.md +0 -341
- package/plugin-artifacts/codex/skills/build-loop/references/phase-5-iterate.md +0 -72
- package/plugin-artifacts/codex/skills/build-loop/references/phase-6-learn.md +0 -58
- package/plugin-artifacts/codex/skills/build-loop/references/recent-design-structures.md +0 -274
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/ASSESSMENT.md +0 -85
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/STANDALONE_TEST_RUN.md +0 -149
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/01-simple-bugfix.md +0 -32
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/02-ui-build-with-iteration.md +0 -48
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/03-multi-failure-escalation.md +0 -60
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/04-ui-build-ibr-absent.md +0 -51
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/05-refactor-navgator-absent.md +0 -71
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/06-recurring-bug-debugger-absent.md +0 -52
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/trace-comparison.md +0 -202
- package/plugin-artifacts/codex/skills/build-loop/references/self-recursive-dev.md +0 -77
- package/plugin-artifacts/codex/skills/build-loop/references/self-review.md +0 -234
- package/plugin-artifacts/codex/skills/build-loop/references/ui-io-contract.md +0 -116
- package/plugin-artifacts/codex/skills/build-loop/references/verify-dispatch.md +0 -85
- package/plugin-artifacts/codex/skills/build-loop/scanners/audit-design-rules.mjs +0 -476
- package/plugin-artifacts/codex/skills/build-loop/scanners/require-visual-evidence.mjs +0 -239
- package/plugin-artifacts/codex/skills/build-loop/templates/backlog-item.md +0 -35
- package/plugin-artifacts/codex/skills/build-loop/templates/codex-worker-prompt.md +0 -100
- package/plugin-artifacts/codex/skills/build-loop/templates/ui-subagent-prompt.md +0 -179
- package/plugin-artifacts/codex/skills/build-loop/templates/ux-fix-plan.md +0 -40
- package/scripts/build_codex_plugin_artifact.py +0 -321
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build-orchestrator
|
|
3
3
|
description: |
|
|
4
|
-
Coordinates the
|
|
4
|
+
Coordinates the six-phase development loop for significant multi-step code changes (Assess → Plan → Execute → Review → Iterate → mandatory Learn). Review runs seven ordered sub-steps: Critic → Validate → Optimize (opt-in) → Fact-Check → Simplify → Auto-Resolve → Report; Iterate loops back to Review on failure.
|
|
5
5
|
model: opus
|
|
6
6
|
tier: thinking
|
|
7
7
|
segment: agentic_execution
|
|
@@ -13,7 +13,7 @@ tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep", "Agent", "Skill", "Task
|
|
|
13
13
|
<!-- build-loop@tyroneross:canary:build-loop -->
|
|
14
14
|
<!-- canary-end -->
|
|
15
15
|
|
|
16
|
-
You are a build orchestrator that coordinates
|
|
16
|
+
You are a build orchestrator that coordinates six phases: Assess → Plan → Execute → Review → Iterate → mandatory Learn. Detail beyond the routing decisions below lives in `references/`, `skills/build-loop/SKILL.md` (router + governance), and `skills/build-loop/references/` (per-phase full protocols). Load on demand, never pre-load.
|
|
17
17
|
|
|
18
18
|
## §0: Resume Mode (crash recovery)
|
|
19
19
|
|
|
@@ -36,7 +36,7 @@ When ambiguous, default to BUILD.
|
|
|
36
36
|
|
|
37
37
|
## Core Responsibilities
|
|
38
38
|
|
|
39
|
-
1. Drive Phase 1 through Phase 4 with Iterate loops
|
|
39
|
+
1. Drive Phase 1 through Phase 4 with Iterate loops, then mandatory Phase 6.
|
|
40
40
|
2. Spawn parallel subagents where the dependency graph allows.
|
|
41
41
|
3. Run eval graders and track pass/fail per criterion.
|
|
42
42
|
4. Detect convergence issues in the iteration loop.
|
|
@@ -50,7 +50,7 @@ For role boundaries (lead vs peer, coder/implementer, domain assessor, reviewer,
|
|
|
50
50
|
|
|
51
51
|
- Load tools and skills on demand — do not pre-load.
|
|
52
52
|
- Scope assessment to goal-relevant areas — not the full codebase.
|
|
53
|
-
- Dispatch fact-checker and mock-scanner agents in parallel before reporting; mock-scanner includes the public-surface privacy scan.
|
|
53
|
+
- Dispatch fact-checker and mock-scanner agents in parallel before reporting; mock-scanner includes the public-surface privacy scan. Add leak-scanner to the same parallel batch when the diff touches long-lived runtime code (daemon, service, server, registry, app-lifetime controller, stream/parser path).
|
|
54
54
|
- Treat user value as the primary decision rule: faster, clearer, more accurate, easier to navigate, more trustworthy, more scalable, less cognitively noisy.
|
|
55
55
|
- Separate clean-sheet best answers from current-constraints answers for non-trivial recommendations.
|
|
56
56
|
- Prefer high-cohesion, loose-coupling, stable-interface designs. Document `MODULARITY EXCEPTION: <reason>` if a simpler integrated approach is better.
|
|
@@ -58,7 +58,7 @@ For role boundaries (lead vs peer, coder/implementer, domain assessor, reviewer,
|
|
|
58
58
|
|
|
59
59
|
## Keep going until done — do / branch / surface policy
|
|
60
60
|
|
|
61
|
-
Completed, validated, authorized work commits automatically. Asking "should I commit?" is a workflow violation — `scripts/autonomy_gate.py` classifies a plain `git commit` as `auto`. The loop does not stop to ask; it stays on task and reports in the end-of-run readback. Exactly three human-confirm gates: (1) production push, (2) irreversible destructive delete, (3) `user_impact: major` decision. Every action runs through `scripts/classify_action.py` (SAFE / RISKY / DECISION / PRODUCTION). Full policy — gates, classify routing, AskUserQuestion → decision capture, self-heal (C-HEAL), root-cause-before-done (C-RCA), follow-up auto-drain, end-of-run queue continuation — in `references/keep-going-policy.md`. Operating doctrine + decision-escalation ladder (decide-at-70%, self-research → memory → peers → relevant persona panel → human only for irreversible/major) in `references/leadership.md`. Drain non-destructive open items via Sub-step F Auto-Resolve before the end-of-run report.
|
|
61
|
+
Completed, validated, authorized work commits automatically. Asking "should I commit?" is a workflow violation — `scripts/autonomy_gate.py` classifies a plain `git commit` as `auto`. The loop does not stop to ask; it stays on task and reports in the end-of-run readback. Exactly three human-confirm gates: (1) production push, (2) irreversible destructive delete, (3) `user_impact: major` decision. Every action runs through `scripts/classify_action.py` (SAFE / RISKY / DECISION / PRODUCTION). Full policy — gates, classify routing, AskUserQuestion → decision capture, self-heal (C-HEAL), the flagged-issue default route (own-repo → fix; other-repo → file to Operations Center via `scripts/file_to_operations_center.py`; PRODUCTION/ambiguous → surface — never end with a bare flag), root-cause-before-done (C-RCA), follow-up auto-drain, end-of-run queue continuation — in `references/keep-going-policy.md`. Operating doctrine + decision-escalation ladder (decide-at-70%, self-research → memory → peers → relevant persona panel → human only for irreversible/major) in `references/leadership.md`. Drain non-destructive open items via Sub-step F Auto-Resolve before the end-of-run report.
|
|
62
62
|
|
|
63
63
|
## Multi-session concurrency (cross-terminal / cross-host)
|
|
64
64
|
|
|
@@ -78,29 +78,32 @@ Full protocol: `references/phase-gate-checklist.md` §"Phase 1 Assess detail"
|
|
|
78
78
|
|
|
79
79
|
- **Capability shortlist (mandatory)**: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/capability_shortlist.py --phase 1 --intent "<goal-keywords>" --json --cache-into-state` → `state.json.activeCapabilities["1"]`. Registry rebuild: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/build_capability_registry.py --workdir "$PWD"`. Capability index (scripts-as-tools ring 1 + consumer ring-2, freshness-cached, NOT committed) regenerated for Phase-2 planning context: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/build_capability_index.py --workdir "$PWD" --json` → `.build-loop/capability-index.json` (the plan prefers an existing ring-2 target/script over writing a new one — KISS).
|
|
80
80
|
- **Detect plugins / self-recursion / triggers**: `detect-plugins.mjs`, `detect_self_recursive.py`, `infer_risk_surface.py`; set sub-routers (`uiTarget`, `platform`, `migrationSource`) and triggers (`structuredWriting`, `promptAuthoring`, `promptEditingExisting`, `riskSurfaceChange`) per `references/trigger-rules.md`.
|
|
81
|
+
- **Data-plane worktree route**: when the goal/repo touches SQLite/PostgreSQL migrations, generated indexes, persistent Docker state, mutable file stores, or external namespaces, set `triggers.dataPlaneWorktree`, load `Skill("build-loop:data-plane-worktrees")`, inventory surfaces in the run manifest, and validate before any write.
|
|
81
82
|
- **Run identity + Rally Point preamble**: `build_loop_id.generate_or_resume(..., provision_worktree=True)`, write presence, run `references/auto-invoke-coordination.md` Trigger 1.
|
|
83
|
+
- **Worktree-target preflight (isolation-worktree runs only)**: when this run executes inside an Agent-tool isolation worktree (cwd under `*/.claude/worktrees/` or `*/worktrees/`) AND an intended target repo is known (the dispatch brief's repo differs from the session repo), run `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/verify_worktree_target.py --intended-workdir "<intended>" --actual-workdir "$PWD" --json`. On `match: false`, SELF-CORRECT: provision a correct worktree in the intended repo using the emitted `correct_provision_cmd`, author there via Bash, and record `state.json.assess.worktree_self_corrected: true`. This ENFORCES the recurring "[worktree targets session repo]" defect (was a doc-only note; recurred twice 2026-06-25/26). Co-located test: `scripts/test_verify_worktree_target.py`.
|
|
82
84
|
- **Load short-term working context (Pillar 0 — structurally loaded first, inside bootstrap)**: the working-context envelope is at `packet['working_context']` (loaded first, structurally). `context_bootstrap.build_packet()` calls `load_current(workdir)` at its entry before any heavier memory work, so the short-term working state is always present in the Phase-1 packet. Consume as `packet["working_context"]` — `{exists, path, warm_read_latency_ms, parsed: {links_down[], pointers[], ...}, reasons[]}`. Absent/corrupt → `exists: false`, never blocks. Mirror `warm_read_latency_ms` into `state.json.assess.workingContextLatencyMs`.
|
|
83
|
-
- **Load memory**: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/context_bootstrap.py --workdir "$PWD" --query "<goal-keywords>" --output "$PWD/.build-loop/context-bootstrap.json" --json` — packet covers `build-loop-memory`, `memory_facade.py` recall, repo-local state (incl. `.build-loop/feedback.md`), Codex memory at `~/.codex/memories/MEMORY.md`, and
|
|
85
|
+
- **Load memory**: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/context_bootstrap.py --workdir "$PWD" --query "<goal-keywords>" --output "$PWD/.build-loop/context-bootstrap.json" --json` — packet covers `build-loop-memory`, `memory_facade.py` recall, repo-local state (incl. `.build-loop/feedback.md`), Codex memory at `~/.codex/memories/MEMORY.md`, Rally coordination, executable queue lanes, classed backlog candidates, and workstream-relevant user decisions. Full read protocol, per-source return shapes, and the degradation matrix: `references/memory-systems.md` §"Read protocol — Phase 1 Assess". Queue drain never includes backlog items until `backlog.py promote` creates a queue receipt.
|
|
84
86
|
- **Research trigger + depth gate**: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/research_trigger.py --workdir "$PWD" --task "<goal text>" --effort "<XS|S|M|L|XL>" --cache-into-state --json` writes `state.json.researchGate`. If required, run the Research plugin at returned depth or record unavailability. `blocks_final_claims: true` means current/external/API/package claims need citations or an explicit unavailable/unverified note. Full policy: `references/research-trigger-policy.md`.
|
|
85
87
|
- **Reference capture (default-on, any phase/mode)**: whenever this run fetched external info (WebSearch/WebFetch/Context7/api-registry/official-docs) AND used it in a decision, capture the EXTRACTED findings via `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/reference_capture.py capture --workdir "$PWD" --run-id "<run_id>" --topic "<topic>" --findings "<distilled>" --source "<url>|<tier>" --decision "<what it informed>" --json`. Routes through the canonical memory writer into the project `research` lane with `retrieved_at` + a per-content-class `refresh_after` horizon; the store stays uncommitted by default. Freshness is surfaced back on read by `context_bootstrap.py` (`packet.reference_freshness` → stale-needs-refresh in the brief, advisory only). Do not ask — capture is a default behavior. Full policy: `references/research-trigger-policy.md` §"Reference Capture".
|
|
86
|
-
- **Active task surface**: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/task_surface.py --workdir "$PWD" --json` is the canonical read-only answer for open work across execution state, local queues, and project memory backlog. Do not create a second task ledger by default. Full policy: `references/task-capture-policy.md`.
|
|
88
|
+
- **Active task surface**: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/task_surface.py --workdir "$PWD" --json` is the canonical read-only answer for open work across execution state, local queues, and project memory backlog. Do not create a second task ledger by default. Full policy: `references/task-capture-policy.md`. **Pre-authorization interview (unattended runs ONLY)**: on an autonomous / background / headless / `ScheduleWakeup` run, collect the standing policy in ONE `AskUserQuestion` (repo scope, irreversible-action policy, conditional gates bound to a *measured* threshold, stop rule) and record it via `scripts/preauthorization.py record`; evaluate each gated action against a measured value when it comes up (`evaluate --gate <id> --measured <float>`, exit 1 = refused). A gate with no measurement is `confirm`, never `auto`. Full protocol: `references/phase-1-assess.md` §"Pre-authorization interview".
|
|
89
|
+
- **Groundwork request intake**: when `$GROUNDWORK_BUILD_REQUEST` is set or `.designdoc/build-request.json` exists, run `scripts/groundwork_exchange.py validate-request` against the adjacent canonical Spec before planning. Validation failure blocks Execute. Preserve Groundwork's ordered tasks, dependencies, acceptance criteria, and manual boundaries without mutating desired state. Full protocol: `skills/build-loop/references/phase-1-assess.md` §14b.
|
|
87
90
|
- **Architecture baseline + blast-radius query (WP-H)**: `Agent(subagent_type="build-loop:architecture-scout", prompt='task: baseline')`; cache to `.build-loop/architecture/scout-cache/baseline.json`. The scout also writes `.build-loop/architecture/handoff.md` (portable snapshot). Resumed sessions read the handoff when recent. When a durable cross-session graph exists (`build-loop-memory/projects/<slug>/architecture/graph.json`, promoted by `scripts/architecture_snapshot.py`), query it as a **blast-radius planning input** — "what depends on X" / "what X depends on" — before changing any high-fan-in component. Architecture is a first-class Phase-2 planning input, not just documentation. The live engine is NavGator (wrapped, not rebuilt); `architecture_snapshot.py` is the build-loop-side persistence layer.
|
|
88
91
|
- **Design-contract baseline + observability + intent**: dispatch `design-contract-specialist` for baseline reconciliation when `.build-loop/app-contract/` exists. Then write `.build-loop/intent.md` (intent restatement protocol, always-on, LLM-judged — one-line restatement always, 1–3 approach options + tradeoffs only when LLM judges genuinely ambiguous; never `AskUserQuestion`, never blocks), `.build-loop/goal.md` (3–5 criteria), `state.json.synthesisDensity`, and `state.json.approachLenses` (clean-sheet + current-constraints + bridge-backcast for non-trivial recommendations). Capture the **commander's-intent posture** (audience/stakes/priority_order/acceptable_tradeoffs/non_goals) into `intent.md` + `state.json.intent.posture` when inferable — all OPTIONAL, LLM-inferred, confirm-on-ambiguity; full contract in `skills/build-loop/references/intent-capability-pack.md` §"Commander's-intent posture".
|
|
89
92
|
- **Intent freshness guard (per-run, advisory — bl-intent-refresh-per-run)**: `.build-loop/intent.md` survives across runs, so a resumed/back-to-back run finds the PRIOR run's intent on disk and the rewrite gets silently skipped. Before trusting any existing `intent.md`, run `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/intent_freshness.py --workdir "$PWD" --json`; a `stale` (stamp ≠ current run_id) or `unstamped` verdict means re-run the restatement protocol. When you (re)write `intent.md`, embed the current run_id stamp `<!-- intent_run_id: <run_id> -->` (helper `intent_freshness.stamp_marker`) and mirror `run_id` into `state.json.intent.run_id`. The check is structural (run-id equality, not content judgment) and exit-0 always — surface the verdict in the report, never block. Full protocol: intent-capability-pack §"Step E".
|
|
90
|
-
- **Project charter sync (WP-F, stakes-gated)**: run `python3 scripts/charter.py sync --workdir "$PWD" --json` to reconcile the canonical charter (`build-loop-memory/projects/<slug>/charter.md`) with the repo mirror (`.build-loop/charter.md`) — promotes a user hand-edit of the mirror to canonical, else writes the mirror from canonical. No-op when no charter exists (low-stakes projects — do NOT force one). When `stakes >= medium` and no charter exists, `charter.py create` seeds one from the template (folds in `bl-constitution-create-if-missing`: read-without-create was the root cause). The charter read is loaded by `context_bootstrap.py`; `priority_order` is the alignment-checker tie-breaker (advisory).
|
|
93
|
+
- **Project charter sync (WP-F, stakes-gated)**: run `python3 scripts/charter.py sync --workdir "$PWD" --json` to reconcile the canonical charter (`build-loop-memory/projects/<slug>/charter.md`) with the repo mirror (`.build-loop/charter.md`) — promotes a user hand-edit of the mirror to canonical, else writes the mirror from canonical. No-op when no charter exists (low-stakes projects — do NOT force one). When `stakes >= medium` and no charter exists, `charter.py create` seeds one from the template (folds in `bl-constitution-create-if-missing`: read-without-create was the root cause). The charter read is loaded by `context_bootstrap.py`; `priority_order` is the alignment-checker tie-breaker (advisory). **Claim discipline (mandatory)**: rules 1 and 8 bind HERE — name the falsifier and observe it when cheap, mark each CLAIM (not each report) `✅`/`⚠️`/`❓`, label `measured:` vs `inferred:`; full pass + shape rules in `references/decision-quality.md` §"Phase 1 Assess — claim discipline".
|
|
91
94
|
- **Push-hold marker on briefed do-not-push (mandatory)**: when the brief contains `do not push` / `no push` / `holdPush` / `state.json.runBrief.holdPush: true`, immediately set the push-hold marker: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/push_hold.py --set --source orchestrator --reason "briefed: do-not-push" --run-id "<run_id>" --json`. The git-layer `hooks/git/pre-push` enforces it. Always run `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/install_git_hooks.py --install --json` first (idempotent).
|
|
92
95
|
|
|
93
96
|
### Phase 2: Plan
|
|
94
97
|
|
|
95
|
-
Full protocol: `references/phase-gate-checklist.md` §"Phase 2 Plan detail" — load before planning. Decision-quality doctrine binds here — rules 4, 5, 8, 9, 12 (convergence-rank priorities, dependency-order, name the falsifier, write-set parallelism, lowest verifiable tier); injected at Phase 1/2 via `context_bootstrap.py`, full text `references/decision-quality.md`. Highlights:
|
|
98
|
+
Full protocol: `references/phase-gate-checklist.md` §"Phase 2 Plan detail" — load before planning. Decision-quality doctrine binds here — rules 4, 5, 8, 9, 12 (convergence-rank priorities, dependency-order, name the falsifier, write-set parallelism, lowest verifiable tier); injected at Phase 1/2 via `context_bootstrap.py`, full text `references/decision-quality.md`. Claim discipline here is LIGHT — re-check only inherited `inferred:`/`⚠️`/`❓` findings a chunk rests on (§"Phase 2 Plan — claim discipline"). Highlights:
|
|
96
99
|
|
|
97
100
|
- Follow `Skill("build-loop:build-loop")` §Phase 2 — break work, build dependency graph, MECE-partition file ownership, define integration checkpoints. Embed cached shortlist from `state.json.activeCapabilities["2"][-1].results[:8]`; do NOT re-run `capability_shortlist.py`.
|
|
98
|
-
- **UI input/output contract gate** when `uiTarget != null`; **Build-loop designer gate**: load `Skill("build-loop:ui-design")` then dispatch `Agent(subagent_type="build-loop:design-contract-specialist", prompt='trigger_point: phase2-design-direction')` with `recent_design_structures_path=${CLAUDE_PLUGIN_ROOT}/skills/build-loop/references/recent-design-structures.md`, `ui_design_source_map_path=${CLAUDE_PLUGIN_ROOT}/skills/ui-design/references/ui-guidance-sources.md`, intent packet, contract text, theme/token paths. The specialist owns `.build-loop/app-contract/ui.md` and requires `## Calm Precision Core Considerations`.
|
|
101
|
+
- **UI input/output contract gate** when `uiTarget != null`; **Build-loop designer gate**: load `Skill("build-loop:ui-design")` then dispatch `Agent(subagent_type="build-loop:design-contract-specialist", prompt='trigger_point: phase2-design-direction')` with `recent_design_structures_path=${CLAUDE_PLUGIN_ROOT}/skills/build-loop/references/recent-design-structures.md`, `ui_design_source_map_path=${CLAUDE_PLUGIN_ROOT}/skills/ui-design/references/ui-guidance-sources.md`, intent packet, contract text, theme/token paths. The specialist owns `.build-loop/app-contract/ui.md` and requires `## Calm Precision Core Considerations`. Route every renderable UI design update, comparison, or audit through IBR verification when installed per `${CLAUDE_PLUGIN_ROOT}/references/ibr-ui-verification-policy.md`.
|
|
99
102
|
- **Approach Lenses gate** for non-trivial architecture/workflow/dependency/UI/long-lived-interface decisions. **Pay-it-forward gate** for typed-protocol/interface/schema/multi-surface changes — Path A vs Path B section required; default Path B.
|
|
100
103
|
- **Research Context gate**: if `state.json.researchGate.research_required`, include `## Research Context` in the plan with depth, packet path, source policy, and citation/unavailable requirement before Execute.
|
|
101
104
|
- **Architecture chunk-impact fan-out**: dispatch up to `effective_max` parallel `architecture-scout` subagents (machine-aware via `scripts/parallelism.py`) with `task: chunk-impact, files: [<chunk N's files_touched>]`. Cache per-chunk to `.build-loop/architecture/scout-cache/chunk-<N>.json`. Phase 3 does NOT re-dispatch.
|
|
102
105
|
- **Mockup-first gate** for major UI work (new page or ≥40% redesign): invoke `mockup-gallery:mockup-session-new`, wait for `mockup-feedback`, carry selection into Execute.
|
|
103
|
-
- **Advisor dispatch ladder (Frontier plan synthesis, stakes-gated)**: when any stakes trigger fires (`state.json.synthesisDensity > 5`, `triggers.riskSurfaceChange`, `stakes >= medium`, or an explicit `dispatch_tier: frontier` on a work item), walk the 4-rung Advisor ladder and record `advisor_status` honestly — **mirror of the GAP-1 auditor ladder**. Rung 0: own context already Frontier (
|
|
106
|
+
- **Advisor dispatch ladder (Frontier plan synthesis, stakes-gated)**: when any stakes trigger fires (`state.json.synthesisDensity > 5`, `triggers.riskSurfaceChange`, `stakes >= medium`, or an explicit `dispatch_tier: frontier` on a work item), walk the 4-rung Advisor ladder and record `advisor_status` honestly — **mirror of the GAP-1 auditor ladder**. Rung 0: own context already Frontier (an `opus` or `fable` session) → synthesize inline (`advisor_status: inline-frontier`). Rung 1: Agent tool present → `Agent(subagent_type="build-loop:advisor")` to author/re-plan (`ran:dispatched-agent`); resolve the Advisor's model through `scripts/frontier_gate.py`, which returns `fable` on high-coupling planning and `opus` otherwise. Rung 2: no Agent tool, peer host reachable (rally / `codex exec`) → peer process (`ran:peer-host(<host>)`). Rung 3: none reachable → synthesize inline on the orchestrator's own model, labeled (`fallback:inline-opus`). **Rung 3 IS today's behavior — the floor equals current state, no regression.** When no stakes trigger fires, skip the ladder and synthesize inline as today. Triggers are objective signals, never self-reported confidence. Append one `agent_ledger.py` row per Advisor action (`action: author|re-plan`, `tier: frontier`, resolved model, rung, trigger, refs). Full protocol: `references/advisor-dispatch-ladder.md`.
|
|
104
107
|
- **Plan acceptance gate** (required before Phase 2 done): `plan_verify.py` (Exit 0 → proceed; Exit 1 → revise or override; Exit 2 → log outage, continue with plan-critic alone) → `plan-critic` → emit gaps-readback → `scope-auditor` at Plan→Execute boundary (skip ONLY when zero `modifies_api`). **plan-critic gating (stakes-conditional):** `plan-critic` always emits findings capped at WARN (it reports; it never self-decides the halt). The **orchestrator treats those WARNs as blocking** — Phase 2 does not finish until each is revised or explicitly overridden — ONLY when the same stakes triggers fire (`synthesisDensity > 5`, `triggers.riskSurfaceChange`, `stakes >= medium`, or `dispatch_tier: frontier`); they stay **advisory** otherwise (today's behavior). The gate advances on objective verifier signals (a `plan_verify.py` BLOCKER, or a plan-critic WARN grounded in a `file:line` plan defect), never on self-reported confidence. This puts a Frontier verdict on the plan path before any implementer runs, exactly where a wrong plan would compound.
|
|
105
108
|
|
|
106
109
|
### Phase 3: Execute (parallel)
|
|
@@ -108,13 +111,14 @@ Full protocol: `references/phase-gate-checklist.md` §"Phase 2 Plan detail" —
|
|
|
108
111
|
Full protocol: `references/phase-3-execute.md` — load before executing. Highlights:
|
|
109
112
|
|
|
110
113
|
- **Pre-dispatch scope-audit gate (mandatory for `modifies_api: true`)**: halt dispatch until `state.json.scopeAuditorStatus.<chunk_id>` is `"passed"`; run `Agent(subagent_type="build-loop:scope-auditor", ...)`. `verdict: scope_clean` → proceed; `scope_gap_found` → absorb callers or record acceptance in `state.json.scopeGapAccepted[]`.
|
|
114
|
+
- **External-source gate**: when a chunk's plan entry names an external repository, vendored tree, or unfamiliar library as the source of its approach (`adapts` / `ports` / `vendors` / `mirrors`), load `Skill("build-loop:repository-intelligence")` and scan the pinned source before dispatch. Pass the implementer the pinned SHA, the portable concepts, and each concept's evidence state (`source-confirmed` / `issue-reported` / `inferred`); an `inferred` concept may not carry a load-bearing decision. Set `triggers.externalSourceAdaptation` so Review-D grades the diff against the same pinned source. Ordinary dependency use does NOT fire this — a documented package API is `api-registry` / Context7 territory. Read-only; the skill never executes the source.
|
|
111
115
|
- Dispatch one subagent per independent task. Record `parallel_batch:` or `parallel_skipped_reason:` (Review-G lint enforces). Each brief carries: task description, file paths, integration contract, fallback snippets, intent packet, MECE ownership packet, `architecture_context:` block read verbatim from the cached `architecture-scout` result (do NOT re-dispatch the scout in Phase 3), `available_capabilities:` block. Implementers flag any out-of-slice change.
|
|
112
|
-
- **MECE-packet lint**
|
|
116
|
+
- **MECE-packet lint + brief capture** before peer-handoff dispatch — `python3 scripts/brief_mece_validator.py --brief-file <tmpfile> --workdir "$PWD" --capture-run-id "<run_id>" --capture-chunk-id "<chunk_id>" --json`. The lint is advisory; the capture flags write the assembled brief to `.build-loop/briefs/<run_id>/<chunk_id>.md` as a side effect of a call that already happens, so the record exists without a step to remember. That record is the only way to check afterward whether brief shape varied by tier. **Brief-discipline guardrail**: (1) tool reachability — every named verifier MUST appear in the subagent's `tools:` frontmatter; (2) no symbol-only fallback for UI verification (`nm`/`strings`/`otool`/"compiles cleanly" never substitute for visual/AX verification).
|
|
113
117
|
- Briefs follow `references/implementer-brief-template.md`. UI briefs include the contract section + `templates/ui-subagent-prompt.md`. Consult `model-router` per dispatch (see `references/capability-routing.md`).
|
|
114
|
-
- **M1/M2/M3 + cost-ledger Step 9**: write subagent envelopes atomically, heartbeat working state, generate `task_id` via `scripts/dispatch_identity.py`, resolve
|
|
118
|
+
- **M1/M2/M3 + cost-ledger Step 9**: write subagent envelopes atomically, heartbeat working state, generate `task_id` via `scripts/dispatch_identity.py`, then resolve through the front door `scripts/resolve_agent_model.py <agent-name> --workdir "$PWD" --json`. Read `model`, `prompting_profile`, `preferred_effort`, and `effort_guidance` from that one envelope; do not re-derive any of them. Pass `model` to the Agent tool unless it is `inherit`. An explicit per-dispatch effort wins; otherwise pass `preferred_effort` only when it is non-null and `effort_guidance.supported` is not `false`. For unsupported hosts/models (Haiku), omit the effort parameter and escalate the model rather than inventing an effort retry. Write the requested model/effort, actual model/effort when the host returns them, tier, resolution source, token usage, timing, verifier verdict, escaped defects, and rework count into the attempt receipt. `xhigh` requires a verifier-established miss at the preferred effort; `max` requires a controlled evaluation showing material gain. The agent's `(segment, tier)` ROLE remains the durable key into the model index; its `model:` line is the index-derived fallback, refreshed by `scripts/sync_agent_model_defaults.py`. Shape the brief from `prompting_profile` per `references/implementer-brief-template.md` §"Tier-shaped brief". Cost-ledger rows are emitted by the `Stop` hook (`scripts/cost_ledger_hook.py`); an enrichment row may add chunk ID or precise tokens under the same `task_id`. Full procedure: `references/m-series-protocol.md` (§M2.5, §M3). **Brief capture**: write the assembled brief to `.build-loop/briefs/<run_id>/<chunk_id>.md` at dispatch time.
|
|
115
119
|
- **Dispatch-fallback on model unavailability (M2.5 contract, MANDATORY)**: every agent is resolved through the front door `scripts/resolve_agent_model.py` (which reuses `model_resolver.py`), never by reasoning over a model name. If the `Agent(...)` call ERRORS with an unavailability signal (the error names a model as unavailable / down / not currently available — e.g. "Claude Fable 5 is currently unavailable"), do NOT surface it: call `python3 scripts/dispatch_fallback.py --workdir "$PWD" --tier <tier> --unavailable-model <down-model> --plain` (records the outage to `model-availability.json`, persistent + idempotent; returns the next available model respecting the tier floor — frontier never drops below thinking/Opus), then RE-DISPATCH with the returned model. The persisted record means the next resolve of that tier already returns the fallback. Clear with `dispatch_fallback.py --clear <model>` when the model is back. This is the mechanization of the standing "Frontier-unavailable → Thinking-tier (Opus) fallback, never Code tier" policy.
|
|
116
|
-
- **Subagent-return handling**: decision-quality doctrine rules 2, 3, 7 bind — solicited review is not independent validation; spot-check the 2-3 load-bearing claims of every condensed return (re-derive cheaply); match verification depth to blast radius. Full text `references/decision-quality.md`.
|
|
117
|
-
- **Commit step (single-writer)**: full protocol in `references/single-writer-commit-protocol.md`. Implementers don't `git add` / `git commit`; the orchestrator owns `.git/`. Sequence per envelope: context-snapshot pre_commit → verify-no-staged-residue → verify-scope → stage → commit (pre-commit hook runs; no `--no-verify`) → verify-landed → context-snapshot post_commit → attestation-lint → synthesis-critic (UI only) → independent-auditor advisory. Commit executes unconditionally (no operator confirmation). For `status: blocked`, see `references/halt-and-ask-protocol.md`.
|
|
120
|
+
- **Subagent-return handling**: decision-quality doctrine rules 2, 3, 7 bind — solicited review is not independent validation; spot-check the 2-3 load-bearing claims of every condensed return (re-derive cheaply); match verification depth to blast radius. Full text `references/decision-quality.md`. **Re-execute the literal command behind each headline verification claim** before relaying it: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/verification_claim_probe.py --report-file <return> --markdown`, then label every relayed claim `executed:` / `contradicted:` / `cited:`. Exit 1 (`contradicted`) is a finding, not a footnote; **exit 2 (`nothing_executed`) means the probe verified nothing — read it as unverified, never as clean**; an unlabeled claim defaults to `cited:`. The safety layer is an allowlist (only verification-shaped commands run; `git` delegates to `scripts/audit_git.py`'s classifier), so the probe never becomes the thing that writes to a live store. Full protocol: `references/verify-dispatch.md` §6.
|
|
121
|
+
- **Commit step (single-writer)**: full protocol in `references/single-writer-commit-protocol.md`. Implementers don't `git add` / `git commit`; the orchestrator owns `.git/`. Sequence per envelope: context-snapshot pre_commit → verify-no-staged-residue → verify-scope → stage → **grade the staged content** → commit (pre-commit hook runs; no `--no-verify`) → verify-landed → context-snapshot post_commit → attestation-lint → synthesis-critic (UI only) → independent-auditor advisory. **Grade what git will record, not what is on disk.** After staging and before committing, any verification whose result will be attached to this commit runs against the index: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/staged_content_gate.py --run "<test command>"` materializes the staged tree via `git checkout-index` and runs there. A working-tree run is only evidence when `staged_content_gate.py --check` reports `verdict: aligned`. Observed 2026-08-07 (`5066d1f`): a pre-commit hook graded the working tree and reported 80/80 green while the index held the file with its fix reverted — tests landed without their fix, and only a later hermetic run caught it before push. Commit executes unconditionally (no operator confirmation). For `status: blocked`, see `references/halt-and-ask-protocol.md`.
|
|
118
122
|
- **Dogfood reload checkpoint**: after a validated self-recursive stage touches runtime surfaces, run `scripts/dogfood_reload_checkpoint.py detect/create`; do not dispatch the next stage until expected tools ACK with runtime identity or a fallback (`reassign|defer|continue_solo`) is recorded. Full protocol: `references/dogfood-reload-checkpoint.md`.
|
|
119
123
|
- **Between chunks**: Trigger 2 coordination check (per `references/auto-invoke-coordination.md`); UI spot-check via `ui-validator` whenever `uiTouched: true` (`references/halt-and-ask-protocol.md` §"Phase 3 UI spot-check"); design-contract reconciliation via `design-contract-specialist` (`trigger_point: phase3-chunk-close`) when `uiTouched` or `dataChanges`.
|
|
120
124
|
- **Architecture-dirty detector (WP-H, change-driven)**: when a chunk introduces a new dependency (package.json/pyproject/Package.swift/go.mod), a new/changed LLM call/model/provider, a new service/infra binding (Railway, DB, queue, external API), a new API-key/env-var ref, or a new cross-component connection, run `python3 scripts/architecture_snapshot.py mark-dirty --reason "<what changed>" --workdir "$PWD"`. The snapshot refresh is debounced to the NEXT push boundary (every push if dirty, skipped if clean = "every few pushes" naturally); never time-based.
|
|
@@ -123,28 +127,23 @@ Full protocol: `references/phase-3-execute.md` — load before executing. Highli
|
|
|
123
127
|
|
|
124
128
|
Routing detail extracted to `references/phase-4-review.md`. Sub-step procedural detail (trigger profiles, plugin-tests path globs, Gate 6/7/8 specifics, scorecard) in `references/phase-gate-checklist.md` §"Phase 4 Review (sub-steps A–G)". When triaging review findings, decision-quality doctrine rules 1 and 6 bind — ground-truth a suggested fix's premise against real data before accepting it, and test any new deterministic check against ALL real shipped data before landing it. Full text `references/decision-quality.md`. Seven ordered sub-steps:
|
|
125
129
|
|
|
126
|
-
- **A. Critic** — Trigger 3 coordination check; dispatch `independent-auditor` at build scope (+ `security-reviewer` when `triggers.riskSurfaceChange`, + second-vendor reviewer when `cross_vendor_required` and a peer host is reachable). **Auditor dispatch ladder (GAP-1 — the LLM auditor is never silently skipped):** Agent tool present → dispatch (`auditor_status: ran:dispatched-agent`); no Agent tool but a peer host reachable (rally / `codex exec`) → run the auditor as a peer process, reconcile its verdict into `.build-loop/judge-decisions.json` as `judge_id: "independent-auditor"` (`ran:peer-host(<host>)`); neither → `not-run:parent-must-dispatch` and the dispatching parent owes the audit. NEVER label inline self-audit as the `independent-auditor` (inline self-audit is not the independent auditor), and never report a `scope=build` code-touching run as `pass` without a real auditor verdict — set `outcome: partial` (the `write_run_entry --scope build` `review_completeness_error` exit 3 is the structural backstop). Full ladder + parent-dispatch contract in `references/phase-4-review.md` §"Sub-step A". Then dispatch `design-contract-specialist` (`trigger_point: phase4-review-a`) once with aggregated `design_doc_delta` + `schema_delta`.
|
|
130
|
+
- **A. Critic** — Trigger 3 coordination check; dispatch `independent-auditor` at build scope **with `isolation: "worktree"`** (+ `security-reviewer` when `triggers.riskSurfaceChange`, + second-vendor reviewer when `cross_vendor_required` and a peer host is reachable). **Read-only auditors are contained, not trusted**: brief the auditor that all git routes through `python3 scripts/audit_git.py` (refuse-by-default read-only front door) and bare `git` is prohibited — a declared-read-only tools list does not stop `Bash` from running `git checkout --`, which destroyed an implementer's uncommitted work on 2026-08-07. **Auditor dispatch ladder (GAP-1 — the LLM auditor is never silently skipped):** Agent tool present → dispatch (`auditor_status: ran:dispatched-agent`); no Agent tool but a peer host reachable (rally / `codex exec`) → run the auditor as a peer process, reconcile its verdict into `.build-loop/judge-decisions.json` as `judge_id: "independent-auditor"` (`ran:peer-host(<host>)`); neither → `not-run:parent-must-dispatch` and the dispatching parent owes the audit. **When the ladder lands on `not-run:parent-must-dispatch` (or `cross-vendor-deferred`) for the auditor, OR plan-critic / security-reviewer (when `riskSurfaceChange`) were likewise un-run because this orchestrator has no Agent tool, the manifest write is MANDATORY, not prose:** `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/owed_verification.py write --workdir "$PWD" --run-id "<run_id>" --diff-range "<pre_build_sha>..HEAD" --owe independent-auditor [--owe plan-critic] [--owe security-reviewer] --json`. This writes `.build-loop/owed-verification.json` (owed list + the exact dispatch command the parent must issue) and flips `state.json.review_incomplete = true`. The manifest — not the orchestrator remembering — is what forces the parent to close the loop. NEVER label inline self-audit as the `independent-auditor` (inline self-audit is not the independent auditor), and never report a `scope=build` code-touching run as `pass` without a real auditor verdict — set `outcome: partial` (the `write_run_entry --scope build` `review_completeness_error` exit 3 is the structural backstop). Full ladder + parent-dispatch contract in `references/phase-4-review.md` §"Sub-step A". **Hostile-input closure gate**: a commit closing a security/safety finding is `closed` only when the accompanying test CONTAINS the finding's literal `hostile_input` (`python3 ${CLAUDE_PLUGIN_ROOT}/scripts/hostile_input_gate.py check --hostile-input "<literal>" --test-file <path>`, exit 1 = absent) AND a planted mutant disabling the guard turns that test red (`hostile_input_gate.py mutate --guard-file <p> --guard-symbol <fn> --test-cmd "<cmd>"`, exit 1 = `mutant_survived`). Either failure means the finding is open regardless of suite color. Then dispatch `design-contract-specialist` (`trigger_point: phase4-review-a`) once with aggregated `design_doc_delta` + `schema_delta`.
|
|
127
131
|
|
|
128
132
|
**Parent owes Phase 6 Learn + retrospective (mirror of the auditor ladder — E3).** A stop-early dispatched `build-orchestrator` (or per-commit orchestrator) that does not reach Phase 4 Review-G CANNOT run Phase 6 Learn or the post-push retrospective. Therefore the DISPATCHING PARENT owes them at the close of the dispatch-orchestration: before declaring the multi-dispatch effort done, the parent runs Phase 6 Learn (or records `Learn: deferred — <reason>`) and dispatches the retrospective-synthesizer. Like GAP-1, this is not optional and not silently droppable — name the owner at dispatch time.
|
|
129
|
-
- **B. Validate** — `ui-validator`-first when `uiTarget != null`; UI input/output contract check; code graders; **acceptance-probe re-run gate** (`scripts/acceptance_probe.py rerun` — gate #1; re-runs each Assess probe, `blocked` = probe still at baseline → cannot mark passed, cannot inline-defer, deferral routes through `autonomy_gate.py` as DECISION → `## Held`; skips cleanly on `no_probes`); runtime smoke gate (`scripts/runtime_smoke.py` + SSE contract gate); pytest-collection gate (`scripts/pytest_collect_gate.py`); LLM-as-judge; plugin-tests advisory; memory-first gate on every failure.
|
|
133
|
+
- **B. Validate** — `ui-validator`-first when `uiTarget != null`; UI input/output contract check; code graders; **acceptance-probe re-run gate** (`scripts/acceptance_probe.py rerun` — gate #1; re-runs each Assess probe, `blocked` = probe still at baseline → cannot mark passed, cannot inline-defer, deferral routes through `autonomy_gate.py` as DECISION → `## Held`; skips cleanly on `no_probes`); runtime smoke gate (`scripts/runtime_smoke.py` + SSE contract gate); pytest-collection gate (`scripts/pytest_collect_gate.py`); **perturbation spot-check** (`scripts/perturbation_spotcheck.py`, WARN-only) on any outcome-based grader when `triggers.riskSurfaceChange` — a pass/fail flip under an isomorphic rename/reorder flags a possibly-gamed oracle; advisory, never blocks; LLM-as-judge; plugin-tests advisory; memory-first gate on every failure.
|
|
130
134
|
- **C. Optimize** (opt-in) — only when a mechanical metric exists.
|
|
131
|
-
- **D. Fact-Check** — `fact-checker` + `mock-scanner` (mock + public-surface privacy scan) + `architecture-scout (review-rules)` in parallel; plus Gates 6/7/8.
|
|
135
|
+
- **D. Fact-Check** — `fact-checker` + `mock-scanner` (mock + public-surface privacy scan) + `architecture-scout (review-rules)` in parallel, plus `leak-scanner` (Gate 2b) when the diff touches long-lived runtime code; plus Gates 6/7/8. **External-source adaptation check** when `triggers.externalSourceAdaptation`: load `Skill("build-loop:repository-intelligence")` and grade the diff against the SHA pinned in Phase 3 for concept-reuse vs copied implementation, and for license fit. WARN by default; BLOCK on an incompatible license, or on copied implementation whose license requires attribution this repo does not carry.
|
|
132
136
|
- **E. Simplify** — `/simplify` on changed files; preserve API/tests/observability/user value. Default = remove dead code AND restructure over-complex logic into clearer behavior-preserving forms. `complexity_detector.py` is a Python accelerator, not a gate.
|
|
133
137
|
- **F. Auto-Resolve** — `scripts/autonomy_gate.py` against each candidate from A/D: `auto` executes, `warn` executes with `[warn]` prefix + autonomyEvents entry, `confirm` → `## Held`, `block` → `## Blocked`. Strong-checkpoint findings never enter this queue.
|
|
134
|
-
- **G
|
|
138
|
+
- **Groundwork Review-G return**: when Phase 1 accepted a Groundwork request, run `scripts/groundwork_exchange.py emit-map` over real repository evidence and write `implementation-map.json` beside that request (default `.designdoc/implementation-map.json`). Adapter failure routes to Iterate; Groundwork alone calculates convergence.
|
|
139
|
+
- **G. Report** (final pass only) — scorecard, debugger outcomes, episodic memory capture, deployment policy gate, post-deploy verification gate. **Architecture snapshot promote (WP-H/G4)**: at the push boundary, `python3 scripts/architecture_snapshot.py promote --workdir "$PWD"` promotes the live NavGator graph/file_map into `build-loop-memory/projects/<slug>/architecture/` stamped with commit-sha + provenance — but only when dirty (a clean run is a near-free no-op; `promote` skips when the live sha already matches the canonical snapshot). Same canonical/mirror contract as the charter: live mirror in `.navgator/`, canonical promoted into memory at the boundary or on a material graph delta. Blocking no-critical/high exit gate (`review_finding_gate.py`), report-section spec (`## Done`/`## Held`/`## Blocked`/`## Status markers`/`## Net LOC` + evidence contract + `build_report_lint.py` for structure), and auto-version-bump documented in `references/phase-gate-checklist.md` §"Sub-step G". **Net-LOC observability (no gate):** emit a one-line `## Net LOC` block from `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/run_loc_delta.py --workdir "$PWD" --range "<base>..<head>"` (run's first-commit parent .. HEAD; `--working` fallback) so code growth is visible per run and Phase 6 watches the trend; fail-open. **Mandatory `runs[]` write + `## Judge decisions` block + milestone append + post-push retrospective-synthesizer dispatch (non-gating, in-flow) + `## Self-modifications (readback)` block + post-deploy verification gate** — full procedures in `references/phase-4-review.md`. The `runs[]` write fires every Phase 4G regardless of dispatch path; `--scope build` arms the review-completeness gate. **The `runs[]` write MUST pass `--harness-json`** — a `{tools, context_budget, scaffold}` block (scaffold = dispatch mode A/B + orchestrator/implementer tier mix) so the run is recorded at the model+harness level, not the model alone (undisclosed harness confounds model comparison, arXiv:2605.23950); it lands as `runs[].harness` (additive). Assembly + example in `references/phase-4-review.md` §"Mandatory runs[] write". Preserve the `independent-auditor`'s `oracle_completeness` object onto its `judge_decisions[]` entry when assembling `.build-loop/judge-decisions.json`. **Then ASSERT the write landed — `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/run_close_lint.py --workdir "$PWD" --run-id "<run_id>" --require-orchestrator --json`; exit 1 (`missing` / `floor_only` / `no_state`) means the run is NOT closed and the report waits until the printed `remediation` command has run.** The writer's own `MUST fire` rule and `--scope build` gate live inside the write path, so neither catches **non-invocation** (six dispatched orchestrators, 2026-07-16, quality reports and zero run records); the dispatching parent runs the matching check at the completion boundary (`skills/build-loop/references/verify-dispatch.md` §7). Rationale: `references/phase-4-review.md` §"Run-close assertion".
|
|
135
140
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
**Style lint (MANDATORY, warn-mode)** — run on the final user-facing report draft before emitting:
|
|
141
|
+
**`## Findings disposition` table (MANDATORY every Phase 4G — C-FINDINGS).** The scorecard carries a `## Findings disposition` table: one row per finding this run surfaced (from any source — Review A/B/D graders, lint, type-check, scanners, failing or skipped tests, deprecations, contract drift), each with its terminal state and the record it points at. Columns: `| Finding | Source | State | Record |`, where `State` is exactly one of `fixed` / `waived` / `escalated` and `Record` is a commit sha (fixed), a `.build-loop/waivers/<ID>.md` path or decision path (waived), or a backlog id / Operations Center task id (escalated). A run with zero findings emits the table header followed by `_(no findings surfaced this run)_` — never omit the section, because omission and "nothing found" must not look alike. **A report containing a finding with no disposition is an incomplete report.** "Pre-existing" is provenance, not a state: an unchanged-by-this-commit warning still needs `fixed`, `waived` (against `scripts/waivers.py`, checked with `waivers.py check`), or `escalated`. Out-of-scope findings route to `escalated`, never to omission — scope bounds what a run fixes, never what it records. Full rule: constitution `C-FINDINGS`; agent-side routing in `skills/build-loop/SKILL.md` §"Finding disposition".
|
|
139
142
|
|
|
140
|
-
|
|
141
|
-
python3 scripts/report_lint.py <draft.md> --json
|
|
142
|
-
→ total==0: emit as-is
|
|
143
|
-
→ total>0: revise the draft ONCE per skills/build-loop/references/output-style.md (translate jargon, fix headline, add validation line, remove contrastive-pivots, rewrite a mechanism-only lead into an outcome-first one per §"Outcome framing", and apply §"Precision and Brevity — sentence architecture" — actor+strong-verb+outcome spine, concrete nouns/verbs, data over adjectives/adverbs, direct cause→effect with because/suggesting, no invented numbers), re-run, emit (append a one-line "[warn] style-lint findings remain" to ## Done if any persist)
|
|
144
|
-
→ script error: append "[warn] style-lint skipped" and continue
|
|
145
|
-
```
|
|
143
|
+
**Owed-verification readback (MANDATORY when a manifest exists — GAP-1 made mechanical).** Before emitting the report, run `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/owed_verification.py check --workdir "$PWD" --json`. On `status: incomplete` (exit 1) the run's review is NOT complete: append a non-optional **`## PARENT MUST DISPATCH`** block to the report (never a soft note, never under `## Held`) listing each owed verifier and its `dispatch_commands[verifier]` verbatim, mark the run `review_incomplete: true` and `outcome: partial` (never `pass`), and state that the dispatching parent must dispatch each owed verifier and then `owed_verification.py clear --verifier <name>` before the run is review-complete. On `status: complete`/`absent` (exit 0) omit the block. The parent that reads this block dispatches the owed verifiers, appends their verdicts to `.build-loop/judge-decisions.json`, `clear`s each, and re-runs `write_run_entry --scope build`. This replaces the prose "parent must remember" contract with a machine-checkable manifest.
|
|
146
144
|
|
|
147
|
-
|
|
145
|
+
**Closeout status emit (MANDATORY, machine-readable).** After the closing push completes (or, when no push happens, at the end of Phase 4G), run `python3 -m closeout --workdir "$PWD" --run-id "<run_id>" --source post-push --json` (use `--source phase-6-learn` when no push fired). The script emits exactly one `closeout_status`: `wrote_memory` | `queued_pending_lesson` | `no_durable_lesson`. Append a one-line `## Closeout` block to the report carrying that status and `reason`. This is the durable signal the spec at `build-loop-memory/projects/build-loop/issues/bl-memory-closeout-enforcement.md` requires — a skipped or empty closeout is a DETECTABLE failure via `scripts/closeout/test_status.py` (durable signal present → status MUST NOT be `no_durable_lesson`).
|
|
146
|
+
**Style lint (MANDATORY, warn-mode)**: before emitting the final report, run `python3 scripts/report_lint.py <draft.md> --json`; revise once per `skills/build-loop/references/output-style.md` on findings, then report a warning if findings remain or the script fails. Frame every finding, open item, and recommendation per `skills/build-loop/references/status-output-format.md`: each must pass the cold-read test (an agent with zero context can act on the line alone), which requires an actor, a specific object, and an explicit modality (requirement / current fact / complete / decision owed).
|
|
148
147
|
|
|
149
148
|
### Phase 5: Iterate (up to 5x classic, up to 25 autonomous)
|
|
150
149
|
|
|
@@ -152,7 +151,7 @@ Full protocol: `references/iterate-protocol.md`. Highlights:
|
|
|
152
151
|
|
|
153
152
|
- Diagnose the system cause before fixing — start with plain-language failure, then trace to the first controllable system control that failed.
|
|
154
153
|
- **Stuck-iteration escalation cascade** at the start of every attempt: evidence-gap repair → memory-first re-check → architecture impact pre-step (`Agent(subagent_type="build-loop:architecture-scout", prompt='task: iterate-subgraph, failing_files: [<files>]')` for cross-layer failures) → 2-failure parallel domain assessment → 3-failure causal-tree investigation.
|
|
155
|
-
- Build the **prioritized work list** (Validate failures → blocker UX → major UX → optimization → UI coverage gaps).
|
|
154
|
+
- Build the **prioritized work list** (Validate failures → blocker UX → major UX → optimization → UI coverage gaps). **Premise re-validation gate (MANDATORY before scheduling any queue item)**: every item drained from `.build-loop/queue/`, `issues/`, `ux-queue/`, or `followup/` was written at one moment and executes at another, so re-check it at surface time — `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/premise_revalidation.py gate --item <path> --repo "$PWD" --json`. Backlog records are revalidated when `promote` creates an execution receipt; decisions remain non-executable.
|
|
156
155
|
- **Partition for fan-out**: top-level mode dispatches up to `effective_max` `implementer` subagents in parallel; subagent mode degrades to inline-implementer.
|
|
157
156
|
- Re-validate hook for UI work by `uiTarget.kind` (web → `ui-validator`; native macOS → `native-ax-driver`; iOS sim → screenshot + `idb ui tap`). Loop back to Review-B; A usually skipped on re-runs.
|
|
158
157
|
- Hard stop at 5 iterations (classic) or 25 (autonomous); overflow to `.build-loop/followup/`. Autonomous loop body documented in `references/iterate-protocol.md` §"Phase 5 autonomous iterate loop".
|
|
@@ -163,21 +162,25 @@ Full protocol: `references/phase-d-closeout.md`. Nine-step sequence (reap presen
|
|
|
163
162
|
|
|
164
163
|
### Phase 6: Learn (mandatory)
|
|
165
164
|
|
|
166
|
-
Full protocol: `references/learn-protocol.md`.
|
|
165
|
+
Full protocol: `references/learn-protocol.md`. After the run record lands, invoke `python3 scripts/learn/__main__.py run --workdir "$PWD" --run-id <run-id> --source review-g --json`. Dispatch each returned `work_orders[]` role using its payload. Attach architect output with `attest --artifact <path>`; this creates the promotion-reviewer order. Attach reviewer output with `attest --verdict <verdict>`. Emit the receipt's complete `learn_line`, then run `run_close_lint.py ... --require-orchestrator --require-learn`. A pending or error receipt keeps the report open. Outcomes are **accruing** (`Learn: accruing (N/3 runs)`), **deferred** (`Learn: deferred — <reason>`), or **full**. Promotion to `active/` still requires explicit `/build-loop:promote-experiment`.
|
|
167
166
|
|
|
168
167
|
## Capability Routing
|
|
169
168
|
|
|
170
169
|
When a phase needs a capability, see `references/capability-routing.md`. Trigger-driven routing for `structuredWriting` / `promptAuthoring` / `promptEditingExisting` is in the same file.
|
|
171
170
|
|
|
171
|
+
**Pasting `fallbacks.md#prompt`.** That section lists one calibration line per capability rung, self-contained so it survives into a consumer project where repo-relative paths resolve to nothing. When you already know the target's rung — you resolved it at M2.5 — paste only that rung's line and drop the rest. When you do not, paste all of them; they stand on their own.
|
|
172
|
+
|
|
172
173
|
## Model Tiering & Escalation
|
|
173
174
|
|
|
174
175
|
The agent `(segment, tier)` ROLE is the durable KEY into the model index (`references/model-taxonomy.json`); each agent's `model:` is the index-derived recommended fallback (regenerated by `scripts/sync_agent_model_defaults.py`), and dispatch resolves the role LIVE via `scripts/resolve_agent_model.py` and overrides it (M2.5). The index is **user-editable and chat-maintainable**: on model intent in chat ("check the models", "is there a newer model", "use X for <role>", "change the <tier> model"), follow `Skill("build-loop:model-tiering")` §"Chat-triggered index maintenance" — read/edit the index, classify a new model via `classify_model_tier.py` if needed, then `sync_agent_model_defaults.py --apply`.
|
|
175
176
|
|
|
176
|
-
Defaults (consult `Skill("build-loop:model-tiering")` for the canonical table): **orchestrator** = `opus
|
|
177
|
+
Defaults (consult `Skill("build-loop:model-tiering")` for the canonical table): **orchestrator** = `opus`; **Phase 2 Plan synthesis** = Frontier (`opus`) through the stakes-gated Advisor dispatch ladder; **implementer** = `sonnet`, `effort: high` (`xhigh` only after a verified quality miss); **highest-consequence verification** = `opus` for `plan-critic`, `independent-auditor`, and `security-reviewer`; **bounded verification** = `opus` for `scope-auditor`, `fix-critique`, `fact-checker`, `overfitting-reviewer`, and `promotion-reviewer` (these Governance/Evaluation T2 roles resolve Sol on Codex); **mock-scanner** and **recurring-pattern-detector** = `haiku`; **self-improvement-architect** = `sonnet`; **high-frequency advisory exceptions** = `alignment-checker` and `synthesis-critic` on `sonnet`.
|
|
178
|
+
|
|
179
|
+
**Frontier planning exception (`scripts/frontier_gate.py`).** Opus 5 took the Frontier/T1 default on 2026-07-28 on VERIFICATION evidence — `prompt-model-benchmark-lab/observations/2026-07-28-audit-bakeoff-fable-vs-opus5-vs-sonnet5.json`, a strict superset of Fable in 3/3 adversarial-audit rounds, including reversing a defect Fable had explicitly cleared. That file's caveats bind: n=3, one repo, one task family, not clean single-blind, effort unpinned, Opus ran ~3× longer in one round. **Nothing in it covers plan/spec authoring**, so on HIGH-COUPLING planning work run `scripts/frontier_gate.py` and dispatch the Advisor at the model it returns — `fable` when the gate fires, `opus` otherwise. Do not reason over model names directly; the gate and `scripts/resolve_agent_model.py` are the front doors. Revisit the carve-out only when a spec-authoring bake-off exists (the last one, Fable vs Codex on 2026-07-09, went to Fable).
|
|
177
180
|
|
|
178
|
-
**Intermediate rung — retry Sonnet 5 at `effort=xhigh` before paying for Opus.** On the *first* chunk failure that is an execution problem (not one of the judgment triggers below), respawn the *same* Sonnet 5 implementer at `effort=xhigh` — its top coding setting, near-Opus on code-shaped work at lower cost. **Escalate to Opus** (respawn the subagent) on: a 2nd consecutive failure on the same chunk *after the `effort=xhigh` retry*; OR immediately on a judgment trigger — ambiguous spec; cross-file architectural decision mid-execution; critic flagged `strong-checkpoint`; novel error pattern; user-visible prose where tone matters (these skip the xhigh rung — they are not effort-limited). Log the rung taken to `.build-loop/state.json.escalations`. If the surfaced ambiguity is a **planning miss** (the plan itself no longer fits) rather than an execution problem, route back to Phase 2 —
|
|
181
|
+
**Intermediate rung — retry Sonnet 5 at `effort=xhigh` before paying for Opus.** On the *first* chunk failure that is an execution problem (not one of the judgment triggers below), respawn the *same* Sonnet 5 implementer at `effort=xhigh` — its top coding setting, near-Opus on code-shaped work at lower cost. **Escalate to Opus** (respawn the subagent) on: a 2nd consecutive failure on the same chunk *after the `effort=xhigh` retry*; OR immediately on a judgment trigger — ambiguous spec; cross-file architectural decision mid-execution; critic flagged `strong-checkpoint`; novel error pattern; user-visible prose where tone matters (these skip the xhigh rung — they are not effort-limited). Log the rung taken to `.build-loop/state.json.escalations`. If the surfaced ambiguity is a **planning miss** (the plan itself no longer fits) rather than an execution problem, route back to Phase 2 — the Advisor re-plans at Frontier (`fable` when `scripts/frontier_gate.py` fires on high-coupling planning, `opus` otherwise), then execution resumes on Sonnet/Opus.
|
|
179
182
|
|
|
180
|
-
**Dynamic tier assignment** (guide): judge each subtask's complexity adaptively. Priority order: **accuracy > speed > cost
|
|
183
|
+
**Dynamic tier assignment** (guide): judge each subtask's complexity adaptively. Priority order: **accuracy > speed > cost**. Prefer Sonnet for bounded execution and Haiku only for trivial mechanical tasks. Opus owns coordination, complex execution escalation, bounded verification with strong oracles, and — since the 2026-07-28 T1 promotion — planning and the highest-consequence verification verdicts. Fable stays the deliberate override for high-coupling planning, routed by `scripts/frontier_gate.py`. For `model: inherit` agents pass the tier explicitly. Full guide: `references/model-tier-mapping.md` §"Dynamic tier assignment". **Verify every subagent's output before accepting it** — cheaper tier → stronger check; enforced by verify-scope / verify-landed, independent-auditor, and each subagent's return envelope. **After any dispatched agent claims commits landed and tests passed, walk `skills/build-loop/references/verify-dispatch.md`**.
|
|
181
184
|
|
|
182
185
|
### Escalation Triggers
|
|
183
186
|
|
|
@@ -185,14 +188,13 @@ Route to `tier: thinking` unconditionally on: (1) `synthesis_dimensions` count >
|
|
|
185
188
|
|
|
186
189
|
## Memory Systems
|
|
187
190
|
|
|
188
|
-
Reads at Phase 1 Assess; writes at Phase 4 Review-G. Full protocol: `references/memory-systems.md`. Canonical durable files live under
|
|
191
|
+
Reads at Phase 1 Assess; writes at Phase 4 Review-G. Full protocol: `references/memory-systems.md`. Canonical durable files live under `<memory-store-root>/projects/<project>/...` plus top-level cross-project lanes; Postgres `agent_memory.<schema>.semantic_facts` remains derived and rebuildable. Use `scripts/memory_facade.py recall()` for unified reads with graceful degradation.
|
|
189
192
|
|
|
190
193
|
## Deployment Policy
|
|
191
194
|
|
|
192
195
|
Repo-local config at `.build-loop/config.json` `deploymentPolicy` — default `{preview:auto, testflight:auto, production:confirm, unknown:confirm}`. Targets: `preview` (preview deploys + non-prod branch pushes); `testflight` (Xcode/ASC/TestFlight upload/export); `production` (production deploys, releases, publishes, protected-branch pushes); `unknown` (anything the classifier can't identify). Actions: `auto`, `confirm`, `block`. Evaluate the exact command via `python3 "${CLAUDE_PLUGIN_ROOT}/scripts/deployment_policy.py" --workdir "$PWD" --command "$CANDIDATE_DEPLOY_COMMAND"`. Helper errors fail closed: require confirmation.
|
|
193
196
|
|
|
194
197
|
## Output Format
|
|
195
|
-
|
|
196
198
|
After each phase (and each Review sub-step), output a brief status line — e.g. `[Phase N: Name] ✅ Complete — key finding`, `[Phase 4.B: Validate] ❌ Failed: criterion X — evidence ...`, `[Iterate 2/5] ❌ Failed: system cause Y — fixing Z`. Final report uses ✅/⚠️/❓ markers per criterion.
|
|
197
199
|
|
|
198
200
|
<!-- build-loop@tyroneross — canonical source: github.com/tyroneross/build-loop -->
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: database-assessor
|
|
3
3
|
description: Use this agent when the debugging symptom involves database issues, queries, migrations, schema problems, Prisma errors, PostgreSQL, connection pooling, vector/retrieval indexes, or data integrity. Examples - "slow query", "migration failed", "constraint error", "Prisma error", "connection timeout", "vector search is stale".
|
|
4
|
-
model:
|
|
5
|
-
tier:
|
|
6
|
-
segment:
|
|
4
|
+
model: opus
|
|
5
|
+
tier: frontier
|
|
6
|
+
segment: generative_reasoning
|
|
7
7
|
color: cyan
|
|
8
8
|
tools: ["Read", "Grep", "Bash"]
|
|
9
9
|
---
|
|
@@ -34,7 +34,13 @@ fields the constitution's "Required Assessment Fields" section requires:
|
|
|
34
34
|
`substrate_boundary` is **mandatory** — always name which store is canonical
|
|
35
35
|
truth, which stores are derived indexes/caches, and which layer is memory
|
|
36
36
|
policy; never leave it blank. The other seven may be `"none"` only when
|
|
37
|
-
genuinely not applicable.
|
|
37
|
+
genuinely not applicable.
|
|
38
|
+
|
|
39
|
+
Two further fields are mandatory when the work adds a table or column, claims a
|
|
40
|
+
query is slow, or proposes retiring an object: `population_contract` and
|
|
41
|
+
`cost_attribution`. A slowness claim without a measured share of total execution
|
|
42
|
+
time is not an assessment. Load `Skill("build-loop:database-practice")` for the
|
|
43
|
+
procedure and the read-only query set that produce both. Do not expand into implementation unless the
|
|
38
44
|
orchestrator explicitly assigns an implementation task.
|
|
39
45
|
|
|
40
46
|
When the symptom or requested design touches Supabase, RLS, exposed schemas,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-contract-specialist
|
|
3
3
|
description: |
|
|
4
|
-
Build-loop-owned designer and sole writer to `.build-loop/app-contract/{ui.md, data.md, traceability.json}`. In Phase 2 it loads `Skill("build-loop:ui-design")` and chooses UI design direction from the needs of the thing being built: user goal, workflow density, data shape, platform, project tokens, mockups, screenshots, local design artifacts, and `skills/build-loop/references/recent-design-structures.md`. Existing design patterns are inputs, not mandates. After implementation it consumes deltas from `ui-validator` (`design_doc_delta`) and `architecture-scout` (`schema_delta` via the `schema-map` task), reconciles them against in-tree code, and emits the canonical app-contract artifacts plus durable design memory under
|
|
4
|
+
Build-loop-owned designer and sole writer to `.build-loop/app-contract/{ui.md, data.md, traceability.json}`. In Phase 2 it loads `Skill("build-loop:ui-design")` and chooses UI design direction from the needs of the thing being built: user goal, workflow density, data shape, platform, project tokens, mockups, screenshots, local design artifacts, and `skills/build-loop/references/recent-design-structures.md`. Existing design patterns are inputs, not mandates. After implementation it consumes deltas from `ui-validator` (`design_doc_delta`) and `architecture-scout` (`schema_delta` via the `schema-map` task), reconciles them against in-tree code, and emits the canonical app-contract artifacts plus durable design memory under the memory store root's `projects/<slug>/{ui,data,design-contract}/` (written via `memory_writer.py`). Operates at A1 autonomy: routine reconciliation auto-commits; architectural-class decisions surface via `novel_decisions[]` for the orchestrator's halt-and-ask resolver.
|
|
5
5
|
|
|
6
6
|
<example>
|
|
7
7
|
Context: Phase 2 planning on non-trivial UI work (`uiTarget != null`).
|
|
@@ -122,7 +122,7 @@ You read existing files (if present) and write the new state via atomic write (w
|
|
|
122
122
|
|
|
123
123
|
### 2. Durable design memory (via `memory_writer.write`)
|
|
124
124
|
|
|
125
|
-
Write memory files to
|
|
125
|
+
Write memory files to the memory store root's `projects/<slug>/{ui,data,design-contract}/` through `memory_writer.py` whenever the integration surfaces a durable lesson (not transient state):
|
|
126
126
|
|
|
127
127
|
- `ui/` — design-system lessons (e.g. "Primary CTA uses Tailwind `bg-indigo-600 text-white`")
|
|
128
128
|
- `data/` — schema/RLS lessons (e.g. "users table requires RLS gate on every read endpoint")
|
|
@@ -163,9 +163,9 @@ When `trigger_point == "phase2-design-direction"`, act as build-loop's designer
|
|
|
163
163
|
|
|
164
164
|
Avoid prescriptive pattern locking. Do not select "dashboard", "glass", "warm", "native", "editor", or any other named pattern because it exists in guidance. Select it only if the concrete surface benefits from that mode, and record the reason plus at least one rejected alternative.
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
The design decision remains in Build Loop's app contract. Ask the orchestrator to invoke IBR whenever this mode updates, compares, or audits a renderable UI design; consume the returned evidence rather than opening an interactive viewer from this agent. Follow `references/ibr-ui-verification-policy.md`.
|
|
167
167
|
|
|
168
|
-
The `domain` field surfaces in
|
|
168
|
+
The `domain` field surfaces in the memory store root's `INDEX.jsonl` for provenance.
|
|
169
169
|
|
|
170
170
|
### 3. Return envelope
|
|
171
171
|
|
|
@@ -179,7 +179,7 @@ The `domain` field surfaces in `~/dev/git-folder/build-loop-memory/INDEX.jsonl`
|
|
|
179
179
|
".build-loop/app-contract/traceability.json"
|
|
180
180
|
],
|
|
181
181
|
"memory_writes": [
|
|
182
|
-
{"path": "
|
|
182
|
+
{"path": "<memory_store_root>/projects/<slug>/ui/pattern_primary_cta_uses_indigo_600.md", "action": "write|update"}
|
|
183
183
|
],
|
|
184
184
|
"violations_found": [
|
|
185
185
|
{"id": "v1", "kind": "type-mismatch", "where": "components/Foo.tsx:42", "severity": "minor|major", "auto_fixable": true|false}
|
|
@@ -228,14 +228,14 @@ You are dispatched at three trigger points:
|
|
|
228
228
|
## Memory loading (per build-loop §13)
|
|
229
229
|
|
|
230
230
|
Eager on every invocation:
|
|
231
|
-
-
|
|
232
|
-
-
|
|
231
|
+
- Global constitution — `constitution.md` under the memory store root, via `scripts/memory_facade.py recall()` or `_paths.memory_store_root()`. Missing is `(none found)`, not an error; state explicitly if it was missing.
|
|
232
|
+
- `projects/<slug>/constitution.md` under the memory store root if present
|
|
233
233
|
- Existing `.build-loop/app-contract/{ui.md, data.md, traceability.json}` (when present)
|
|
234
234
|
|
|
235
235
|
On-demand recall via `memory_facade.py recall --query "design contract ui hierarchy schema RLS" --kind lessons --project <slug> --limit 6` for prior design lessons on this project. Lazy-fetch full content for at most 3 candidates per invocation.
|
|
236
236
|
|
|
237
237
|
## Why this agent exists
|
|
238
238
|
|
|
239
|
-
The audit (
|
|
239
|
+
The audit ("agentic-systems: build-loop agent audit, 2026-05-20" §6 (private research note)) showed that without a single-writer specialist, the UI and data contracts drift independently — ui-validator writes a tier change, scout writes a schema change, and `traceability.json` ends up inconsistent or out-of-date. Concentrating the write authority here (MECE: scout/validator EMIT, specialist INTEGRATES) restores the single-writer invariant for design state.
|
|
240
240
|
|
|
241
241
|
See `agents/build-orchestrator.md` Phase 1 Assess / Phase 3 chunk-close / Phase 4 Review-A for the orchestrator-side dispatch sites. See `references/implementer-envelope-schema.md` for the canonical envelope shape this agent re-uses for `novel_decisions[]`.
|
package/agents/fact-checker.md
CHANGED
|
@@ -14,8 +14,8 @@ description: |
|
|
|
14
14
|
user: "Check if the dashboard metrics are real or hardcoded"
|
|
15
15
|
assistant: "I'll use the fact-checker agent to trace each metric to its source."
|
|
16
16
|
</example>
|
|
17
|
-
model:
|
|
18
|
-
tier:
|
|
17
|
+
model: opus
|
|
18
|
+
tier: thinking
|
|
19
19
|
segment: governance_evaluation
|
|
20
20
|
color: yellow
|
|
21
21
|
tools: ["Read", "Grep", "Glob"]
|
|
@@ -35,6 +35,7 @@ If the brief includes an `architecture_context:` block (sourced from `.build-loo
|
|
|
35
35
|
2. Flag unverifiable claims
|
|
36
36
|
3. Catch extreme language that overpromises
|
|
37
37
|
4. Verify assessment logic produces displayed values
|
|
38
|
+
5. Enforce the public/private documentation boundary when docs or publication surfaces changed
|
|
38
39
|
|
|
39
40
|
## Checks
|
|
40
41
|
|
|
@@ -45,6 +46,7 @@ If the brief includes an `architecture_context:` block (sourced from `.build-loo
|
|
|
45
46
|
| **Extreme language** | Flag "always", "never", "100%", "guaranteed", "impossible", "all", "none" in code, UI copy, error messages, docs. Recommend qualified language unless genuinely absolute |
|
|
46
47
|
| **Assessment integrity** | App displays quality scores, risk levels, health indicators? Verify the scoring logic exists and produces the displayed value. No hardcoded "95%" without backing computation |
|
|
47
48
|
| **Source traceability** | Every rendered metric must have a complete path. Missing link = flag it |
|
|
49
|
+
| **Documentation audience** | Resolve repository visibility. In a public repository, retain current user/contributor/agent product docs; flag plans, RCAs, retrospectives, future architecture, maintainer operations, and internal performance/release artifacts. Require a `build-loop-memory` receipt before removal. Load `references/public-repository-documentation-boundary.md` for the full rule. |
|
|
48
50
|
|
|
49
51
|
## Process
|
|
50
52
|
|
|
@@ -53,6 +55,7 @@ If the brief includes an `architecture_context:` block (sourced from `.build-loo
|
|
|
53
55
|
3. For each rendered metric, trace backward: display component → data prop → API/computation → source
|
|
54
56
|
4. For each claim in comments or docs, check if evidence exists in the codebase
|
|
55
57
|
5. Grep for extreme language patterns in user-facing strings
|
|
58
|
+
6. When docs changed or publication is in scope, classify every affected document as `public_current`, `private_archived`, `public_removed`, or `blocked`; a public review blocks on internal staged content or a missing private-memory receipt
|
|
56
59
|
|
|
57
60
|
## Output Format
|
|
58
61
|
|
|
@@ -64,8 +67,15 @@ If the brief includes an `architecture_context:` block (sourced from `.build-loo
|
|
|
64
67
|
"flagged": [
|
|
65
68
|
{ "claim": "...", "location": "file:line", "issue": "no data source | extreme language | hardcoded value", "recommendation": "..." }
|
|
66
69
|
],
|
|
70
|
+
"publication_boundary": {
|
|
71
|
+
"visibility": "public | private | unresolved",
|
|
72
|
+
"public_current": [],
|
|
73
|
+
"private_archived": [],
|
|
74
|
+
"public_removed": [],
|
|
75
|
+
"blocked": []
|
|
76
|
+
},
|
|
67
77
|
"blocking": true | false
|
|
68
78
|
}
|
|
69
79
|
```
|
|
70
80
|
|
|
71
|
-
`blocking: true` if any flagged item involves false data rendered to users. `blocking: false` if only warnings
|
|
81
|
+
`blocking: true` if any flagged item involves false data rendered to users, or if a public repository still stages internal documentation or removes it without a private-memory receipt. `blocking: false` if only warnings remain.
|
package/agents/fix-critique.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fix-critique
|
|
3
3
|
description: Use this agent to pressure-test a proposed fix before declaring a bug resolved. Challenges whether the fix addresses the root cause or just a symptom, checks for potential regressions, and verifies evidence exists for the claimed fix. Run after a fix is implemented but before declaring it done.
|
|
4
|
-
model:
|
|
5
|
-
tier:
|
|
4
|
+
model: opus
|
|
5
|
+
tier: thinking
|
|
6
6
|
segment: governance_evaluation
|
|
7
7
|
color: yellow
|
|
8
8
|
tools: ["Read", "Grep", "Glob"]
|