[PR #1854] [MERGED] fix(artifacts): count a changed partial-inventory root once #4854

Closed
opened 2026-10-31 00:56:02 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/artifact-comparison-root-once


📝 Commits (1)

  • f68c520 fix(artifacts): count a changed partial-inventory root once

📊 Changes

2 files changed (+114 additions, -17 deletions)

View changed files

📝 src/domain/artifactComparison.ts (+31 -14)
📝 tests/boundary/filesystem/artifactComparisonSummary.test.ts (+83 -3)

📄 Description

Summary

Fixes #1844.

compare_artifacts could report and count the root of two partial inventories twice. This happened when both inventories omitted node details but their manifest root digests differed. The root got two rows:

  • from classifyAvailability: unknown with availability
  • from rootHashChange: changed with content, because the fallback only stood down when an existing root row already carried content

So summary reported changed: 1, unknown: 1 for a single path.

Change

applyRootHashChange replaces rootHashChange. When the manifest root digests differ:

  • No root row yet (e.g. partial pages omit every occurrence): it appends the content row, as before.
  • Root row is unknown or changed without content: it upgrades that row in place to changed, adds content (dimensions stay in schema order: ["content", "availability"]), and keeps the row's occurrence and artifact IDs while merging citations.
  • Root row already has content, or is contradiction, added, or removed: it leaves the row unchanged, so contradiction precedence holds.

The overall truncated status and the incompleteness limitations are unchanged.

Validation

tests/boundary/filesystem/artifactComparisonSummary.test.ts runs real inventoryArtifact observations and derived partial Evidence through compareArtifacts:

  • Nodes omitted, digests differ: one root row, changed with ["content", "availability"], changed: 1, unknown: 0, still truncated. This test fails without the fix.
  • Nodes and occurrences omitted, digests differ: one content row, changed: 1.
  • Identical partial Evidence: no inferred content change; one unknown availability row.

npm run test:focused passes on the artifact comparison, artifact MCP, and analysis-session composition suites (14 files, 92 tests). npm run check:fast passes.

🤖 Generated with Claude Code


🔄 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/1854 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/artifact-comparison-root-once` --- ### 📝 Commits (1) - [`f68c520`](https://github.com/morluto/rea/commit/f68c52071c5a259d1df6f53b918772c905cc8a6b) fix(artifacts): count a changed partial-inventory root once ### 📊 Changes **2 files changed** (+114 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/artifactComparison.ts` (+31 -14) 📝 `tests/boundary/filesystem/artifactComparisonSummary.test.ts` (+83 -3) </details> ### 📄 Description ## Summary Fixes #1844. `compare_artifacts` could report and count the root of two partial inventories twice. This happened when both inventories omitted node details but their manifest root digests differed. The root got two rows: - from `classifyAvailability`: `unknown` with `availability` - from `rootHashChange`: `changed` with `content`, because the fallback only stood down when an existing root row already carried `content` So `summary` reported `changed: 1, unknown: 1` for a single path. ## Change `applyRootHashChange` replaces `rootHashChange`. When the manifest root digests differ: - **No root row yet** (e.g. partial pages omit every occurrence): it appends the content row, as before. - **Root row is `unknown` or `changed` without `content`**: it upgrades that row in place to `changed`, adds `content` (dimensions stay in schema order: `["content", "availability"]`), and keeps the row's occurrence and artifact IDs while merging citations. - **Root row already has `content`, or is `contradiction`, `added`, or `removed`**: it leaves the row unchanged, so contradiction precedence holds. The overall `truncated` status and the incompleteness limitations are unchanged. ## Validation `tests/boundary/filesystem/artifactComparisonSummary.test.ts` runs real `inventoryArtifact` observations and derived partial Evidence through `compareArtifacts`: - Nodes omitted, digests differ: one root row, `changed` with `["content", "availability"]`, `changed: 1, unknown: 0`, still `truncated`. This test fails without the fix. - Nodes and occurrences omitted, digests differ: one `content` row, `changed: 1`. - Identical partial Evidence: no inferred content change; one `unknown` availability row. `npm run test:focused` passes on the artifact comparison, artifact MCP, and analysis-session composition suites (14 files, 92 tests). `npm run check:fast` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:56:02 +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#4854
No description provided.