CL-6324 step 3: the sidecar deploys from the closure - #99
Closed
TheGreatAxios wants to merge 3 commits into
Closed
Conversation
added 3 commits
August 20, 2026 01:03
The deploy frame no longer carries a definition, so every sidecar test that built one now stages a source-ref pin and registers what the pinned closure evaluates to through an injected materializer. The lifecycle suite asserts the new contract directly: an onTrigger body's sources.json is staged and its definition is not, the child's env carries the materialized closure dir and the hub-approved wire hash, and the durable record carries the pin a restore re-materializes from. The step-coverage gate moves with it -- the frame's arktype can no longer narrow a table it cannot see, so coverage is checked against the closure-derived definition.
The sidecar no longer writes a definition into its deploy tree and reads it back. A deploy materializes the frame's frozen closure, evaluates the pinned code, and runs THAT; the boot-time restore re-materializes the same pin and re-derives the same definition, so both paths reach the runnable definition by one computation. The child gets the closure dir plus the hub-approved wire hash it re-verifies its own projection against, and the durable record carries the pin a restore replays. The pieces that make it executable: - Closure staging (`workflow-host-wiring/closure-staging.ts`) owns the durable per-deployment source stores, the mount resolution both paths derive from the pin alone, and the apply. Injectable so a test can stand in for fetch + SRI-verify + layout + evaluate. - A `WorkflowProbeExecutor` is wired at the boot edge, so a probe answers with a real inert projection and its wire hash instead of the hub-link's rejecting placeholder. Its airlocked child, the closure materializer, the closure apply, and the inline source-asset delivery come from upstream's own sidecar at `4ed8baf4` (see VENDORED.md). - Child spawns are in-memory: a rung lifts its inline children to refs and serves grandchildren from that map, so no rung reads a definition off disk at any depth. - `WORKFLOW_DEFINITION_REPO_ID`/`_REF` are gone. What survives is `WORKFLOW_DEFINITION_ID` — identity for the run-authenticated capabilities route a step tool calls, never a repo to read from.
Closes the three sidecar rows on the conversion table and records what the conversion did not prove: no run has executed end to end, the MCP credential-handle defect still gates a real launch, every test injects the closure materializer, and the pinned tool-package arm was left in place deliberately where upstream went all-source-tools.
Contributor
Author
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.
The execution host comes off the retired
workflow.jsonlineage. A deploymaterializes the frame's frozen closure, evaluates the pinned code, and runs
that; the boot-time restore replays the same pin through the same helper, so
both paths reach the runnable definition by one computation rather than two
that can drift.
bun run typecheckexits 0 repo-wide on this branch — the 24 sidecar errorsthe conversion table named are gone.
What landed
workflow-host-wiring/closure-staging.ts): the durableper-deployment source stores (siblings of the reclaimed instance dir, so they
survive a restart with no re-delivery), the mount resolution both paths derive
from the pin alone, and the apply. Injectable, so a test stands in for
fetch + SRI-verify + layout + evaluate without publishing a package.
CLOSURE_PACKAGE_DIRexists, threaded on the frozen substrate env, so therun child evaluates the pinned code and re-verifies its projection against
DEFINITION_HASH— now the hub'sapprovedWireHash, never a sidecarrecompute. A frame carrying no approved hash fails closed.
createWorkflowProbeExecutoris wired at the boot edge,so
workflow.probe.requestreturns a real inert projection, its advisory grantset, and its wire hash instead of
workflow.probe.error.createWorkflowSpawnChild/createWorkflowSpawnSuspendableChildare gone; a rung lifts its inline childrento refs and serves grandchildren from that map, so no rung reads a definition
off disk at any depth. An onTrigger body's
sources.jsonis still staged (anin-process body child loses its env across a restart); its definition is not.
referencedDefinitionHashesis gone;approvedWireHashandsourceRefare required, so an unrestorable recordfails at the scan boundary rather than half-restoring.
WORKFLOW_DEFINITION_REPO_ID/_REFare gone. What survives isWORKFLOW_DEFINITION_ID: identity for the run-authenticated capabilities routea step tool calls, never a repo to read from.
Vendoring
Four modules are near-verbatim copies of upstream's own sidecar at
4ed8baf4—the probe handler, the closure materializer, the closure apply, and the inline
source-asset delivery — plus
bin/workflow-probe-child.VENDORED.mdmoves theapps/sidecarrow to that commit and records the two adaptations the fork'smodule layout forced (host-platform resolution lives in this fork's
tool-materialization.ts; the probe child's shebang drops upstream'sintx-srccondition, which workbench forbids).
Green
bun run typecheck— exit 0, repo-wideapps/sidecar— 138 pass, 0 failpackages/folded-runs— 44 pass, 0 failpackages/chat— 509 pass, 0 failbun run lint— 0 errors (14 pre-existing warnings)Not proven — the honest part
No run has executed end to end on these rails. The task asked for a
RunStartedproof; it did not fit, because it needs a real published orcommitted source package plus a live hub, and the box went to porting the
source-ref lane into a fork that never had it (upstream's sidecar at the prior
pin already had
workflow-closure-apply,workflow-closure-materialization,source-asset-delivery, and the probe handler; workbench's had none of them).The remaining wire, in order:
mcp:<slug>isnot a legal
ToolCredentialHandle, so any MCP-pinned launch fails closed atrender time. Gates a real chat launch, not the deploy path.
renderAgentRuntimeSourceTreeoutput through thedeploy: every test injects the closure materializer, so the actual
fetch/SRI/layout/evaluate path is exercised only by upstream's tests at the
vendored pin.
typechecks; no
workflow.probe.requestframe has reached it.all-source-tools (
req.agent.toolFactories); workbench'sagent-runtimepinstool packages instead, so
materializeStepToolsstays. Whether thesource-format deploy still stages a
tool-packages-manifest.jsonfor thosepins is the first thing an end-to-end run will answer.
Stacked on
cl-6324-deployathead-convert.