@tyroneross/build-loop 0.34.0 → 0.36.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 +1 -1
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +71 -18
- package/README.md +208 -299
- package/agents/advisor.md +2 -0
- package/agents/alignment-checker.md +2 -0
- package/agents/api-assessor.md +3 -1
- package/agents/architecture-scout.md +2 -0
- package/agents/assessment-orchestrator.md +2 -0
- package/agents/build-orchestrator.md +13 -8
- package/agents/database-assessor.md +107 -3
- package/agents/design-contract-specialist.md +2 -0
- package/agents/fact-checker.md +2 -0
- package/agents/fix-critique.md +26 -5
- package/agents/frontend-assessor.md +3 -1
- package/agents/implementer.md +2 -0
- package/agents/independent-auditor.md +2 -0
- package/agents/mock-scanner.md +2 -0
- package/agents/optimize-runner.md +2 -0
- package/agents/overfitting-reviewer.md +2 -0
- package/agents/performance-assessor.md +3 -1
- package/agents/plan-critic.md +5 -2
- package/agents/promotion-reviewer.md +2 -0
- package/agents/recurring-pattern-detector.md +4 -1
- package/agents/retrospective-synthesizer.md +14 -0
- package/agents/root-cause-investigator.md +39 -2
- package/agents/scope-auditor.md +2 -0
- package/agents/security-reviewer.md +3 -0
- package/agents/self-improvement-architect.md +2 -0
- package/agents/synthesis-critic.md +2 -0
- package/agents/transcript-pattern-miner.md +2 -0
- package/agents/ui-validator.md +2 -0
- package/assets/build-loop-plugin-icon.png +0 -0
- package/bin/build-loop-install.js +234 -0
- package/commands/run.md +1 -1
- package/hooks/git/pre-commit +40 -0
- package/hooks/git/pre-push +35 -10
- package/hooks/hooks.json +42 -5
- package/hooks/pre-edit-architecture.sh +2 -2
- package/hooks/route-guard.sh +15 -0
- package/hooks/route_guard.py +221 -0
- package/hooks/session-start-extensions.sh +10 -0
- package/hooks/session-start-git-hooks.sh +6 -1
- package/hooks/session-start-rally-point.sh +23 -1
- package/hooks/test_session_start_rally_version.sh +123 -0
- package/package.json +7 -2
- package/plugin-artifacts/codex/.codex-plugin/plugin.json +1 -1
- package/plugin-artifacts/codex/AGENTS.md +77 -16
- package/plugin-artifacts/codex/README.md +208 -299
- package/plugin-artifacts/codex/assets/build-loop-plugin-icon.png +0 -0
- package/plugin-artifacts/codex/references/agent-role-taxonomy.md +34 -0
- package/plugin-artifacts/codex/references/backlog-system.md +285 -0
- package/plugin-artifacts/codex/references/capability-routing.md +49 -0
- package/plugin-artifacts/codex/references/coordination-file-template.md +2 -2
- package/plugin-artifacts/codex/references/coordination-rules.md +275 -6
- package/plugin-artifacts/codex/references/memory-systems.md +25 -2
- package/plugin-artifacts/codex/references/memory.md +16 -0
- package/plugin-artifacts/codex/references/model-tier-mapping.md +45 -6
- package/plugin-artifacts/codex/references/phase-1-assess.md +19 -1
- package/plugin-artifacts/codex/references/phase-2-plan.md +10 -1
- package/plugin-artifacts/codex/references/phase-3-execute.md +5 -3
- package/plugin-artifacts/codex/references/phase-4-review.md +22 -1
- package/plugin-artifacts/codex/references/phase-5-iterate.md +4 -3
- package/plugin-artifacts/codex/references/phase-6-learn.md +3 -1
- package/plugin-artifacts/codex/references/verify-dispatch.md +85 -0
- package/plugin-artifacts/codex/skills/build-loop/SKILL.md +19 -10
- package/plugin-artifacts/codex/skills/build-loop/fallbacks.md +1 -1
- package/plugin-artifacts/codex/skills/build-loop/references/capability-routing.md +49 -0
- package/plugin-artifacts/codex/skills/build-loop/references/experiment-results-template.md +101 -0
- package/plugin-artifacts/codex/skills/build-loop/references/memory.md +16 -0
- package/plugin-artifacts/codex/skills/build-loop/references/output-style.md +98 -5
- package/plugin-artifacts/codex/skills/build-loop/references/phase-1-assess.md +19 -1
- package/plugin-artifacts/codex/skills/build-loop/references/phase-2-plan.md +10 -1
- package/plugin-artifacts/codex/skills/build-loop/references/phase-3-execute.md +5 -3
- package/plugin-artifacts/codex/skills/build-loop/references/phase-4-review.md +22 -1
- package/plugin-artifacts/codex/skills/build-loop/references/phase-5-iterate.md +4 -3
- package/plugin-artifacts/codex/skills/build-loop/references/phase-6-learn.md +3 -1
- package/plugin-artifacts/codex/skills/build-loop/references/verify-dispatch.md +85 -0
- package/plugin-artifacts/codex/skills/build-loop/templates/codex-worker-prompt.md +4 -0
- package/scripts/build_codex_plugin_artifact.py +7 -0
- package/scripts/embed_backend.py +17 -13
- package/scripts/lessons_index/query.py +1 -1
- package/scripts/memory_graph/__init__.py +2 -2
- package/scripts/sync_navgator_lessons.py +4 -4
- package/skills/api-registry-bridge/SKILL.md +1 -1
- package/skills/auto-decision-capture/SKILL.md +4 -3
- package/skills/auto-finding-capture/SKILL.md +119 -0
- package/skills/build-loop/SKILL.md +19 -10
- package/skills/build-loop/fallbacks.md +1 -1
- package/skills/build-loop/references/capability-routing.md +49 -0
- package/skills/build-loop/references/experiment-results-template.md +101 -0
- package/skills/build-loop/references/memory.md +14 -0
- package/skills/build-loop/references/output-style.md +98 -5
- package/skills/build-loop/references/phase-1-assess.md +19 -1
- package/skills/build-loop/references/phase-2-plan.md +10 -1
- package/skills/build-loop/references/phase-3-execute.md +5 -3
- package/skills/build-loop/references/phase-4-review.md +20 -1
- package/skills/build-loop/references/phase-5-iterate.md +4 -3
- package/skills/build-loop/references/phase-6-learn.md +2 -0
- package/skills/build-loop/references/verify-dispatch.md +85 -0
- package/skills/build-loop/templates/codex-worker-prompt.md +4 -0
- package/skills/debug-loop/SKILL.md +4 -2
- package/skills/debugging-memory/SKILL.md +24 -12
- package/skills/{debugging/assess/SKILL.md → debugging-memory/references/assess.md} +6 -13
- package/skills/{debugging/memory/SKILL.md → debugging-memory/references/search.md} +10 -17
- package/skills/{debugging/store/SKILL.md → debugging-memory/references/store.md} +5 -13
- package/skills/debugging-memory/references/subagent-integration.md +3 -3
- package/skills/defenseclaw-bridge/SKILL.md +1 -1
- package/skills/{loop-builder → focused-loop-builder}/SKILL.md +6 -6
- package/skills/ibr-bridge/SKILL.md +1 -1
- package/skills/knowledge/SKILL.md +13 -2
- package/skills/{knowledge-review/SKILL.md → knowledge/references/review-mode.md} +8 -20
- package/skills/logging-tracer/SKILL.md +20 -4
- package/skills/model-bakeoff/SKILL.md +44 -0
- package/skills/model-tiering/SKILL.md +55 -20
- package/skills/optimize/SKILL.md +2 -2
- package/skills/prd-bridge/SKILL.md +1 -1
- package/skills/recursive-retrospective/SKILL.md +46 -0
- package/skills/recursive-retrospective/references/01-retrospective.md +136 -0
- package/skills/recursive-retrospective/references/02-learning-capture.md +72 -0
- package/skills/recursive-retrospective/references/03-judge.md +45 -0
- package/skills/research/SKILL.md +1 -1
- package/skills/root-cause-analysis/SKILL.md +42 -0
- package/skills/security-methodology/SKILL.md +10 -1
- package/skills/security-scan/SKILL.md +55 -0
- package/skills/spec-writing/SKILL.md +42 -1
- package/skills/sync-skills/SKILL.md +8 -7
- package/commands/assess.md +0 -41
- package/commands/compose-handoff.md +0 -113
- package/commands/debug.md +0 -20
- package/commands/debugger-detail.md +0 -34
- package/commands/debugger-scan.md +0 -15
- package/commands/debugger-status.md +0 -20
- package/commands/debugger.md +0 -32
- package/commands/optimize-run.md +0 -31
- package/commands/promote-experiment.md +0 -129
- package/commands/rally-point.md +0 -301
- package/commands/research-run.md +0 -22
- package/commands/review-knowledge.md +0 -16
- package/commands/self-review.md +0 -51
- package/commands/setup-memory.md +0 -32
- package/commands/start-prd.md +0 -57
- package/commands/test.md +0 -34
- package/commands/verify-plan.md +0 -39
- package/skills/debugging/debug-loop/SKILL.md +0 -231
- package/skills/logging-tracer-bridge/SKILL.md +0 -70
- /package/skills/{loop-builder → focused-loop-builder}/presets/active-project-evidence.yaml +0 -0
- /package/skills/{loop-builder → focused-loop-builder}/presets/generic-artifact-loop.yaml +0 -0
- /package/skills/{loop-builder → focused-loop-builder}/presets/presentation-audit.yaml +0 -0
- /package/skills/{loop-builder → focused-loop-builder}/presets/research-synthesis.yaml +0 -0
- /package/skills/{loop-builder → focused-loop-builder}/presets/source-ingestion-raw-data-audit.yaml +0 -0
- /package/skills/{loop-builder → focused-loop-builder}/references/spec-format.md +0 -0
- /package/skills/{loop-builder → focused-loop-builder}/scripts/loop_builder.py +0 -0
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Official marketplace for build-loop — orchestrated 5-phase development loop with optional Learn phase",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.36.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "build-loop",
|
|
14
14
|
"source": "./",
|
|
15
|
-
"description": "Orchestrated 5-phase development loop (Assess → Plan → Execute → Review → Iterate) plus optional Learn phase. Review combines critic, validate, optimize, fact-check, simplify, and report as ordered sub-steps. Bundles native debug-loop, debugging-memory, and logging-tracer skills without a build-loop MCP server.
|
|
16
|
-
"version": "0.
|
|
15
|
+
"description": "Orchestrated 5-phase development loop (Assess → Plan → Execute → Review → Iterate) plus optional Learn phase. Review combines critic, validate, optimize, fact-check, simplify, and report as ordered sub-steps. Bundles native debug-loop, debugging-memory, and logging-tracer skills without a build-loop MCP server. The logging-tracer skill includes an optional Coding Debugger escalation hop to delegate to the standalone supporting plugin for extended capability (cross-project memory, additional assessors). NavGator integration via cherry-pick bridge. Opus 4.7 orchestrator, Sonnet execution, Haiku pattern-matching.",
|
|
16
|
+
"version": "0.36.0",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Tyrone Ross"
|
|
19
19
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "build-loop",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Multi-phase build orchestration with native debugging: assess, plan, execute, review, iterate. Plan-verify gate on Phase 2. Optional UI design gates. Native debug-loop, debugging-memory, and logging-tracer skills provide root-cause investigation without a bundled MCP server. Orchestrator owns when-to-fire; bundled skills own procedural detail; logging-tracer
|
|
3
|
+
"version": "0.36.0",
|
|
4
|
+
"description": "Multi-phase build orchestration with native debugging: assess, plan, execute, review, iterate. Plan-verify gate on Phase 2. Optional UI design gates. Native debug-loop, debugging-memory, and logging-tracer skills provide root-cause investigation without a bundled MCP server. Orchestrator owns when-to-fire; bundled skills own procedural detail; the logging-tracer skill includes an optional Coding Debugger escalation hop to the standalone supporting plugin for extended capability.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tyrone Ross",
|
|
7
7
|
"url": "https://github.com/tyroneross"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "build-loop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Multi-phase build orchestration with native debugging: assess, plan, execute, review, iterate. Plan-verify gate on Phase 2. Optional UI design gates. Native debug-loop, debugging-memory, and logging-tracer skills provide root-cause investigation without a bundled MCP server. Orchestrator owns when-to-fire; bundled skills own procedural detail; bridges are optional escalation hops to supporting plugins for extended capability.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tyrone Ross",
|
package/AGENTS.md
CHANGED
|
@@ -18,31 +18,35 @@ There is NO gate for code size or complexity. Genuine inability to proceed (miss
|
|
|
18
18
|
|
|
19
19
|
## Session-start preflight
|
|
20
20
|
|
|
21
|
-
Run this once at the start of every session, **before any other action**, to learn the coordination state of this repo (active peers, pending ACKs addressed to you, north-star paths, memory locations, guardrails) and to write a presence record so other tools can see you.
|
|
21
|
+
Run this once at the start of every session, **before any other action**, to learn the coordination state of this repo (active peers, pending ACKs addressed to you, north-star paths, memory locations, guardrails) and to write a presence record so other tools can see you. Rally is coordination metadata, not verification evidence: use it to discover peers, claims, handoffs, and soft file conflicts; confirm code/package/release truth from the repo, tests, manifests, registries, or GitHub directly.
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
rally codex --
|
|
24
|
+
rally enter --tool codex --json
|
|
25
|
+
rally next --tool codex --json
|
|
26
|
+
rally room --tool codex --json
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
The command is **host-neutral** —
|
|
29
|
+
The command surface is **host-neutral** — substitute the `--tool` value for your host: `codex`, `cursor`, `gemini`, `claude_code`, or `other`. If `rally --help` on the local machine disagrees with an older instruction, follow the live CLI help and record the docs drift.
|
|
28
30
|
|
|
29
31
|
When you know your intent or files at session start, include them so peers can see the work immediately:
|
|
30
32
|
|
|
31
33
|
```bash
|
|
32
|
-
rally
|
|
34
|
+
rally enter --tool codex --path "<file-or-dir>" --json
|
|
35
|
+
rally say claim --tool codex --subject "<what you are doing>" --path "<file-or-dir>" --json
|
|
33
36
|
```
|
|
34
37
|
|
|
35
38
|
When you finish or hand off, close the loop:
|
|
36
39
|
|
|
37
40
|
```bash
|
|
38
|
-
rally stop codex --
|
|
41
|
+
rally stop codex --json
|
|
39
42
|
```
|
|
40
43
|
|
|
41
|
-
`rally stop` removes live presence
|
|
42
|
-
Peers read active work from `active_peers[]` and last-known active/stopped session state from `peer_states[]`.
|
|
44
|
+
`rally stop` removes live presence for the selected session/name/tool and releases active claims for cooperative peers. Peers read active work from Rally room state; those records are peer-authored coordination records, never proof that code, tests, releases, or remote refs are correct.
|
|
43
45
|
|
|
44
46
|
**Fallback:** if `rally` is not on PATH, proceed without preflight — do **not** crash, do **not** block on it. The Phase 1 Rally Point presence write below covers the minimum coordination contract.
|
|
45
47
|
|
|
48
|
+
**Codex heartbeat parity:** codex sessions emit presence via `session_probe.py --tool codex` (wired in `.codex/hooks.json` `SessionStart`), so their presence/claims/lead decay identically to claude sessions — parity proven by `scripts/rally_point/heartbeat_parity_vectors.json`.
|
|
49
|
+
|
|
46
50
|
## Output style
|
|
47
51
|
|
|
48
52
|
Concise output — say only what the user needs to decide or act; cut narration, restated context, filler; no jargon.
|
|
@@ -78,6 +82,21 @@ These run parameters apply on any host — pass them on the invocation (`--flag`
|
|
|
78
82
|
|
|
79
83
|
**Budget-aware behavior is host-neutral** — without programmatic budget tracking, treat the budget as a soft wall-clock target: check in at ~50%, finalize before the deadline rather than starting new chunks.
|
|
80
84
|
|
|
85
|
+
## Codex Execution Adapter
|
|
86
|
+
|
|
87
|
+
The phase logic in this file is host-neutral, but several primitives it names are Claude-Code-specific. When running under Codex (or any non-Claude host), map each primitive to its Codex equivalent. This closes the functional-parity gap — the workflow runs the same; only the dispatch mechanics differ.
|
|
88
|
+
|
|
89
|
+
| Claude primitive | Codex equivalent | How |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| `Agent(subagent_type="<name>", …)` | Codex worker, peer process, inline read, or unavailable-fallback | **Preferred:** spawn a Codex worker per `references/codex-subagents.md` (role mapping + permission gate) using `templates/codex-worker-prompt.md` as the prompt skeleton — only under explicit `--parallel` / delegation authorization. **No authorization:** keep the work in the lead session (inline), still writing the same MECE plan + ownership packet. **Cross-vendor verifier:** a reachable peer host via `codex exec <prompt>` or a rally-channel handoff. **None reachable:** record the role as not-run and have the dispatching parent owe it (see the verifier matrix below). |
|
|
92
|
+
| `Skill("<name>")` | Inline-read the skill | Read that skill's `SKILL.md` and follow it inline. Codex auto-discovers root `skills/*/SKILL.md`; for nested build-loop skills, read the file at its path. There is no Codex "invoke skill" call — the SKILL.md body is the instruction set. |
|
|
93
|
+
| `AskUserQuestion` | Surface to user | Codex has no structured-choice tool. Print the question + 2–4 labeled options inline and wait for the reply; persist the answer as a DECISION record (see Post-Build steering-decision capture). For non-blocking/reversible choices, pick the default, label it `[ASSUMED: <reason>]`, and continue. |
|
|
94
|
+
| `TaskCreate` / `TaskUpdate` / `TaskList` | Backlog files or inline list | Use the host-neutral backlog system (`scripts/backlog.py`, `.build-loop/backlog/`) for durable work items, or a plain inline checklist in the lead session for within-run tracking. Do not block on a task tool that does not exist. |
|
|
95
|
+
| `PushNotification` | Surface to user | Print the notification inline in the session; there is no background push channel under `codex exec`. |
|
|
96
|
+
| `${CLAUDE_PLUGIN_ROOT}` | Repo-relative path or `BUILD_LOOP_ROOT` | Under Codex this variable is unset. Resolve scripts/references relative to the repo root (`root="$(git rev-parse --show-toplevel)"`), or export `BUILD_LOOP_ROOT=<path-to-build-loop>` and substitute it. Every `${CLAUDE_PLUGIN_ROOT}/…` invocation in this file has a working `"$root"/…` or `"$BUILD_LOOP_ROOT"/…` equivalent. |
|
|
97
|
+
|
|
98
|
+
When a primitive is unavailable and no equivalent applies, do not silently skip the step — record it as not-run and surface it in the end-of-run readback so the dispatching parent (or the user) can complete it.
|
|
99
|
+
|
|
81
100
|
## Core Principles
|
|
82
101
|
|
|
83
102
|
- **KISS + DRY — code and output (governing).** Before adding a rule, gate, schema, script, agent, or report section, first try to (a) delete something, (b) extend something that exists, or (c) do nothing. A new mechanism must earn its place against a *named, observed* failure in this repo — not a cited statistic. Prefer one rule covering many cases over many narrow rules; one source of truth over duplicated logic. For output: say it once in the fewest words that keep the evidence; omit empty sections; headline first. Fewer rules and fewer lines is the default; growth is the justified exception. When this tensions with the principles below, simplify. **Every issue is a systems issue:** when something doesn't work, debugging finishes only when the *system* is updated so the class can't recur (durable guidance/check/simplification/restructure addressing root cause + meta-point, never a surface patch). Default corrective move is to reduce complexity (fewer lines/deps/steps) or, when size is irreducible, better structure (split large files, progressive disclosure) to minimize cognitive load. Scalable means simple over compact — every node (rule, script, agent, step, dep) is a failure site.
|
|
@@ -91,7 +110,7 @@ These run parameters apply on any host — pass them on the invocation (`--flag`
|
|
|
91
110
|
- **No false data.** No mock data in production. No hardcoded metrics pretending to be real. No unverified claims.
|
|
92
111
|
- **Name every UI input and output.** For UI work, every affected surface must have an input/output contract before component choices are locked: data taxonomy, CRUD/domain operation, component mapping, states, modality fallback, validation/security, and traceability.
|
|
93
112
|
- **Diagnose before fixing.** Root-cause analysis before code changes. Many errors sharing a pattern = one system problem.
|
|
94
|
-
- **C-RCA / root_cause_before_done — investigate every open issue to root cause before "done," verified by a second subagent.** Before any completion claim, investigate EVERY open issue — failed tests, loose ends, errors, warnings, minor issues — none left unaddressed. For each, reach the ROOT CAUSE, not a surface patch. Use debugging skills (debug-loop / root-cause-investigator / systematic-debugging) and/or a 5-whys / causal-tree analysis to find the true cause AND its full span (does the same root cause affect other sites? fix all of them). The fix MUST address the root cause — a surface/symptom patch is a violation. The root-cause identification, fix, and non-regression MUST be verified by an independent subagent before "done." Pairs with C-HEAL (reactive self-heal) and the verify-every-subagent rule.
|
|
113
|
+
- **C-RCA / root_cause_before_done — investigate every open issue to root cause before "done," verified by a second subagent.** Before any completion claim, investigate EVERY open issue — failed tests, loose ends, errors, warnings, minor issues — none left unaddressed. For each, reach the ROOT CAUSE, not a surface patch. Use debugging skills (debug-loop / root-cause-investigator / systematic-debugging) and/or a 5-whys / causal-tree analysis to find the true cause AND its full span (does the same root cause affect other sites? fix all of them). The fix MUST address the root cause — a surface/symptom patch is a violation. The root-cause identification, fix, and non-regression MUST be verified by an independent subagent before "done." **Closure test (counterfactual):** not closed at "an actionable control" — closed only when the named lever would have prevented/detected/contained THIS exact failure on the real input (not a hand-constructed one); a control that exists but is dormant on the real signal does not count. **Fix strength:** prefer the strongest feasible control — eliminate → impossible-state → automated-block → detect → contain → decision-support → docs — over the reflex "add a detect-gate"; a dependency you don't own is never "ignore it" (isolate / validate / monitor / degrade / escalate / accept-residual-risk explicitly). Pairs with C-HEAL (reactive self-heal) and the verify-every-subagent rule.
|
|
95
114
|
- **Research persistent problems, don't just retry.** When a fix doesn't hold, the same Iterate criterion fails 2+ times, or behavior contradicts your model, stop guessing and do internet research from trusted sources (T1 official docs and issue trackers first) before another attempt. `root-cause-investigator` carries WebSearch for exactly this. A documented upstream bug or library/terminal behavior often explains an "impossible" intermittent failure faster than another local loop — and prevents shipping a layered workaround over a known root cause. Mark confidence on what you find (✅ T1 cited / ⚠️ inferred).
|
|
96
115
|
- **Hook policy.** Hooks are advisory and non-blocking by default. Stop hooks must emit valid JSON on stdout when they emit anything, must exit 0, and must not stop work for reminders such as dirty worktrees, coordination notes, missing optional telemetry, or cache maintenance. Blocking is reserved for explicit safety/security/integrity gates: destructive actions, secret exposure, protected push/deploy/publish/release gates, or the self-modification safety gate. If a Stop hook needs blocking behavior, it must be behind an explicit opt-in and explain the exact safety boundary.
|
|
97
116
|
- **Converge or escalate.** If iteration isn't improving scores, stop and surface the blocker. Don't burn cycles.
|
|
@@ -132,7 +151,9 @@ Run once at the Phase 1 preamble, immediately after `run_id` is known and before
|
|
|
132
151
|
--workdir "$PWD" --query "<goal-keywords>" \
|
|
133
152
|
--output "$PWD/.build-loop/context-bootstrap.json" --json
|
|
134
153
|
```
|
|
135
|
-
The packet covers: canonical `build-loop-memory` root/project `MEMORY.md` + `constitution.md`, indexed recall via `memory_facade.py`, repo-local `.build-loop/{feedback,state,goal,intent,plan}` files, Codex memory registry `~/.codex/memories/MEMORY.md` plus linked rollout summaries, best-effort Rally/coordination state, **queue counts + top items** (`queues.{issues,backlog,ux-queue,followup,proposals}.{count,top[]}`), **progressive lessons** (`lessons_progressive[]` — SQLite FTS5, scoped to current work, zero external deps; degrades gracefully when DB absent), and `session_prefs`.
|
|
154
|
+
The packet covers: canonical `build-loop-memory` root/project `MEMORY.md` + `constitution.md`, indexed recall via `memory_facade.py`, repo-local `.build-loop/{feedback,state,goal,intent,plan}` files, Codex memory registry `~/.codex/memories/MEMORY.md` plus linked rollout summaries, best-effort Rally/coordination state, **queue counts + top items** (`queues.{issues,backlog,ux-queue,followup,proposals}.{count,top[]}`), a **backlog summary** (`backlog.{open_p01,stale,gated}` from `.build-loop/backlog/INDEX.md` when present), **progressive lessons** (`lessons_progressive[]` — SQLite FTS5, scoped to current work, zero external deps; degrades gracefully when DB absent), and `session_prefs`.
|
|
155
|
+
|
|
156
|
+
**Backlog system (host-neutral, any agent).** Deferred-but-wanted work lives in `<repo>/.build-loop/backlog/` as plain Markdown+YAML items (`items/<ID>.md`, canonical truth) with a regenerated `INDEX.md` (derived view). Read it with `cat <repo>/BACKLOG.md` → `INDEX.md` → `grep` over `items/*.md`; write it with `python3 ${RUNTIME_PLUGIN_ROOT}/scripts/backlog.py {new,sync,list} --repo <path>` (pure stdlib — runs under bare `python3`, no host SDK). `sync` regenerates INDEX deterministically, archives done/dropped (never deletes), flags past-`review_by` items, and mirrors active items one-way into the user's personal memory (`build-loop-memory/projects/<slug>/backlog/`) for a cross-repo view. Full convention, schema, and lifecycle: `references/backlog-system.md`.
|
|
136
157
|
3. **Surface + ask once** (immediately after reading the packet):
|
|
137
158
|
- Read `packet.agent_brief` for the one-liner summary, then check each queue: if any `queues.*.count > 0`, emit `#issues=N #backlog=M …` plus the top item titles from `queues.*.top[0].title`.
|
|
138
159
|
- Surface `lessons_progressive[].name` (up to 3) as ambient context so planning reflects recent learnings.
|
|
@@ -161,11 +182,13 @@ Multiple build-loop sessions can run concurrently against the same project acros
|
|
|
161
182
|
|
|
162
183
|
1. **Write presence and intent at the Phase 1 preamble** (immediately after `run_id` is known), and refresh it at each phase-start. Preferred Rust path:
|
|
163
184
|
```bash
|
|
164
|
-
rally
|
|
185
|
+
rally enter --tool codex --json
|
|
186
|
+
rally say presence --tool codex --subject "phase=assess" --json
|
|
165
187
|
```
|
|
166
188
|
When files are owned, include one `--path` per file or directory so Rally creates explicit file claims:
|
|
167
189
|
```bash
|
|
168
|
-
rally
|
|
190
|
+
rally enter --tool codex --path "src/app.ts" --json
|
|
191
|
+
rally say claim --tool codex --subject "phase=execute" --path "src/app.ts" --json
|
|
169
192
|
```
|
|
170
193
|
Embedded fallback path when the Rust `rally` binary is unavailable:
|
|
171
194
|
```python
|
|
@@ -179,7 +202,7 @@ Multiple build-loop sessions can run concurrently against the same project acros
|
|
|
179
202
|
model="<model>", run_id="$RUN_ID", app_slug=slug,
|
|
180
203
|
phase="assess", files_in_flight=[])
|
|
181
204
|
```
|
|
182
|
-
`tool` values: `claude_code | codex | gemini | other`. Resolve the channel through `discovery_bridge.resolve(...)` before every direct write. Rust-backed channels use `rally
|
|
205
|
+
`tool` values: `claude_code | codex | gemini | other`. Resolve the channel through `discovery_bridge.resolve(...)` before every direct write. Rust-backed channels use `rally enter` / `rally stop`; embedded fallback writes one file per live session at `<resolved-channel>/sessions/<session-id>.json` (session_id, tool, model, run_id, app_slug, phase, files_in_flight, heartbeat_ts, read cursor). Fire-and-forget — never raises, never blocks.
|
|
183
206
|
2. **Read active peers** at the preamble and each phase-start:
|
|
184
207
|
```python
|
|
185
208
|
peers = presence.read_active_presence(channel, exclude_session="<sid>")
|
|
@@ -189,7 +212,7 @@ Multiple build-loop sessions can run concurrently against the same project acros
|
|
|
189
212
|
- No peers / no `files_in_flight` overlap → log one line per peer (tool, run_id, phase); proceed.
|
|
190
213
|
- Overlap with a peer's `files_in_flight` → surface a `soft-claim` **WARNING** (peer, overlapping files, peer phase); proceed with awareness. Interactive hosts MAY additionally ask the user to coordinate; headless hosts (Codex / cron) log + proceed. There is no SAFE-STOP sentinel and no non-zero exit.
|
|
191
214
|
4. **Refresh presence** at every phase-start and whenever the phase's owned files change — re-call `write_presence` with the new `phase` + `files_in_flight` (the per-session read cursor is preserved across refreshes).
|
|
192
|
-
5. **Stop explicitly.** On Rust-backed channels, run `rally stop <
|
|
215
|
+
5. **Stop explicitly.** On Rust-backed channels, run `rally stop <session|name|tool> --json` when the session ends or file ownership changes materially. This clears presence for the selected session/name/tool and releases active claims. Embedded fallback still self-heals with `reap_stale` when a host exits without unregistering.
|
|
193
216
|
6. **Memory writes (M5 — separate concern)** — use `scripts/memory_writer.py write` instead of writing memory files directly. The writer adds provenance frontmatter (source_repo, source_workdir, source_run_id, source_host, cross_repo_validated, applied_in_repos, created_at, last_updated_at), then atomically appends a row to `INDEX.jsonl` for sibling discovery:
|
|
194
217
|
```
|
|
195
218
|
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py write \
|
|
@@ -197,6 +220,13 @@ Multiple build-loop sessions can run concurrently against the same project acros
|
|
|
197
220
|
--type feedback --run-id "$RUN_ID" --workdir "$PWD" --host codex \
|
|
198
221
|
--body-file /tmp/memory-body.md
|
|
199
222
|
```
|
|
223
|
+
Codex-specific guard: `apply_patch` has no shell `workdir`; relative patch
|
|
224
|
+
paths target the active workspace. For direct cross-repo memory repairs, use
|
|
225
|
+
absolute `apply_patch` paths, or write through `memory_writer.py`. If a file
|
|
226
|
+
was already exposed as a Codex file card and then moved to canonical memory,
|
|
227
|
+
leave an openable pointer, mirror, or stub at the old path and update any
|
|
228
|
+
dependent indexes/links so Finder and Codex file cards do not point at a
|
|
229
|
+
missing path.
|
|
200
230
|
7. **Memory reads (cross-session discovery)** — between phases, tail the index for new peer learnings:
|
|
201
231
|
```
|
|
202
232
|
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_index.py tail \
|
|
@@ -261,7 +291,7 @@ Full provider substitution table (Thinking / Code / Pattern → each host's mode
|
|
|
261
291
|
- Break work into tasks with exact file paths
|
|
262
292
|
- Identify dependency order — what must complete before what?
|
|
263
293
|
- Flag parallel-safe groups: files that don't import each other can be written simultaneously
|
|
264
|
-
- Partition files and agents MECE: every changed file has exactly one owner, every required responsibility has an owner, and each group declares `owns`, `does not own`, `interface contract`,
|
|
294
|
+
- Partition files and agents MECE: every changed file has exactly one owner, every required responsibility has an owner, and each group declares all seven ownership fields — `owns`, `does not own`, `interface contract`, `integration checkpoint`, `allowed tools`, `denied tools`, and `acceptance criteria` (the testable conditions the returning envelope must satisfy — the verifier's per-chunk oracle)
|
|
265
295
|
- Define checkpoints where work should be verified before continuing
|
|
266
296
|
- Optimize: remove unnecessary steps, combine related changes, eliminate redundant work
|
|
267
297
|
- **Two-lens approach gate**: for non-trivial architecture, workflow, dependency, UI/product, or long-lived interface decisions, add a `## Approach Lenses` section before implementation tasks. It must include:
|
|
@@ -308,7 +338,7 @@ Wire all three surfaces (`skills/build-loop/SKILL.md`, `agents/build-orchestrato
|
|
|
308
338
|
### Phase 3: Execute
|
|
309
339
|
|
|
310
340
|
- Dispatch parallel work for independent file groups
|
|
311
|
-
- Each worker gets minimal context + integration contract (what interfaces to implement) + an intent packet explaining how the subtask fits the north star + a MECE ownership packet defining owned files, non-owned files, interface contracts, and
|
|
341
|
+
- Each worker gets minimal context + integration contract (what interfaces to implement) + an intent packet explaining how the subtask fits the north star + a MECE ownership packet defining all seven fields: owned files, non-owned files, interface contracts, integration checkpoints, allowed tools, denied tools, and acceptance criteria (the testable conditions the returning envelope must satisfy — the verifier's per-chunk oracle)
|
|
312
342
|
- If the host supports typed subagents, map read-only codebase questions to explorer-style agents and disjoint implementation slices to worker-style agents. If the host requires explicit user authorization for subagents, identify parallel-safe groups but execute locally unless the user asked for delegation, parallelization, workers, or a `--parallel` mode.
|
|
313
343
|
- **Single-entry routing (host-neutral):** every coding task enters through one build-loop invocation; the runtime auto-classifies intent (build / optimize / research / debug / test) and routes accordingly. The host does not pick a mode — classification is internal. This applies equally across coding hosts (Claude Code, Codex, Cursor, Gemini CLI, others).
|
|
314
344
|
- **Subagent scaling (host-neutral):** when the host supports parallel delegation (e.g. Codex with `--parallel` authorization), dispatch up to `scripts/parallelism.py effective_max_implementers()` workers — machine-aware cap, default 8, ceiling 12 — decomposing work into the maximum number of independent MECE chunks. The permission gate still applies: workers only on explicit `--parallel` / delegation authorization. When parallel delegation is unavailable, execute sequentially without asking.
|
|
@@ -342,6 +372,18 @@ The `synthesis_attestation` map MUST have one entry per dimension named in the p
|
|
|
342
372
|
|
|
343
373
|
Seven ordered sub-steps; intermediate failures route to Iterate, final pass writes Report artifacts.
|
|
344
374
|
|
|
375
|
+
**Verifier contract matrix (Codex parity).** Each review verifier has a required output shape, a routing effect, and a rule for whether inline Codex execution is valid. Mirror `skills/build-loop/references/codex-subagents.md` (role mapping) and `skills/build-loop/references/phase-4-review.md`.
|
|
376
|
+
|
|
377
|
+
| Verifier | When | Required output | Routing effect | Inline Codex valid? |
|
|
378
|
+
|---|---|---|---|---|
|
|
379
|
+
| **Critic (independent-auditor)** | every non-trivial build (Sub-step A) | JSON envelope: `verdict ∈ {yay, nay, suggest_correction, look_again}` + `findings[]` (`severity: critical\|high\|medium\|low`) | `nay`/critical+high route to Iterate; advisory at chunk close, gating at build scope | **Inline self-review is NEVER recorded as `independent-auditor`** (per `skills/build-loop/references/phase-4-review.md` §20). A lead session inline-reasoning IS valid review work, but it must NOT be written to `judge-decisions.json` with `judge_id: independent-auditor`, and a `scope=build` code-touching run must report `outcome: partial` (not `pass`) when no real dispatched/peer auditor ran. Record `auditor_status` honestly: `ran:dispatched-agent` / `ran:peer-host(<host>)` / `not-run:parent-must-dispatch`. |
|
|
380
|
+
| **Validate (graders)** | every build (Sub-step B) | scorecard rows: criterion · method · PASS/FAIL · evidence | any FAIL routes to Iterate | Yes — code-based graders (test/lint/type/build) run inline in the lead session. UI validation must use a real visual/AX surface, never symbol-only checks. |
|
|
381
|
+
| **Fact-Check** | every build (Sub-step D) | per-claim trace: metric → source, or `unverifiable` | unverifiable rendered number is **blocking** → Iterate | Yes — runs inline; it is a read-and-trace pass, no dedicated agent required. |
|
|
382
|
+
| **Mock-Scanner** | every build (Sub-step D) | findings: path · pattern · `blocking\|warning` | blocking (renders to user) → Iterate | Yes — inline grep/scan of production paths. |
|
|
383
|
+
| **Security-Reviewer** | only when Assess flagged a risk-surface change (Sub-step A) | findings vs OWASP LLM/Agentic/Web top-10, severity-tagged | critical/high feed the no-critical/high exit gate (blocking) | Yes inline, OR a cross-vendor peer when `cross_vendor_required` and a peer host is reachable; if neither, record `cross_vendor: untested` — never claim it ran. |
|
|
384
|
+
|
|
385
|
+
**The inline-self-review rule is the load-bearing one:** a solicited inline pass agreeing with the lead is not independent validation. Dispatch a real auditor (Agent tool), run it as a peer process (`codex exec` / rally handoff), or mark the run `not-run:parent-must-dispatch` so the parent that *does* have the dispatch capability completes the audit before Report finalizes.
|
|
386
|
+
|
|
345
387
|
**Sub-step A — Critic (adversarial read-only)**: perform a read-only adversarial review of the diff — inline in the lead session, or via an authorized explorer when delegation is permitted. This is the independent-auditor pass: render one of four verdicts (`yay` approve / `nay` reject / `suggest_correction` / `look_again`) gathering context from intent, goal, PRD, constitution. Catch scope drift, missed edge cases, rubric violations before spending tokens on full validation. **When Assess flagged a risk-surface change** (new auth, network, persistence, secrets, or external-input surface), also run a security review in this sub-step against OWASP LLM/Agentic/Web top-10 — its critical/high findings feed the no-critical/high exit gate and are blocking. Strong-checkpoint findings route back to Execute (no iteration burn); guidance findings are logged.
|
|
346
388
|
|
|
347
389
|
**Sub-step A.5 — Synthesis-decision backstops (post-implementer-commit, runs before B):**
|
|
@@ -454,7 +496,9 @@ Build loop stores state in `.build-loop/` within the project directory:
|
|
|
454
496
|
├── followup/ # Overflow when iteration cap hit; input to subsequent build
|
|
455
497
|
│ └── <topic>.md
|
|
456
498
|
├── backlog/ # Deferred-but-wanted work (drained by end-of-run continuation)
|
|
457
|
-
│
|
|
499
|
+
│ ├── INDEX.md # DERIVED view — regenerated by `scripts/backlog.py sync`; do not hand-edit
|
|
500
|
+
│ ├── items/<ID>.md # CANONICAL items — host-neutral MD+YAML (id/status/priority/type/area/gated/provenance/evidence/review_by)
|
|
501
|
+
│ └── archive/<ID>.md # done/dropped items (never deleted)
|
|
458
502
|
├── evals/ # Scorecard archives
|
|
459
503
|
│ └── YYYY-MM-DD-*.md
|
|
460
504
|
└── issues/ # Discovered issues (drained by end-of-run continuation)
|
|
@@ -490,11 +534,20 @@ When a run created zero refs: `Branch hygiene: clean — no run-created branches
|
|
|
490
534
|
|
|
491
535
|
**Structural run-close (Stop hook).** Phase D above is the orchestrator path. An INLINE run (skill-as-methodology, no orchestrator dispatch) never reaches it, so a host `Stop` hook fires the minimum structural closeout with no human prompt — `hooks/closeout.sh stop` → `scripts/stop_closeout.py`:
|
|
492
536
|
|
|
493
|
-
1. **Record + surface.** Records the run via `append_run.py` (so Phase 6 Learn's `runs[]` sees it) and runs `judgment_gate.py --agent-tool-available false`, surfacing a WARN `systemMessage` when a stakes-gated run skipped the Frontier judgment layer. A Stop hook cannot dispatch agents, so it auto-records + auto-surfaces the gap — it does not run the retrospective-synthesizer or memory closeout; it leaves `.build-loop/closeout-pending/<run-id>.md` for the next SessionStart (`hooks/closeout.sh session-start`) to surface once.
|
|
537
|
+
1. **Record + surface.** Records the run via `append_run.py` (so Phase 6 Learn's `runs[]` sees it) and runs `judgment_gate.py --agent-tool-available false`, surfacing a WARN `systemMessage` when a stakes-gated run skipped the Frontier judgment layer. A Stop hook cannot dispatch agents, so it auto-records + auto-surfaces the gap — it does not run the retrospective-synthesizer or memory closeout; it leaves `.build-loop/closeout-pending/<run-id>.md` for the next SessionStart (`hooks/closeout.sh session-start`) to surface once. A terminal (`pass`) record also releases the run identity — the `execution` block is archived to `historicalExecutions` and cleared — so the next inline effort mints a fresh `build_loop_id` instead of silently resuming a finished run (partial/blocked outcomes keep identity for crash-resume).
|
|
494
538
|
|
|
495
539
|
2. **Contract.** Advisory + fail-open (always exit 0, never `decision: block`), self-gated on `.build-loop/` presence + this-session match (`current_session_id`, heartbeat-freshness fallback when the host passes no session id), minimal-PATH safe, idempotent with Phase D — the marker is the inline-path sentinel and `runs[]` membership is the Phase-D sentinel, so neither double-records the other. Tests: `scripts/test_stop_closeout.py` + `hooks/test_closeout.sh`.
|
|
496
540
|
|
|
497
|
-
3. **Codex wiring.** Both hosts ship in-repo: Claude via `hooks/hooks.json`, Codex via the tracked `.codex/hooks.json` — `Stop` and `SessionStart` entries call the same shim (`root="$(git rev-parse --show-toplevel)"; bash "$root/hooks/closeout.sh" stop`).
|
|
541
|
+
3. **Codex wiring.** Both hosts ship in-repo: Claude via `hooks/hooks.json`, Codex via the tracked `.codex/hooks.json` — `Stop` and `SessionStart` entries call the same shim (`root="$(git rev-parse --show-toplevel)"; bash "$root/hooks/closeout.sh" stop`). ⚠ VERIFIED DORMANT under `codex exec` 0.139.0 (live probe 2026-06-12, `--dangerously-bypass-hook-trust`): codex fired global/built-in hooks but never the repo-level file. Until codex honors repo-level hooks, the working Codex path is the global `~/.codex/hooks.json` (the shim self-gates on `.build-loop/`, so a global install is safe — but global installs are user-opt-in, not shipped).
|
|
542
|
+
|
|
543
|
+
**Codex closeout + run-recording fallbacks (do these MANUALLY when hooks do not fire).** Because repo-level Codex hooks are dormant under `codex exec` (verified above), the `Stop`/`SessionStart` shim that auto-records a run does NOT run on its own in a Codex session. Unless the global `~/.codex/hooks.json` is installed AND confirmed firing, a Codex run must perform these steps by hand before declaring the run done (resolve `${RUNTIME_PLUGIN_ROOT}` to the build-loop repo root — see the Codex Execution Adapter):
|
|
544
|
+
|
|
545
|
+
1. **Append the run record** — `python3 "$root"/scripts/append_run.py …` so Phase 6 Learn's `runs[]` sees this run. Without it, the run is invisible to the recurring-pattern detector and the milestone log.
|
|
546
|
+
2. **Run the judgment gate** — `python3 "$root"/scripts/judgment_gate.py --workdir "$PWD" --run-id <run-id> --agent-tool-available false --json`. On a stakes-gated run that stayed at the inline floor, it surfaces the skipped-Frontier-judgment WARN that the Stop hook would otherwise have surfaced.
|
|
547
|
+
3. **Write the closeout status** — record `state.json.runs[N].closeout_status` (and the inline-path marker `.build-loop/closeout-pending/<run-id>.md` if a follow-up surface is needed), matching what `stop_closeout.py` would have written.
|
|
548
|
+
4. **Phase 6 Learn recording** — run the cheap detector + consolidation and emit the `## Learn` outcome line (accruing / deferred / full) explicitly; it does not auto-fire without the hook.
|
|
549
|
+
|
|
550
|
+
These are idempotent with the hook path (the marker is the inline sentinel; `runs[]` membership is the Phase-D sentinel), so a later host that DOES fire the hook will not double-record. The rule: **never let "the hook will catch it" stand in for run recording under Codex** — confirm the hook fired, or do the four steps by hand.
|
|
498
551
|
|
|
499
552
|
## Post-Build
|
|
500
553
|
|