Skip to content

ci: attribute recovered Pi UID 0 hosted admission and checkpoint failures #3966

Closed

Description

@github-actions

Current state

The active red-main record is cleared. The bot recorded that run 42946726347 at a875fa5f910c68df7dde92546ef09df0ea204ec4 included the failing set and passed. This issue retains the original failure for attribution; it does not declare current main red or reserve the integration slot.

Out of scope

No new timeout, retry, skip, weakened native assertion or assumption that the triggering squash caused the failure. Do not conflate this with #2744's prepared-consumer third-request failure or close it solely because a subsequent run was green. No production/deployment access is needed for the keyless fixture investigation.

Context and observed failure

Original run 42939960767 ran on main 067d1904bafccf0503a1e3effd6bd260ebf34769 and failed runtime_host. The downloaded failed-job command records were decoded and inspected on 2026-11-11. The Pi UID 0 hosted-app command reported 2 pass / 3 fail / 56 assertions:

  1. native hosted pi uid 0 first/warm admission, health, WebSocket, Stop and cancellation failed RECOVERY_READ_DID_NOT_EXECUTE_AGAIN at historical scripts/native-proof/hosted-app.test.ts:188: expected one fake_provider_enter event, received zero. This is missing execution evidence, not an observed duplicate.
  2. a retained native checkpoint descriptor records the actual release interruption and reconciles the same root failed opening the checkpoint's notes/worker-1.md with ENOENT at historical line 591.
  3. a native checkpoint descriptor released just after its delete still completes release failed opening the same relative fixture file with ENOENT at historical line 633.

The retained-cwd and identity-inspector cases passed. The earlier Claude UID 1000 hosted admission case passed. Expected corrupt-intent recovery diagnostics elsewhere in the log are not these assertion failures.

The three named assertions/entry points remain at scripts/native-proof/hosted-app.test.ts:188, :576 and :618 on inspected main 3c44ac6fc56d27675dadaf38a16254db53c39f69. The two missing-file failures may follow the first fixture turn failing to produce its output, but this is an unproven relationship. No unique failing admission/relay/safety boundary is established by the downloaded log. The later green run is recovery evidence, not root-cause proof. The native command was not re-executed in this triage.

Scope and missing reproduction

Reproduce or attribute the original Pi UID 0 first hosted turn using the supported keyless native-proof fixture. Retain per-phase durable request/terminal and fixture provider-admission evidence, the first refusal/error and checkpoint contents before teardown. Compare the original SHA with current main and identify whether the descriptor cases are cascades or independent failures. The original run and decoded assertions are the starting evidence; a green control alone does not settle cause.

Acceptance criteria

  • A failing run or deterministic controlled fixture identifies why the first turn has zero fake_provider_enter events, with its actual durable outcome and first boundary failure, or an existing independently proven fix is shown to eliminate that exact failure.
  • Both checkpoint ENOENT cases are attributed independently or demonstrated to follow the first failure; any separate reproducible defect gets its own scoped issue.
  • A fix or fixture correction has named failing-first and restored mutation receipts for the observed cause, without loosening the admission/recovery/release obligations.
  • The restored keyless Pi UID 0 hosted-app/native path passes under the supported fixture; the PR records its conditions and actual main proof.

Verification

Use the repository native-proof runner and the three named tests. Preserve the original run link, actual source SHA, decoded assertion and first boundary evidence. Keep needs: repro until current repeatability or causal resolution is demonstrated. Classified p2 because the active incident recovered and no current blocking/security/data-loss urgency is established.

Contract impact

No contract change is proposed by this attribution brief; reassess if a discovered fix needs one.

Artifact evidence — 2026-11-13

The retained proof artifact of run 42939960767 names the first failure: receipt. The Pi worker started and reached Pi startup ready; its first inference request was then refused by the relay with 403 brain_inference_refused: Inference network admission refused, so the turn ended in error after 1,082 ms and the fake provider was never entered. RECOVERY_READ_DID_NOT_EXECUTE_AGAIN and the two checkpoint ENOENT failures follow from that.

  • Answered: why the first turn had zero provider-enter events, and whether the ENOENTs are cascades (they are).
  • Still open: which branch of the egress operation's admit() refused. The failed cell's directory has no egress-records.json.
  • Not the same failure: the 2026-11-10 failure of this case on main (run 42875027911) is an automatic-index abort and belongs with ci: attribute recurring native automatic-index aborts on main #2921.
  • Not reproduced: the Pi UID 0 cell alone passed 8 of 8 on an idle 4-CPU VM.

