Skip to content

id(boards): Post embed_ref is never validated — dangling and cross-board game-post references are accepted into BoardGraph #3963

Closed

Description

@dezren39

Bug

BoardGraph validates every object reference a Post carries — thread, parent post, and each attachment get existence + same-board scope checks via require_scoped — except embed_ref. A post whose embed_ref names a hash that is not in the graph at all, or a post that lives in a different board, is accepted into the graph. The module header promises the graph "checks signatures, canonical references, board scope, and the authority rules needed to accept an object" (pkgs/id/src/boards.rs:3-9); embed_ref is the one reference class that escapes that promise.

Evidence (verified this run, main @ e860d3a)

  • pkgs/id/src/boards.rs:62-68 — GamePostRef { object: ArtifactHash }, "Hash of the immutable signed game-post object."
  • pkgs/id/src/boards.rs:145 — Post.embed_ref: Option<GamePostRef>.
  • pkgs/id/src/boards.rs:505-524 — the BoardObject::Post arm of validate_links checks require_board, require_scoped(thread), the parent post (incl. same-thread), and every attachment — embed_ref is never read.
  • Laptop probe ~/git/fleet/probe-2026-11-01-laneB-boards/ (verbatim boards.rs, sha256 bcc08b3e… matching the repo file @ e860d3a; faithful minimal SignedArtifact harness; all 8 built-in boards tests pass):
    • post with embed_ref = hash of a nonexistent object → insert Ok (accepted)
    • post with embed_ref = a real post in a different board → insert Ok (accepted)
    • controls: the same missing hash as an attachment → insert Err; the same foreign post as an attachment → insert Err

Why it matters

The board graph is the validation substrate every later layer (replication #3806, board views #2813) will trust: an object in the graph is supposed to have had its references checked. A dangling embed reference means projections must re-validate (or render broken embeds), and a cross-board embed reference breaks the board-scope invariant the rest of the module enforces everywhere else — including for the attachments on the very same post.

Acceptance criteria

  • A Post whose embed_ref names an object not present in the graph is rejected at BoardGraph::insert with a clear error.
  • A Post whose embed_ref names an object scoped to a different board is rejected at insert.
  • The expected kind of the referenced object is decided and documented (a dedicated game-post object kind does not exist yet in v1; at minimum existence + same-board scope via require_scoped, with the kind rule stated in the code/docs for when the game-post type lands).
  • Regression tests in the boards.rs test module cover the missing-object and cross-board embed_ref cases, mirroring the existing attachment controls.
  • All existing boards tests still pass.

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/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b
    • Session / ID: cron job new-issue-creator-code-b, run 2026-11-01 14:20 CST
    • Found via: filed this run
    • Task: Validate Post.embed_ref in BoardGraph::validate_links (existence + same-board scope, like attachments), decide/document the expected referenced kind, and add regression tests for missing and cross-board embed references.
    • Expectation: effort/s — done when the acceptance criteria on this issue pass, including the two new rejection tests mirroring the attachment controls.
    • Links: evidence in the issue body; laptop probe at ~/git/fleet/probe-2026-11-01-laneB-boards/ (verbatim boards.rs, sha256-matched @e860d3a9; embed_ref missing/cross-board accepted, attachment controls rejected).
  3. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · adopted as Phase 1 of design #4113

  4. removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  5. 66 remaining items

  6. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor
    • Session / ID: repo-fleet-monitor run 2026-11-02 20:12 CST
    • Found via: monitor reconciliation
    • Task: Claim-evaporated repair: task 6273 is queued unclaimed (attempts 3/3, checkpoint stage handed_off) while this issue still carried claimed labels. Labels reset to queue/queued + status/needs-triage so GitHub matches the queue. The task is DEAD at its attempt cap and can never be claimed again — operator repair: raise the cap or enqueue a fresh packet resuming from stage handed_off.
    • Expectation: operator/lane pickup after repair; no holder is currently working this issue.
  7. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  8. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. dezren39 commented on Nov 3, 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

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/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