Commit Graph
43 Commits
Author SHA1 Message Date
alex dcc66a4b26 Thread the load-time child environment into the runner 2026-12-01 11:56:55 +00:00
alex e623dae30c Store the bare skip reason and own its format in present 2026-12-01 11:56:52 +00:00
alex b4090c22d7 Tag wait results with a job-or-run discriminant 2026-12-01 11:56:49 +00:00
alex 5a44640ef3 Pin single finalization when a run is cancelled in the FIFO 2026-12-01 11:56:46 +00:00
alex 6f7f9d2a3b Keep a reloaded run's bounded answer and cover the wait fallback 2026-12-01 11:56:43 +00:00
alex b442cf0ebf Finish the start-plan rename in identifiers and docs 2026-12-01 11:56:37 +00:00
alex 79f9df84a0 Merge ticket/t6-presentation: presentation rulebook in present.ts (#26) 2026-12-01 11:42:52 +00:00
alex d94c2795a7 Guard the observation seam at 256 children and across crash restore 2026-12-01 11:39:54 +00:00
alex df929590e8 Emit job events, checkpoint at terminal, and bound the run wait 2026-12-01 11:39:54 +00:00
alex 466915b13d Delete the unreachable workflow result renderer 2026-12-01 11:35:46 +00:00
alex 3781f0e041 Own task and start presentation rules in present.ts 2026-12-01 11:35:45 +00:00
alex e15c86f007 Merge ticket/t4-step-mirrors: step schemas, whole-plan hash v2, record schemas (#24)
# Conflicts:
#	test/workflow-journal.test.ts
2026-12-01 11:26:53 +00:00
alex ed59a748cb Own persisted record shapes with TypeBox schemas
TaskSnapshot, JobSnapshot, the workflow journal record, and their entry
envelopes are TypeBox schemas whose Static types are the persisted types.
persistence.ts restores with Value.Check, so the hand-written validators
(and their drift: validTask skipped step, validJob skipped timings and
errors) are gone. A fast-check property holds persist -> restore equal
over generated records.
2026-12-01 11:21:40 +00:00
alex fa747145ce Hash whole plan steps under payload version 2
workflowStepInputHash and workflowItemInputHash feed the canonical
serializer the plan with provenance stripped, so every step field is
hashed by default and a new one cannot vanish from the replay contract.
The payload marker moves 1 -> 2 to separate hash eras; nothing replays
today (ADR 0004).
2026-12-01 11:19:33 +00:00
alex 8bc08bd08a Project the workflow journal from run state
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.
2026-12-01 11:18:13 +00:00
alex 1176537b32 Test the workflow supervisor through a fake host
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.
2026-12-01 11:09:26 +00:00
alex 621f6e2579 Make the workflow supervisor host seam real
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.
2026-12-01 11:09:26 +00:00
alex 7114650aed Split workflow modules by concern: plan, run, command 2026-12-01 10:55:35 +00:00
alex ee53b7ef18 Cover the mode/no-UI cell, start cwd resolution, and the over-cap warning 2026-11-30 17:42:25 +00:00
alex 90297c9229 Thread load-time ultra config through the formatters and rename advisory targets 2026-11-30 17:42:25 +00:00
alex e77e783737 Replace dead keyword helpers with property coverage of the matcher 2026-11-30 17:42:25 +00:00
alex 325711f098 Test the keyword with ultra mode on and no-keyword input 2026-11-30 17:28:42 +00:00
alex 4fcfe85d0c Add the ultracode keyword trigger 2026-11-30 17:27:34 +00:00
alex 8f8fe92089 Add ultra keyword configuration 2026-11-30 17:27:34 +00:00
alex 7cf6a3cc2c Merge ticket/ultra-t3: ultra mode with injected guidance and size guideline (#17) 2026-11-30 17:24:41 +00:00
alex d7f345ac04 Add completion notices for ultra runs 2026-11-30 17:21:35 +00:00
alex d7c311139c Add ultra mode with injected guidance and size guideline 2026-11-30 17:20:47 +00:00
alex d78d6fc31b Add inline plans and the ultra tool 2026-11-30 17:14:59 +00:00
alex b8e5c7eab5 Add live subagent dashboard and default to 16 workers 2026-11-26 20:43:59 +00:00
alex c6dae27ec4 Journal each-step items as per-item rows
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.
2026-11-26 20:09:54 +00:00
alex 01cea75342 Add an append-only state-log check as a verify gate
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.
2026-11-26 20:05:39 +00:00
alex d4eb164b03 Fix workflow-layer review findings
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.
2026-11-26 19:44:12 +00:00
alex 5baa7f4508 Merge ticket/t6-journal: journal workflow runs as resume-ready entries
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.
2026-11-26 19:30:47 +00:00
alex 9a42c809d5 Merge ticket/t5-start-surface: add the workflow start surface and trust gate 2026-11-26 19:28:39 +00:00
alex f4e1535eec Execute each-step fan-out with fail-soft item semantics 2026-11-26 19:25:52 +00:00
alex cfa4a2389b Add the each-step split, template, and bound pipeline 2026-11-26 19:25:52 +00:00
alex e6f062f402 Journal workflow runs as resume-ready entries 2026-11-26 19:24:14 +00:00
alex 5922d8a8bc Add workflow start surface with trust gate 2026-11-26 19:23:38 +00:00
alex d24693fa04 Teach job surfaces about workflow runs and skipped steps 2026-11-26 19:18:02 +00:00
alex 3aabfb2e63 Execute workflow plans as DAG jobs on the manager 2026-11-26 19:18:02 +00:00
alex 3e536b4e02 Add workflow plan parsing, validation, and discovery 2026-11-26 17:58:17 +00:00
alex 7753d6778a Add workflow item cap environment configuration 2026-11-26 17:58:17 +00:00
alex 4deccb95ef Turn the subagent extension into the pi-subagent Pi package
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
2026-11-25 13:40:16 +00:00