Skip to content

fix: reconcile the strict-feature suite with the verification AGENTS.md prescribes - #1157

Merged
scarmuega merged 2 commits into
mainfrom
fix/strict-feature-suite
Aug 3, 2026
Merged

fix: reconcile the strict-feature suite with the verification AGENTS.md prescribes#1157
scarmuega merged 2 commits into
mainfrom
fix/strict-feature-suite

Conversation

@scarmuega

@scarmuega scarmuega commented Aug 3, 2026

Copy link
Copy Markdown
Member

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-features had been failing on fourteen dolos-cardano property tests (9 model::accounts::prop_tests, 3 model::epochs::prop_tests, 2 model::pools::prop_tests) panicking on the strict-feature epoch-coherence assertions in EpochValue. 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 at Epoch(858894), delta at 6887), 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 (new rebase helper in epoch_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/141 dolos-cardano lib tests pass under strict.

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_support imports synthetic chains that jump from a fresh genesis domain straight to epoch 2, tripping live_mut's strict assert inside the fixture (EpochState at Epoch(0), delta at 2; trace: import_blocksRollWorkUnitEpochStatsUpdate::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 and rebase helper (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 — new Run unit tests (all features) step enforcing the prescribed all-features form.

Verification

Command Result
cargo test --workspace --all-targets pass (23 targets ok, 0 failed)
cargo test --workspace --all-features --exclude dolos-minibf --exclude dolos-minikupo --exclude dolos-trp pass (27 targets ok, incl. doctests)
cargo test -p dolos-cardano --features strict --lib pass (141 ok — the fourteen included)
cargo clippy --all-targets --all-features -- -D warnings pass
cargo +nightly fmt --all -- --check pass
cargo deny check advisories pass

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Expanded Linux CI coverage with comprehensive all-features workspace testing.
    • Improved property-based and round-trip test reliability by enforcing consistent epoch alignment across generated test data.
    • Added coverage for epoch rebasing while preserving associated values.
  • Documentation

    • Updated testing guidance to reflect the standard and all-features test commands, including documented fixture-related exclusions.

scarmuega and others added 2 commits August 3, 2026 16:20
…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>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Epoch alignment validation

Layer / File(s) Summary
Rebase generated epoch values
crates/cardano/src/model/epoch_value.rs, crates/cardano/src/model/accounts.rs, crates/cardano/src/model/epochs.rs
Test generators now rebase related values to shared account or epoch-state epochs.
Align round-trip delta epochs
crates/cardano/src/model/accounts.rs, crates/cardano/src/model/epochs.rs, crates/cardano/src/model/pools.rs
Round-trip tests now use the entity’s current epoch or the following epoch for transitions.
Document feature test coverage
.github/workflows/ci.yml, AGENTS.md
CI and testing guidance now define standard workspace tests and an all-features run excluding three service crates.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • txpipe/dolos#759: Related epoch alignment changes for model values and pool snapshots.
  • txpipe/dolos#764: Related epoch-transition timing changes in Cardano model state.
  • txpipe/dolos#902: Introduced strict epoch assertions exercised by these test updates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main changes to reconcile strict-feature tests with the verification requirements documented in AGENTS.md.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/strict-feature-suite

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.

❤️ Share

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

@coderabbitai coderabbitai Bot 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 294f6f6 and 6ea6b07.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • AGENTS.md
  • crates/cardano/src/model/accounts.rs
  • crates/cardano/src/model/epoch_value.rs
  • crates/cardano/src/model/epochs.rs
  • crates/cardano/src/model/pools.rs

Comment thread AGENTS.md
@scarmuega
scarmuega merged commit ed944a2 into main Aug 3, 2026
14 checks passed
@scarmuega
scarmuega deleted the fix/strict-feature-suite branch August 3, 2026 21:39
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.

1 participant