Repository navigation
fix(artifacts): report unknown inventory traversal in inspection coverage - #5867
Conversation
…ection coverage Artifact inspection derived its coverage status only from always-zero omission counts, so an inventory substep with unknown container-entry traversal (for example, an omitted FIFO) yielded complete-within-substeps. Analysis-view summaries also exposed the inventory's typed source_coverage only for PCK and PyInstaller roots. Derive the inspection status from the inventory substep's coverage (unknown traversal is partial), and carry the producer's source_coverage plus the traversal-unknown caveat in every artifact summary. Hash-count fields keep their existing format gating. Fixes #5837 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; no blocking defects were found. SummaryThe PR makes inspection coverage follow the inventory producer’s traversal coverage.
No actionable defects or new security issues were found. Tests were not run during this review. Live supersession status could not be checked because GitHub authentication was unavailable. Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
…y-unknown-coverage
What broke:
inspect_artifactreportedcoverage.status: "complete-within-substeps"(and its summarysource_complete: truewith nosource_coverage) even when the nested inventory reportedcontainer-entriestraversal coverageunknown, e.g. a directory with an omitted FIFO.Fix: The inspection producer derives its status from the inventory substep's typed coverage (unknown traversal →
partial), and artifact summaries always carry the producer'ssource_coverageplus the traversal-unknown caveat.Risk: Low. Additive summary field (already declared optional in the output schema); inspections of roots with unknown traversal now report
partialinstead ofcomplete-within-substeps.Summary
Fixes #5837. Machine consumers reading an inspection or its summary were told coverage was complete while the inventory owner had already recorded unknown traversal. Only limitation prose or a separate inventory-view call revealed the gap.
Problem and expected behavior
Trigger:
open_binary+inspect_artifact(or CLIrea inspect-artifact) on a directory that contains ordinary files and a FIFO. The inventory omits the FIFO and reportscoverage: {scope: "container-entries", status: "unknown"}.Violated invariant (docs/tool-design.md): completeness must come from examined coverage, and missing coverage is unknown. A completed inventory substep does not establish exhaustive traversal.
Change and scope
src/domain/artifactInspection.ts:inspectionCoveragenow reads the inventory substep's coverage. It previously ignored that argument and checked only omission counts, which are always zero. Unknown traversal yields the existingpartialstatus.truncatedstill takes precedence for omissions.src/domain/analysisView/artifactInventoryView.ts:source_coverageand the "Producer traversal coverage is unknown" unknown no longer depend on the PCK/PyInstaller-only gate, so summaries of every format read the owner's fact instead of hiding it. That gate now controls onlyavailable_hash_status_countsand the hash-unknown caveat, which keep their existing behavior. This also fixes summaries of historical inline inspections that still saycomplete-within-substeps.docs/mcp-contracts.md: documents the summary'ssource_coverageand thepartialmapping.Not included: no new status enum value.
partialalready existed and the preciseunknownstays available assource_coverage.status.source_coveragestaysexactOptionalin the view schema so that older retained view Evidence still parses.Contribution scope: ordinary fix within existing boundaries; maintainer scope decision not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage: inventory producer owns traversal coverage (unchanged); inspection coverage composition in
src/domain/artifactInspection.tsis the earliest changed stage.Contribution scope fit and linked maintainer decision: existing artifact inspection boundary; not applicable.
CLI and MCP/tool-catalog contract: no schema change.
inspect_artifactcan now emit the already-declaredpartialstatus. Artifact summaries now always include the already-declared optionalsource_coverage.Provider, bridge, target-format, or platform compatibility: all artifact formats. Roots whose traversal is unknown (omitted entries, DMG/PKG/universal Mach-O without a native adapter, encrypted PCK, opaque PyInstaller) now report
partial.Evidence, artifact, provenance, or reconstruction contract: inspection IDs change for those roots because the status is part of the digested result. Nested inventory Evidence is unchanged.
Target selection, authority, upstream behavior, and cleanup details: not applicable.
Generated metadata, package, or installation impact: none (
docs:checkpasses).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:
tests/boundary/mcp/artifactInspectionCoverageMcp.test.tsuses the productioncreateServersession over MCP. It covers a directory with a FIFO and one without, and checksinspect_artifactcoverage plus both summary paths (inspect_analysis_viewsummary of the retained parent, andinspect_artifact {detail: "summary"}) against the advertised output schema.Base reproduction or other evidence (executed): with
src/changes stashed, the new test fails on base in both cases:expected 'complete-within-substeps' to be 'partial'for the FIFO case, andexpected undefined to deeply equal { scope: 'container-entries', … }for the summary'ssource_coverage. With the fix, both cases pass.User-visible CLI/MCP output (executed,
rea inspect-artifact <dir with Info.plist, main.js, FIFO>from the built CLI with isolated HOME/XDG/TMPDIR):Before (base f801b2f):
{"inspection_status":"complete-within-substeps","inventory_coverage":{"scope":"container-entries","status":"unknown"}} {"summary_inspection_status":"complete-within-substeps","source_complete":true, "unknowns":["Inventory does not establish application runtime behavior or complete format-specific analysis."]}After:
{"inspection_status":"partial","inventory_coverage":{"scope":"container-entries","status":"unknown"}} {"summary_inspection_status":"partial","source_complete":true, "source_coverage":{"scope":"container-entries","status":"unknown"}, "unknowns":["Inventory does not establish application runtime behavior or complete format-specific analysis.", "Producer traversal coverage is unknown; missing matches do not prove source absence."]}Cost: the CLI summary response for this fixture grows from 4531 to 4667 bytes (+136, measured). A complete-traversal summary adds only the
source_coverageobject (~67 bytes, computed, not measured). Token counts were not measured. There is no extra call, and the projection does no new work beyond reading the already-parsed coverage.Remaining proof gaps: only the macOS directory+FIFO case was exercised end-to-end. Other unknown-traversal formats (DMG/PKG, encrypted PCK, opaque PyInstaller) go through the same composition but their new
partialstatus was not asserted individually.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
npm run test:focused -- tests/boundary/mcp/artifactInspectionCoverageMcp.test.tson base (src stashed): 2 failed (expected). With fix: 2 passed.npm run test:focused -- <39 related files>(artifact inspection/inventory/comparison domain tests, artifact/PCK/PyInstaller/desktop/prompt/session MCP boundary tests, artifact provider boundary tests, Apple/mobile/Harmony/ZIP/PCK/PyInstaller acceptance tests, CLI logging/environment): 39 files, 252 tests passed.node scripts/rea.mjs inspect-artifact … --jsonand--detail summary --evidence_output …): before/after output above.npm run check:fast: passed.npm run format:check: passed.npm run docs:check: passed.Compatibility, safety, and release
Author readiness
Human owner: @kaoru0822-kitauji
Before merge
type(scope): outcome.🤖 Generated with Claude Code