Skip to content

feat(artifacts): name integrity checks for ZIP, PyInstaller and changed release files - #11081

Merged
morluto merged 1 commit into
feat/integrity-check-readersfrom
feat/integrity-check-remaining-readers
Nov 15, 2026
Merged

morluto merged 1 commit into
feat/integrity-check-readersfrom
feat/integrity-check-remaining-readers

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Refs #10508 (Phase 6.1). Stacked on #11056. More readers now say which consistency check an integrity failure tripped, the providers that turn those failures into artifact_changed keep the name, and more Evidence payload checks report where in the record they failed.

Problem and expected behavior

After #11056, ZIP, PyInstaller and release-exposure files changed during a read still raised integrity failures that only the message told apart. Nine provider projections also rebuilt AnalysisArtifactChangedError from a reader failure without the check, so a named failure lost its name. Several readEvidencePayload callers did not pass the payload's location, so their evidence_integrity_mismatch had no issue_path.

Expected: the reader names the check, every projection keeps it, and payload failures are located in the Evidence record.

Change and scope

  • ZIP: short source read → read-coverage; metadata changed between enumerations → entry-metadata; open of an entry not in this reader's inventory → foreign-entry, of an inventoried entry with different metadata → entry-metadata.
  • PyInstaller: open → foreign-entry / entry-metadata; compressed member short of its source span → read-coverage; member size disagreeing with its declaration → declared-size; private PYZ image changed → container-identity.
  • Release exposure asReadFailure: a RegularFileChangedError is member-identity, except while the selected artifact itself is re-inventoried (container-identity).
  • readerIntegrityFailure replaces nine local new AnalysisArtifactChangedError(op, path, cause.message, { cause }) copies.
  • readEvidencePayload callers in comparisonEvidenceResult, comparisonSourceEvidence, managedNativeVerificationSource, managedInspectionEvidence and reconstructionVerification pass within: ["normalized_result"] (or ["parameters"]).

Not included: the other unnamed readers and the location-less callers listed under remaining proof gaps.

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.

Contract and boundary impact

  • Semantic owner and earliest changed stage: each reader names its own check at the throw site (ZipArtifactReader, PyInstallerArtifactReader, PyInstallerMemberStream, PyInstallerPyzStore, ReleaseExposureReader asReadFailure). readerIntegrityFailure (StableArtifactFailure.ts) is now the single conversion from a reader integrity failure to AnalysisArtifactChangedError; the PE, Rust, SQLite, APK signature, NTFS journal, Playwright trace, Apple dispatch and release-exposure projections use it instead of their own copies, which dropped the check
  • Contribution scope fit and linked maintainer decision: not applicable; additive error details within existing boundaries
  • CLI and MCP/tool-catalog contract: additive: artifact_changed and artifact integrity errors from these readers gain details.integrity_check; evidence_integrity_mismatch from the listed readEvidencePayload callers gains details.issue_path. Codes, categories and messages unchanged
  • Provider, bridge, target-format, or platform compatibility: none
  • Evidence, artifact, provenance, or reconstruction contract: none; no Evidence schema change
  • 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: artifactZipIntegrity.test.ts (five tampered-entry opens assert entry-metadata; a new unknown-key open asserts foreign-entry); PyInstallerBoundaries.test.ts (new: foreign vs changed-metadata open); ReleaseExposureReader.test.ts (new: a member file vs the selected artifact changing while read → member-identity / container-identity through projectAnalysisError); comparisonEvidenceResult.test.ts (new: a status contradiction reports issuePath ["normalized_result","status"])
  • Base reproduction or other evidence: mutation (run, reverted): without the foreign/metadata split in ZIP and PyInstaller, or without within in readComparisonResult, 3 tests fail; without the asReadFailure names, both new release-exposure cases fail
  • User-visible CLI/MCP output (if applicable): audit_release_exposure over a directory whose member changes while read → {"code":"artifact_changed","details":{…,"boundary":"stable-artifact-read","integrity_check":"member-identity"}}
  • Remaining proof gaps: other readers still raise unnamed integrity failures (Mach-O slice, INES, FIT, SafeOutputTree, JavaScript files, SQLite snapshot, classify/scan inventory, AsarEntryStream remainder, …); callPath.ts, artifactInspection.ts and functionInventory.ts still call readEvidencePayload without a location because their position in the source record is not known there. PE, Rust, SQLite, APK, NTFS, trace and Apple projections are covered by the shared helper, not by per-provider tests

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

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

  • npm run check:fast — passed
  • npm run test:local -- src/apkSignature/apkSignatureFailures.test.ts src/application/ntfs/NtfsJournalService.test.ts src/native/pe/PeCertificatesProvider.test.ts src/native/pe/PeResourcesProvider.test.ts src/sqlite/SqliteDatabaseSnapshotLimits.test.ts src/artifacts/ReleaseExposureReader.test.ts src/artifacts/pyinstaller/PyInstallerBoundaries.test.ts src/domain/comparisonEvidenceResult.test.ts — 339 passed, 4 skipped
  • npm run test:focused -- tests/boundary/filesystem/artifactZipIntegrity.test.ts tests/boundary/mcp/processComparisonVerificationMcp.test.ts tests/boundary/mcp/functionComparisonMcp.test.ts — 48 passed
  • Mutations above — the named tests failed as expected, then restored
  • command — result

