Files

7.4 KiB
Raw Permalink Blame History

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).

  • Increase the default global worker limit from 4 to 16; PI_SUBAGENT_MAX_WORKERS overrides and the 1 to 32 validation range are unchanged.
  • Replace TUI /subagents notifications 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.

  • ultra tool: 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.
  • ultracode keyword: 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_async and workflow runs stay pull-based (PI_SUBAGENT_ULTRA_NOTIFY, default on; ADR 0006).
  • Switches and bounds: PI_SUBAGENT_ULTRA master kill switch (default on), PI_SUBAGENT_ULTRA_GUIDELINE small/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-tools gains ultra.

[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 with id, agent, task, needs, each, model, cwd; declared args with {args.<name>}, {steps.<id>.output}, and {item} templating.
  • workflow tool: a single async start action — 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 cap min(maxWorkers − 1, 4) inside the shared FIFO; runs managed via the existing subagent_jobs tool and /subagents view.
  • 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-v1 entry per run with resume-ready per-step records (id, input hash, status, attempt count, bounded output, timings).
  • TLA+ scheduler model extended — needs sets, skipped state, per-run reservation, each-item semantics — under the TLC gate.
  • workflow-authoring skill ships in-repo under .agents/skills/; child launches exclude workflow tools alongside subagent*.

[0.1.0] - 2026-11-25

Initial release as a Pi package.

  • subagent tool: synchronous single, parallel, and chain delegation to named Pi agents in isolated child processes.
  • subagent_async and subagent_jobs tools: start jobs without waiting, then list, get, wait, or cancel them.
  • /subagents command, 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.