[GH-ISSUE #4681] [Bug] Application version comparison treats unresolved relationship targets as aligned #2441

Closed
opened 2026-10-17 21:04:42 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @morluto on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4681

Area

Evidence, artifacts, or reconstruction

Observed behavior

Controlled complete graph comparison returns the uniquely paired importer as unchanged with no dimensions, although its imported peer has two ambiguous cross-version candidates. The four peer items correctly remain unknown. The importer's relationship comparison silently treats these unresolved targets as aligned by node kind.

Reproduction

Executed a bounded compiled-domain control against main 1e36e707b1f991fde826947bab04d436e64b7f97 using createJavaScriptApplicationNode, createJavaScriptApplicationEdge, createJavaScriptApplicationGraph, and compareJavaScriptApplicationVersions:

  • Each version has three javascript-module nodes with artifact-local identities: one main node with source digest d repeated 64 times, two peer nodes sharing digest c repeated 64 times. Artifact digests differ between versions; labels, properties and artifact-path locations are otherwise equal.
  • Each main node imports one of its local peer nodes. No peer has a unique permitted match key; all four peers remain ambiguous.
  • Compare the validated graphs under complete coverage with distinct synthetic Evidence IDs and no native observations.

Observed output:

{"summary":{"unchanged":1,"added":0,"removed":0,"changed":0,"unknown":4},"main_status":"unchanged","main_dimensions":[],"main_match_basis":"exact-module-source-digest","imported_peer_match":"ambiguous","peer_right_candidates":2}

No CLI/MCP, target execution, or real application reproduction was performed. Original control artifacts are retained locally under .cache/codebase-audit/relationship-ambiguity-proof.*; the graph premises above describe the executed fixture.

Expected behavior

Preserve the exact main-module content match and ambiguous peer candidates. Its relationship alignment remains unknown until adjacent identities are established; inventory completeness alone cannot resolve that ambiguity. Do not force a peer pairing or claim equality solely because both neighbors have the same node kind. AGENTS.md requires unresolved identity/applicability to remain unknown rather than aligned.

Impact and scope

Observed analytical uncertainty loss in a controlled pure comparison. Real-application frequency and public adapter reproduction: NOT_ENOUGH_INFO. The result retains source edges and peer ambiguity, so a reader can recover the uncertainty manually; the importer status hides it.

REA version

6.5.0, main 1e36e707b1f991fde826947bab04d436e64b7f97. The relevant fallback remains in published 556504edc.

Runtime and platform

Node 24.18.0, Darwin arm64; pure graph computation.

Target and artifact context

Synthetic, schema-validated complete three-node graphs. Synthetic digest values represent fixture identities; no bytes or runtime behavior were independently observed.

Interface

Shared comparison domain; CLI/MCP impact is source-derived, not executed in this control.

Earliest failure stage

Relationship comparison after cross-version node matching.

Relevant output or evidence

src/domain/javascript/javascriptApplicationVersionItems.ts, edgeSignature: an unpaired neighbor becomes unmatched:${neighbor?.kind ?? "unknown"}. relationshipSignature compares those strings, losing the unresolved identity. matchedItem then sees complete graphs and no differing dimensions and returns unchanged. Related #4520 concerns location-only changes and has an independent fix; #3188 concerns module digest matching.

Typed outcome or recovery expected

Retain known content/property facts, candidate sets, and both source edges while representing unresolved relationship alignment explicitly. A uniquely matched-neighbor control should remain unchanged when its topology is equal; positive direction/relation/target differences should still be reported. Partial coverage must not acquire stronger certainty.

Analysis or suspected cause

The relationship producer returns a binary signature equality instead of carrying identity uncertainty separately. Proposed check: compare the same fixture with unique peer digests, and with an actual resolved target change, before selecting an explicit relationship-outcome representation.

Additional context

Open/closed searches for comparison/version, unmatched/ambiguous, and relationship found #3188/#3191/#4520 and broader trackers, no focused duplicate. This report does not claim that either ambiguous peer pair is equal or different.

Originally created by @morluto on GitHub (Oct 17, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4681 ### Area Evidence, artifacts, or reconstruction ### Observed behavior Controlled complete graph comparison returns the uniquely paired importer as `unchanged` with no dimensions, although its imported peer has two ambiguous cross-version candidates. The four peer items correctly remain `unknown`. The importer's relationship comparison silently treats these unresolved targets as aligned by node kind. ### Reproduction Executed a bounded compiled-domain control against main `1e36e707b1f991fde826947bab04d436e64b7f97` using `createJavaScriptApplicationNode`, `createJavaScriptApplicationEdge`, `createJavaScriptApplicationGraph`, and `compareJavaScriptApplicationVersions`: - Each version has three `javascript-module` nodes with artifact-local identities: one main node with source digest `d` repeated 64 times, two peer nodes sharing digest `c` repeated 64 times. Artifact digests differ between versions; labels, properties and artifact-path locations are otherwise equal. - Each main node imports one of its local peer nodes. No peer has a unique permitted match key; all four peers remain ambiguous. - Compare the validated graphs under complete coverage with distinct synthetic Evidence IDs and no native observations. Observed output: ```json {"summary":{"unchanged":1,"added":0,"removed":0,"changed":0,"unknown":4},"main_status":"unchanged","main_dimensions":[],"main_match_basis":"exact-module-source-digest","imported_peer_match":"ambiguous","peer_right_candidates":2} ``` No CLI/MCP, target execution, or real application reproduction was performed. Original control artifacts are retained locally under `.cache/codebase-audit/relationship-ambiguity-proof.*`; the graph premises above describe the executed fixture. ### Expected behavior Preserve the exact main-module content match and ambiguous peer candidates. Its relationship alignment remains unknown until adjacent identities are established; inventory completeness alone cannot resolve that ambiguity. Do not force a peer pairing or claim equality solely because both neighbors have the same node kind. AGENTS.md requires unresolved identity/applicability to remain unknown rather than aligned. ### Impact and scope Observed analytical uncertainty loss in a controlled pure comparison. Real-application frequency and public adapter reproduction: NOT_ENOUGH_INFO. The result retains source edges and peer ambiguity, so a reader can recover the uncertainty manually; the importer status hides it. ### REA version 6.5.0, main `1e36e707b1f991fde826947bab04d436e64b7f97`. The relevant fallback remains in published `556504edc`. ### Runtime and platform Node 24.18.0, Darwin arm64; pure graph computation. ### Target and artifact context Synthetic, schema-validated complete three-node graphs. Synthetic digest values represent fixture identities; no bytes or runtime behavior were independently observed. ### Interface Shared comparison domain; CLI/MCP impact is source-derived, not executed in this control. ### Earliest failure stage Relationship comparison after cross-version node matching. ### Relevant output or evidence `src/domain/javascript/javascriptApplicationVersionItems.ts`, `edgeSignature`: an unpaired neighbor becomes `unmatched:${neighbor?.kind ?? "unknown"}`. `relationshipSignature` compares those strings, losing the unresolved identity. `matchedItem` then sees complete graphs and no differing dimensions and returns `unchanged`. Related #4520 concerns location-only changes and has an independent fix; #3188 concerns module digest matching. ### Typed outcome or recovery expected Retain known content/property facts, candidate sets, and both source edges while representing unresolved relationship alignment explicitly. A uniquely matched-neighbor control should remain unchanged when its topology is equal; positive direction/relation/target differences should still be reported. Partial coverage must not acquire stronger certainty. ### Analysis or suspected cause The relationship producer returns a binary signature equality instead of carrying identity uncertainty separately. Proposed check: compare the same fixture with unique peer digests, and with an actual resolved target change, before selecting an explicit relationship-outcome representation. ### Additional context Open/closed searches for comparison/version, unmatched/ambiguous, and relationship found #3188/#3191/#4520 and broader trackers, no focused duplicate. This report does not claim that either ambiguous peer pair is equal or different.
Author
Owner

@morluto commented on GitHub (Oct 17, 2026):

Published on main in 4d980d017 (fix(javascript): preserve unresolved version relationships).

The relationship producer now carries positive topology differences separately from unresolved neighbor identity. Same-kind unpaired neighbors no longer establish equality. Exact content pairing, ambiguity candidates, original nodes/observations and source edges remain intact. Known content/property or complete topology changes remain changed while retaining any separate identity uncertainty. Complete inventory is not mislabeled incomplete merely because relationship alignment is unknown.

The superseded combined signature and edge wrapper are removed. An unknown item with no observed substantive difference no longer generates a redundant changed_from edge; its explicit pairing and uncertainty remain in the item. Unknown items with observed relationship differences under partial coverage still retain the comparison edge and partial evidence.

Reproduction/validation:

  • Clean 556504edc baseline: seven of nine expanded domain controls fail; uniquely paired equal topology and a resolved target change already pass. All nine pass with the fix.
  • 45 focused tests across 11 domain, compiled CLI and MCP files pass, followed by the final expanded nine-control run (eight overlap that suite).
  • Actual public CLI analysis/comparison of tiny Webpack bundles observes an exact main-factory match whose imported identical peers retain two ambiguous candidates. Main status is unknown with explicit relationship identity uncertainty; inventory coverage stays complete. No application code is executed.
  • The earlier relocation and source-directory controls now preserve exact bytes/pairing while reporting their unresolved chunk/sibling relationship. The fully resolved location-only domain control still returns unchanged. No duplicate peer match is forced.
  • npm run check:fast, npm run docs:check including five conformance tests, and normal commit/push hooks pass.

Completed retained-Evidence comparison against clean 556504edc, same tiny real CLI analysis inputs: two alternating warm filesystem repeats, baseline/candidate elapsed 110.17/111.15ms, CPU 142.65/139.90ms, sampled process-family RSS 120.09/104.73MB, raw cl100k_base full reply tokens 14,211/14,264. Separate first processes recorded; caches not flushed. Source nodes, observations, source relationships, matching and coverage were checked equal; exactly two formerly unchanged items become explicitly unknown. No redundant comparison edges are added. An intermediate implementation emitted unnecessary unknown change edges and cost 15,333 tokens; final graph cleanup removes that redundancy without dropping source facts or pairing.

CPU is wait4 root plus reaped children; sampled RSS can miss peaks/reparenting. No speed or memory improvement claim from this small sample. Whole-agent/catalog/retry, public adapter overhead, input analysis, cancellation and large-bundle costs remain unmeasured. Original Bitwarden releases were not rerun. Scope is controlled Darwin/Node 24.18.0 pure graphs and specified CLI/MCP workflows, without target execution or heavy profiling.

<!-- gh-comment-id:6229846452 --> @morluto commented on GitHub (Oct 17, 2026): Published on main in 4d980d017 (`fix(javascript): preserve unresolved version relationships`). The relationship producer now carries positive topology differences separately from unresolved neighbor identity. Same-kind unpaired neighbors no longer establish equality. Exact content pairing, ambiguity candidates, original nodes/observations and source edges remain intact. Known content/property or complete topology changes remain changed while retaining any separate identity uncertainty. Complete inventory is not mislabeled incomplete merely because relationship alignment is unknown. The superseded combined signature and edge wrapper are removed. An unknown item with no observed substantive difference no longer generates a redundant `changed_from` edge; its explicit pairing and uncertainty remain in the item. Unknown items with observed relationship differences under partial coverage still retain the comparison edge and partial evidence. Reproduction/validation: - Clean 556504edc baseline: seven of nine expanded domain controls fail; uniquely paired equal topology and a resolved target change already pass. All nine pass with the fix. - 45 focused tests across 11 domain, compiled CLI and MCP files pass, followed by the final expanded nine-control run (eight overlap that suite). - Actual public CLI analysis/comparison of tiny Webpack bundles observes an exact main-factory match whose imported identical peers retain two ambiguous candidates. Main status is unknown with explicit relationship identity uncertainty; inventory coverage stays complete. No application code is executed. - The earlier relocation and source-directory controls now preserve exact bytes/pairing while reporting their unresolved chunk/sibling relationship. The fully resolved location-only domain control still returns unchanged. No duplicate peer match is forced. - `npm run check:fast`, `npm run docs:check` including five conformance tests, and normal commit/push hooks pass. Completed retained-Evidence comparison against clean 556504edc, same tiny real CLI analysis inputs: two alternating warm filesystem repeats, baseline/candidate elapsed 110.17/111.15ms, CPU 142.65/139.90ms, sampled process-family RSS 120.09/104.73MB, raw cl100k_base full reply tokens 14,211/14,264. Separate first processes recorded; caches not flushed. Source nodes, observations, source relationships, matching and coverage were checked equal; exactly two formerly unchanged items become explicitly unknown. No redundant comparison edges are added. An intermediate implementation emitted unnecessary unknown change edges and cost 15,333 tokens; final graph cleanup removes that redundancy without dropping source facts or pairing. CPU is wait4 root plus reaped children; sampled RSS can miss peaks/reparenting. No speed or memory improvement claim from this small sample. Whole-agent/catalog/retry, public adapter overhead, input analysis, cancellation and large-bundle costs remain unmeasured. Original Bitwarden releases were not rerun. Scope is controlled Darwin/Node 24.18.0 pure graphs and specified CLI/MCP workflows, without target execution or heavy profiling.
Author
Owner

@XinwangTao commented on GitHub (Oct 18, 2026):

This is a good catch: when relationship targets stay unresolved, treating them as "aligned by node kind" makes the comparison report success with zero dimensions, which hides the actual ambiguity. Since the four peer items correctly stay unknown, the importer should arguably surface that uncertainty too (e.g. report the relationship as unresolved or unknown rather than unchanged). The fix in 556504e (preserving unresolved version relationships with positive topo...) looks like the right direction - keeping the ambiguity visible instead of collapsing it into a false negative.

<!-- gh-comment-id:6249578097 --> @XinwangTao commented on GitHub (Oct 18, 2026): This is a good catch: when relationship targets stay unresolved, treating them as "aligned by node kind" makes the comparison report success with zero dimensions, which hides the actual ambiguity. Since the four peer items correctly stay unknown, the importer should arguably surface that uncertainty too (e.g. report the relationship as unresolved or unknown rather than unchanged). The fix in 556504e (preserving unresolved version relationships with positive topo...) looks like the right direction - keeping the ambiguity visible instead of collapsing it into a false negative.
Author
Owner

@morluto commented on GitHub (Oct 18, 2026):

Closing as fixed on main after reconciling this report with the landed owner/consumer changes.

  • 4d980d017: fix(javascript): preserve unresolved version relationships. Validated with 45 focused domain/CLI/MCP tests, nine expanded domain controls, check:fast, and docs:check. Clean baseline fails seven controls and passes two positive controls. Controlled static fixtures only; no target execution or large-bundle profiling.

Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.

<!-- gh-comment-id:6255992909 --> @morluto commented on GitHub (Oct 18, 2026): <!-- rea-backlog-reconciliation-2026-10-19-4681 --> Closing as fixed on `main` after reconciling this report with the landed owner/consumer changes. - [4d980d017](https://github.com/morluto/rea/commit/4d980d017622d3175d86aaf3b0dcfbdf4ca3d091): fix(javascript): preserve unresolved version relationships. Validated with 45 focused domain/CLI/MCP tests, nine expanded domain controls, check:fast, and docs:check. Clean baseline fails seven controls and passes two positive controls. Controlled static fixtures only; no target execution or large-bundle profiling. Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2441
No description provided.