PolicyEngine / PolicyEngine/chronicle
Bundle expectations: per-source deltas that compose across parallel PRs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 11h 48m
- Merged PRs (30d)
- 45
Description
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_sourcemapping asserted key-by-key, so a PR touching onlyslcand a PR touching onlyobrcompose 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in tests/test_chronicle_bundle.py and inspect the existing whole-bundle, per-entity, and per-source assertions. Run that test file before and after reorganizing expectations around per-source and per-package counts. Done means disjoint source changes avoid constant conflicts while derived totals and the whole-bundle snapshot still catch drift or dropped records.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100