Skip to content

Rust hygiene: collapse compare_archive.rs into compare.rs #347

@willwashburn

Description

@willwashburn

Context

crates/relayburn-sdk/src/analyze/compare_archive.rs is 753 lines that documents itself out of existence. Its own doc says (paraphrasing) "per #259's redesign, the Rust ledger is already SQLite-only, so this port is a thin shell." The actual logic is a 5-line wrapper around Ledger::query_turns + build_compare_table.

The other ~750 lines are fixture and helper boilerplate to test what is fundamentally a one-liner.

Proposed fix

  1. Move compare_from_archive (the one functional helper) into crates/relayburn-sdk/src/analyze/compare.rs as a small fn.
  2. Re-target the test cases that actually exercise distinct compare logic into compare.rs's test module; drop the duplicate fixtures.
  3. Delete crates/relayburn-sdk/src/analyze/compare_archive.rs.
  4. Update crates/relayburn-sdk/src/analyze.rs to keep the public compare_from_archive re-export pointing at the new location — that keeps the SDK surface stable.

Verify the conformance gate (deep-equal vs TS) keeps passing on the compare verb.

References

  • crates/relayburn-sdk/src/analyze/compare_archive.rs
  • crates/relayburn-sdk/src/analyze/compare.rs
  • crates/relayburn-sdk/src/analyze.rs:54 (re-export site)
  • Analyze review notes from the May 2026 Rust review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions