Repository navigation
New
- Supervisor is now actively notified at every review boundary, with
spiral detection and adjudication signals. Previously the supervisor was
never told when worker↔reviewer reviews happened, so it couldn't break the
revision spirals that stall complex tasks unless the operator noticed and
poked it — the opposite of autonomous execution. Now:- Every review start/end is surfaced to the supervisor (all autonomy
levels) so it can adjudicate each revision case-by-case, carrying the
normalized disposition (APPROVE/REVISE/RETHINK/REFUSED/UNAVAILABLE), the
per-step review round, and — when the reviewer emits anIssues Found
section — finding counts by severity plus a converging-vs-circling
severity trend (dropping/flat/rising, with amixedflag). These are
the signals an adjudicating supervisor uses to tell "healthy deepening,
severity dropping (let it run)" from "circling the same class
(intervene)" at a glance. - Revision-spiral escalation: after a configurable number of
consecutive non-APPROVE reviews on the same step (default 3), the
supervisor gets an urgent, steer-deliveredreview-intervention-needed
alert with the disposition history and finding trend, so it can steer the
worker to a resolution (implement the remaining legitimate findings, or
stop and log a blocker). Re-escalation is trend-gated + cooldown-spaced:
a converging spiral is left to run; only a flat/rising one re-interrupts. - Order-of-operations violations (a step marked complete before code
review ran) escalate immediately as a distinct signal, kept out of the
revision-spiral count. - Reviewer-unavailable is surfaced as a separate broken-reviewer
signal, never counted toward a spiral. - Detection state is reconstructed from event history on resume, so an
in-progress spiral survives a pause/resume. Severity vocabulary and
spiral tuning are configurable undertaskRunner.reviewer
(severityLabels,spiral.{enabled,threshold,cooldownReviews, treatUnavailableAsNonApprove}); the core default vocabulary is generic
(critical/important/minor).
- Every review start/end is surfaced to the supervisor (all autonomy
Fixed
-
orch_retry_taskcould not re-drive a v2 batch after a finalize-gate
refusal (#629). On the segment runtimesegments[]is authoritative —
resume re-derives task status from it — so a retry that reset only the task
record was silently undone: the wave was counted done andorch_resume
no-op'd. Retry/skip now update the segment records too (worktree identity
preserved so resume re-executes in place); resume's re-execute path
transitions the executed segment on success/failure, treats a pause as
still-pending (not failed/unretryable-skipped), and keeps the real lane
outcome. Also from the same incident:- Review-gate remediation spawn. With every checkbox already checked
the lane never launched a worker after retry, so the alert's "have the
worker address the findings" remedy was unreachable. The lane now spawns
a bounded (2) remediation iteration focused on the outstanding gate's
step;review_step's complete-step guard exempts a re-review whose
latest verdict is REVISE/RETHINK. - New exit classification
review_gate_refusal(exit code 0) — a
governance refusal is no longer recorded as a worker crash, and tier-0
auto-retry never retries it. - Diagnostic reports are no longer clobbered by a no-op resume ($55/1h42m
reported as $0/0s): field-wise evidence merge with the prior report; cost
now comes from outcome telemetry. skip-dependentsno longer names tasks outside the batch (the dependency
graph is repo-wide; blocked IDs are now scoped to the wave plan).
- Review-gate remediation spawn. With every checkbox already checked
-
Duplicate review notifications. A repeated
review_completedfor the
same review file (retried tool turn / re-invokedreview_step/ doubled RPC
event) reached the supervisor twice and would have advanced the spiral
streak twice (firing a round early). The review-boundary bridge is now
idempotent per (step, type, review file): one file = one review. -
Build marker.
.pi/runtime/<batchId>/engine.jsonnow records
taskplaneVersionandtaskplaneBuild(sha256 prefix of the loaded
extension sources), and the takeover summary shows them — a local
pre-release deploy is distinguishable from the published version without
grepping for tool names. -
orch_pauseon an owned single-wave batch with a holding lane completed
the batch 0/1, skipped the task and removed its worktree (penster
20260906T194514). Two writers turned a paused task intoskipped, and pause
was only honoured before the next wave. Paused tasks are nowpending;
a wave with paused tasks finalizes the batch aspaused(worktrees
preserved, no merge); pause causes are tracked so Tier-0 recovery can never
clear an operator pause. On resume, tasks that succeeded before the pause are
merged by a catch-up step; a failed merge on resume pauses again instead of
completing with work unmerged.orch_retry_taskacceptsskippedtasks and
reopens a wrongly-completed batch; provenance branches are reported, not
cleared. Hold exits no longer consume the iteration budget (interim until
#627). The batch-complete alert reports outcomes and the orch branch state
separately and never says "merged" when nothing was (workspace-aware). -
Stale "Ready for integration" banner and supervised "Integration Plan"
prompt after the batch was already integrated (#610). When the engine
finished while the supervisor was mid-turn, the batch-end epilogue was
deferred (#621); if the supervisor integrated within that turn, the deferred
epilogue still fired at settle with content computed for an orch branch that
no longer existed. Integration (manual and auto) now supersedes the deferred
epilogue and marks the batch integrated; the epilogue also re-resolves at
dispatch time and skips when the orch branch is gone. -
A worker that held for a supervisor ruling was relaunched with the
"work continuously" nag, or died silently (#630).escalate_to_supervisor
is fire-and-forget; a correctly-holding worker ends its turn and exits. The
lane now recognises a clean exit after an unanswered escalation as a HOLD
exit: not a stall, relaunched with a hold-resume prompt (act on a delivered
ruling; never proceed past the hold / self-approve /.DONE), bounded to 3
relaunches, then the task fails with an explicitHold unresolvedreason and
supervisor alert instead of a frozenrunninglane. A ruling delivered as a
steer, or consumed by the exit-intercept, releases the hold (reply watermark
by message timestamp). Acknowledgement contract:send_agent_message
withtype="info"acknowledges ("received, ruling pending") — the worker
stays on hold and its relaunch budget resets, so an hours-long operator
ruling neither burns the budget nor is mistaken for a ruling;type="steer"
is the ruling and releases the hold.send_agent_messageto a dead-pid agent now returns a
distinct error (pid, last registry update, resume guidance). The in-tool
wait / first-classheldstate is the #627 follow-up. -
A replacement supervisor could not resume the batch it inherited (#631).
Takeover importedphase: executinginto memory and every recovery tool
refused, although persistedexecutingmeans "orchestrator disconnected"
and is resumable. The engine is a forked child that can outlive its
supervisor, so the fix verifies engine shutdown instead of inferring it:- Every engine publishes an identity (
.pi/runtime/<batchId>/engine.json:
pid, supervisor pid, start/exit) before it starts; the batch id is
preallocated by the supervisor and the engine refuses to resume any other
batch. Exit marking is pid-scoped (a stale callback cannot mark a newer
engine exited). - One ownership gate for
orch_resume,orch_retry_task,
orch_skip_task,orch_force_merge,orch_pause(inherited),
orch_abort,orch_integrateand a fresh/orch: refused while an
engine is attached to this session (running or still exiting); refused
while the target's recorded engine is alive elsewhere; refused when no
identity is recorded; allowed once verified dead/exited.forcenever
bypasses it. The gate runs against the batch that would actually be acted
on (persisted, or reconstructed on force-resume), never a cached phase. orch_pauseon an inherited batch with a verified-dead engine performs an
administrative pause (persistspaused) — the non-destructive stop
that previously required hand-editingbatch-state.json.- Abort verifies the local engine has actually exited (grace → SIGTERM →
SIGKILL) before persisting/deleting state, and refuses otherwise; agents
still alive before a lane re-executes are terminated with verification. - An orphaned engine (supervisor gone) winds itself down as
paused
instead of running headless; IPC after the channel closes no longer
crashes it. - New
orch_confirm_engine_shutdown(note)tool /
/orch-confirm-engine-shutdown <note>command: the explicit, audited
path for batches with no engine identity (pre-0.30.6). Migration
note: the first recovery/start against a pre-0.30.6 batch requires this
one-time confirmation after verifying no engine process exists. - The takeover summary now reports engine liveness and dead-but-"running"
registry agents (no registry hand-edit needed; resume reconciles them). isProcessAlivetreats only ESRCH as dead (EPERM/unknown fail closed).
- Every engine publishes an identity (
-
review_stepcould fail OPEN to APPROVE, and every successful review
emitted a spurious "Reviewer unavailable" (#624). The review-boundary
path only handled string tool results (structured content → "" → UNKNOWN,
conflated with UNAVAILABLE), and the worker-facing gate's APPROVE-first
substring fallback flipped REVISE reviews to APPROVE — workers advanced
past open P1 findings. One shared, line-orientedparseReviewVerdict
(heading / bold / plain / bracket / next-line variants; skips the
[APPROVE | REVISE | RETHINK]placeholder) serves the tool, the
lane-runner and the supervisor; APPROVE only from an explicit Verdict
line; body-text fallback can guess REVISE/RETHINK but never approve; the
review file's verdict is authoritative over the tool-return parse. -
A task could finalize over an outstanding REVISE/RETHINK (#626,
minimal cut). Both a worker-written.DONE(TP-2037) and the runtime's
checkbox heuristic (TP-2039) merged unreviewed work. Before.DONEis
created or accepted, each gate's LATEST review file must not read
REVISE/RETHINK; otherwise the task fails (review_gate_refusal) with a
steer-deliveredunresolved-verdictalert and remediation guidance. Steps
with no review at all are not blocked by this cut (full coverage gate is
the designed follow-up). -
A REVISE'd step kept flipping back to
✅ Complete— an uncommitted
STATUS edit "never authored by the worker". The lane-runner's checkbox
heuristic marked any fully-checked step Complete regardless of its review
verdict; the worker correctly reverted it per the recovery recipe and the
runtime flipped it back on every relaunch (also trippingreview_step's
complete-step guard). Step completion is now review-gated (same rule as
the finalize gate); STATUS logsStep completion withheld. -
Worktree cleanup could destroy uncommitted work (#628, minimal cut).
removeWorktreeandforceCleanupWorktreenow refuse a worktree with
uncommitted changes (opt-inallowDirtyonly after preserving progress);
a toplevel-identity check keeps corrupted/orphaned-worktree recovery
working; engine/resume cleanup paths surface a refusal loudly and never
force-clean past it. The takeover state-machine half of #628 remains open. -
Supervisor audit-trail timestamps were fabricated by the LLM (#625).
The system prompt literally instructedecho '{"ts":…}' >> actions.jsonl.
Newlog_recovery_actiontool code-stampstsandbatchIdand enforces
the entry schema; the prompt and primer now mandate it (including for
hand-remediation under operator rulings) and forbid hand-writing the file. -
Exit-intercept reply window is configurable:
taskRunner.worker.exitInterceptTimeoutSec(.pi/taskplane-config.json;
YAMLexit_intercept_timeout_sec; default 60, 15..1800) — a supervisor
inside a long tool call could not answer in 60 s. Resume's reconnect and
re-execute paths now forward the worker env (model, thinking, tools and
this window) — previously dropped on retry+resume. -
Worker mail to the supervisor was only surfaced after the worker exited,
not live during the run. A worker that mailed the supervisor mid-run
(vianotify_supervisor/escalate_to_supervisor— e.g. asking for help to
break a review spiral) sat unread in its outbox until it exited, so the
supervisor "woke up" too late. The lane-runner now polls the worker outbox
on a live timer during the run (in addition to the post-exit drain), acking
each surfaced message so nothing is double-delivered. (Segment-expansion
requests were already scanned live; reply/escalate mail was not — that
asymmetry was the bug.) -
Engine-worker IPC crashed Pi on a stale extension context (#620,
reported by @daemons2000): The asynchronous engine-worker IPC handlers
(child.on("message"|"error"|"exit")), the widget refresh
(updateOrchWidget), the batch-end epilogue dispatch, and the
supervisor-alert delivery all used a capturedExtensionContext/
ExtensionAPIafter Pi had invalidated it — on session replacement/reload,
or at the end of a headless-prun while the forked engine worker was
still emitting IPC. Everyctxaccessor (ctx.ui,ctx.isIdle()) and the
pi.send*methods call Pi'sassertActive, which throws"This extension ctx is stale after session replacement or reload". That throw, uncaught
inside achild_processcallback, became a process-fatal
uncaughtExceptionthat exited the supervising Pi process mid-batch;
recovery required a restart.Fixed by generalizing the #597 hardening pattern to any thunk
(safeCtxCallFromCallback) and routing all four stale-sensitive vectors
through it:ctx.ui.notify(all worker-IPC callbacks + the main-thread
fallback path),ctx.ui.setWidget(guarded insideupdateOrchWidget, the
single choke point),ctx.isIdle()(the batch-end epilogue now skips
dispatch and stops monitoring when the ctx is stale), and
pi.sendUserMessage(both supervisor-alert callbacks — #597's
sendMessage-only wrapper did not cover it). The guard no-ops only on
Pi's exact stale-ctx error (viaisStaleExtensionCtx), logs any other
error so real failures still surface, and never rethrows (a throw from an
IPC callback is the very crash this fixes). The"error"IPC branch now
persists the failed batch state before touching the UI, so a dead UI
sink can never prevent the dashboard/resume from seeing the failure.
Engine state, review, verification, retries, and failure propagation are
unchanged. This is the same class as #597 (stale captured handle in a
background callback) but a distinct path — timers/pi.sendMessagethere,
child-process IPC/ctx.ui.*here. 7 new regression tests (wrapper
behavior + wiring assertions for all four vectors).