fix: reconcile the strict-feature suite with the verification AGENTS.md prescribes - #1157
Conversation
…riant The fourteen strict-feature property-test failures (accounts, epochs, pools) were a coherence bug in the test strategies, not in the ledger code: entities and deltas drew their epochs independently, so the strict assertions in EpochValue (a delta targets the entity's current epoch; a transition targets exactly the next one) failed almost surely. Rebase the independently drawn EpochValues onto one epoch per entity (ESTART rotates them in lockstep, so this is the only healthy shape) and carry the entity's epoch on each delta in the affected tests, following the alignment precedent already set by minted_blocks_inc_roundtrip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AGENTS.md told every agent to verify with `cargo test --workspace --all-features` while CI ran default features only, so the guidance and the suite disagreed. With the dolos-cardano strict failures fixed, the run now gets past that crate and surfaces a second latent class: the minibf (223), minikupo (33) and trp (10) fixtures import synthetic chains that jump from a fresh genesis domain straight to epoch 2, tripping the strict epoch-coherence assertions inside the fixture itself (EpochState still at epoch 0 when an epoch-2 block rolls). Reconcile the two sides on what the repository actually keeps green: AGENTS.md now prescribes the default-features run plus an all-features run that excludes the three service crates (reason recorded in the file), and CI runs both so they cannot drift again. The exclusions come off once the fixtures build epoch-coherent domains. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe change aligns generated epoch-dependent values and round-trip deltas across Cardano model tests. It adds a test-only rebasing helper and updates CI and testing guidance for all-features workspace tests with three service crates excluded. ChangesEpoch alignment validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AGENTS.md`:
- Around line 316-317: Update the all-features Cargo test command in AGENTS.md
to include the --all-targets flag, while preserving the existing workspace,
feature, and exclusion arguments so local verification matches CI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 31590b63-7208-4ab2-b717-fdbdeb7261bc
📒 Files selected for processing (6)
.github/workflows/ci.ymlAGENTS.mdcrates/cardano/src/model/accounts.rscrates/cardano/src/model/epoch_value.rscrates/cardano/src/model/epochs.rscrates/cardano/src/model/pools.rs
Plan
Item 3 of the store-APIs follow-up plan, split out of #1155 per review feedback ("green tests doesn't belong to this PR").
Diagnosis
cargo test --workspace --all-featureshad been failing on fourteendolos-cardanoproperty tests (9model::accounts::prop_tests, 3model::epochs::prop_tests, 2model::pools::prop_tests) panicking on thestrict-feature epoch-coherence assertions inEpochValue. The bug is in the test strategies, not in ledger code, and the assertions themselves are correct: entities and deltas drew their epochs independently (reproduced: entity atEpoch(858894), delta at6887), violating the invariant the assertions encode — a delta targets the entity's current epoch, a transition targets exactly the next one.The fix rebases the independently drawn
EpochValues onto one epoch per entity (newrebasehelper inepoch_value.rs's test module; ESTART rotates them in lockstep, so that is the only healthy shape) and carries the entity's epoch on each delta, following the alignment precedent already in the file (minted_blocks_inc_roundtrip). 141/141dolos-cardanolib tests pass understrict.Un-masked second class: with fail-fast no longer stopping at dolos-cardano, the run surfaces a latent, pre-existing incoherence in the service-crate fixtures — minibf (223), minikupo (33), trp (10) — whose
test_supportimports synthetic chains that jump from a fresh genesis domain straight to epoch 2, trippinglive_mut's strict assert inside the fixture (EpochStateatEpoch(0), delta at2; trace:import_blocks→RollWorkUnit→EpochStatsUpdate::apply). That is test-harness wiring with its own escalation (#1156) and follow-up plan (dolos-service-fixture-epoch-coherence). Until the fixtures build epoch-coherent domains, AGENTS.md prescribes the all-features run with those three crates excluded — reason recorded in the file — and CI runs both prescribed commands (all-features leg on Linux only; feature-gated code is platform-independent) so guidance and suite cannot drift apart again.Changes
crates/cardano/src/model/{epoch_value,accounts,epochs,pools}.rs— the strategy fixes andrebasehelper (test code only; no ledger change).AGENTS.md— testing prescription now matches what the repository keeps green, with the exclusion reason recorded..github/workflows/ci.yml— newRun unit tests (all features)step enforcing the prescribed all-features form.Verification
cargo test --workspace --all-targetscargo test --workspace --all-features --exclude dolos-minibf --exclude dolos-minikupo --exclude dolos-trpcargo test -p dolos-cardano --features strict --libcargo clippy --all-targets --all-features -- -D warningscargo +nightly fmt --all -- --checkcargo deny check advisories🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Documentation