Skip to content

fix(chainfold): reject cursorless snapshots that carry a ring - #48

Merged
rymnc merged 2 commits into
mainfrom
fix/chainfold-cursorless-ring-decode
Sep 29, 2026
Merged

rymnc merged 2 commits into
mainfrom
fix/chainfold-cursorless-ring-decode

Conversation

@rymnc

@rymnc rymnc commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

fixes #49

decode_snapshot validated ring.last() == cursor.block only for Some cursors. A
cursorless envelope with ring entries decoded into an engine with cursor = None and a
non-empty ring, which no engine reaches. The first batch then set the cursor without
pushing its block, and every later batch failed with CursorBlockUnobserved.

Copilot AI lite review requested due to automatic review settings September 28, 2026 10:32
@rymnc rymnc self-assigned this Sep 28, 2026

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Update the mismatch error message to accurately describe cursorless snapshots.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Rejects cursorless snapshots containing ring entries to preserve cursor/ring consistency during decoding.

Changes:

  • Enforces cursor/ring presence consistency.
  • Adds regression coverage for malformed snapshots.
File Description
crates/​chainfold/​src/​snapshot.rs Updates snapshot validation and adds regression coverage; error wording should also cover cursorless cases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/chainfold/src/snapshot.rs Resolved
@oskarth
oskarth removed their request for review September 29, 2026 03:17
@rymnc
rymnc merged commit e5061c8 into main Sep 29, 2026
14 checks passed
@rymnc
rymnc deleted the fix/chainfold-cursorless-ring-decode branch September 29, 2026 08:51
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.

chainfold: decode_snapshot accepts a cursorless snapshot with a non-empty ring

3 participants