Skip to content

id: two world-schedule tests fail deterministically (restore rejects journal: participant used before issued) — blocks every NixOS switch #7618

Closed

Description

@dezren39

Defect

pkgs/id's own test suite fails deterministically at current main: two world-schedule tests panic in WorldCore::restore with

journal event at sequence 1 uses participant 1 before it was issued

Failing tests (both in src/world/tests.rs, module world::tests::schedule_tests):

  • a_fire_the_program_refuses_stays_pending_in_the_journal (panics at tests.rs:7140 — the WorldCore::restore(..., entries).unwrap())
  • replay_reproduces_the_pending_and_fired_sets (panics at tests.rs:7232, same call)

Evidence (2026-11-08, laptop amd)

  • Package check phase (nix sandbox), main as of this morning: test result: FAILED. 2995 passed; 2 failed on the first attempt (drv 2rngdkgnyvpz...), then 3000 passed; 2 failed on a later main (drv yvdsgkaq6f...). The same two tests, both times.
  • Bare worktree retry of the first failing drv succeeded once (ID_EXIT=0) — under the full 16-thread sandbox run at machine load ~16. That single pass does not reproduce.
  • Local runs at main 0a27a7f19f (dev toolchain, cargo test --offline --lib world::tests::schedule_tests::): FAILED in 3/3 runs at --test-threads=16, and FAILED in 3/3 runs at --test-threads=1 (19 passed, 2 failed, finished in 0.01–0.10s). Deterministic in this environment, independent of test parallelism.
  • The tests' journal is synthetic (Recorded::for_world seeds JournalEntry::Created, then the actor's own appends: capability issuance for participant "ann", then ScheduleSet). Restore validates participant issuance in journal order and rejects the stream at sequence 1. Nothing time- or load-dependent is visible in the test setup up to the restore call.

Impact

pkgs/id has doCheck = true, so the failing check phase blocks the id package build, which blocks unit-id-primary.service → system-units → etc → the whole NixOS toplevel: nixos-rebuild switch on amd cannot complete while this stands (observed twice on 2026-11-08, switch attempts for #6765). Every deploy to the laptop is gated on this until fixed — this is fleet-stalling, not a test nit.

Notes for whoever picks this up

  • Recent pkgs/id change in the area: PR id(replication): refuse snapshot header-version downgrades #7611 (id(replication): refuse snapshot header-version downgrades, merged 2026-11-08T09:48:09Z) touched only src/world/replication.rs. Whether the stricter issuance validation arrived there or the tests rotted against an older change is the first question — the two green-field data points are: tests assert the error string "before it was issued" exists elsewhere in the suite (tests.rs:2152/2170/2183), so the rule is intentional somewhere; these two schedule tests may predate it.
  • The one bare-drv pass vs deterministic local failures discrepancy is worth understanding (sandbox profile ci-check vs dev profile is the visible difference).
  • Filed from the atlas: align the production ONNX Runtime version — nix closure ships 1.27.1, corpus pipeline + Gate A fixtures are 1.31.1 #6765 deploy lane, which this blocks; that lane's change (ONNX Runtime pin) is merged and verified independently — do not conflate the two.

Acceptance criteria

  • Both named tests (a_fire_the_program_refuses_stays_pending_in_the_journal and replay_reproduces_the_pending_and_fired_sets in pkgs/id src/world/tests.rs schedule_tests) pass deterministically across repeated runs at --test-threads=16 and at 1.
  • WorldCore::restore no longer rejects a journal whose early events reference a participant the journal itself issues later in sequence - or the tests' journal construction is corrected, with the verdict (code bug vs test bug) recorded on the issue.
  • The full pkgs/id suite is green (0 failed) in the package check phase.

Activity

  1. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor
  2. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/mMedium: expected under 1 day of work
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    priority/highImportant and time-sensitive
    source/humanFiled directly by a human
    on Nov 8, 2026
  3. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    Intake review

    Related: Filed by Drew with laptop evidence at main 0a27a7f (3/3 failures at both thread counts locally; sandbox check phase 2995-3000 passed / 2 failed). Intake search: the one merged-PR hit is an unrelated docs PR (number collision) - no merged fix; still live per filing evidence, and triage must re-verify at current main.

    Notes: Deterministic restore-rejects-journal failure: 'journal event at sequence 1 uses participant 1 before it was issued'. Either restore's issuance ordering is wrong or the schedule tests build a journal the model forbids - the evidence supports a real defect, and the verdict matters beyond the tests.

    Risks: A test-side 'fix' that papers over a real restore-ordering bug in the world journal; criteria require the verdict to be recorded.

    Suggested approach: Reproduce at current main first, read WorldCore::restore's participant-issuance check against the two tests' journal construction, and fix the side the model says is wrong.

    Labels normalized at intake: kind/bug, status/needs-triage, priority/high, effort/m, app/id, source/human, meta/enriched added (existing labels preserved). Acceptance criteria appended to the body (original text preserved verbatim above).

    — fleet monitor, intake pass 2026-11-08 (06:12 CST run)

  4. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    Fresh clean-main reproduction (lane code-f, 2026-11-08): cargo test --lib world::tests::schedule_tests in pkgs/id on a fresh worktree of origin/main db27c4e — 19 passed, 2 failed: a_fire_the_program_refuses_stays_pending_in_the_journal (src/world/tests.rs:7166) and replay_reproduces_the_pending_and_fired_sets (src/world/tests.rs:7258), both: journal event at sequence 1 uses participant 1 before it was issued. Confirms pre-existing on main; used as the baseline verdict to merge PR #6541 under task 13320.

  5. added
    work/assignedQueue worker lifecycle state
    and removed on Nov 8, 2026
  6. 8 remaining items

  7. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    and removed on Nov 10, 2026
  8. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  9. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  10. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    lane: code-w
    task: 14154
    issue: #7618
    stage: handed_off
    note: Task 14154 (small_fix, issue #7618) handed off to the opencode claimant: lane assignment row 5865 is opencode (re-confirmed this claim). Issue #7618 OPEN, no hard-stop labels, no status/needs-triage (fresh, lane code-w 2026-11-10). Attempts 2/3. Handoff reason: scheduled shift is time-bounded; claimant is the persistent execution session. Next: claimant launches the bound opencode session.

  11. added
    priority/normalOrdinary priority (the default)
    and removed
    priority/highImportant and time-sensitive
    on Nov 11, 2026
  12. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    Disposition from the queue (task 14154, lane code-h): already fixed on main — closing with verification.

    The fixture fix landed as commit bd43291 ("test(id): journal the fixture issuance in scheduling_actor (#2894 fallout)"), an ancestor of current origin/main: scheduling_actor now pushes core.issued_entry(ann.id) into the journal right after minting, so the journal records the CapabilityIssued entry in sequence order — exactly the fix the triage (task 13744) prescribed. Verdict as triaged: a test-fixture bug, not a restore-validation bug; validate_restored_event_author was not weakened.

    Verified on current main (05cc6d0) in this claim:

  13. added and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 11, 2026
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

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/humanFiled directly by a humanstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions