Skip to content

feat(native)!: require native Evidence fields that were optional only for historical Evidence - #10946

Merged
morluto merged 1 commit into
feat/evidence-format-revisionfrom
feat/native-evidence-current-format
Nov 15, 2026
Merged

morluto merged 1 commit into
feat/evidence-format-revisionfrom
feat/native-evidence-current-format

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Require the native Evidence fields that were optional only for historical Evidence, and delete the view defaults and reinterpretations that existed for it: Mach-O inspection, native exports, kernel modules, value flow, instructions, Objective-C/Swift metadata and native load images, plus the GPU, native-exports and load-image view defaults.

Refs #10510. Stacked on #10861 (per-site decision rows native/* and analysisView/gpuCodeObjectsView.ts, nativeExportsView.ts, nativeLoadImageView.ts in #10861).

Problem and expected behavior

Each site below accepted a missing field because "older Evidence may omit it", then defaulted, normalized or reported an unknown for it. #10861 already refuses every REA 6.x bundle, so these branches only served Evidence that can no longer be read. Producer check per site (source-derived):

Site Before Producer After
inspect_macho encryption optional; retainedInspectMachoSchema filled an empty "predates encryption reporting" inventory NativeMachoInspection always writes it required; retainedInspectMachoSchema deleted (Mach-O view, managed/native verification use inspectMachoSchema)
Mach-O slice malformed_kind optional; views reported "unrecorded" machoSliceEncryptionSchema requires it required; retainedMachoSliceEncryptionSchema and the "unrecorded" view value deleted
Mach-O symbol runtime_name; import raw_name, name_status, addend defaulted to null withRuntimeName, parseDyldImports always write them required (name_status is exact or ambiguous, no null)
Mach-O *_bytes_hex (4 sites) described as "omitted in older Evidence" written exactly when the name/path is not valid UTF-8 unchanged shape; descriptions state the real condition (the #10861 row proposed "require", which the producer contradicts)
ELF export name_bytes_base64, name_utf8_decodable, visibility; version-name encoding defaulted to null/"unknown"; view added "lack retained encoding facts" unknowns NativeExportParser always writes them; visibility is default or protected required; visibility loses "unknown"; the schema now checks that a null name_bytes_base64 means an ASCII name and that an unresolved version name has no encoding facts; the view's historical unknown and default stripping are deleted
Kernel modinfo modinfo_field_exceeds_limit accepted for older Evidence not produced removed from the reason enum
Value flow limits, limits_reached; metadata omission counts optional / partial; summary counts nullable; empty unavailable reason admitted ReaGhidraBridge always writes them required; record-summary counts are non-null; an empty reason is incompatible metadata (unknown)
Instruction status undecodable "legacy value in older Evidence" Ghidra never writes it removed from the status enum
Instruction containing_*, decoder_context, flow.classification_evidence "omitted in older Evidence/captures" conditional on status, architecture or provider stay optional; descriptions state the real condition
ObjC dispatch category ownership objcImplementationClassName re-split symbol-only Class(Category) names both producers write class_name and category separately function deleted; consumers compare class_name
Swift conformance type_reference_kind optional AppleSwiftDispatchFacets always writes it required
Load-image mapping readable/writable/executable; relocation symbol optional; DOL verification added block_permissions_measured; relocation pages reported "symbol was not recorded" ReaGhidraBridge always writes them (symbol is null when Ghidra has none) required; the DOL check and the relocation unknown are deleted
GPU object amd_target_metadata defaulted to null; the view removed the default GpuInventory/GpuObject always write it required; view override deleted

Change and scope

  • Domain owners: src/domain/native/{nativeInspection,nativeExports,kernelModule,nativeValueFlow,nativeInstruction,objcSwiftMetadata,nativeLoadImage}.ts, src/domain/apple/machoEncryption.ts, src/domain/gpu/gpuCodeObjects.ts, src/domain/evidenceRecordSummary.ts.
  • Views: machoView.ts, nativeExportsView.ts, nativeLoadImageView.ts (RELOCATION_SYMBOL_UNRECORDED deleted), gpuCodeObjectsView.ts.
  • Consumers: managedNativeVerificationSource.ts, nativeInvestigationGraph.ts, GhidraDolLoadImage.ts, GhidraLoadImageValues.ts.
  • Docs: docs/guides/native/binary-diagnostics.md, docs/guides/native/native-investigation.md, docs/providers/ghidra-provider.md.

Not included: managed, JavaScript/Electron and process rows of #10861 (separate slices); firmware analysis_timeout_ms (kept optional by decision); go limits_reached (not a historical omission); the instruction incoming_references omission (conditional on the request, not historical).

Contract and boundary impact

  • Semantic owner and earliest changed stage: the domain result schemas above; views and consumers read the owner's parsed facts. Superseded: retainedInspectMachoSchema, retainedMachoSliceEncryptionSchema, the "unrecorded" encryption cause, objcImplementationClassName, RELOCATION_SYMBOL_UNRECORDED, the DOL block_permissions_measured check, and the view-level default removals.
  • Contribution scope fit and linked maintainer decision: Phase 5 / D4 of the approved plan, tracker [Design] Version Evidence bundles and own historical format compatibility in one place #10510.
  • CLI and MCP/tool-catalog contract: output schemas of inspect_macho, inspect_native_exports, inspect_kernel_module, analyze_function, inspect_native_instruction, inspect_native_dispatch_metadata, inspect_native_load_image, GPU code-object inspection, inspect_analysis_view and the Evidence bundle summary change as in the table.
  • Provider, bridge, target-format, or platform compatibility: none; no bridge or parser output changes.
  • Evidence, artifact, provenance, or reconstruction contract: native records missing these fields are refused as malformed.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: catalog digests change.

Expected effects:

  • 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 replaced (historical admission → refusal): machoView.test.ts (symbol without runtime_name, slice without malformed_kind, report without encryption are refused by the schema and the view), managedNativeVerificationSource.test.ts (inspect_macho without encryption is an integrity error), NativeExportsView.test.ts, NativeExportParser.test.ts, tests/boundary/filesystem/nativeExports.test.ts (rows without encoding facts or visibility, and non-ASCII names without bytes, are refused), NativeLoadImageViews.test.ts (relocation without symbol refused), GhidraDosComLoadImage.test.ts (observation without permissions or relocation symbol refused at the field path), evidenceRecordSummary.test.ts, objcSwiftMetadata.test.ts / nativeInvestigationGraph.test.ts (category ownership comes from the producer split).

  • Added: nativeInstruction.test.ts (undecodable refused), shape checks for amd_target_metadata, type_reference_kind and the modinfo reason enum.

  • Fixtures updated to what producers write (value-flow limits, load-image permissions and relocation symbols, Mach-O import fields, export runtime names).

  • Base reproduction or other evidence: source-derived — on the base, the replaced tests asserted that each omission parsed with a default, so the new refusal assertions fail there.

  • Remaining proof gaps: real Ghidra not run.

  • 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 (typecheck + lint) — passes.
  • npm run docs:check — passes.
  • npm run test:focused over every test file referencing the changed producers, views or fixtures (213 files: 141 by schema/operation name plus 72 by field/fixture name), in batches; failures were fixed and the 21 affected files rerun — 870 passed. Final runs of the edited files (Mach-O view, analysis view MCP, load-image views, value trace, GPU, ObjC/Swift, instruction, kernel module, DOL/DOS load image) — passed. tests/conformance/contracts/mcpOutputSchemaProfile.test.ts and mcpResponseBudget.test.ts — 15 passed.
  • Pre-push hook (typecheck + lint).

Compatibility, safety, and release

  • Breaking changes or migration steps:
    • Native records missing any field in the table are refused as malformed (invalid_request / evidence_integrity_mismatch at the field path). They come only from REA 6.x bundles, which feat(evidence)!: give Evidence bundles a format revision owned by one module #10861 already refuses; recreate the observation.
    • Enum narrowing for callers: Mach-O view encryption malformed_kind loses "unrecorded"; ELF export visibility loses "unknown"; instruction status loses "undecodable"; kernel modinfo entry reasons lose "modinfo_field_exceeds_limit"; Mach-O import name_status is no longer nullable. Each removed value was written only for historical Evidence.
    • Bundle summary native_dossier.value_flow observed counts are no longer nullable.
    • Relocation pages no longer add "The relocation symbol was not recorded…", and native-export name queries no longer add "Some ELF names lack retained encoding facts…".
  • Real Hopper/Ghidra, browser, or OS coverage: none.
  • Package or release metadata impact: breaking marker on the commit.
  • 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.

… for historical Evidence

Mach-O encryption, slice malformed cause, symbol runtime names and import
facts; ELF export encoding facts and visibility; value-flow limits; load-image
permissions and relocation symbols; Swift type-reference kind and GPU AMD
target metadata are required. Legacy enum values (unrecorded, unknown
visibility, undecodable, modinfo_field_exceeds_limit) and the retained
schemas, view defaults and reinterpretations that served historical Evidence
are deleted.

BREAKING CHANGE: native records missing these fields are refused as
malformed; recreate the observation.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T08:41:36.982903Z cfc7b2e 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.

@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 with its stated dependency on #10861.

Summary

Requires current native Evidence fields at their owning schemas and removes the historical defaults and reinterpretations from views and consumers.

  • Mach-O reports require their recorded encryption and symbol facts.
  • ELF export rows require recorded name-encoding facts and visibility.
  • Load-image records require mapping permissions and relocation symbols.
  • Value-flow records and bundle summaries require their recorded limits and counts.
  • Instruction results no longer accept the legacy undecodable status.
  • Objective-C joins use split class and category facts, and Swift rows require their type-reference kind.
  • GPU objects require the nullable AMD target metadata field.
  • Kernel module reasons no longer include the historical field-limit value.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  P[Current native producers] --> S[Owning result schemas]
  S -->|Required facts present| E[Evidence]
  S -->|Required facts missing| R[Reject malformed result]
  E --> V[Views and consumers]
  V --> O[Selected facts without historical defaults]
Loading

Reviews (2) · Last reviewed commit: "feat(native)!: require native Evidence f..." · Reviewed by Greptile

@morluto
morluto merged commit a4a1c49 into feat/evidence-format-revision Nov 15, 2026
1 check passed
@morluto
morluto deleted the feat/native-evidence-current-format branch November 15, 2026 08:50
morluto added a commit that referenced this pull request Nov 15, 2026
… for historical Evidence (#10946)

Mach-O encryption, slice malformed cause, symbol runtime names and import
facts; ELF export encoding facts and visibility; value-flow limits; load-image
permissions and relocation symbols; Swift type-reference kind and GPU AMD
target metadata are required. Legacy enum values (unrecorded, unknown
visibility, undecodable, modinfo_field_exceeds_limit) and the retained
schemas, view defaults and reinterpretations that served historical Evidence
are deleted.

BREAKING CHANGE: native records missing these fields are refused as
malformed; recreate the observation.
morluto added a commit that referenced this pull request Nov 15, 2026
… module (#10861)

* feat(evidence)!: give Evidence bundles a format revision owned by one module

`src/domain/evidenceFormat.ts` owns Evidence format evolution. Bundles now
carry `evidence_format: 1`; every bundle reader admits only the current
revision and refuses an unmarked or other-revision bundle once, with the
single recreate-observations guidance, instead of admitting earlier shapes
one optional field at a time.

The 6.7-era artifact inventory summary identities are no longer rebuilt:
compare_artifacts checks the current projection only and reports a mismatch
with the owner's guidance. The pre-6.6 identity diagnosis uses the same
guidance. SQLite `worker_timeout_ms` and Dart AOT `string_pool.policy`,
optional only for historical Evidence, are now required.

BREAKING CHANGE: Evidence bundles written by REA 6.x (no `evidence_format`)
are refused by import, comparison, reconstruction and analysis-snapshot
readers as an integrity mismatch telling the caller to recreate the
observations; re-exporting an earlier bundle does not update its format or
identities. Bundles constructed by hand must include `"evidence_format": 1`.
6.7-era artifact summaries are refused by compare_artifacts, and SQLite and
Dart AOT Evidence without the newly required fields fails validation.

* fix(evidence): let the ledger application admit its bundle's format

build_reconstruction_obligation_ledger registered the full bundle schema with the SDK, so an unmarked or other-revision bundle was refused as invalid_request before the format owner ran. Register it like coverage: the application parses the request envelope and admits the bundle.

* feat(pcap)!: read capture Evidence through the current result schema only (#10879)

Delete the pcap read-compatibility schema that defaulted executable identity for historical capture Evidence, and require query_labels_hex (null when unknown) now that every producer writes it. Evidence from an earlier format is refused at the bundle format owner; a record that omits these fields is reported as malformed instead of defaulted.

BREAKING CHANGE: inspect_pcap_capture results always carry query_labels_hex, and analysis views no longer default missing tshark/capinfos identity fields.

* feat(desktop)!: require the effective view policy in desktop state Evidence (#10886)

inspect_desktop_application_state always records the complete policy it used, including sqlite_view_bytes. Drop the optional historical shape and the task draft's absent-policy branch.

BREAKING CHANGE: desktop application state results without effective_view_policy, or with a policy missing sqlite_view_bytes, are refused as malformed.

* feat(android)!: require component declaration facets and reference aggregates in Android Evidence (#10904)

* feat(android)!: require component declaration facets and reference aggregates in Android Evidence

The JADX producers always write the manifest component projection with every declaration facet, target_definition and direct_invokes_coverage. Require them, delete the duplicate observed component schema, drop the unknown declaration coverage that only described historical omission, and give manifest view results their explicit facet.

BREAKING CHANGE: Android package, component and reference results missing these fields are refused as malformed; component declaration_coverage and its summary counts no longer include unknown; manifest view results always carry facet manifest.

* refactor(android): parse package results with the domain schema directly

* feat(browser)!: require the DOM length unit and redirect-scoped prior-hop facts (#10897)

* feat(browser)!: require the DOM length unit and redirect-scoped prior-hop facts

Both CDP producers always declare node_value_length_unit, and the observation session writes redirect_response on every redirect event and no other. Require the unit, drop the diff's absent-unit branch, and admit redirect_response exactly on redirect rows.

BREAKING CHANGE: DOM snapshots without node_value_length_unit and redirect timeline rows without redirect_response are refused as malformed, including inline inspections passed to compare_web_captures.

* docs(browser): drop the historical redirect_response omission note

* feat(native)!: require native Evidence fields that were optional only for historical Evidence (#10946)

Mach-O encryption, slice malformed cause, symbol runtime names and import
facts; ELF export encoding facts and visibility; value-flow limits; load-image
permissions and relocation symbols; Swift type-reference kind and GPU AMD
target metadata are required. Legacy enum values (unrecorded, unknown
visibility, undecodable, modinfo_field_exceeds_limit) and the retained
schemas, view defaults and reinterpretations that served historical Evidence
are deleted.

BREAKING CHANGE: native records missing these fields are refused as
malformed; recreate the observation.
morluto added a commit that referenced this pull request Nov 15, 2026
…ved undecodable status (#11092)

verify-real-ghidra-com asserted that an unlisted-address record relabelled with the legacy undecodable status still parsed. #10946 removed that value with the other historical native enum values, so the lane failed on main after a correct not-in-listing result. The verifier now checks that the producer's record parses and that the relabelled record is refused.
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior 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: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant