Repository navigation
dir-sim: persisted rules resolve by exact (name, version) - #1481
Conversation
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 28 minutes. View limit details
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 |
Codex Review SummaryThis 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. |
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
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 inStoredRule { name, version }, next toStoredOriginandStoredVersion. ARuleIdnames 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.REVERTis always registered, because the store records it itself.VersionStore::restore_stored: refuses an image that names any unknown rule.RestoreError::UnknownRuleslists 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), andrule(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)REVERTresolves 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 warningsandcargo testpass onlance-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