The journal rebuilt the step/item graph from the flat job record: rows
were grouped by stepId, an each-step's coordinator row was picked out of
the collision with its item children, and a positional fallback covered
rows without step ids. After the seam (#22) the supervisor owns the DAG
index, so the record is a projection of that state instead.
- WorkflowSupervisor.journal(execution) projects the record from its
stepTasks/itemTasks index and the run spec while the run is live.
- journal.ts keeps the pure row builders, now over the shared InternalTask
record, and builds the record from plan order plus the index; itemsByStep,
the byStep collision handling, and the positional fallback are gone.
- The manager calls the run's projection at finalize and passes it to
onWorkflowJournal; interrupted runs project at shutdown as before.
- jobUsage() moves the usage summation into job-state.ts so the snapshot
and the journal read one number.
Journal tests that hand-built flat snapshots to exercise the
reverse-engineering are replaced by run-state-driven ones; a cancelled
run's journal is now covered too.
Part of #23.
Add a second WorkflowSupervisorHost adapter and drive release order, transitive skips, fail-soft items, zero-item failure, cancellation with pending items, stall detection, and injected cap limits without a manager or temp agent directories.
Move Execution, InternalTask, and the status predicates into job-state.ts; the supervisor now creates, schedules, and settles shared rows only through its host. Concentrate cancellation and shutdown settlement in one supervisor policy, make restored rows honest (no fabricated AgentConfig), and thread load-time cap limits through WorkflowRunSpec so release enforcement and the review card share one value. Agent discovery is memoized per cwd within a prepare call.
Each `pi-workflow-run-v1` step record now carries `items`: one row per
fanned-out child with its source line, a stable per-item input hash, status,
attempt count, bounded output, and timings, alongside the step's aggregate
record. The format has shipped nowhere, so it is extended in place.
Item identity (`itemValue`) now rides the task identity into the child's
snapshot instead of living only on the manager's internal task, so the
journal reads the line the child actually ran rather than re-deriving it
from the source output. Item hashes key the plan, step, args, and item line
— never prior outputs — so identical items hash alike across runs, and item
outputs use the same bound and truncation marker as step outputs.
Persistence validates the rows (one-based index, required fields) and the
optional item identity on job snapshots. Round-trip tests cover restore,
bounding, and hash stability, plus a property test for the hash inputs.
The t2 implementer claimed a merge it had not made; briefs since carried the verification wording per-brief. The rule belongs in the standing worker rules once, with a checkable criterion.
The 2026-11-26 pipeline session mangled committed wiki state-log bullets three times with prefix-anchored edits, each silent at edit time. scripts/check-state-log.ts fails when a state-log line present in HEAD is missing or modified in the working tree; additions pass. Wired as npm run wikicheck, on_settle in .pi/verify.json.
Move ready-step release, skip propagation, item fan-out and settle, the per-run cap, and workflow cancellation settlement into src/workflow-supervisor.ts. The manager keeps the FIFO pool, worker accounting, admission, and the job/task lifecycle, and hands a run to the supervisor through a small host seam. Behavior-preserving move; spec/SubagentJobs.tla untouched.
Correctness: exclude workflow dispatch from child sessions, surface invalid workflow item configuration, reject {item} outside each-steps, and confirm every untrusted project directory once per workflow start. Refactors: share task settlement, status icons, validation failures, task identity construction, and workflow run state; normalize item counts to a map. Document YAML repair leniency and glossary wording.
Resolve the t4/t6 overlap in index.ts by keeping the trust-gated workflow
start path and adding the journal persistence hook and entry renderer.
Adapt journal step lookup to the item engine: an each-step's item children
share their step's id, so the run journal records one row per plan step from
the coordinator's aggregate status and joined output. Per-item journal rows
remain a follow-up. Adds a regression test for the seam.
Generalizes the chain predecessor to needs sets, adds skipped as a terminal
step status with a transitive cascade, encodes each-step items (fail-soft,
zero items fail the step, failed items fail the run), and reserves at most
min(MaxWorkers - 1, 4) concurrent steps per workflow run inside the global
pool. Commits a run's outcome only after every step settled, so skip
propagation completes before a run is called failed.
Move the extension from ~/.pi/agent/extensions/subagent into this repo
and package it for pi install:
- Sources under src/, entry exposed via the pi manifest in package.json
- Host packages (@earendil-works/*, typebox) stay peer dependencies
- Tests, TLA+ spec, and research notes move along unchanged in behavior
- Gates (.pi/verify.json): typecheck, tests, tlc, smoke — all green
- Install: pi install git:git.rwiesner.com/alex/pi-subagent or local path
Scaffold the per-repo configuration the engineering skills read:
- docs/agents/issue-tracker.md: Gitea (git.rwiesner.com/alex/pi-subagent)
driven by the `gt` CLI, including Gitea's native issue dependencies and
the absence of sub-issues
- docs/agents/triage-labels.md: the five canonical triage roles at their
default label strings
- docs/agents/domain.md: single-context layout (root GLOSSARY.md + docs/adr/)
- AGENTS.md: the `## Agent skills` block pointing at each of the above