Skip to content

id: implement note embed views and reply anchoring (#7587 slice 2) - #12206

Merged
dezren39 merged 4 commits into
mainfrom
queue/20725-7587-note-board-slice2
Nov 22, 2026
Merged

dezren39 merged 4 commits into
mainfrom
queue/20725-7587-note-board-slice2

Conversation

@dezren39

@dezren39 dezren39 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Project NoteRef embeds into live or pinned content targets, preserving all concurrent live candidates and exposing a changed-since-posted indicator.
  • Fall back to the signed pinned version when live note data is unavailable.
  • Project exact/relocated reply anchors onto the current version, while orphaned replies remain on their original anchored version and passage.
  • Keep fetching and markup rendering outside the id package, consistent with its pure-projection boundary.

Verification

  • rustfmt --edition 2024 --check pkgs/id/src/boards.rs pkgs/id/src/boards/records.rs
  • git diff --check
  • Focused cargo test --manifest-path pkgs/id/Cargo.toml -p id --lib note_anchor_tests is running locally through fleet-build-lock.

Implements #7587 slice 2 and decision invariants 2-3 from #5830.


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

repo-worker-tmp-code-b added 2 commits November 21, 2026 00:31
…, partial)

Pure resolver for live/pinned NoteRef embeds and passage anchors
(exact/relocated/orphaned) with tests. Rendering and reply display
are not yet wired. Refs #7587, #5830 invariants 2-3.
@dezren39
dezren39 requested a review from a team as a code owner November 21, 2026 07:39
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 394b4729-bd93-406c-ab45-6d9c7c8471bd
Commits

Reviewing files that changed from the base of the PR and between 0912c06 and 2d9d911.

Files selected for processing: 2

  • pkgs/id/src/boards.rs
  • pkgs/id/src/boards/records.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T18:43:23.061961Z 2d9d911 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e101852570

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

#[serde(deny_unknown_fields)]
pub struct NotePassageSelector {
/// Stable section identifier in the note version.
pub section_id: String,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bound passage section identifiers during post validation

A signed post can now carry an arbitrarily large note_anchor.passage.section_id: BoardObject::validate_shape validates the post body and note reference but never validates this new string, and the signed-artifact envelope supplies no body-size bound. This bypasses the existing MAX_BOARD_TEXT_BYTES limits and lets a board participant force oversized strings through signature verification, graph storage, cloning, and replication. Validate section identifiers with a bounded text check when accepting the post, rather than relying on callers to construct reasonable selectors.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bb7effc: validate_shape now runs validate_text("note passage section", ...) on an anchor's passage section_id, so it is bounded by MAX_BOARD_TEXT_BYTES and must be non-empty, on both sign and verify. Added note_anchor_shape_bounds_the_passage_section.


Generated by Claude Code

A signed post's note_anchor.passage.section_id was never checked, so a
board participant could push an arbitrarily large string through
signature verification, storage and replication. Validate it like other
board text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb7effc8ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +618 to +622
#[test]
fn anchor_resolves_exact_when_quote_stays_at_original_range() {
assert_eq!(
resolve_note_anchor(&anchor(), &[passage(4, 12, 'c')]),
NoteAnchorResolution::Exact(anchor().passage.unwrap())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add property-based coverage for note projection invariants

The new resolution and presentation helpers are covered only by fixed examples, despite exposing meaningful invariants around passage identity, preservation of concurrent heads, and immutable orphan targets. Root AGENTS.md explicitly requires property-based coverage where meaningful invariants exist and states that example tests “do not replace PBT/MBT where those fit.” Add generated anchors, passage sets, and head sets with invariant oracles—for example, successful passage resolution must preserve the section and quote hash, orphan presentation must preserve the original version and passage, and live presentation must retain every concurrent candidate. The existing board property tests do not exercise these new helpers.

AGENTS.md reference: AGENTS.md:L38-L42

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 2d9d911: a note_projection_properties proptest module over generated anchors (including whole-note), passage sets and head sets drawn from small alphabets so they collide. Oracles: exact resolution returns the anchor's own selector, relocation keeps section and quote hash and picks the earliest match only when no exact one exists, orphaned means no same-quote passage; an orphan reply keeps the anchor's version and passage; a live embed shows every head in order and falls back to the pin only when there are none.


Generated by Claude Code

Property tests over generated anchors, passage sets and head sets: a
resolved passage keeps its section and quote hash (exact only on the
same range, relocation only to the earliest match), an orphan stays on
its original version and passage, and a live embed keeps every head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39 dezren39 added work/assigned Queue worker lifecycle state queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state labels Nov 22, 2026
@dezren39

Copy link
Copy Markdown
Member Author

Picked up by repo-worker-code (lane code-h) to review current findings, checks, and mergeability for this PR.

@dezren39
dezren39 merged commit c763b2e into main Nov 22, 2026
1 check passed
@dezren39
dezren39 deleted the queue/20725-7587-note-board-slice2 branch November 22, 2026 18:43
@dezren39

Copy link
Copy Markdown
Member Author

Verified PR #12206 merged at 2026-11-22T18:43:41Z as c763b2e. No closing issue references; #7587 remains open.

@dezren39 dezren39 removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants