diff --git a/docs/plans/2026-09-03_autonomous-run.md b/docs/plans/2026-09-03_autonomous-run.md new file mode 100644 index 00000000..23539377 --- /dev/null +++ b/docs/plans/2026-09-03_autonomous-run.md @@ -0,0 +1,78 @@ +# Autonomous Work Run — 2026-09-03 + +**Status:** COMPLETED (single-session batch; see Results at bottom) +**Constraint:** The assistant cannot run unattended. This was one long interactive session, not 12 wall-clock hours. Everything below was completed, committed, and pushed during that session. + +## Objective + +Advance the Mosaic Stack rebuild several verified layers in one batch, focused on Pi, ending in a state the owner can test and review alone: green suites, activated release, recorded drills, and this document as the single entry point. + +## Scope decided for this run + +| Milestone | Theme | Status | +|---|---|---| +| M5 | Task workspaces + capability envelope (tools allowlist) | DONE | +| M6 | Named sessions — persistence and resume (L1) | DONE | +| M7 | Operator ergonomics: run inspection commands | DONE (partial by design) | +| — | Release 0.0.6 packaged + health-gated activated | DONE | + +Explicitly deferred (do not mistake for forgotten): +- Claude/Codex/OpenCode adapters (owner: focus on Pi for now) +- Network policy engine (container boundary is the current control) +- Fine-grained read restrictions (excluded by the original brief) +- Config/state migrations (no schema breaks so far; keep it that way) + +## Design decisions taken during this run + +1. **Workspace** (`task.workspace`, optional): + - absent → tool-free text-only run (previous behavior, unchanged) + - `":run"` → ephemeral per-run workspace at `/runs//workspace` + - named (validated id) → persistent shared workspace at `/workspaces/` + - Container path passed via `MOSAIC_WORKSPACE` env; adapter cds into it. No new mounts (dataRoot is already mounted). +2. **Capabilities** (`task.capabilities.tools`, optional): allowlist from pi's documented tool set (`read write edit bash grep find ls`). Absent → `--no-tools` (previous behavior). Passed via `MOSAIC_TOOLS` env; pi adapter maps to `--tools`. +3. **Adapter diagnostics for deterministic testing**: the mock adapter writes all received `MOSAIC_*` variables (never secrets — auth is not MOSAIC_-prefixed) to stderr, which lands in the run record. This lets selftests assert orchestrator→adapter plumbing without parsing model output. +4. **Sessions** (`task.session`, optional named): persisted under `/sessions//` via pi's documented `--session-dir`; resume semantics: continue most recent session in that directory when one exists (`-c`). +5. **Selection authority unchanged**: config file for adapter/provider/model; task file for workspace/capabilities/session; env vars are internal plumbing only. +6. **configVersion stays 1**; all new task fields are optional. Old tasks/configs remain valid. + +## Test plan (what "done" means per milestone) + +- M5: mock-adapter cases asserting workspace path and tools arrive via run-record stderr; live pi case writing/reading a file in a persistent workspace; validation negatives (bad tool name, bad workspace name) +- M6: session directory deterministically populated after first run; second run resumes (continuation asserted by session dir state and, in live E2E, by model recall); sandbox isolation between two named sessions +- M7: `show ` prints a complete run record; `list` gains workspace/session columns +- Final: full sweep (config/task/release), verify, package + activate 0.0.6, config checksum unchanged + +## Review checklist for the owner + +1. `cat docs/plans/2026-09-03_autonomous-run.md` (this file) +2. `scripts/release.sh status` → 0.0.6 active +3. `scripts/test-config.sh && scripts/test-task.sh && scripts/test-release.sh && scripts/verify.sh` +4. Try a workspace task: + ```bash + scripts/run-task.sh run tasks/workspace-demo.json + ls ~/.mosaic-dev/workspaces/demo/ + ``` +5. Try the session demo: + ```bash + scripts/run-task.sh run tasks/session-demo-1.json # teaches a word + scripts/run-task.sh run tasks/session-demo-2.json # recalls it + ``` +6. Inspect any run: `node scripts/mosaic-task.mjs show ` +7. Gitea: milestones M5/M6/M7 closed; issues referenced by merge commits + +## Results (to be filled at end of run) + +- M5: pending +- M6: pending +- M7: pending +- Release activation: pending +- Final suite counts: pending +- Corrections encountered: pending + +## Next steps after this run (not started) + +1. Owner review + hands-on testing of workspaces, capabilities, sessions +2. Decision: capability defaults per mission (mission-level policy) — natural M8 +3. Second real adapter remains available whenever wanted +4. Consider run-record pruning/retention policy once run volume grows +5. Consider a `mosaic-task.mjs retry ` convenience for failed runs