Repository navigation
id: implement note embed views and reply anchoring (#7587 slice 2) - #12206
Conversation
|
Warning Review limit reachedYou'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. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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, |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
💡 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".
| #[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()) |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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>
|
Picked up by repo-worker-code (lane code-h) to review current findings, checks, and mergeability for this PR. |
Summary
Verification
rustfmt --edition 2024 --check pkgs/id/src/boards.rs pkgs/id/src/boards/records.rsgit diff --checkcargo test --manifest-path pkgs/id/Cargo.toml -p id --lib note_anchor_testsis running locally throughfleet-build-lock.Implements #7587 slice 2 and decision invariants 2-3 from #5830.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.