Skip to content

ci: attribute recurring native automatic-index aborts on main #2921

Closed

Description

@schlessera

Out of scope

Do not raise deadlines, weaken queued-refresh or cleanup assertions, change merge gates, retry a failed proof into green, or assume that the historical checkpoint-holder explanation applies to these runs. This issue selects diagnosis, not a product repair or a new release commitment.

Context

Classification of 49 failed first-main attempts from the October 21–25 delivery cohort found three automatic-index abort receipts in runtime_host:

Each failed the native Pi UID-0 hosted cell while draining queued refresh, with NATIVE_AUTOMATIC_INDEX_COMPLETED, NativeBrainManagerError, unknown checkpoint outcome and AbortError [ABORT_ERR]. The receipt reports an actual automatic-index failure; it is not merely a wait-function timeout. Other retained-reference controls in those same command receipts passed.

On inspected main 6814f2ce5d3ea7f626284ab28b3c230428d06630, the drain explicitly throws on the recorded failure (const failed, scripts/native-proof/hosted-app.test.ts:404-405). Historical job lines differ; use each immutable squash for attribution.

Closed #1967 documents an earlier matching outer signature and a bounded release correction, but its historical holder remained unknown. These later receipts do not prove the same mechanism or that its correction was absent. Open #2878 concerns different database/sidecar publication-stamp failures; matching the outer automatic-refresh phase does not establish a shared cause. Delivered #2880/#2929 concerns cancellation before a Pi prompt; it is a lifecycle lead whose presence and relevant behavior must be checked at each historical squash, not an attributed explanation or proof that these aborts are repaired.

Duplicate searches covered the exact assertion, automatic/native/abort, and existing checkpoint/publication issues. No open issue was found owning these three abort receipts as a distinct attribution task.

Scope

Preserve the three source-bound receipts and inspect their retained native operation, worker-exit, queued-refresh, checkpoint identity and cancellation evidence. Determine which operation was aborted, which cancellation authority or deadline caused it, whether a worker/reference survived the relevant completion boundary, and whether the occurrences share a cause. If evidence is insufficient, identify the precise missing boundary and specify bounded diagnostics for the next natural occurrence.

Acceptance criteria

Verification

Start from the listed job logs and their existing runtime-proof artifacts. Do not start with a new native fixture allocation or broad rerun. Retain normalized excerpts, artifact identities and digests. If additional execution is later justified, use the repository's guarded native proof entry point with an explicit finite observation bound.

Contract impact

None selected. Diagnosis only; any eventual consumer-visible correction must assess its own contract impact.

2026-10-25 triage at main dcd3b336dbade5e29e8a131eeeb5a0d9cffe60ff: The finite artifact-first attribution spike already has complete scope, evidence inputs, exclusions and a valid unresolved-evidence deliverable, so it is ready without a causal reproduction prerequisite. Corrected #2880 to delivered lifecycle context; preserve the explicit prohibition on starting with a new native fixture/broad rerun. p2 is wanted unscheduled diagnosis, not a release commitment.

