Skip to content

feat(artifacts): name the integrity check for target digests, Apple bundle readers and extraction - #11125

Merged
morluto merged 1 commit into
mainfrom
feat/integrity-check-apple-extraction
Nov 15, 2026
Merged

morluto merged 1 commit into
mainfrom
feat/integrity-check-apple-extraction

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Refs #10508 (Phase 6.1). The selected-target digest check was written four times (session target identity, keyed archive, dylib resolution, native Mach-O source) without naming a check, and the dylib, asset catalog and extraction readers raised integrity failures that only the message told apart. Each now names its check, and the digest failure has one owner.

Problem and expected behavior

  • trace_dylib_resolution on a rewritten target returned reason: "integrity" with no check; the MCP test could only search the serialized error for the word "integrity".
  • NativeMachoSourceVerificationFailure rebuilt the verification cause and dropped any check the cause named.
  • Extraction tests matched "not materialized" and "missing from inventory".
  • Expected: the producer names the check; rebuilt failures keep it.

Change and scope

  • targetDigestChangedFailure(subject, expected, observed) (container-identity); messages unchanged.
  • Native Mach-O source: selected path gone (container-identity), short slice read (read-coverage); the verification wrapper spreads primaryFacts() like the other rebuild sites.
  • Root hash revalidation (hashStableRootArtifactHandle): container-identity.
  • Asset catalog changed before/during assetutil: member-identity. Dylib member changed while traced: member-identity; incomplete digest coverage: read-coverage.
  • Extraction: inventoried source changed (container-identity), selected occurrence without node and traversal entry absent from inventory (inventory-node), inventoried entries not reproduced (traversal-coverage, new).

Not included: readStableArtifact, ArtifactFileSource, GPU/model sources, .NET bundle (open in #11065) and the container readers (#11119).

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: targetDigestChangedFailure (withArtifactTargetIdentity.ts) owns the "selected target digest changed" failure for the session target check, keyed archive, dylib resolution and the native Mach-O source; the remaining sites name their check at the throw; NativeMachoSourceVerificationFailure keeps the verification cause's reader facts via primaryFacts()
  • Contribution scope fit and linked maintainer decision: approved owner change (Phase 6.1, [Design] Assert structured remediation facts instead of guidance prose #10508)
  • CLI and MCP/tool-catalog contract: additive: more integrity errors carry details.integrity_check; one new value, traversal-coverage (a verification traversal did not reproduce every inventoried entry). Codes, categories and messages unchanged
  • Provider, bridge, target-format, or platform compatibility: none
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): unchanged; the wrapper still carries the producer outcome and verification cause
  • 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: dylibResolutionMcp.test.ts (JSON.stringify(...).toContain("integrity") -> details.integrity_check: "container-identity" over MCP), keyedArchiveStandaloneSelection.test.ts ("Active archive digest changed" -> container-identity), artifactProvider.extractionCompleteness.test.ts (3 message matches -> traversal-coverage / inventory-node; the missing path stays asserted because it is only in the message), NativeMachoSource.test.ts (2 cases assert container-identity)
  • Base reproduction or other evidence: mutations (run, reverted): dropping the check from targetDigestChangedFailure and from the extraction sites failed 6 tests in 3 files; dropping primaryFacts() from the Mach-O verification wrapper failed the path-replacement case
  • User-visible CLI/MCP output (if applicable): trace_dylib_resolution after the target is rewritten: {"code":"artifact_operation_failed","category":"integrity_mismatch",…,"details":{"operation":"trace_dylib_resolution","reason":"integrity","integrity_check":"container-identity",…}}
  • Remaining proof gaps: the asset catalog before/after identity checks and dylib member reads have no deterministic trigger without a race; they name fixed values at the throw. The missing-path list on traversal-coverage remains prose (no structured field added)

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 test:focused -- tests/boundary/providers/native/artifactProvider.extractionCompleteness.test.ts tests/boundary/mcp/dylibResolutionMcp.test.ts tests/boundary/filesystem/keyedArchiveStandaloneSelection.test.ts src/artifacts/apple/AppleAssetCatalogAnalysis.test.ts src/native/NativeMachoSource.test.ts: 85 passed, 6 skipped (base: same counts). Warm wall/CPU (user+sys), two runs each: after 15.7 / 25.8 s and 12.4 / 15.3 s; before 17.2 / 27.6 s and 18.6 / 16.8 s (noise; dominated by the MCP and extraction files)
  • Regression: npm run test:focused -- src/native/NativeMachoSource.test.ts tests/boundary/cli/dylibResolutionCli.test.ts src/artifacts/apple/AppleAssetCatalogResourceCoverage.test.ts src/artifacts/apple/MachoLoadCommandReader.test.ts: 105 passed, 1 skipped
  • Mutations above: each failed the named cases, then reverted
  • npm run check:fast: passed; node scripts/verify/architecture-guards.mjs: passed; npx oxfmt --check src tests: passed
  • command — result

Compatibility, safety, and release

Additive public detail only. No message, code or category changes.

  • Breaking changes or migration steps: none (one additive value)
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; macOS only
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: none

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.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T12:55:39.955905Z
We couldn’t complete this review. Comment @codex review to try again.
b5104db PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 blocking defect was found.

Summary

Adds named integrity checks for target digests, Apple readers, native Mach-O reads, and extraction.

  • Changed target digests now carry a named integrity check.
  • Apple bundle readers name changed members and incomplete reads.
  • Artifact extraction names missing inventory entries and incomplete traversals.
  • Native Mach-O failures keep their specific integrity check.

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

@morluto
morluto merged commit 6363881 into main Nov 15, 2026
7 checks passed
@morluto
morluto deleted the feat/integrity-check-apple-extraction branch November 15, 2026 13:05
@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