Skip to content

Bundle expectations: per-source deltas that compose across parallel PRs #157

Description

@juaristi22

Filed from #137's review: four UK-wave PRs (#137, #139, #141, #155) branch from the same base and each rewrites the absolute totals in tests/test_chronicle_bundle.py (fact_count, source_package_count, per-entity and per-source splits). Each is right on its own branch and stale the moment a sibling merges — so the current shape costs one hand-recomputed rebase per sibling merge, and the tempting conflict resolution (take one side's numbers) yields a green test that has stopped checking anything.

Proposal: keep the whole-bundle snapshot as a final tripwire, but move the load-bearing assertions to per-source (or per-package) counts:

  • a by_source mapping asserted key-by-key, so a PR touching only slc and a PR touching only obr compose without conflict — their diffs to the mapping are disjoint;
  • derived totals (sum of the mapping) asserted against the snapshot, so drift between the two representations still fails loudly;
  • per-package fact counts inside each source's packages, so an accidental record-set drop inside one package can't hide in a source-level aggregate.

A sibling merge then rebases with zero constant edits when sources are disjoint (the common case), and a genuine collision surfaces as a real semantic conflict on one mapping line instead of four unrelated integers.

Current cost is real: this wave alone has done four hand re-measurements (~13-minute suite runs each) that per-source deltas would have made no-ops.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions