Failure analysis and recovery evidence

Begin in design by naming the workflows and people a failure would affect. During implementation, refine actual failure triggers, eliminated opportunities and remaining scenarios. Keep the depth proportional to consequences: a documentation correction can describe misleading guidance and its repair in a few sentences; payment, access, migration and recovery changes need deeper analysis.

Every agentic process owes the common recovery contract and interruption matrix. For changed execution paths, map applicable interruption boundaries to observed recovery evidence in this existing analysis. Reuse prior evidence when its identity and scope remain valid. A new executor, credential refresh or phase transition alone creates no new approval requirement. A documentation update establishes the requirement; only executed adapter and runtime checks establish conformance.

The shared failureAnalysisSchema in apps/web/lib/change-review/failure-analysis.ts is the payload contract for external review_semantic_change calls and Build Studio’s existing verificationOut.failureAnalysis field. It carries the Workroom, final tree and diff digest, design reference and early analysis, scope, eliminated opportunities (or a substantive reason none were eliminated), and remaining scenarios. Each scenario names its trigger, real business/user effect, prevention, containment, detection, recovery, existing evidence IDs and accountable residual disposition. Empty checkboxes, bare assurances and exhaustive zero-risk claims do not satisfy the gate.

Use the existing local integration evidence lane, including its lightweight documentation path. Executed reports retain commands, observed output, completion time, final tree and diff digest. The server resolves their IDs within the owning Workroom and rechecks currency before reviewer dispatch and publication. Old reports missing these bindings need to be rerun. A submitted narrative is not a passing test. Do not copy another Workroom’s evidence or label skipped verification as passed.

Which Workroom owns a local run (BI-C9912C22). A local-CI result is linked to the gating session’s live Workroom on the gated branch. The room whose head is exactly the gated commit wins; otherwise a single room on that branch is linked even when it has not recorded its head yet or holds an older commit, as an adopted room often does before its first sync. Several inexact rooms leave the result unlinked rather than guessed. Linking confers no authority: the resolver still requires the evidence commit to equal the room’s head at review.

A delivered room is not re-reviewed. The failure review gates publication of an unpublished change. When complete is refused with failure_review_required for a room whose pull request is bound and whose backlog item is done, the refusal carries deliveredCloseout and names the governed close-out instead: update_workroom_status with status archived and a reason naming the merge, as the Workroom reaper does for merged rooms. The boundary itself is unchanged; complete still requires a current review.

A claim-time base is not an authored head (BI-A7797C2C). A claim records headSha equal to baseSha, because nothing has been committed yet. That value is a trunk commit, so it says nothing about what the room produced. Pull-request binding, the reaper’s local git reachability check and the provider merge signal all read the head through authoredHeadSha (apps/web/lib/work-capsules/authored-head.ts). A head equal to the base counts as no head at all:

Before this rule, such a room never bound to its PR, so the delivered close-out above could not be offered. The reaper could also archive it as delivered while its backlog item was still open.

Build Studio’s in-platform evidence. A Build Studio sandbox cannot run the full local-integration gate: it has no Docker socket, by design. What it can execute is the guard gauntlet (the same scripts/pregate-preflight.mjs the external path runs) and scoped unit tests in the build’s own worktree. Those runs record evidence under distinct tiers, in-platform-preflight and in-platform-scoped-tests, that state their coverage and never claim the full gate. For a Workroom whose executor is Build Studio, and only there, the evidence resolver accepts such a record when it is passed, current, bound to the Workroom’s head SHA, and carries its head tree hash, diff digest, commands, observed output, completion time and validity window. The review function stamps the Workroom’s head branch and SHA before recording, so the record can bind. Every other currency check is unchanged, and an external Workroom still needs the full gate or the documentation lane.

Build Studio’s finalize stage. When a Build Studio build enters review, the platform prepares what the semantic review requires instead of leaving it to the build’s specialists. It captures the assembled change and runs the guard gauntlet bound to the Workroom’s head. If every failure is a missing decision (Docs-Impact, Seed-Fit, Convergence-Impact, Data-Impact, Design-Grounding or Process-Spine), a specialist is given the gauntlet’s own failure text, which states each trailer’s grammar and allowed values. It writes one trailer per decision, the lines are committed as an empty signed commit, and the gauntlet runs again. The gauntlet, not the specialist, decides, and rounds are bounded. Any other failure stops the stage and stays a failure. After a passing gauntlet the stage records the scoped tests as in-platform-scoped-tests evidence, resolves both records through the evidence adapter, and asks for the failure-analysis narrative. The platform fills the schema version, Workroom, tree, diff digest, design reference (the recorded design by content hash) and evidence IDs, and validateFailureAnalysis must accept the result before it is saved to verificationOut.failureAnalysis. Each outcome (ready, gauntlet-failed, tests-failed, analysis-invalid and the others) is recorded on the build.

Scoped-test stops (BI-33B54E4B). Scoped tests run with NODE_ENV=test, because the sandbox exports NODE_ENV=development and Vitest keeps an existing value. A test failure is re-run once on the same tree to separate a flake; both runs are recorded and only the last is cited. A confirmed failure ends tests-failed with the failing tests named, its kind (tests or typecheck), the tested tree and the scoped-test record. The review job hands it back to the build’s coding agent through the same bounded repair as guard, review and risk findings (one shared bound), with the failing tests and the recorded output in the brief, and escalates to the owner with the still-failing tests once the bound is spent. On the next sweep, an unchanged tree reuses its recorded failure instead of re-running the gauntlet and tests, as long as the same runner (SCOPED_TEST_RUNNER_IDENTITY) recorded it. A run that reached no verdict (a runner crash, or a result that could not be recorded) ends tests-not-run. It is never handed back or reused, because no code change can fix a runner that did not run.

Build Studio’s pre-build reviews. A large-shape Build Studio build owes design-spec, spec-approval, architecture-review and plan-review receipts before it may enter the build phase, and nothing on the install could request them: the design is an accepted BuildArtifactRevision, not a repository blob, and a Build Studio room records no branch head. The server reviewer dispatcher (dispatchOwedIndependentReviews) now also considers Build Studio rooms whose build is in plan and whose item is still open, routes the design-phase gates of the build’s implementation readiness decision through the same reviewer recovery, and binds each review to the design revision by id and value digest (artifactRef.kind: feature-build-revision). The reviewer reads that revision through read_build_artifact_revision, which serves the same page shape and identity keys as read_source_at_version, so the terminal reader policy, hydration and citation checks are unchanged. The request travels on a live connection of the person who requested the build, preferring the operator’s external CLIs, and the room records which assistant carried it; the cooldown, idempotent request key (keyed on the revision digest when the room has no head, so a changed design yields a new key) and the governed request_coworker lane are the ones delivered items already use. A failed review, an accepted or deferred residual risk and an xlarge build still escalate to the owner; the platform requests reviews, it approves nothing. Proven on the install on 2026-10-07 (BI-926A7E90): after the deploy, each two-minute tick routed design-spec, spec-approval and architecture-review requests for Build Studio rooms in plan, every one dispatched on the operator’s external connection with no click; reviewers read the bound revision through read_build_artifact_revision and recorded feature-build-revision receipts, and the implementation readiness of BI-2F736827 then read CANONICAL_DESIGN, SPEC_APPROVAL, REVIEW, OBJECTIVE_BASELINE and ARTIFACT_AUTHOR as satisfied. What still holds such a build in plan is the plan-phase family (PLAN_REQUIRED, PLAN_REVIEW_REQUIRED, PLAN_COVERAGE_REQUIRED, TRACEABILITY_INCOMPLETE): Build Studio records no plan coverage and its plan is bound only once an accepted buildPlan revision exists, which is a separate item. Design: docs/superpowers/specs/2026-10-02-build-studio-large-lane-independent-reviews-design.md.

A passed Build Studio plan held on PLAN_REQUIRED (BI-9FA1F9CF). A bug sized medium or large derives no delivery shape (§3.4 rules 1 and 3 of the proportional-gates design disagree), so its build is judged on the unshaped table, whose fix profile owes PLAN_REQUIRED and no spec approval. The platform plan-coverage writer (record-build-plan-coverage.ts, BI-6F2872FC) traced a reviewed plan only to the item’s own scope baseline, which only spec approval mints, so for these builds it returned silently and every resume tick refused PLAN_REQUIRED with “nothing here is waiting on your input”. On 2026-11-13, 19 builds were blocked and one advanced in 12 hours. When the item holds no baseline of its own and inherits none, the writer now traces the plan to the build’s reviewed design: its acceptance criteria carry the AC-n ids the plan’s tasks name, and the coverage binds the design’s digest (scopeBaselineId: build-design:<buildId>), so a changed design reads stale. The gate reads that coverage for PLAN_REQUIRED only; it confers no baseline, approval or plan review. An item’s own baseline always takes precedence. A build with neither now tells its owner why. The plan→build transition also binds the delivery shape before it judges readiness, as the resume loop does, so a decomposition child is not judged unshaped on its first attempt. The build/plan-gate-stall-invariant job runs every 15 minutes. It files one deduplicated PlatformIssueReport per plan-phase build whose latest plan review passed and which has been refused on PLAN_REQUIRED for 15 minutes or more. Stuck builds need no backfill: the next resume tick runs the same transition, which records the coverage.

The existing Change Reviewer and path-selected specialists challenge omissions. The Change Reviewer returns failureAnalysisReview with adequate and a substantive rationale. Missing assessment blocks publication. Analysis and resolved results participate in the existing durable request and receipt identity; a changed result invalidates reuse. Lost GitHub responses retry status publication using the persisted review, not new inference.

Reviewer responses must include a recognized decision, an issue array with recognized severities and substantive descriptions, and a nonempty summary. Empty objects, unknown decisions or severities, and malformed issue lists are inconclusive protocol failures. An explicit inconclusive verdict remains inconclusive. The parser never supplies an approval or downgrades an unknown severity to make an incomplete response usable.

Technical review failures require internal repair or review recovery. They do not authorize a business owner approval prompt. A blocked residual risk always fails closed. An accepted or deferred one fails closed unless it cites a resolved risk-acceptance authority: an owner name or a narrative is never one.

Risks outside the change (BI-09FB398D). In the finalize narrative, the model may mark a risk deferred only when its mitigation lies outside this change (infrastructure durability, another service). It never marks one accepted. The platform puts each deferred risk through the escalation gate, the same routeToHuman seam every owner hand-off uses (apps/web/lib/build/risk-acceptance.ts).

A blocked risk is one the change should mitigate. It still goes to repair and never to acceptance. The saved scenario carries disposition: "accepted", authorityEvidenceId and followUpReference. The evidence adapter resolves the authority from the Workroom’s own log, and only platform code writes that activity kind. The validator then binds it to the room, change, scenario and follow-up. An authority id the model wrote is dropped before validation, and an authority is never counted as verification evidence. The independent semantic review still sees the accepted risk and can fail it.

Repairing only the analysis does not need a new commit (BI-38C51AF2). A review that fails only because the failure-analysis challenge judged the analysis inadequate leaves the change itself unfaulted. The author repairs the analysis and resubmits it on the same head with the next repairRound. When that later receipt for the same head, tree and diff passes with an adequate failure-analysis review, the earlier fail stops blocking Failure Readiness and the publication exception check. Any other critical finding, alone or alongside the analysis challenge, still blocks until the change is repaired and reviewed on its new head. Before this, every fail on a head was permanent, so an analysis-only repair forced a new commit and a fresh full gate on an unchanged tree.

Deployment and protection

When a local run cannot resolve its source identity, its diagnostic report remains available with null verification bindings and an explicit binding error. Such a report cannot satisfy failure readiness. A checkout that moves before binding also requires fresh verification; the producer never substitutes the caller’s checkout or invents a diff digest.

The review packet fits its reviewer (BI-FD7DE19D)

The native review packet must fit the reviewers its data boundary allows. On a confidential review that can be one local model.

Long evidence prose is bounded deterministically before the packet is sent:

The failure-analysis digest still binds the full evidence. The diff is never trimmed: the server rejects an artifact that does not match its digest.

A change too large to fit on its own fails closed as review-endpoint-ineligible. Its summary names the next action and the owner: the author splits the change into smaller pull requests.

Recover a saved review with AI Ops (BI-65DE89EA). Read the task and its immutable request digest, then call verify_semantic_review_eligibility with both. It rebuilds the current route for every required reviewer from the saved request, including the Workroom boundary and protected-data screening, and returns the effective routing requirements and individual endpoint and account exclusions. It does not call a reviewer or change provider settings. It records scoped runtime health evidence. Only complete eligible routes and settled checkpoints produce a passing verification. The original requester uses its ID and the same digest with retry_semantic_review. Admission rechecks the route, the original authority, evidence freshness and the task state. An expired request gets at most one bounded successor.

For a public Workroom, anonymous reads of both exact matching commit trees can prove the server-read range public when repository visibility metadata is unavailable. This does not attest pasted text, private rooms, or the additional evidence surrounding the artifact. The normal payload screening and any authorized transformation still run before external routing.

Measured on DEV on 2026-11-03, before this fix:

The design reference uses path@<40-character Git object hash>, so the reviewer can inspect the recorded early analysis rather than a moving document. The gate checks the reference format; the independent reviewer checks its content and whether it predates implementation.

Server Workroom readiness transitions and Build Studio assembled-change review enforce the contract without a client hook. The platform publishes dpf/failure-readiness on the exact source commit after resolving the recorded verdict. The Failure Readiness workflow verifies that status against the configured DPF_REVIEW_STATUS_PUBLISHER repository variable and rejects statuses older than one hour.

Delivery keeps the status fresh (BI-4D0B2AAB). The merge queue runs the check again, so a review that passed hours earlier failed there as stale. Workroom PR delivery then re-queued the PR without republishing (60 attempts on one room). Before delivery queues a PR that carries the Failure Readiness check, it now republishes the status from the server’s own verdict for the room’s current head. When no publishable review exists, it withholds the PR instead of queueing it to fail. When the only red checks are Failure Readiness and its dpf/failure-readiness status, delivery republishes, re-runs the failed check run, and observes the PR again. Only checks that branch protection requires count, as in GitHub’s merge queue (BI-D081EDD0): a failing check GitHub marks not required, such as a Code Quality scan that hit the API rate limit, neither stops this re-run nor keeps the PR from being queued. A check whose required-ness GitHub does not report still counts. This applies only where the room may act on GitHub (enforce mode and an acting posture). It never republishes from a client’s artifact.

Use a creator-bearing status read. For PRs, GET /repos/{owner}/{repo}/commits/{sha}/statuses returns each status’s creator. The combined GET /repos/{owner}/{repo}/commits/{sha}/status omits creator from its rows entirely, so every status read that way is unattributable and the gate can never pass — no matter which publisher is configured. Verified against commit 9640f133190bc0ed82893f619695a4efe362632c on 2026-09-22: the combined endpoint returned the status with no creator key; the list endpoint returned the same status with creator.login. A row that arrives without a creator is reported as unidentified, never as an untrusted publisher (BI-8B6A67BD).

A failed HTTP read is not a review verdict (BI-9ED0B273). The reader retains the status and no approval inferred, plus a bounded redacted JSON message and only GitHub request ID, rate-remaining/reset and Retry-After headers. Capture is limited to 8 KiB and one second; malformed, absent, oversized or unreadable bodies retain the original refusal. Credentials are redacted before excerpting and control characters sanitized. No extra request or automatic retry is introduced. Use those observed facts to distinguish permission, resource and rate-limit remedies; a bare 403 does not prove any one of them. Do not widen access, fabricate a status or rerun independent inference to repair an evidence-read failure.

A transient evidence read is inconclusive (BI-482A5D5E). Rate limits and transport failures leave a typed inconclusive result, a notice and a run summary. The named verdict runs unconditionally and exits 3. Required checks can be satisfied by a skipped or neutral job, so the inconclusive result stays non-success whether it is currently required or advisory. An HTTP 403 with only quota headers is not enough to infer a rate limit. A permission denial stays an ordinary rejection, as do missing or stale evidence and an invalid publisher. The reader uses the same repository-scoped Actions token with read-only permissions. PRs make one REST LIST request. Merge groups make up to ten queue page requests, then read the exact source heads’ creator-bearing GraphQL status contexts in batches of at most 50. That is at most 30 requests for a full 1,000-head snapshot, with no retries.

The publisher is the identity of the install’s own GitHub credential. publishFailureReadinessStatus posts through resolveGithubToken, so DPF_REVIEW_STATUS_PUBLISHER must be set to the login that credential authenticates as — read it from GET /user with that token — and never to a name chosen for it independently. The credential is the github-pr-sync entry and needs the repo scope to write statuses. Note the consequence before enabling enforcement: where that credential is an operator’s personal account rather than a dedicated platform identity, any status that account posts by hand satisfies the check as readily as one the platform published. A dedicated publisher identity is the stronger arrangement, and the check is only as trustworthy as the account it names. For merge groups it reads the authoritative queue entries and verifies each included source PR, while existing CI verifies the merged code. This follows GitHub’s merge-queue event contract.

GitHub reported the Failure Readiness workflow as advisory on PR #7321. The repository policy can still require that context, so only a passing evidence verdict can satisfy it. GitHub never receives a skipped or neutral verdict as the result of an inconclusive read. Roll out the server producer and configure its trusted GitHub publisher before applying the updated repository protection; otherwise every new PR waits for a status the old install cannot publish. Preserve existing DCO and required checks. Verify status-write permission for the configured GitHub credential and apply the canonical protection policy through its established deployment process. After refreshing an expired status through the same review call, rerun the failed workflow; no fresh inference is needed while its evidence remains valid.

This source change alone does not update a running install or GitHub branch protection. Do not describe repository-wide enforcement as live until both are verified. A service outage does not authorize or publish review evidence. Review records remain durable and the same review call can republish a lost status response without rerunning inference.

The design amendment in docs/superpowers/specs/2026-07-27-shared-change-reviewer-control-design.md remains canonical. Work-kind minimum verification remains the responsibility of the existing verify-first contract; failure analysis adds scenario relationships rather than another work-kind policy.

Unconfigured verification is not a successful check

The workflow preserves exit code 2 when the trusted publisher is missing. This is an infrastructure/configuration problem, not a negative verdict about the change, but it cannot satisfy a required readiness check. GitHub treats a successful job as passing regardless of a notice in its logs; converting this outcome to exit 0 would silently disable enforcement. The gate regression executes the workflow’s actual shell block with no publisher and checks the nonzero outcome.

The platform owner repairs the publisher configuration and reruns the same source check. PR authors must not fabricate a status, switch publisher identities, or repeat independent inference to fix configuration. Configure and verify the existing server producer before requiring this context in repository protection; retain DCO and all other protected checks. An owner-authorized gate repair remains a separately recorded publication exception, never a claim that missing evidence passed.