[PR #5125] [CLOSED] fix(artifacts): keep a member's own name when its logical path is NFC #6777

Closed
opened 2026-11-01 21:42:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5125
Author: @bercedev
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/zip-nfc-member-name


📝 Commits (3)

  • 6a965d1 fix(artifacts): keep a member's own name when its logical path is NFC
  • 9189099 Merge origin/main into fix/zip-nfc-member-name
  • d8b8f8c Merge origin/main into fix/zip-nfc-member-name

📊 Changes

2 files changed (+30 additions, -2 deletions)

View changed files

📝 src/artifacts/inventory/ArtifactGraphConstruction.ts (+10 -2)
📝 tests/boundary/filesystem/artifactZipRelativePaths.test.ts (+20 -0)

📄 Description

Summary

Fixes #5108.

A ZIP member named café.txt (decomposed) appeared in the inventory only as café.txt, and nothing in the Evidence kept the spelling the archive stores. The NFC logical path stays as it is; the member's own name is now recorded as an occurrence limitation when NFC changes it.

Problem and expected behavior

normalizeArtifactPath applies NFC to every member name when the inventory builds logical paths. That is intended, for lookup, but the source spelling was dropped. The ZIP reader already keeps the original name in a limitation when it strips a leading ./; the NFC change had no equivalent. Expected (from the issue): keep the NFC logical_path and retain the decoded member spelling when normalization changes it.

Change and scope

createOccurrence adds Member name "<name>" is not in Unicode NFC; its logical path uses the NFC spelling. when entry.path differs from its NFC form. It is the one place occurrences are built from reader entries, so the note covers every archive reader, not only ZIP. Names already in NFC get no new limitation. Extraction output names are unchanged.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Ordinary fix within existing boundaries: not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: occurrence construction (createOccurrence in src/artifacts/inventory/ArtifactGraphConstruction.ts), right after normalizeArtifactPath.
  • Contribution scope fit and linked maintainer decision: ordinary fix, not applicable.
  • CLI and MCP/tool-catalog contract: no schema change; one more limitation string on affected occurrences.
  • Provider, bridge, target-format, or platform compatibility: all archive readers that feed the inventory.
  • Evidence, artifact, provenance, or reconstruction contract: the source member spelling is recoverable from Evidence; logical identity is unchanged.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: artifactZipRelativePaths.test.ts, a ZIP with café.txt and plain.txt: the first has logical path café.txt and the new limitation, the second has no limitation.
  • Base reproduction or other evidence: on main the new test fails (no limitation on the decomposed member).
  • User-visible CLI/MCP output (if applicable): not captured; the change is in the inventory Evidence the CLI returns.
  • Remaining proof gaps: the compiled CLI (inspect-artifact --json) was not run; checked through the inventory fixture. Other archive formats were not exercised separately.

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

In a Node 24.18.0 container (with procps) and no network, after npm ci:

  • npx vitest run tests/boundary/filesystem src/artifacts src/domain: 6933 passed, 108 failed, 303 skipped. On main, with the new test, 109 failed; the extra failure is the new test, and the other 108 are the same in both runs (release/CI tooling tests that need git, zip and similar tools absent from the container).
  • npx tsc --noEmit: no errors.
  • oxlint on the changed files: 4 warnings, 0 errors, the same 4 as on main.
  • oxfmt --check on the changed files: clean.
  • npm run verify:module-boundaries: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: none needed; inventory only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: the limitation repeats a member name the inventory already read; nothing new is read or written.

Author readiness

Human owner: @bercedev

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • 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.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Note: I used Claude Code while working on this.


🔄 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/5125 **Author:** [@bercedev](https://github.com/bercedev) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/zip-nfc-member-name` --- ### 📝 Commits (3) - [`6a965d1`](https://github.com/morluto/rea/commit/6a965d117eb95204ab39f0f3b35b02a7cd0c6021) fix(artifacts): keep a member's own name when its logical path is NFC - [`9189099`](https://github.com/morluto/rea/commit/91890995fb07f444ec6cd3432ea7087eebcad2d8) Merge origin/main into fix/zip-nfc-member-name - [`d8b8f8c`](https://github.com/morluto/rea/commit/d8b8f8c9a46b1fee4e5360d5d01ae5d361a28850) Merge origin/main into fix/zip-nfc-member-name ### 📊 Changes **2 files changed** (+30 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/inventory/ArtifactGraphConstruction.ts` (+10 -2) 📝 `tests/boundary/filesystem/artifactZipRelativePaths.test.ts` (+20 -0) </details> ### 📄 Description ## Summary Fixes #5108. A ZIP member named `café.txt` (decomposed) appeared in the inventory only as `café.txt`, and nothing in the Evidence kept the spelling the archive stores. The NFC logical path stays as it is; the member's own name is now recorded as an occurrence limitation when NFC changes it. ## Problem and expected behavior `normalizeArtifactPath` applies NFC to every member name when the inventory builds logical paths. That is intended, for lookup, but the source spelling was dropped. The ZIP reader already keeps the original name in a limitation when it strips a leading `./`; the NFC change had no equivalent. Expected (from the issue): keep the NFC `logical_path` and retain the decoded member spelling when normalization changes it. ## Change and scope `createOccurrence` adds `Member name "<name>" is not in Unicode NFC; its logical path uses the NFC spelling.` when `entry.path` differs from its NFC form. It is the one place occurrences are built from reader entries, so the note covers every archive reader, not only ZIP. Names already in NFC get no new limitation. Extraction output names are unchanged. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. Ordinary fix within existing boundaries: not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: occurrence construction (`createOccurrence` in `src/artifacts/inventory/ArtifactGraphConstruction.ts`), right after `normalizeArtifactPath`. - Contribution scope fit and linked maintainer decision: ordinary fix, not applicable. - CLI and MCP/tool-catalog contract: no schema change; one more limitation string on affected occurrences. - Provider, bridge, target-format, or platform compatibility: all archive readers that feed the inventory. - Evidence, artifact, provenance, or reconstruction contract: the source member spelling is recoverable from Evidence; logical identity is unchanged. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `artifactZipRelativePaths.test.ts`, a ZIP with `café.txt` and `plain.txt`: the first has logical path `café.txt` and the new limitation, the second has no limitation. - Base reproduction or other evidence: on `main` the new test fails (no limitation on the decomposed member). - User-visible CLI/MCP output (if applicable): not captured; the change is in the inventory Evidence the CLI returns. - Remaining proof gaps: the compiled CLI (`inspect-artifact --json`) was not run; checked through the inventory fixture. Other archive formats were not exercised separately. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed In a Node 24.18.0 container (with procps) and no network, after `npm ci`: - `npx vitest run tests/boundary/filesystem src/artifacts src/domain`: 6933 passed, 108 failed, 303 skipped. On `main`, with the new test, 109 failed; the extra failure is the new test, and the other 108 are the same in both runs (release/CI tooling tests that need `git`, `zip` and similar tools absent from the container). - `npx tsc --noEmit`: no errors. - `oxlint` on the changed files: 4 warnings, 0 errors, the same 4 as on `main`. - `oxfmt --check` on the changed files: clean. - `npm run verify:module-boundaries`: passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: none needed; inventory only. - Package or release metadata impact: none. - Security, privacy, process, or containment review: the limitation repeats a member name the inventory already read; nothing new is read or written. ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: @bercedev - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] 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. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. Note: I used Claude Code while working on this. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:42:58 +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#6777
No description provided.