7.4 KiB
7.4 KiB
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.tsintoworkflow-plan.ts(plan parsing, discovery, caps, expansion validation),workflow-run.ts(run spec, args/run-shape validation, interpolation, item split/join), andworkflow-command.ts(the/workflowtokenizer, 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).WorkflowRunSpecrequires alimitsfield captured from load-time config at prepare time — execution paths no longer readprocess.env— and restore no longer fabricatesAgentConfigrecords. - 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/WorkflowPlanareStatic<>of schemas beside the parser and validate viaValue.Check;TaskSnapshot,JobSnapshot, and the journal record live inschemas.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:
onJobChangebecomesonJobEvent({ 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 waiton 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, withgetkeeping the full snapshot as the explicit verbose path (ADR 0006 amendment). Restored runs answerwaitfrom their persisted journal; a run in flight at crash time restores asinterruptedwith 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; thesubagenttool 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).
- Increase the default global worker limit from 4 to 16;
PI_SUBAGENT_MAX_WORKERSoverrides and the 1 to 32 validation range are unchanged. - Replace TUI
/subagentsnotifications with a live, keyboard-driven dashboard for job navigation, per-task activity, output, usage, filtering, expansion, and confirmed cancellation. RPC retains text output. - Surface bounded live activity for async tasks without persisting every message, and make synchronous subagent output compact by default with full details available through expansion.
Ultra layer (spec #14): policy and authoring surfaces over the workflow engine.
ultratool: inline plans in the workflow schema, parsed and validated before any child spawns, with one review card per start while ultra mode is off; the journal (source: "inline") is the plan's only persisted copy (ADR 0005).- Ultra mode:
/ultra [on|off]in memory per session (PI_SUBAGENT_ULTRACODE, default off); while on, cache-diffed prompt guidance carries the decision heuristics, the pattern menu with declarative shapes, and the size guideline. ultracodekeyword: interactive-only, case-sensitive, word-bounded; stripped from the prompt, it forces plan-first handling for the next run (PI_SUBAGENT_ULTRA_KEYWORD, default on).- Completion notices: terminal ultra runs deliver status plus the bounded consolidated answer as a message that may start a turn;
subagent_asyncand workflow runs stay pull-based (PI_SUBAGENT_ULTRA_NOTIFY, default on; ADR 0006). - Switches and bounds:
PI_SUBAGENT_ULTRAmaster kill switch (default on),PI_SUBAGENT_ULTRA_GUIDELINEsmall/medium/large/unrestricted (default medium, advice only); invalid values warn and fall back. Caps and child exclusion reuse the workflow engine's — ≤ 64 steps, ≤ 32 items per each-step, ≤ 256 children per run;--exclude-toolsgainsultra.
[0.2.0] - 2026-11-26
Declarative workflow layer (spec #4, feature #3).
- Workflow files: markdown + YAML frontmatter plans in project
.pi/workflows/and the user workflows directory (project overrides user by name); steps withid,agent,task,needs,each,model,cwd; declaredargswith{args.<name>},{steps.<id>.output}, and{item}templating. workflowtool: a single asyncstartaction — validates everything before any child spawns, returns the run id plus the expanded plan./workflow <name> [key=value ...]command for direct starts.- Workflow runs are jobs: DAG release on
needs, transitive skip-propagation, independent branches continue, per-run concurrency capmin(maxWorkers − 1, 4)inside the shared FIFO; runs managed via the existingsubagent_jobstool and/subagentsview. - Each-steps: line fan-out over a prior step's output with fail-soft item semantics — zero items fails the step; failed items leave empty slots while the step succeeds if one item does, and the run fails if any item failed. Fair-share bounded step outputs and prompt budgets with visible truncation markers.
- Caps, validated up front: ≤ 64 steps per workflow, ≤ 32 items per each-step (
PI_SUBAGENT_WORKFLOW_MAX_ITEMS), ≤ 256 expanded children per run. - Project workflow directories reuse the project-agent trust pattern: one combined confirmation per distinct directory; user workflows are trusted.
- Journal: one
pi-workflow-run-v1entry per run with resume-ready per-step records (id, input hash, status, attempt count, bounded output, timings). - TLA+ scheduler model extended — needs sets,
skippedstate, per-run reservation, each-item semantics — under the TLC gate. workflow-authoringskill ships in-repo under.agents/skills/; child launches excludeworkflowtools alongsidesubagent*.
[0.1.0] - 2026-11-25
Initial release as a Pi package.
subagenttool: synchronous single, parallel, and chain delegation to named Pi agents in isolated child processes.subagent_asyncandsubagent_jobstools: start jobs without waiting, then list, get, wait, or cancel them./subagentscommand, footer status line, and persisted job snapshots across reload and resume.- One shared FIFO scheduler with bounded workers (
PI_SUBAGENT_MAX_WORKERS), bounded async admission, and process-tree cleanup on shutdown. - TLA+ spec (
spec/SubagentJobs.tla) model-checked with TLC; test suite and deterministic verification gates.