[PR #698] [MERGED] fix(comparison): retain container-only export shape paths #2178

Closed
opened 2026-10-16 21:15:17 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/698
Author: @kaoru0822-kitauji
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/export-container-coverage


📝 Commits (1)

  • 7864d66 fix(comparison): retain container-only export shape paths

📊 Changes

2 files changed (+291 additions, -1 deletions)

View changed files

📝 src/domain/javascriptExportShapeVariants.ts (+6 -1)
➕ tests/boundary/filesystem/javascriptExportContainerCoverage.test.ts (+285 -0)

📄 Description

Summary

Include retained container-only paths in export-shape comparison instead of silently omitting them.

No separate issue: this is a reproduced comparison-boundary defect.

Problem and expected behavior

Comparing { type: "item" } with { type: "item", options: {} } currently returns no changes and complete-within-inputs, even though the source graph retains /options in property_coverage. Empty arrays, removals and nested empty containers have the same omission.

The existing container policy from #523 represents retained containers as unknown primitive values, as confirmed by the maintainer. Container-only paths must reach that existing logic rather than disappear.

Change and scope

Add both shapes' property-coverage paths to diffPair's unique sorted path set. Reuse the existing field lookup, pairing, availability and uncertainty rules.

An absent/retained-container pair now reports an unknown change with partial coverage. Equal retained containers remain unchanged. This does not invent a structural value model or claim a definitive primitive add/remove.

Contract and boundary impact

  • Semantic owner: export-shape comparison path enumeration.
  • CLI/MCP: existing unknown comparisons now include previously omitted container-only paths; no schemas or tools change.
  • Provider/platform: unchanged.
  • Evidence/provenance: source Evidence, graph observations, source ranges and evidence links are preserved; the derived comparison identifier reflects the corrected output.
  • Process/authorization/cleanup: analysis remains inert; no source execution or new authority.
  • Generated metadata/package: unchanged.

Evidence and regression coverage

The exact new public-workflow test file fails eight cases on unchanged main 132a3a4, while eight controls pass.

Regressions cover absent/empty object and array properties in both directions, nested paths, entire container subtrees, escaped JSON-pointer keys and partial parent coverage. Controls preserve equal containers, unchanged primitive fields and primitive add/remove/change results.

Before/after public analysis → evidence-validated comparison probes retain all 12 source Evidence IDs and complete normalized source analyses. Only comparison observations change.

Validation performed

  • Focused public comparison, schema and existing MCP parity suites: 37 tests passed.
  • Build and npm run check: passed; all five check tasks succeeded (93 existing-file warnings, no errors).
  • npm run jscpd, npm run scan:todos, changed-file lint and git diff --check: passed.
  • Independent review completed before publication with no blocking findings.

Node.js 24.19.0, npm 11.9.0, exact locked dependencies. Hosted CI is tracked separately; no full local suite pass is claimed.

Compatibility, safety, and release

No schema, dependency, packaging, provider or execution-authority changes. Package-install and real Hopper/Ghidra lanes were not rerun for this comparison-only correction.

Prepared with AI assistance.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/698 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/export-container-coverage` --- ### 📝 Commits (1) - [`7864d66`](https://github.com/morluto/rea/commit/7864d665e15edec29ade0f3fb7ac374b8579c2c0) fix(comparison): retain container-only export shape paths ### 📊 Changes **2 files changed** (+291 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascriptExportShapeVariants.ts` (+6 -1) ➕ `tests/boundary/filesystem/javascriptExportContainerCoverage.test.ts` (+285 -0) </details> ### 📄 Description ## Summary Include retained container-only paths in export-shape comparison instead of silently omitting them. No separate issue: this is a reproduced comparison-boundary defect. ## Problem and expected behavior Comparing `{ type: "item" }` with `{ type: "item", options: {} }` currently returns no changes and `complete-within-inputs`, even though the source graph retains `/options` in `property_coverage`. Empty arrays, removals and nested empty containers have the same omission. The existing container policy from #523 represents retained containers as unknown primitive values, as [confirmed by the maintainer](https://github.com/morluto/rea/pull/523#issuecomment-5989506190). Container-only paths must reach that existing logic rather than disappear. ## Change and scope Add both shapes' property-coverage paths to `diffPair`'s unique sorted path set. Reuse the existing field lookup, pairing, availability and uncertainty rules. An absent/retained-container pair now reports an `unknown` change with partial coverage. Equal retained containers remain unchanged. This does not invent a structural value model or claim a definitive primitive add/remove. ## Contract and boundary impact - Semantic owner: export-shape comparison path enumeration. - CLI/MCP: existing unknown comparisons now include previously omitted container-only paths; no schemas or tools change. - Provider/platform: unchanged. - Evidence/provenance: source Evidence, graph observations, source ranges and evidence links are preserved; the derived comparison identifier reflects the corrected output. - Process/authorization/cleanup: analysis remains inert; no source execution or new authority. - Generated metadata/package: unchanged. ## Evidence and regression coverage The exact new public-workflow test file fails eight cases on unchanged main `132a3a4`, while eight controls pass. Regressions cover absent/empty object and array properties in both directions, nested paths, entire container subtrees, escaped JSON-pointer keys and partial parent coverage. Controls preserve equal containers, unchanged primitive fields and primitive add/remove/change results. Before/after public analysis → evidence-validated comparison probes retain all 12 source Evidence IDs and complete normalized source analyses. Only comparison observations change. ## Validation performed - Focused public comparison, schema and existing MCP parity suites: 37 tests passed. - Build and `npm run check`: passed; all five check tasks succeeded (93 existing-file warnings, no errors). - `npm run jscpd`, `npm run scan:todos`, changed-file lint and `git diff --check`: passed. - Independent review completed before publication with no blocking findings. Node.js 24.19.0, npm 11.9.0, exact locked dependencies. Hosted CI is tracked separately; no full local suite pass is claimed. ## Compatibility, safety, and release No schema, dependency, packaging, provider or execution-authority changes. Package-install and real Hopper/Ghidra lanes were not rerun for this comparison-only correction. Prepared with AI assistance. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:17 +00:00
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#2178
No description provided.