[PR #3404] feat(artifacts): recognize CFB containers with explicit coverage limits #5722

Open
opened 2026-10-31 01:08:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3404
Author: @1052326311
Created: 10/14/2026
Status: 🔄 Open

Base: main ← Head: feat/cfb-artifact-recognition


📝 Commits (6)

  • d85f717 feat(artifacts): recognize CFB containers with explicit coverage limits
  • 57ecc4c Merge remote-tracking branch 'origin/main' into sweep/3404
  • 8da92e8 merge: retain CFB recognition alongside current target cancellation
  • 65f2c3b fix: integrate CFB recognition with current format registry
  • 4324053 chore: keep CFB PR limited to format recognition
  • e277e65 test(artifacts): validate advertised CFB MCP schemas

📊 Changes

16 files changed (+267 additions, -1 deletions)

View changed files

📝 docs/mcp-contracts.md (+10 -0)
📝 src/application/BinaryTargetResolver.ts (+3 -0)
📝 src/application/binary/TargetFormatVocabularies.test.ts (+1 -0)
📝 src/artifacts/artifactFormats.ts (+6 -0)
📝 src/artifacts/inventory/ArtifactGraphConstruction.ts (+6 -1)
📝 src/artifacts/inventory/reader.ts (+6 -0)
📝 src/artifacts/inventory/scanReader.ts (+3 -0)
📝 src/domain/analysisSnapshot.ts (+1 -0)
📝 src/domain/artifactGraph.ts (+2 -0)
📝 src/domain/artifactInspection.ts (+14 -0)
📝 src/domain/binaryTargetTypes.ts (+1 -0)
➕ src/domain/cfbFormat.ts (+10 -0)
📝 src/domain/evidenceSubject.ts (+1 -0)
📝 src/domain/liveBinaryTargetSummary.ts (+1 -0)
➕ tests/acceptance/cfbArtifactRecognition.test.ts (+174 -0)
➕ tests/fixtures/cfbArtifact.ts (+28 -0)

📄 Description

Summary

Related to #3153. Recognize Compound File Binary (CFB) containers by their eight-byte signature in root files and nested archive entries. Report the cfb format, digest, and unknown child coverage through the existing CLI/MCP artifact workflows. This is a recognition-only slice, not MSI parsing or full CFB support.

Change and scope

  • Admit signature-matched CFB as a non-executable archive target, independent of its filename. A .msi suffix alone does not establish CFB or Windows Installer semantics.
  • Use the current artifact-format registry and preserve the existing inventory owner. Root and nested inventory explicitly report unavailable CFB stream coverage; inspect_artifact retains an unexplored branch, and extract_artifact refuses CFB without a reader.
  • Extend the live target, Evidence, snapshot, graph, and output vocabularies so the same result passes through persistence and MCP structured output. No new tool, dependency, installer behavior, target execution, or network access is introduced.
  • Document the limitation in docs/mcp-contracts.md.

The synthetic fixture identifies the signature and exercises the contracts; it is not an MSI database or a Windows Installer oracle. Header validity, stream/FAT traversal, MSI tables, cabinet expansion, installed-product state, and Windows execution remain unverified and unsupported.

Maintainer scope decision pending: #3153 asks for a decision on full MSI implementation. Is recognition with explicit unknown coverage useful as an independent first slice, or should it wait for a bounded stream reader? This PR does not close #3153 or assert design acceptance.

Evidence and validation

Current head e277e658ce822030ee853e159d50240d1767a616 includes the merge of previous PR head 8da92e83539a054ee974d679e3e15fbebb591b40 with upstream main@71f680d7c1aa7a45ba0325fe87b104744b0c105f. The merged patch is 16 relevant files against that main revision. No rebase or force-push was used.

On macOS arm64 with the pinned Node 24.22.1 and lockfile-matched npm ci:

  • npm run test:focused -- tests/acceptance/cfbArtifactRecognition.test.ts src/application/binary/TargetFormatVocabularies.test.ts: 42 tests passed on the current candidate. The compiled CLI and real stdio MCP acceptance test covers root and nested recognition, digest/unknown coverage, false .msi and truncated-signature controls, persistence vocabularies, and extraction refusal. The first integration run exposed a missing live MCP output variant; that contract was fixed. Following Greptile's review, all three MCP calls now use artifactMcpCall so the SDK checks the server's advertised output schemas; the same 42 tests passed after this test repair.
  • npm run check:fast: typecheck and lint passed after the latest test repair; the push precheck passed too.
  • npm run docs:check: documentation generation checks and nine README consistency tests passed.
  • npm run format:check: passed before the commit hook reformatted unrelated merged files. Those unrelated changes were removed in a follow-up commit; focused oxfmt --check on all 16 PR files passed afterward.
  • git diff --check: passed on the latest test repair; the full final diff was checked against origin/main before the preceding integration push. Secret-pattern, large-file, generated-file, and final-diff review found no added credentials, binaries, dependencies, or unrelated files.

Earlier baseline/candidate evidence and wider focused checks are recorded in the PR history. Required hosted CI passed on the prior integration head 432405333; CI on e277e658 is running. No real MSI, Windows execution, or full local suite is claimed for the new head. No performance improvement is claimed.

Author readiness

Human owner: @1052326311

  • 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

  • Human owner completes initial review/readiness.
  • Maintainer decides whether the recognition-only slice is independently useful.
  • Required hosted checks pass on the selected revision.

🔄 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/3404 **Author:** [@1052326311](https://github.com/1052326311) **Created:** 10/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/cfb-artifact-recognition` --- ### 📝 Commits (6) - [`d85f717`](https://github.com/morluto/rea/commit/d85f7179a82d7b04b0883b2381e4a7631ac0471b) feat(artifacts): recognize CFB containers with explicit coverage limits - [`57ecc4c`](https://github.com/morluto/rea/commit/57ecc4cdaad24cfd1c0a9528b5f4683bcdf2d655) Merge remote-tracking branch 'origin/main' into sweep/3404 - [`8da92e8`](https://github.com/morluto/rea/commit/8da92e83539a054ee974d679e3e15fbebb591b40) merge: retain CFB recognition alongside current target cancellation - [`65f2c3b`](https://github.com/morluto/rea/commit/65f2c3b019c4d4909c93614ae3f4485492ade86b) fix: integrate CFB recognition with current format registry - [`4324053`](https://github.com/morluto/rea/commit/43240533313fd321c7fe73ef22d0303e1d362a14) chore: keep CFB PR limited to format recognition - [`e277e65`](https://github.com/morluto/rea/commit/e277e658ce822030ee853e159d50240d1767a616) test(artifacts): validate advertised CFB MCP schemas ### 📊 Changes **16 files changed** (+267 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/mcp-contracts.md` (+10 -0) 📝 `src/application/BinaryTargetResolver.ts` (+3 -0) 📝 `src/application/binary/TargetFormatVocabularies.test.ts` (+1 -0) 📝 `src/artifacts/artifactFormats.ts` (+6 -0) 📝 `src/artifacts/inventory/ArtifactGraphConstruction.ts` (+6 -1) 📝 `src/artifacts/inventory/reader.ts` (+6 -0) 📝 `src/artifacts/inventory/scanReader.ts` (+3 -0) 📝 `src/domain/analysisSnapshot.ts` (+1 -0) 📝 `src/domain/artifactGraph.ts` (+2 -0) 📝 `src/domain/artifactInspection.ts` (+14 -0) 📝 `src/domain/binaryTargetTypes.ts` (+1 -0) ➕ `src/domain/cfbFormat.ts` (+10 -0) 📝 `src/domain/evidenceSubject.ts` (+1 -0) 📝 `src/domain/liveBinaryTargetSummary.ts` (+1 -0) ➕ `tests/acceptance/cfbArtifactRecognition.test.ts` (+174 -0) ➕ `tests/fixtures/cfbArtifact.ts` (+28 -0) </details> ### 📄 Description ## Summary Related to #3153. Recognize Compound File Binary (CFB) containers by their eight-byte signature in root files and nested archive entries. Report the `cfb` format, digest, and unknown child coverage through the existing CLI/MCP artifact workflows. This is a recognition-only slice, not MSI parsing or full CFB support. ## Change and scope - Admit signature-matched CFB as a non-executable archive target, independent of its filename. A `.msi` suffix alone does not establish CFB or Windows Installer semantics. - Use the current artifact-format registry and preserve the existing inventory owner. Root and nested inventory explicitly report unavailable CFB stream coverage; `inspect_artifact` retains an unexplored branch, and `extract_artifact` refuses CFB without a reader. - Extend the live target, Evidence, snapshot, graph, and output vocabularies so the same result passes through persistence and MCP structured output. No new tool, dependency, installer behavior, target execution, or network access is introduced. - Document the limitation in `docs/mcp-contracts.md`. The synthetic fixture identifies the signature and exercises the contracts; it is not an MSI database or a Windows Installer oracle. Header validity, stream/FAT traversal, MSI tables, cabinet expansion, installed-product state, and Windows execution remain unverified and unsupported. **Maintainer scope decision pending:** #3153 asks for a decision on full MSI implementation. Is recognition with explicit unknown coverage useful as an independent first slice, or should it wait for a bounded stream reader? This PR does not close #3153 or assert design acceptance. ## Evidence and validation Current head `e277e658ce822030ee853e159d50240d1767a616` includes the merge of previous PR head `8da92e83539a054ee974d679e3e15fbebb591b40` with upstream `main@71f680d7c1aa7a45ba0325fe87b104744b0c105f`. The merged patch is 16 relevant files against that main revision. No rebase or force-push was used. On macOS arm64 with the pinned Node 24.22.1 and lockfile-matched `npm ci`: - `npm run test:focused -- tests/acceptance/cfbArtifactRecognition.test.ts src/application/binary/TargetFormatVocabularies.test.ts`: 42 tests passed on the current candidate. The compiled CLI and real stdio MCP acceptance test covers root and nested recognition, digest/unknown coverage, false `.msi` and truncated-signature controls, persistence vocabularies, and extraction refusal. The first integration run exposed a missing live MCP output variant; that contract was fixed. Following Greptile's review, all three MCP calls now use `artifactMcpCall` so the SDK checks the server's advertised output schemas; the same 42 tests passed after this test repair. - `npm run check:fast`: typecheck and lint passed after the latest test repair; the push precheck passed too. - `npm run docs:check`: documentation generation checks and nine README consistency tests passed. - `npm run format:check`: passed before the commit hook reformatted unrelated merged files. Those unrelated changes were removed in a follow-up commit; focused `oxfmt --check` on all 16 PR files passed afterward. - `git diff --check`: passed on the latest test repair; the full final diff was checked against `origin/main` before the preceding integration push. Secret-pattern, large-file, generated-file, and final-diff review found no added credentials, binaries, dependencies, or unrelated files. Earlier baseline/candidate evidence and wider focused checks are recorded in the PR history. Required hosted CI passed on the prior integration head `432405333`; CI on `e277e658` is running. No real MSI, Windows execution, or full local suite is claimed for the new head. No performance improvement is claimed. ## 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: @1052326311 - [ ] 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 - [ ] Human owner completes initial review/readiness. - [ ] Maintainer decides whether the recognition-only slice is independently useful. - [ ] Required hosted checks pass on the selected revision. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5722
No description provided.