2026-11-15 correction, at main 5af68976988140d8d916f74d7342959a4cc4e66d: the premise above, "The receipt reports an actual automatic-index failure", is wrong. All six recorded occurrences (the three above, plus 2026-10-30, 2026-11-06 and 2026-11-10 in the comments) come from the deliberate --retain-index-namespace negative control (#1977). That control must fail with exactly this signature, and it prints the same lines in green runs. Each job failed for a different reason, and each reason has an owner: #2420/#3202, #2897/#2895, #3655/#3664 and #3966. The attribution comment has the per-run evidence and the operation sequence of the 2026-11-10 artifact. #4020 marks the control's lines in the log, so they are no longer read as the job's failure.

Activity

  1. added
    type: spike
    area: ui-sdk
    area: ci
    priority: p2
    agent-ready
    on Oct 25, 2026
  2. schlessera commented on Oct 25, 2026

    @schlessera
    OwnerAuthor

    2026-10-25 triage at main dcd3b336dbade5e29e8a131eeeb5a0d9cffe60ff: The finite artifact-first attribution spike already has complete scope, evidence inputs, exclusions and a valid unresolved-evidence deliverable, so it is ready without a causal reproduction prerequisite. Corrected #2880 to delivered lifecycle context; preserve the explicit prohibition on starting with a new native fixture/broad rerun. p2 is wanted unscheduled diagnosis, not a release commitment.

  3. schlessera commented on Nov 6, 2026

    @schlessera
    OwnerAuthor

    Recurrence — 2026-11-06, PR #3652 ready proof

    A fresh occurrence of the same outer signature, on a PR that does not touch the native, index, worker or turn paths.

    • Run/job: run 42185293538, job 127784600665 (runtime_host), artifact runtime-host-proof (id 13488580112).
    • Checkout: merge c91bb565f216cd028c86893c0d33182a06d18db5, tree 3f432dba6fb0071f37ed3a08974ff65ba948418f, parents 1f5c6eb75c31f88c2808c62d890e11c75ce26184 (epic/3150-attachments) and c73db5a108cbcbf3bb416fbe2586f05263c95c1a (PR head), as the job's BRAIN_RESOURCE_RECEIPT records it.
    • Failure: scripts/native-proof/hosted-app.test.ts, "native hosted pi uid 0 first/warm admission, health, WebSocket, Stop and cancellation", at the queued-refresh drain (const failed, scripts/native-proof/hosted-app.test.ts:449-450 at this checkout). It threw NATIVE_AUTOMATIC_INDEX_COMPLETED: NativeBrainManagerError: Native manager outcome is unknown; reconcile the same checkpoint identity. AbortError [ABORT_ERR]: The operation was aborted. The test failed after 76.0 s and its command after 140.9 s, with 4 pass and 1 fail in the file. The four retained-checkpoint reproduction and identity-inspector tests in the same command passed.
    • Same tree, same job, two outcomes: the job ran the hosted-app proof five times. Claude uid 1000 (47.3 s), Pi uid 1000 (46.6 s), Claude uid 0 (53.7 s) and a first Pi uid 0 run (run-pi-uid0-pKRdEa, 112.5 s) all exited 0. Only the second Pi uid 0 run failed (run-pi-uid0-ca08B8, exit 1). Owned-loop cleanup reported no remaining mount, loop or backing file, and the parent namespace quota was unchanged.
    • Missing evidence: neither Pi uid 0 directory in the artifact retains run/events.jsonl or native-operations.jsonl. Each holds only native-fixture.json, native-environment.json and runner-quota.json. The aborted manager operation, its subvolume sync interval (if there was one) and the cancellation source therefore cannot be recovered from this run. Retaining both logs for the failed cell is the boundary this spike needs for the next occurrence.
    • Not attributed to CONTRACT: feat(ui-server): deliver recorded attachment reads to the browser (#3589) #3652: the PR changes 22 files, none of them under the native manager, index, worker launcher, backends or turn path. Its runtime additions are a host route, which runs only on request, and a read_attachment record wrapper, which runs only when that tool is called. The fixture's scripted turns call only brain_search, brain_read_base and brain_ui_session. On the same epic, CONTRACT: feat(ui-react): offer an unrestricted Files source with honest upload states and draft-bound originals (#3155) #3590's proof and main's last three runs passed runtime_host.

    Not rerun. Priority raised to p1 and milestone 0.45.0: this signature now blocks an 0.45.0 epic merge (#3652).

  4. added
    priority: p1
    and removed
    priority: p2
    on Nov 6, 2026
  5. added this to the 0.45.0 milestone on Nov 6, 2026
  6. schlessera commented on Nov 13, 2026

    @schlessera
    OwnerAuthor

    Two more occurrences on main, found while triaging #3966 (2026-11-13). Neither is recorded here yet. Both are in the Pi UID 0 cell of native hosted pi uid 0 first/warm admission, ….

    Run When Head What the log shows
    41054017684 2026-10-30 12:15Z 8cb45cc0b NATIVE_AUTOMATIC_INDEX_COMPLETED: NativeBrainManagerError: Native manager outcome is unknown; reconcile the same checkpoint identity. AbortError [ABORT_ERR], case failed after 83.9 s
    42875027911 2026-11-10 18:25Z b77987afb case failed at REAL_ISOLATED_WORKER_WROTE_FIRST_AND_WARM_NOTES after 54.8 s, then NATIVE_INDEX_RELEASE_REPRO_EXACT_HOSTED_ASSERTION

    From the 2026-11-10 artifact (runtime-host-proof, tmp/native-host-proof/run-pi-uid0-IUqS6i/run/events.jsonl, downloadable until 2026-11-17):

    Offset from automatic_index_started Event
    0 s automatic_index_started, ordinal 1, right after the first turn ends
    +0.9 s second turn's backend_log: worker scratch area is read-only this turn: .brain/scratch/ could not be checked (Maintenance temporary storage is busy: … (held by: index) …)
    +47.9 s automatic_index_failed: Native manager outcome is unknown; reconcile the same checkpoint identity. AbortError [ABORT_ERR]: The operation was aborted

    So the index held its maintenance reservation for the whole 47.9 s before the abort, and the next turn ran with scratch read-only because of it. Both turns still entered the provider and returned success.

    The 2026-10-30 artifact has expired; only the job log remains.

    Rate, for scale. From 2026-10-28 to 2026-11-13, runtime_host on main passed 256 times and failed 4 times. These two are half of the failures.

    The failure recorded in #3966 (2026-11-11) is in the same cell but is a different one: its first turn's inference request was refused at network admission.

  7. self-assigned this
    on Nov 15, 2026
  8. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-77ee3ac2. Branch: ci/2921-native-index-abort-attribution.

    path: draft #4012 (scripts/native-proof/hosted-app.test.ts); closure-only reports: #3054 #3056 #3059 #3069 #3116 #3437 #3581 #3622 #3806 #4002 #4007 #4008 #4013

  9. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Attribution — 2026-11-15, at main 5af68976988140d8d916f74d7342959a4cc4e66d

    Result: every recorded occurrence is the deliberate retained-namespace negative control. None is a product automatic-index failure. Each job failed for a different reason, and an existing issue covers each one.

    Where the error line comes from

    With no selectors, scripts/prove-native-host.ts first qualifies the four healthy cells. It then runs a fifth invocation, --backend=pi --app-uid=0 --retain-index-namespace (if (selected.length === 0), scripts/prove-native-host.ts:90-102). That invocation's fixture keeps a descriptor to the index worker's mount namespace (retainMountNamespace, scripts/native-proof/native-worker-lifetime.ts:31). This invocation must fail NATIVE_AUTOMATIC_INDEX_COMPLETED … Native manager outcome is unknown … AbortError. verifyIndexReleaseReproduction (scripts/native-proof/verify-index-release-repro.ts:13-50) refuses any other outcome. #1977 added this control and documented it in scripts/native-proof/README.md ("Expected exit: 1.").

    All six jobs print the line from this fifth invocation, which follows Verifying the deliberately retained index namespace reproduces the expected failure. It is followed by error: Native hosted proof failed (1) and a stack. The same lines appear in green runs. bun scripts/pr-status.ts --failures listed them first, ahead of the real failure, and nothing marked them as expected. That is how they were recorded here. #2895 already noted this for the two 2026-10-25 runs.

    Each occurrence

    Run / job Squash or merge Control verdict in the log What actually failed the job Owner
    40082818803 c636aacce (#2808) NATIVE_INDEX_RELEASE_REPRO_OWNED_CLEANUP: the control's own loop removal hit [Errno 16] Device or resource busy The control's owned-loop cleanup (fixture, infrastructure) #2420, fixed by #3202 (9cf9bfb49, 2026-10-30)
    40157659182 1c5666e7a (#2882) Verified expected automatic-index failure …; receipt phase native managed hosted admission "success":true native separate-UID worker identity: Identity fixture mutation anchor changed (scripts/prove-worker-identity.ts:107). #2882 moved the hosted-app.test.ts run line in fixture.py (fixture) Restored by #2897; local guard #2895
    40157912094 d9f4405ce (#2886) Verified; admission phase passed Same anchor failure, same tree lineage (fixture) #2897 / #2895
    41054017684 8cb45cc0b Verified; admission phase passed Identity cell's owned-loop cleanup: [Errno 16] Device or resource busy, Native proof cleanup failed. 8cb45cc0b predates #3202 (fixture, infrastructure) #2420 / #3202 (#3192 retains its evidence)
    42185293538 merge c91bb565f (#3652) Verified; admission phase passed (exitCode 0) Identity cell: worker_identity_setup_timed_out in captureMaintenanceStage (product boundary, cause unresolved) #3655 (closed with plan), diagnostic #3664
    42875027911 b77987afb NATIVE_INDEX_RELEASE_REPRO_EXACT_HOSTED_ASSERTION: the control failed earlier than designed, at REAL_ISOLATED_WORKER_WROTE_FIRST_AND_WARM_NOTES In the control's first turn, the worker witness got HTTP Error 403: Forbidden on its egress probe and never wrote notes/worker-1.md. The warm turn's probe then needed network approval and timed out. Both ENOENT cases follow from the missing note. The healthy Pi UID 0 cell (run-pi-uid0-cI2wRz) printed worker-pass twice, with no traceback (unresolved) #3966 (same Pi UID 0 network-admission class); red-main #3884

    The 2026-11-06 comment's "two outcomes on the same tree" are the healthy Pi UID 0 cell (run-pi-uid0-pKRdEa, passed) and this control (run-pi-uid0-ca08B8, failed as designed and verified). The PR it blocked failed on #3655.

    Operation and cancellation sequence (the only artifact still retained)

    The runtime-host-proof artifact 13792106997 from run 42875027911 (sha256:55132850b2ab5ca92e5f0d8aa165e8738714822c4f322198c73317b0c70cdf6a) has run-pi-uid0-IUqS6i/run/{events,native-operations}.jsonl and index-descendant-lifetime.json. Offsets are from automatic_index_started (wall 1794335580263):

    Offset Evidence
    +0.009 s subvolume snapshot -r … checkpoints/252e26f5… (root 267), the index's checkpoint
    +0.431 s The fixture opens fd 26 on index descendant pid 571's mnt:[4026532506] (pinned.openedWallAt)
    +17.856 s / +17.869 s Descendant observed dead; the index worker (bwrap pid 553) exits
    +17.902 s Release: subvolume delete --commit-after root 267, code 0
    +17.907 s subvolume sync /brain-fixture 267 starts. The manager's 1 s filesystem sync wake (#1994) runs 29 times, all code 0
    +47.903 s automatic_index_failed: Native manager outcome is unknown … AbortError
    +47.939 s That sync ends code 137 after 30,032 ms. The pinned fd closes in the same millisecond (closedReason: "native-sync-failed")
    +47.979 s A second subvolume sync … 267 completes in 1.4 ms
    • Aborted operation: the index checkpoint's release subvolume sync.
    • Cancellation authority: the client's operation deadline, NATIVE_MANAGER_OPERATION_TIMEOUT_MS = 30_000 (packages/ui-sdk/src/server/native-brain-manager-protocol.ts:201), applied at AbortSignal.timeout(options.timeoutMs) (packages/ui-sdk/src/server/native-brain-manager-client.ts:105).
    • Surviving reference: the fixture's deliberate namespace descriptor, not a worker. The worker was dead by +17.9 s.
    • Shared cause: the occurrences share this designed mechanism only as the control's expected outcome. That outcome failed none of the six jobs.

    The job logs alone show the same control verdicts for the five runs whose artifacts have expired.

    Correlations checked

    Classification

    Later green runs clear none of these. Product and fixture code are unchanged, and no deadline, assertion or gate changes.

    Correction

    #4020 marks the control's output instead of changing it. Every line the control prints stays in the job log, prefixed expected-failure control | , and pr-status --failures counts those lines instead of listing them. The parent's verdict (Verified … or NATIVE_INDEX_RELEASE_REPRO_*) stays plain. The README now explains how to read a failed runtime_host log.

  10. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Delivered by #4020, squash c6f98e8d9d2f63d144ff82d6d1d6ff0db128547c on main (verified as an ancestor of origin/main). Candidate run 43726726734 passed. The squash's main run 43729104640 was still in progress at merge.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: ciarea: ui-sdkpriority: p1type: spike

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions