Skip to content

V6: Diff / compliance engine #308

Description

@ckrough

Complexity: L

Scope

The diff / compliance engine. Given the source-of-truth Composition snapshot (from #304's resolver) and each channel/hop's ListingSnapshot, compute:

  • Per-hop and per-channel status: in_sync / stale / missing.
  • The version delta (live version stamp vs. current Composition version).
  • A normalized text diff for stale rows.

Persist the resulting sync-status rows via #304's model.

Dependencies

Acceptance criteria

  • Identical normalized text and a matching version stamp -> status in_sync (test).
  • Text differing by a word, or an older live version stamp -> status stale, with the diff populated (test).
  • A missing snapshot -> status missing (test).
  • Running the engine over a fixture batch persists one status row per animal x channel x hop, and they read back through the V2: Compliance data model + source-of-truth resolution + Alembic + org RLS #304 store (integration test).

ADR: docs/adr/0033-listing-sync-verification.md. Epic: #302.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionalitymodule:listingsListing Compliance service (services/listings)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions