Skip to content

dir-sim: persisted rules resolve by exact (name, version) - #1481

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-0455e606-wmtsor
Oct 11, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-0455e606-wmtsor

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

Decision 2(a): persisted rules resolve by exact (name, version). An implementation registered under any other version is never used in its place. Read-only inspection of the history still works when a rule is unknown. This is D-DSP-4.

  • StoredImage: the image with every rule held as text in StoredRule { name, version }, next to StoredOrigin and StoredVersion. A RuleId names its rule as &'static str, which a storage crate cannot write.
  • RuleRegistry: resolves a stored rule only to the registered rule with the same name and the same version. Another version is different behaviour and is never taken in its place. REVERT is always registered, because the store records it itself.
  • VersionStore::restore_stored: refuses an image that names any unknown rule. RestoreError::UnknownRules lists every unknown version.
  • History: restores the same image for reading only. Deltas are stored verbatim, so viewing a version needs no rule. It exposes reads only (view, diff, tag, verdict, version, value, lookup), and rule(v) returns the rule each simulated version was made with, as stored. Nothing can be simulated on top of it.

The plan and board record decisions 2(a), 3(b) and 4(b).

Tests (tests/persist.rs)

  • Round trip: a stored image round-trips and reads the same.
  • No version substitution: registering v2 does not stand in for v1, and both unknown versions are listed.
  • Unknown rules stay readable: a history with unknown rules still reads every version, diff, verdict and tag the same.
  • Revert: REVERT resolves without being registered.

Disable runs were red as required: substituting a same-name rule fails the v2/v1 test, and dropping the unknown-rule check fails the refusal test.

cargo +1.99.0 fmt --check, clippy --all-targets -D warnings and cargo test pass on lance-graph-dir-sim, rerun after rebasing on #1480. The supersession index is current.

Next

The log PR (D-DSP-2a: ordered logical versions in atomic, verified append-only batches; torn saves are detected and incomplete recovery is refused) follows once this merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg


Generated by Claude Code

A RuleId names its rule as &'static str, so a persisted history cannot
hold one: a storage crate writes text. StoredImage is the image with
every rule as StoredRule { name, version }, StoredOrigin and
StoredVersion beside it.

RuleRegistry resolves a stored rule only to the registered rule with
the same name and the same version. Another version of the rule is a
different behaviour and is never taken in its place. REVERT is always
registered, since the store records it itself.

VersionStore::restore_stored refuses an image with any unknown rule
(RestoreError::UnknownRules lists every such version). History restores
the same image for reading only: deltas are stored verbatim, so viewing
a version needs no rule. It exposes reads only (view, diff, tag,
verdict, version, value, lookup) and rule(v) gives each simulated
version's rule as stored; nothing can be simulated on top of it.

tests/persist.rs: stored round trip reads the same; a v2 registration
does not stand in for v1 (both unknown versions listed); the unknown
history still reads every version, diff, verdict and tag the same;
revert resolves unregistered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 11, 2026 10:07
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 63 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: b0233380-ccf1-4dc5-828a-bd12a7434f1e

📥 Commits

Reviewing files that changed from the base of the PR and between d025754 and 164bdfe.


📒 Files selected for processing (5)
  • .claude/board/STATUS_BOARD.md
  • .claude/plans/dir-sim-persist-v1.md
  • crates/lance-graph-dir-sim/src/image.rs
  • crates/lance-graph-dir-sim/src/store.rs
  • crates/lance-graph-dir-sim/tests/persist.rs

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T10:09:30.916592Z 164bdfe Draft marked ready
ℹ️ 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.

@AdaWorldAPI
AdaWorldAPI merged commit c7c4a53 into main Oct 11, 2026
13 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Oct 11, 2026
D-DSP-2b. A new workspace-excluded crate, lance-graph-dir-sim-lance, so
lance-graph-dir-sim itself stays free of lance, arrow and datafusion.
It stores the records lance_graph_dir_sim::log builds and reads them
back; it decides nothing about their content.

- LanceLog::append stores one batch as one Lance commit (Create for the
  first, then Append) and only then advances the LogState. The writer
  holds the dataset version it last saw: if the dataset is elsewhere,
  nothing is written (StaleWriter), because Lance would rebase an append
  onto a newer version and interleave two writers' batches. A commit that
  does not land as the next version is reported as Race.
- LanceLog::restore reads every record in one scan and hands them to
  replay; a missing dataset is an empty log.
- The logical versions stay in the records; the Lance version is only
  the physical commit counter.

Tests: two saves restore to the same reads and the same log state; a
missing dataset is an empty log; a stale writer writes nothing, on create
and on append; a batch stored with a record missing is refused at
restore; a batch out of order is refused before anything is written.

CI: .github/workflows/dir-sim-persist.yml builds and tests the crate
(protoc and the protobuf includes installed, which lance's build needs).
Board: D-DSP-2a shipped (#1482), D-DSP-4 shipped (#1481), D-DSP-2 in PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
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