diff --git a/BUILD-LOG.md b/BUILD-LOG.md index 5ff4c6f9..7eac6f10 100644 --- a/BUILD-LOG.md +++ b/BUILD-LOG.md @@ -137,4 +137,30 @@ All 11 acceptance criteria demonstrated. The real model request passed. Configuration-driven Hello World verified. `main` merged with M1 and tagged `config-hello-v1`. +--- + +## Phase 6: Mission and task abstraction (M2) + +### Entry 6.1 — before + +- Timestamp: 2026-09-03 +- Intended action: Add the first mission/task layer, host-side only (Gitea milestone M2, issues #6-#9): strict v1 schemas for missions and tasks, a task runner executing through the proven config-driven container path, immutable write-once run records under `/runs/`, `expectExact` gating, timeouts, selftests, fixtures, and docs. +- Reason: The foundation plan's following layer — mission (objective + directives), task (bounded unit), run (one attempt), result (immutable evidence) — must exist as data and records before any policy or multi-agent work. +- Expected result: `scripts/run-task.sh tasks/hello-marker.json` succeeds with exactly `MOSAIC_HELLO_OK`; wrong expectations fail; every run leaves an immutable record; configuration remains untouched. + +### Entry 6.2 — after + +- Timestamp: 2026-09-03 +- Commands run: `scripts/test-task.sh` (18 cases incl. live runs); `scripts/run-task.sh validate` / `run` on committed fixtures; `node scripts/mosaic-task.mjs list`; config checksum comparison across runs. +- Observed result: + - Selftests: 18 passed, 0 failed (schema negatives; live exact-marker success; wrong expectExact fails; distinct run dirs; result.json contents; list). + - Fixture run: status `succeeded`, response exactly `MOSAIC_HELLO_OK`, mission snapshot recorded. + - Run records written once under `/runs/r--/`; reruns never clobber. +- Failure or correction: none this phase. +- Credential check: no credential material in task data, run records, or logs. + +## Result (M2) + +Mission/task layer verified end-to-end. `main` merged with M2 and tagged `mission-task-v1`. + diff --git a/README.md b/README.md index 3c062c92..5d608c30 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,28 @@ Rules enforced by `scripts/mosaic-config.mjs`: Run paths (`build/hello/verify/reset`) fail closed when configuration is missing or invalid; they never invent it. +## Missions & tasks (M2) + +Missions and tasks are validated JSON data (strict schemas, version-pinned). The M2 layer is host-side only: mission directives are recorded for provenance but do not yet reach the runtime system prompt (capability/policy layer comes later). + +```text +missions/hello.json objective + directives (missionVersion 1) +tasks/hello-marker.json prompt + optional mission ref + expectExact + timeout +/runs/r-/ immutable run record: task.json, mission.json, + stderr.txt, result.json (all write-once) +``` + +Usage: + +```bash +scripts/run-task.sh validate tasks/hello-marker.json # strict validation, writes nothing +scripts/run-task.sh run tasks/hello-marker.json # execute; result recorded under dataRoot/runs +scripts/mosaic-task.mjs list # list runs and statuses +scripts/test-task.sh # selftests (schema negatives + live runs) +``` + +A run exits 0 only when its expectation is met (`expectExact` match); mismatches, nonzero agent exits, and timeouts record `status: failed` in `result.json` and exit 1. Each run gets a unique directory — rerunning never rewrites history. + See `docs/plans/2026-09-02_atomic-mosaic-foundation.md` for the full plan. Inside the container: @@ -93,7 +115,9 @@ scripts/bootstrap.sh # create config.json if absent (idempotent) scripts/build.sh # build the image scripts/hello.sh # one-shot request; prints the model response scripts/verify.sh # full gated test; exit 0 only on exact MOSAIC_HELLO_OK +scripts/run-task.sh # run a mission/task file (see Missions & tasks) scripts/test-config.sh # fast config-layer selftests (no Docker) +scripts/test-task.sh # mission/task selftests (schema + live runs) scripts/reset.sh # delete the configured data root (safety-checked) ```