Next step: retain the egress record for a failed cell, so the next occurrence names its branch. That is #3997: the proof writes egress-records.json only after its turn assertions pass, and the lost record already carries the specific refusal reason. This issue waits for a natural failure after #3997 lands; needs: repro stays until then.

Triage 2026-11-13 at main 631bbae2c: added the artifact evidence and narrowed the open question. needs: repro kept.

Triage 2026-11-14 at main c82e30ae4: pointed the next step at #3997. Labels unchanged.

2026-11-14 triage at main faa480e8c864d547cd8b4eb75965b7d609284770: Declared the existing #3997 failure-artifact prerequisite canonically. The unknown admission-refusal branch still needs reproduction evidence; no product cause or repair is inferred.

Resolution — 2026-11-16

Closed as completed by #3726 (40dbae0a2, merged 2026-11-11 09:28 UTC, after the failing commit 067d1904b, which is not one of its ancestors). This is the "existing independently proven fix" branch of the first acceptance criterion. It does not rest on a later green run.

2026-11-16: removed the Blocked by #3997 line and needs: repro/blocked; closed as completed with milestone 0.45.0 (the release that delivered #3726).

Activity

  1. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ciCI workflows, the gates they run, release scripts, packaging.
    on Nov 11, 2026
  2. github-actions commented on Nov 11, 2026

    @github-actions
    Author

    Main is green again: run https://github.com/schlessera/brain-kit/actions/runs/42946726347 at a875fa5f910c68df7dde92546ef09df0ea204ec4 included the failing set and passed. The red-main record is cleared.

  3. changed the title [-]ci: main red at 067d1904bafc: runtime_host[/-] [+]ci: attribute recovered Pi UID 0 hosted admission and checkpoint failures[/+] on Nov 11, 2026
  4. schlessera commented on Nov 11, 2026

    @schlessera
    Owner

    2026-11-11 triage: decoded the original failed native-host command and retained the exact first missing-provider-event assertion plus two checkpoint ENOENT failures. The red-main record has recovered, but the cause and possible cascade remain unattributed. Added priority: p2 and needs: repro; no guard, timeout, assignment or active incident record was changed.

  5. added
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    needs: reproBlocked on a reproduction.
    on Nov 11, 2026
  6. schlessera commented on Nov 13, 2026

    @schlessera
    Owner

    Triage 2026-11-13: the retained artifact names the first failure. The Pi turn's inference request was refused at network admission, and the other two failures are a cascade.

    I downloaded the runtime-host-proof artifact of the recorded run (42939960767, 067d1904b) and read tmp/native-host-proof/run-pi-uid0-rmwMPH/run/.

    What the first turn did (events.jsonl, frames.jsonl):

    Offset Event
    0 ms governed_begin_end (209 ms)
    +178 ms worker_start, attempt 1, backend pi
    +962 ms backend_log: Pi startup ready
    +1,108 ms worker_exit
    no fake_provider_enter
    result frame: outcome: "error", durationMs: 1082

    The result frame's failure is:

    {"errorClass":"unknown","status":403,"message":"403 {\"type\":\"error\",\"error\":{\"type\":\"brain_inference_refused\",\"message\":\"Inference network admission refused\"}}"}

    That text has one source: the inference relay answers it when the egress operation's admit() returns false without a cancellation (fetch, packages/ui-sdk/src/server/inference-relay.ts:110-127; admit, packages/ui-sdk/src/server/egress-proxy.ts:269-297). So the worker started, became ready, sent its first inference request, and the relay refused it before it reached the fake provider.

    This answers the acceptance question. "Why the first turn had zero provider-enter events": the request was refused at admission. RECOVERY_READ_DID_NOT_EXECUTE_AGAIN (expected 1, received 0) is downstream of that. Nothing re-executed; the turn never got in.

    Still unknown: which branch of admit() refused. It can return false for a changed safety snapshot, a cancelled turn, a destination or port rule, the byte limit, an approval, or a recorder failure. The denial reason lives in the turn's egress record, and this run's directory has no egress-records.json (passing cells do). That file, or the reason carried in the refusal message, is the one missing piece.

    The two checkpoint failures are a cascade. Both read …/checkpoints/<id>/notes/worker-1.md, the file the refused turn would have written, and fail with ENOENT.

    The 2026-11-10 failure in the same cell is a different one. The previous main run to select this proof (42875027911, b77987afb) also failed native hosted pi uid 0 first/warm admission, …, at REAL_ISOLATED_WORKER_WROTE_FIRST_AND_WARM_NOTES, followed by the same two ENOENT cases. Its artifact shows both turns entering the provider and returning success. The second turn logs worker scratch area is read-only this turn … Maintenance temporary storage is busy … (held by: index), and the automatic index that started after the first turn fails 47.9 s later with Native manager outcome is unknown; reconcile the same checkpoint identity. AbortError. That is the automatic-index abort family tracked in #2921, so I am not counting it here.

    Rate. From 2026-10-28 to 2026-11-13, runtime_host on main passed 256 times and failed 4 times. Three of the four are in the Pi UID 0 cell: this one, the 2026-11-10 one above, and run 41054017684 on 2026-10-30 (also an automatic-index abort).

    Reproduction attempt. Not reproduced. On a 4-CPU Ubuntu 24.04 VM at main 631bbae2c, prepared with the hosted job's own scripts/ci-runtime-setup.sh --native, I ran this cell alone, bun scripts/prove-native-host.ts --backend=pi --app-uid=0, eight times on an idle machine: 8 of 8 passed, five cases each, in 111 to 143 s. I did not run it under load. I ran the cell alone because the full proof does not reach it on that VM: the Claude UID 0 cell's schedule Git publication inherits active native peer folder admission case hits its 30 s limit there in 2 of 2 rounds, which looks like that environment being slow and is not a hosted failure.

    Why it stays open. A first turn refused at inference admission is a failure a person would see as an errored turn, and the cause is one captured field away. needs: repro stays until the denial reason is retained.

    Next step, small and specific: make the native proof keep egress-records.json for a failed cell as it does for a passing one, or include the egress denial reason in the relay's refusal. The 2026-11-11 artifact expires on 2026-11-18.

  7. added
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 14, 2026
  8. schlessera commented on Nov 15, 2026

    @schlessera
    Owner

    Related occurrence, found while attributing #2921 (2026-11-15). On main run 42875027911 at b77987afb, the failing Pi UID 0 invocation was the retained-namespace negative control (--retain-index-namespace). It was not the healthy cell. The job failed NATIVE_INDEX_RELEASE_REPRO_EXACT_HOSTED_ASSERTION, because the control failed before its designed failure point:

    • REAL_ISOLATED_WORKER_WROTE_FIRST_AND_WARM_NOTES failed at scripts/native-proof/hosted-app.test.ts:202 after 54.8 s. The descriptor case and the descriptor-released-after-delete case then hit ENOENT on notes/worker-1.md. The cwd case and the identity-inspector case passed.
    • runtime-host-proof artifact 13792106997 (sha256:55132850b2ab5ca92e5f0d8aa165e8738714822c4f322198c73317b0c70cdf6a, expires 2026-11-17) holds run-pi-uid0-IUqS6i/run/frames.jsonl:
      • Turn 1 (odysseus-native-bash-1): the worker witness printed worker-pass, then its egress probe raised urllib.error.HTTPError: HTTP Error 403: Forbidden, so it never wrote the note.
      • Turn 2: the witness raised TimeoutError: timed out after a tool_approval_request for Network localhost:<port> ("This session received data from another site …").
      • Both turns returned outcome: "success".
    • The healthy Pi UID 0 cell in the same job (run-pi-uid0-cI2wRz) printed worker-pass for both turns, with no traceback.

    Like the first-turn network-admission refusal recorded here, this is a first-turn egress refusal in a Pi UID 0 cell. That the two share a cause is not established. Not rerun.

  9. schlessera commented on Nov 16, 2026

    @schlessera
    Owner

    Reproduction — 2026-11-16

    Three agents on different models worked this independently, then cross-reviewed each other's write-ups. All three now agree this is most likely the #3725 race, which #3726 fixed. An earlier alternative, a session_binding_unavailable refusal, is excluded for this run: that check did not exist at 067d1904b. The recipe below was re-run today. needs: repro stays, because the failed run kept no egress record, so its own denial reason cannot be confirmed. Landing #3997 would make a recurrence on current main distinguishable from this one.

    The run's artifact expires 2026-11-18. The figures quoted under "Relation to the recorded failure" were taken from it before then.

    Deterministic reproduction of the first-turn 403 Inference network admission refused

    Finding. The commit of the failed run, 067d1904b, refuses a healthy
    first inference request with exactly the response recorded in the failed
    turn, when a new chat's session binding commits between the two safety reads
    of the relay's first admission. #3726 (40dbae0a2, merged about seven hours
    after that commit) removes it. This reproduces the mechanism and proves the
    fix; the failed run kept no egress record, so its own denial reason remains
    unconfirmed.

    Why it happens. A new chat's session_info announces the session and
    queues its catalog and safety binding on the write worker. The admission
    snapshot's scope includes the bound session, so it changes when that commit
    lands. Before #3726 the relay did not wait for its own announced binding. If
    the commit landed between the snapshot and its immediate re-read, the proxy
    recorded denied / safety_changed and the relay answered 403, although
    recording and authority were both healthy.

    Recipe. Needs Bun and a clone; no root, no container, no API key, about
    two minutes. The forcing is the regression test from #3726, which holds the
    write worker's commit with a shared-memory gate and releases it at a chosen
    safety read. Only test files are added; no source file is changed.

    git clone https://github.com/schlessera/brain-kit && cd brain-kit
    git checkout --detach 067d1904bafccf0503a1e3effd6bd260ebf34769
    bun install --frozen-lockfile --ignore-scripts
    
    T=packages/ui-server/tests
    # The #3726 probe fixture, and the first block of its test (six cases).
    git show 40dbae0a2:$T/fixtures/relay-binding-probe.ts > $T/fixtures/relay-binding-probe.ts
    git show 40dbae0a2:$T/relay-session-binding.test.ts | sed '/^async function adverseFixture/,$d' > $T/relay-session-binding.test.ts

    Add one logging line directly above the first assertion in
    packages/ui-server/tests/relay-session-binding.test.ts:

         const egress = db.query("SELECT json_extract(payload,'$.outcome') outcome,json_extract(payload,'$.reason') reason FROM governance_events WHERE kind='egress_connection'").all();
    +    console.log("PROBE", JSON.stringify({ kind, releaseAt, status: response.status, body: response.body, requests, egress, snapshots: samples.map((s: any) => ({ session: JSON.parse(s.scope)[2]?.sessionId ?? null, recordingAvailable: s.recordingAvailable, authorityCurrent: s.authorityCurrent })) }));
         expect(response.status, "HEALTHY_OWN_BINDING_JOINS_BEFORE_INFERENCE_SNAPSHOT").toBe(200);

    Then run it:

    bun run test packages/ui-server/tests/relay-session-binding.test.ts

    Expected at 067d1904b: 2 pass, 4 fail. The inference cases released at
    read 2 and read 3 fail HEALTHY_OWN_BINDING_JOINS_BEFORE_INFERENCE_SNAPSHOT
    (expected 200, received 403) and print:

    PROBE {"kind":"inference","releaseAt":2,"status":403,"body":"{\"type\":\"error\",\"error\":{\"type\":\"brain_inference_refused\",\"message\":\"Inference network admission refused\"}}","requests":0,"egress":[{"outcome":"denied","reason":"safety_changed"}],"snapshots":[{"session":null,"recordingAvailable":true,"authorityCurrent":true},{"session":"ithaca","recordingAvailable":true,"authorityCurrent":true}]}
    
    Field Value
    Status 403
    Body {"type":"error","error":{"type":"brain_inference_refused","message":"Inference network admission refused"}}
    Egress record denied, reason safety_changed
    Provider requests 0
    Snapshots session null, then bound; recording and authority available throughout

    The provider-relay cases fail the same way with their own message. The two
    cases released at read 0 (binding already committed) pass with 200 and one
    provider request.

    Control. Repeat the same steps after
    git checkout -f --detach 40dbae0a2f332eb20c52c2a967611894ca30d289 (or on
    current main, where the test file already exists and needs only the logging
    line): 6 pass, 0 fail, every case 200 with one provider request and a
    completed egress record. On main 5af689769 the unmodified file passes
    28 of 28.

    Telling a real reproduction from an artefact. It is real only if the
    status is 403 with that exact body (not 499, and not Inference request refused), the egress reason is safety_changed, and no provider request was
    made. A module-load error, or a five-second Atomics.wait timeout
    (BINDING_WRITER_COMMITTED_WITHOUT_EVENT_LOOP_PROGRESS), is not one.

    Relation to the recorded failure. In the failed cell, the host stalled
    for about 80 ms while announcing the session (the two sockets received
    session_info 78.8 ms apart, against 0.1 ms in the passing Pi cell of the
    same run), and the worker was stopped 104 ms after the session was named
    without ever entering the fixture provider. That is the window this test
    forces. The two checkpoint failures open notes/worker-1.md, which only the
    first turn's tool call writes, so they follow from the refused turn.

  10. removed
    needs: reproBlocked on a reproduction.
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 16, 2026
  11. added this to the 0.45.0 milestone on Nov 16, 2026
  12. schlessera commented on Nov 16, 2026

    @schlessera
    Owner

    Closing as completed by #3726. The body's new "Resolution — 2026-11-16" section has the evidence and its limit: the denial reason is inferred from the forced window, because the run kept no egress record. #3997 stays open so that the next refusal records its reason. Any recurrence after #3726 gets a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ciCI workflows, the gates they run, release scripts, packaging.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: fixSomething is broken and must behave the way it is documented.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions