Skip to content

fix(comparison): account for unpaired records after explicit bundle pairing - #603

Merged
morluto merged 3 commits into
morluto:mainfrom
rudycelekli:campaign/rea-oct5-domain-bundle-pairs
Oct 5, 2026
Merged

morluto merged 3 commits into
morluto:mainfrom
rudycelekli:campaign/rea-oct5-domain-bundle-pairs

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 5, 2026 •

Copy link
Copy Markdown

Summary

Explicit cross-record pairs no longer discard leftover opposite-side occurrences; one-sided membership stays unknown, without inferred additions or removals.

No issue is linked: this is a narrow, reproduced correction to an existing comparison invariant discovered while reviewing current code, with no new feature, architectural change, or public contract requiring a proposal.

Problem and expected behavior

For two bundles both containing A, B, C, an explicit A-left to B-right pair produced one changed pair and one unchanged C but silently dropped leftover B-left and A-right. Every input-side record must be accounted for after caller-selected one-to-one pairing.

Change and scope

Preserve remaining opposite-side occurrences when that same ID has already been consumed by an explicit pair. Keep the current upstream contract: one-sided membership remains unknown with unresolved_branch conclusions, and records_added/records_removed remain zero. Existing pair validation and Evidence identities are preserved.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Evidence bundle comparison / explicit record-pair accounting.
  • CLI and MCP/tool-catalog contract: same commands, schemas and result fields; corrected existing comparison values only.
  • Provider, bridge, target-format, or platform compatibility: no provider/bridge changes or new platform support.
  • Evidence, artifact, provenance, or reconstruction contract: existing content-addressed inputs and provenance preserved; no new artifact identity or authority claim.
  • Process execution, authorization, cleanup, or containment impact: none in production.
  • Generated metadata (docs/product-catalog.json), package, or installation impact: none; relevant metadata checks remain enforced.

Evidence and regression coverage

  • Tests added or updated: 7 focused canonical bundle comparison tests pass, including left/right count conservation and invalid-pair coverage.
  • Base reproduction or other evidence: executed production comparison regression fails on unchanged branch base; patched regression passes. No module mocks.
  • User-visible CLI/MCP output (if applicable): representative selected fields from the executed comparison fixture, not a claimed live CLI/provider session:
{"status":"unknown","summary":{"records_unchanged":1,"records_changed":1,"records_removed":0,"records_added":0,"unresolved":2}}
  • Remaining proof gaps: Caller-selected record alignment, not behavioral absence or runtime equivalence. The unmatched occurrence classifications retain existing limitations.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- src/domain/bundleComparison.test.ts — pass: 1 files, 7 tests.
  • npm run check — pass on final signed head.
  • Current upstream AGENTS.md/CONTRIBUTING (chore(test): separate development feedback from full verification #599) makes full check:pr optional for narrow fixes. Previous full-suite, check:ci and package evidence remains archived for the pre-repair or pre-rebase head; those counts are not claimed for this head. No packaging/distribution or provider behavior changed.

Existing upstream lint/TypeDoc warnings remain; passing gates are not claimed warning-free.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; existing comparison result shape preserved.
  • Real Hopper/Ghidra, browser, or OS coverage: not required for this pure comparison correction; controlled Evidence/fixture coverage described above.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no secrets, production data, new process execution, authorization mechanism, or containment change.

Review checklist

  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed (no new public contract or metadata change).
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

AI assistance was used for investigation, implementation and testing. The commit is signed and includes DCO sign-off.

CI baseline fixture follow-up

CI exposed an upstream source-map recovery fixture expecting a require inside dynamic with scope to be a known unbound loader. The lexical producer correctly keeps that binding unknown. The maintainer independently corrected the fixture in #609. I merged that upstream change and preserved the owner's exact fixture; the final diff against that upstream parent contains only this comparison correction. No production source-map extraction was weakened.

At final signed merge head fbcc337221745a18c79c0684af0ae4082f5dcf2e, npm run build:cached, npm run check, and the pre-push npm run check:fast pass; 30 focused tests across 2 files pass, including the original comparison regressions and all 23 source-map boundary tests. Remote CI reruns are not claimed complete while pending.

@rudycelekli

rudycelekli commented Oct 5, 2026 •

Copy link
Copy Markdown
Author

Update: the maintainer independently corrected the shared source-map fixture in #609 while the repair was being verified. I merged that upstream change and kept the owner's exact fixture, so the final diff against that upstream parent contains only this PR's comparison correction. Production source-map semantics are unchanged.

At signed head fbcc337, all 30 focused tests pass (the original comparison regressions plus 23 source-map boundary tests), as do build:cached, check, and pre-push check:fast. Remote CI is rerunning; pending checks are not claimed passing.

@morluto
morluto merged commit 12a2e37 into morluto:main Oct 5, 2026
19 checks passed
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(comparison): account for unpaired records after explicit bundle pairing.” I appreciate your contribution to REA.

darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…airing (morluto#603)

* fix(comparison): account for unpaired records after explicit bundle pairing

Signed-off-by: Rudy Celekli <[email protected]>

* test(browser): preserve unknown with-scope loader bindings

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
@morluto morluto added bug Something isn't working area: build Build, CI, packaging, and publishing labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants