feat(runs)!: add governed Builder successor retries - #266
Merged
alvaroloes merged 1 commit intoSep 2, 2026
Merged
Conversation
BREAKING CHANGE: Builder runs can no longer use generic run resume or conversation continuation. Clients must create an eligible immutable successor through POST /v1/runs/:runId/retry.
alvaroloes
merged commit Sep 2, 2026
a797e59
into
codex/governed-retry-security-primitives
14 checks passed
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 changes
runs.retry_of_run_idlineage and a governedPOST /v1/runs/:runId/retryoperation that creates at most one directsuccessor for a failed, fully tracked, plan-linked Builder attempt.
identity, agent, mode, engine and trigger while keeping every terminal parent
and its events, transcript, usage, receipt and sandbox evidence immutable.
credentials, request/write leases, sandbox teardown and exhaustive remote
GitHub output before inserting or dispatching a successor.
the operator receives an actionable fresh-Gate-1 requirement instead of
fabricated legacy evidence.
REST, MCP/conversation and worker paths. Non-Builder resume behavior remains
unchanged.
and SDK contracts, migration 0045, audit events and adversarial concurrency,
lineage, replay and preflight coverage.
This PR is stacked on
codex/governed-retry-security-primitivesbecause asuccessor is safe only after the predecessor's request fencing, durable
repository-write leases, run-unique branches and terminal revocation controls
are present.
Why
A Builder can finish its local work yet fail before a durable GitHub delivery.
Generic resume mutates or revives the same attempt and cannot preserve the
required-plan approval source safely. Re-running an executed proposal also
cannot create an auditable second attempt under the existing root uniqueness
rules.
The governed successor keeps the failed attempt immutable, preserves the exact
human-approved identity and admits a new run only when Facility can prove that
all old effects are quiescent and no ambiguous delivery exists. Historical
runs that predate durable write tracking intentionally require a fresh
Architect proposal and explicit human Gate 1 decision.
Verification
CI=true pnpm verifypasses completely: all real failures are fixed, buttwo pre-existing runner 100 ms timeout flakes failed under global load
37/37passed1/1passed47/47passed97/97passed18/18passed23/23passed21/21,677/677,57/57passed179/181; both pre-existing timeout flakespassed isolated and bounded Git delivery passed
3/3verify,minimum-node,self-host-build,sandbox-e2e, title and commit-subject checks passedgit diff --checkand migration compatibility passed0, P1=0, P2=0The clean global gate initially found one genuine issue: production run
producer #20 was absent from the governed producer inventory. The final commit
adds
builder-plan-producer-inventory.test.tswith marker and AST assertions,and all related regressions pass.
pnpm verifyis not described as completelygreen because the two pre-existing 100 ms runner flakes still failed under the
global load, despite passing in isolation.
Non-blocking P3 review notes:
server accepts
{};deployment window;
GitHub verification retains an unavoidable post-validation TOCTOU boundary.
Breaking change
Builder runs can no longer use generic resume or conversation continuation.
Operators must use the governed immutable-successor operation, or obtain a
fresh Architect proposal and explicit Gate 1 decision when durable tracking
evidence is unavailable. Generic non-Builder resume behavior is unchanged.
BREAKING CHANGE: generic resume and conversation continuation now fail closed
for Builder runs; use the governed immutable-successor retry operation.