Collaboration record (conductor loop, docs/plans/CONDUCTOR.md): - round 1 (worker session worker-1, 2m28s): retry implemented per spec - conductor live test exposed spec gap: direct invocation lacked launcher env exports - round 2 (same worker session, 59s): spawnEnv made self-sufficient, but used PI_* where compose interpolates MOSAIC_* - conductor hotfix: 3-line rename to MOSAIC_PROVIDER/MOSAIC_MODEL/ MOSAIC_DATA_ROOT Final: node scripts/mosaic-task.mjs retry <runId> re-executes a run's task snapshot as a new run; live retry replied REMEMBERED; all suites green (24/32/14 + verify). Known limitation: retrying a run whose task used a RELATIVE mission path resolves it against the temp dir; lineage tracking deferred. Closes #25, closes #26, closes #27
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
# Conductor protocol — poor-man orchestration loop
|
||||
|
||||
How the stack orchestrates headless pi workers to do work on itself.
|
||||
|
||||
## Roles
|
||||
|
||||
| Role | Runs where | Powers | Never has |
|
||||
|---|---|---|---|
|
||||
| **Conductor** | host (assistant or owner) | git (clone/commit/push), task dispatch, review, verification suites, Gitea | nothing new |
|
||||
| **Worker** | container (headless pi via `scripts/run-task.sh`) | read/write/edit/bash inside its workspace; persistent session on request | git credentials, docker socket, host filesystem |
|
||||
|
||||
## The loop
|
||||
|
||||
1. **Decompose**: conductor turns a goal into worker tasks small enough to
|
||||
specify completely in one prompt (file paths, acceptance criteria, style
|
||||
constraints, verification the worker can run itself, e.g. `node --check`).
|
||||
2. **Mirror**: conductor maintains the repo clone at
|
||||
`<dataRoot>/workspaces/stack-repo` (host-side git; workers see it read-write
|
||||
through their workspace mount).
|
||||
3. **Dispatch**: `scripts/run-task.sh run <worker-task.json>` — worker edits the
|
||||
clone. Session name `worker-<n>` keeps continuity across refinement rounds.
|
||||
4. **Extract**: `git -C <workspace> diff > patch` — the worker's entire output
|
||||
is a reviewable diff. Run record (result.json, stderr.txt) is the receipt.
|
||||
5. **Review**: conductor reads the diff line by line. Bad output → refine the
|
||||
prompt, re-dispatch (same session: "your patch had these problems…").
|
||||
6. **Integrate**: conductor applies the patch to the real repo, runs the full
|
||||
suites, commits and pushes. Suites failing → revert apply, back to step 5.
|
||||
7. **Record**: update CURRENT.md, BUILD-LOG, close the Gitea issue.
|
||||
|
||||
## Guardrails
|
||||
|
||||
- Workers never receive credentials; they never run git; they never leave the
|
||||
workspace (container is the boundary; tools allowlist is the gate).
|
||||
- Every worker diff is reviewed by the conductor before integration. No
|
||||
auto-apply. (Auto-apply would be a capability-policy decision for later.)
|
||||
- Verification is mechanical: suites + `node --check` / `bash -n` gates.
|
||||
- Recursive decomposition = "fail → smaller task", never "hope."
|
||||
|
||||
## Worker task template
|
||||
|
||||
```json
|
||||
{
|
||||
"taskVersion": 1,
|
||||
"id": "t-worker-<name>",
|
||||
"prompt": "<full spec: goal, files, constraints, acceptance, self-checks>",
|
||||
"workspace": "stack-repo",
|
||||
"capabilities": { "tools": ["read", "write", "edit", "bash"] },
|
||||
"session": "worker-1",
|
||||
"timeoutSeconds": 600
|
||||
}
|
||||
```
|
||||
@@ -11,9 +11,9 @@ Gitea issue: (none queued — awaiting owner direction)
|
||||
|
||||
## Queue (ordered, not started)
|
||||
|
||||
1. Owner review of M5–M7 (workspaces, capabilities, sessions) — hands-on
|
||||
2. M8 candidate: mission-level capability policy (defaults per mission)
|
||||
3. M9 candidate: run-record retention + `retry <runId>` convenience
|
||||
1. Owner review of M5–M8 (workspaces, capabilities, sessions, conductor loop)
|
||||
2. M8 follow-up: retry lineage (retriedFrom field) + relative-mission-path retry limitation
|
||||
3. M9 candidates: mission-level capability policy; run-record retention; decision on auto-apply policy for worker patches
|
||||
|
||||
## Rules
|
||||
|
||||
@@ -30,3 +30,4 @@ Gitea issue: (none queued — awaiting owner direction)
|
||||
- 2026-09-03 — M5 workspaces + capability envelope (#20, #21) — merged, tests green
|
||||
- 2026-09-03 — M6 named sessions + resume (#22, #23) — merged, teach/recall verified
|
||||
- 2026-09-03 — M7 run inspection + release 0.0.6 (#24) — merged, activated
|
||||
- 2026-09-03 — M8 conductor loop + worker-built retry (#25, #26, #27) — merged; worker authored retry in 2 refinement rounds, conductor fixed a 3-line interpolation rename; live retry verified
|
||||
|
||||
Reference in New Issue
Block a user