Skip to content

id(ci): flake-check builds can receive a corrupted source copy — run 40617526037 failed 7 checks with parse errors absent from the git tree #1569

Closed

Description

@dezren39

Problem

CI run 40617526037 (PR #1563, head 56f010e) failed 7 pkgs/id flake checks (rustfmt-check, cargo-check, test-shard-1/2/3, crash-gate-sampled, crash-gate-ingest) with symptoms of a corrupted source copy inside the build, not the committed code:

  • rustfmt job 122589807600 log shows Rust parse errors in the build copy of pkgs/id/src/directory.rs: error[E0765]: unterminated double quote string at :2925 and prefix 'com' is unknown at :2896 (normalize_email("ok@example.com")).
  • The git content at the PR head (verified via the GitHub contents API at 56f010e, 2026-10-28T02:44Z) has those exact lines intact and valid; the PR diff is that single file and its committed form parses.
  • All failures are confined to the one run; other workflows on the same head (nix ci) passed.

So the source snapshot the nix builds received differed from the git tree — torn/corrupted in a way that split string literals. Every check that compiled that file failed the same way, which reads exactly like several independent code failures until the logs are compared.

Impact

Acceptance

  • Identify where the build's source copy can diverge from the git tree (flake source filtering / cache / checkout path) for run 40617526037, or catch the divergence mechanically (e.g. a source-tree hash check early in the id workflow that fails fast with a clear "source snapshot mismatch" message instead of 7 downstream parse/test failures).
  • A re-run of the failed jobs on the same head passes without any code change, OR the divergence mechanism is found and fixed.

Filed by repo-queue-worker lane A (task 1622 resume, 2026-10-28).

Acceptance criteria

  • The divergence point for run 40617526037 is identified — where the flake build's source copy can differ from the git tree (flake source filtering / cache / checkout path) — OR a mechanical guard exists (e.g. a source-tree hash check early in the id workflow) that fails fast with a clear "source snapshot mismatch" message instead of 7 downstream parse/test failures.
  • A re-run of the failed jobs on the same head passes without any code change, OR the divergence mechanism is found and fixed.
  • Root-cause findings are recorded on this issue either way, so the next phantom-parse failure is recognizable on sight.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 28, 2026
  2. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  3. added
    effort/mMedium: expected under 1 day of work
    source/queue-workerFiled or worked by the queue/worker pilot
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 28, 2026
  4. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: PR #1563 (the victim PR — a single-file diff to pkgs/id/src/directory.rs whose committed form parses; still open, blocked by this) · issue #1521 / queue task 1622 (the work PR #1563 serves; the task's resume notes name this same corruption) · the Magic Nix Cache HTTP 418 flake on the PR for #1418 (task 1485) as a sibling CI-infra phantom.

    Notes: Still live — verified this run: no merged PR resolves it; PR #1563 is open and its head is the run in question. The issue arrived with a ## Acceptance section; the appended ## Acceptance criteria formalizes it and adds the record-the-root-cause criterion. Evidence quality is high (run/job IDs, git-content comparison at head 56f010e9).

    Risks / suggested approach: CI-investigation class: start from the run's checkout/cache path rather than the code; if the mechanism cannot be reproduced, the hash-check guard is the durable deliverable. Effort classed effort/m — infra root-causing is open-ended, and a one-line fix after a long hunt is the expected shape.

    — repo-fleet-monitor intake pass, 2026-10-28T03:50Z

  5. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — queue task 2608 (lane E) — triage verdict: CONFIRMED one-off divergence; root cause unproven; routed to the guard branch

    Verified 2026-11-01:

    • The incident record checks out: run 40617526037 on head 56f010e is the only id run for that head (status completed/cancelled); nix ci and Auto Assign on the same head both succeeded — the torn copy was confined to the id workflow's source path on that runner.
    • The blocked work is long resolved: PR id(directory): drop + truncate torn final journal line in replay (#1521) #1563 merged 2026-10-28T07:14Z (merge commit ec0ce84) with no directory.rs fix for these errors — the committed file was never the bug. No re-run ever passed on the torn head itself.
    • No recurrence is recorded since 2026-10-28, and the acceptance's second branch is unmet: grep of .github/workflows/id-check.yml and pkgs/id on main (0ea0a0f) finds no source-tree hash or snapshot-mismatch guard.
    • The divergence point itself remains unproven (checkout state vs flake source copy vs runner store/cache) — the issue's own acceptance allows the mechanical-guard branch instead of a proven mechanism.

    Route: ci_investigation packet enqueued as queue task 5020: rank the divergence candidates from the run logs + workflow definition and record the findings here, and add the early source-snapshot integrity guard (digest at checkout, verify the build's copy, fail fast with "source snapshot mismatch" naming the differing files), verified clean-pass and mutated-fail.

  6. added
    queue/queuedHas a queued task in the Supabase agent queue
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 1, 2026
  7. 64 remaining items

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 1, 2026
  9. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up (task 5020 resumed, lane B)

    • Agent: repo-worker-code (lane B), queue task 5020
    • Why reopened: the issue was closed after PR fix(ci): derive id flake source path via getFlake outPath (#1569) #3524 merged, but the acceptance is not met in CI — fresh main run 41303442327 (head 628c06a) still fails EVERY check job at "Verify build source copy against checkout snapshot" with error: '/home/runner/work/code/code' is a shallow Git repository, so 'revCount' is not available (Determinate Nix getFlake on the shallow actions/checkout). Same failure on run 41301886497 (PR fix(ci): derive id flake source path via getFlake outPath (#1569) #3524 head).
    • This round: add &shallow=1 to the getFlake URL in both Verify steps (tells nix not to require revCount for the source copy), verify the expression + guard both ways on the laptop against a shallow clone, merge, and confirm the Verify step passes on the next main id run. Fallback if shallow=1 is not honoured: fetch-depth: 0 on the id-check checkouts.
  10. added a commit that references this issue on Nov 1, 2026
  11. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done — guard wiring FIXED and verified in CI (queue task 5020, lane B)

    • Agent: repo-worker-code (lane B)
    • Round 3 fix: PR fix(ci): shallow=1 on the id source-snapshot getFlake derivation (#1569) #3675 (merged c35ab37de) adds &shallow=1 to the git+file:// getFlake URL in both Verify steps of .github/workflows/id-check.yml. Root cause of the round-2 failure: actions/checkout is shallow and Determinate Nix refuses getFlake revCount on a shallow repo (revCount is not available), so the Verify step failed on every main run (41301886497, 41303442327) while Snapshot succeeded.
    • CI proof: main id run 41304099604 (head c35ab37de): "Verify build source copy against checkout snapshot" = success, and the job proceeded to "Run full nix flake check" — the first main run where the guard actually compares the build source copy.
    • Both-ways verification: laptop, exact workflow expression against a --depth 1 clone: clean verify passes (477 files); a mutated store copy fails exit 1 with source snapshot mismatch naming src/directory.rs. Codex review of PR fix(ci): shallow=1 on the id source-snapshot getFlake derivation (#1569) #3675 completed with no findings.
    • Acceptance: root-cause findings recorded on this issue across rounds 1–3 ✓; guard early in the id workflow, fails fast by name ✓; verified both ways (clean pass in CI + mutated fail locally) ✓. Closing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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/queue-workerFiled or worked by the queue/worker pilotstatus:done

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions