feat(graph): run ADC's pr-review-with-approval workflow on the engine - #1011
Merged
Conversation
…ort reach a parked run A resumed run held the budget reservation of every spawned child that never settled. An inline executor runs inside the process that spawned it, so a resume can prove it dead. The held reservation starved the pool and refused the next metered node. uncertainSpawnBudgets now keeps only runtimes that can re-attach. A parked waitForWakes run also ignored the abort signal. The wait now races the abort, so a host can shut a suspended run down.
… engine Lower the real template to an EngineGraphSpec with two host kinds. agent.run is metered into the conserved pool. decision parks the run; the human answer arrives as a resume. The if guard becomes the edge guard on the decision's data edge. The spike proves: approve and timeout paths, the park across a process restart, kill-anywhere replay at every journal boundary over host kinds, the pool cap acting as maxRunCostUsd, and the settles projected onto the actionResults shape the ADC run detail UI reads. An external effect is at-least-once across a crash; the fake host models the idempotency key that makes delivery exactly-once.
tangletools
approved these changes
Aug 24, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
Automated approval: author drewstone, all checks green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The ADC integration spike the graph-engine map (#966) was built toward: agent-dev-container's real
pr-review-with-approvaltemplate (workflow-templates.ts), hand-lowered to anEngineGraphSpecand run on the engine. ADC keeps its front-end and business kinds; the engine provides execution, durability, and the conserved pool.Proof (all in
tests/graph/adc-workflow-spike.test.ts, 5/5 green)${...}expressions assemble.onTimeout: defaultresolves through the suspension'sonExpire: 'default'; the post is skipped and the run completes cleanly.maxRunCostUsdmaps toBudget.maxUsd; a pool smaller than the agent's spend fails the run.actionResultsrows the run-detail UI reads (succeeded/skipped/waiting, per-step cost).Two kernel defects the spike exposed (first commit)
inlineruntime the process death proves the child dead; holding the reservation starved the pool and refused the next metered node (budget-exhausted, run endsunreachable-terminal). The existing replay test never saw it — its chain is all-pure, so reservations were zero.uncertainSpawnBudgetsnow charges only runtimes that can re-attach (bridge, sandbox).waitForWakesrun ignored abort. Nothing connected the abort signal to the wake wait, so a suspended run could never be shut down. The wait now races the abort.Integration findings for the ADC lift (no code needed now)
waitingevent (ADC's decision row already works this way), never precompute one.waitingevent, which matches ADC's transports acting on the decision row.onCrash: 'restart'declaration). Exactly-once delivery needs an idempotency key at the hub-executor seam; the engine's stable instance identity supplies it. The fake host models this.${...}templates lower to pure script nodes; single-field reads are edge projections; ADC'sif:guards are the engine's condition tree verbatim (it was adopted from ADC).Verification
vitest run tests/graph/adc-workflow-spike.test.ts5/5. Typecheck + lint green. Full local suite: graph/kernel/supervise all pass; the improvement/worktree files show the documented macOS baseline noise — the same files run in isolation fail identically (2) on this branch and on pristineorigin/main, so the branch adds zero failures. Linux CI is the authority.https://claude.ai/code/session_01CBYrFq6uXPbDwchUhRnVfT