Skip to content

id(lib): references.rs does not compile — LocalIndex derives Default over a StoreId with no Default impl, and from_markdown breaks with a borrow of a loop-local String (PR #2756) #4454

Closed

Description

@dezren39

Summary

pkgs/id/src/references.rs, landed today by PR #2756 (merge 4b6d1f9, 2026-11-02T16:04Z, for #2259), does not compile. The module is declared unconditionally (pub mod references;, pkgs/id/src/lib.rs:213), so the id lib build on current main (verified at 466cf98) fails with two errors, both in references.rs:

  1. E0277 — LocalIndex derives Default over a field whose type has none. references.rs:301-303: #[derive(Clone, Debug, Default)] pub struct LocalIndex { store: StoreId, ... }, but StoreId (references.rs:61-63) derives only Clone, Debug, PartialEq, Eq, PartialOrd, Ord, and there is no impl Default for StoreId anywhere in pkgs/id/src, pkgs/id/crates, or pkgs/id/tests (grep-verified this run).
  2. E0597 — Reference::from_markdown breaks out of its parse loop with a borrow of a loop-local String. references.rs:122-124: the arm binds let rest: String = chars.collect(); and then break rest.strip_prefix("id://")?.strip_suffix(')')?; — the break value is a &str borrowed from rest, which is dropped at the end of the match arm while the borrowed value is stored in hex outside the loop.

Evidence (verified this run, laptop probe)

Probe: ~/git/fleet/probe-2026-11-02-laneA-references/ on the laptop — references.rs copied verbatim from main (md5 b939a8c3b71faa4fef2958834888ce1c, matched against the sandbox clone, the laptop copy, and the GitHub API copy of the file at main), with only a minimal p2panda_core::Hash shim and a waiting::AuthorKey = [u8; 32] stub around it. cargo test --offline on the verbatim file (log: verbatim-output.txt in the probe dir):

error[E0277]: the trait bound `StoreId: Default` is not satisfied   (src/references.rs:303)
error[E0597]: `rest` does not live long enough                      (src/references.rs:124)
error: could not compile `probe` (lib) due to 2 previous errors     (cargo-exit:101)

Both error patterns were additionally reproduced as minimal standalone files on both rustc 1.98 and the repo-pinned rustc 1.99 (edition 2024), so neither is a shim or toolchain artifact. With exactly two minimal fixes applied to the probe copy only — a Default impl for StoreId in the probe's lib.rs, and .to_owned() on the from_markdown break value — the module compiles and all 12 of its own unit tests pass (patched-output.txt), confirming these are the only two errors and that the tests were written against a compiling version that never landed.

Caveat: a full cargo check -p id --lib on the real crate was started in a laptop fleet worktree but stayed blocked behind another lane's build-directory lock for the duration of this run; the verbatim-file probe plus the isolated reproductions are the verification. PR #2756's checks at merge were CodeRabbit only (skipping) — no CI compile ran on it.

Why it matters

Every id build, test run, and Nix build on main is broken until this is fixed, and the failure is invisible to the feature-gated build-rot issues already tracked (#4340 web-feature tests, #4159 --no-default-features, #3962 ssh feature — all different feature sets; this one is the default lib build). Any lane now building pkgs/id on current main will hit these two errors first and may misattribute them to its own change.

Acceptance criteria

  • cargo check -p id --lib (default features) compiles on main: StoreId gains a Default impl (or LocalIndex drops the derive and constructs its store explicitly), and from_markdown no longer borrows across the loop break (e.g. the hex slice is owned, or rest is bound outside the loop).
  • cargo test -p id --lib references passes — the module's 12 existing unit tests, including the markdown round-trip tests that exercise from_markdown.
  • No other module's behavior changes; the fix is confined to references.rs (plus, if the Default impl is placed there, that same file).

Distinct from: #4340 (web-feature test rot in web/routes.rs), #4159 (--no-default-features gating in chat.rs/invite.rs), #3962 (ssh-feature compile), #3923 (id-core test compile — different crate).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/criticalDrop everything: main broken, security exposure, repo-wide outage
    queue/queuedHas a queued task in the Supabase agent queue
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: filed

  3. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  4. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Pickup by repo queue worker lane H for task 6354 (triage of #4454). Revalidating the two references.rs compile errors against current main and routing the fix; no hard-stop labels on #4454, PR #2756 confirmed MERGED 2026-11-02T16:04:19Z, and no open PR owns a references.rs compile fix.

  5. 17 remaining items

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

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

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

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  10. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/criticalDrop everything: main broken, security exposure, repo-wide outagesource/creatorFiled by the new-issue-creator jobtask/fixhas a fix task queuedtask/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