Release 0.4.0: run state, supervisor seam, and bounded observation

This commit is contained in:
alex committed 2026-12-01 12:14:43 +00:00
1 parent d6a11b32e5
commit 8dd5fb0fad
2 files changed
+14 -1

No files matched your search

+13
View File
@@ -1,5 +1,18 @@
# Changelog
## [0.4.0] - 2026-12-01
The architecture deepening: first-class run state, a real supervisor seam, and bounded observation (spec #20).
- Split `workflow.ts`/`workflows.ts` into `workflow-plan.ts` (plan parsing, discovery, caps, expansion validation), `workflow-run.ts` (run spec, args/run-shape validation, interpolation, item split/join), and `workflow-command.ts` (the `/workflow` tokenizer, parser, formatter); rename the expanded plan to the start plan (`StartPlan`, `startPlan`, `toStartPlan`) per the glossary.
- Move the shared job/run state and status predicates into `src/job-state.ts`; the workflow supervisor owns only its DAG index over shared task records and reaches manager state exclusively through its host interface (effects only), with one cancellation policy (immediate abort, drain, settle queued and coordinator rows cancelled). `WorkflowRunSpec` requires a `limits` field captured from load-time config at prepare time — execution paths no longer read `process.env` — and restore no longer fabricates `AgentConfig` records.
- Project the workflow journal from run state at the terminal transition instead of reverse-engineering the step/item graph from flat snapshots; the record's shape and meaning for equivalent runs are unchanged (ADR 0004).
- Own the step and persisted shapes with TypeBox schemas: `WorkflowStep`/`WorkflowPlan` are `Static<>` of schemas beside the parser and validate via `Value.Check`; `TaskSnapshot`, `JobSnapshot`, and the journal record live in `schemas.ts`; the hand-written persistence validators are gone; journal input hashes cover whole plan steps under payload version 2, so a new step field changes the hash by default.
- Bound observation: `onJobChange` becomes `onJobEvent({ jobId, kind })`; persistence writes a small start entry plus the checkpoint at the terminal transition, never per transition (ADR 0004 amendment); snapshots are cached lazily and rebuilt only on change; runner updates carry the appended message instead of cloning transcripts; a 256-child scale property pins O(1) persisted entries per run.
- `subagent_jobs wait` on a run returns the consolidated answer — run status, a per-step one-line summary, and the last succeeded step's bounded output (status and error when none succeeded) — byte-identical to the ultra completion notice, with `get` keeping the full snapshot as the explicit verbose path (ADR 0006 amendment). Restored runs answer `wait` from their persisted journal; a run in flight at crash time restores as `interrupted` with no task rows.
- Collect the presentation rules in `src/present.ts` — one skipped format, one failed-body composition, one task-label format, one start formatter — with the TUI renderer, `job-format`, and the dashboard as thin adapters that keep their layouts; the `subagent` tool no longer reaches into the TUI renderer for predicates; the unreachable workflow result renderer is deleted.
- Wait results are tagged (`kind: "job" | "run"`), FIFO-queued cancellations pin single finalization, and skip reasons are stored bare with their format owned by the rulebook.
## [0.3.0] - 2026-11-30
Live subagent dashboard, 16 default workers, and the ultra layer (spec #14).
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "pi-subagent",
"version": "0.3.0",
"version": "0.4.0",
"description": "Synchronous and asynchronous subagents for Pi.",
"type": "module",
"keywords": ["pi-package"],