Compatibility, safety, and release

  • Breaking changes or migration steps: none (additive fields)
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; macOS only
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: none; the new fields are fixed identifiers and schema paths

Author readiness

Human owner:

  • 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.

…ed release files, and keep them through reader projections
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no actionable defect was found in the reviewed changes.

Summary

This PR adds named integrity checks to ZIP, PyInstaller, and release-exposure reads. It also shares the conversion to artifact_changed and adds locations to more Evidence payload errors.

  • ZIP and PyInstaller errors name the integrity check that failed.
  • Artifact change errors keep the name of the check that failed.
  • Evidence validation errors point to the payload’s place in its record.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  R["Reader detects inconsistency"] --> F["ArtifactReaderFailure.integrityCheck"]
  F --> H["readerIntegrityFailure"]
  H --> A["AnalysisArtifactChangedError"]
  A --> P["details.integrity_check"]
  E["readEvidencePayload with within"] --> I["EvidenceIntegrityError.issuePath"]
  I --> O["details.issue_path"]
Loading

Reviews (2) · Last reviewed commit: "feat(artifacts): name integrity checks f..." · Reviewed by Greptile

@morluto
morluto merged commit 0f83cf5 into feat/integrity-check-readers Nov 15, 2026
1 check passed
@morluto
morluto deleted the feat/integrity-check-remaining-readers branch November 15, 2026 12:04
morluto added a commit that referenced this pull request Nov 15, 2026
…ed release files (#11081)

feat(artifacts): name integrity checks for ZIP, PyInstaller and changed release files, and keep them through reader projections
morluto added a commit that referenced this pull request Nov 15, 2026
…-exposure readers (#11056)

* feat(artifacts): name integrity checks for DMG, directory and release-exposure readers

Directory members and release-exposure members whose file identity or
bytes changed since inventory report member-identity; a directory entry
without captured state reports entry-metadata and a changed directory root
container-identity; an hdiutil checksum failure reports image-checksum.
AnalysisArtifactChangedError carries the check from the reader failure and
projects it as details.integrity_check.

* fix(artifacts): name missing directory entry state and keep integrity checks through error copies

* feat(artifacts): name integrity checks for ZIP, PyInstaller and changed release files (#11081)

feat(artifacts): name integrity checks for ZIP, PyInstaller and changed release files, and keep them through reader projections

* feat(artifacts): name integrity checks for the remaining readers and their projections (#11098)
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant