Skip to content

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

Merged
morluto merged 2 commits into
feat/evidence-format-revisionfrom
feat/android-evidence-current-format
Nov 15, 2026
Merged

morluto merged 2 commits into
feat/evidence-format-revisionfrom
feat/android-evidence-current-format

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Require the Android fields that were optional only for historical Evidence: the package components projection, every manifest component declaration facet, trace_android_references target_definition and direct_invokes_coverage, and the manifest view result's facet.

Refs #10510. Stacked on #10861 (per-site decision row android/androidAnalysis.ts:242,302, android/androidManifestComponents.ts:64, analysisView/analysisViewResult.ts manifest facet).

Problem and expected behavior

  • inspect_android_package.components defaulted to an unavailable inventory with a "This Evidence predates the manifest component projection" limitation.
  • Component declaration facets (declaration_index, location, enabled, process, grant_uri_permissions*, intent_filters, meta_data) were optional and declaration_coverage defaulted to unknown. A second schema, observedAndroidManifestComponentSchema, already required them for producers, so the shape had two owners.
  • target_definition and direct_invokes_coverage were exactOptional for "older retained Evidence".
  • Manifest view results omitted facet ("legacy manifest views keep their original shape").

Producer check: JadxAnalysis parses components through the observed (required) schema and always writes target_definition and direct_invokes_coverage; AndroidManifestComponentDetails writes every facet with declaration_coverage complete or partial only. Expected: one component schema with every facet required; declaration_coverage is complete | partial and the component summary counts drop unknown; results missing any of these fields are malformed; manifest view results carry facet: "manifest".

Change and scope

  • src/domain/android/androidManifestComponents.ts: facets required; observedAndroidManifestComponent* deleted (AndroidManifestComponentInventory replaces the observed inventory type); JadxAnalysis/AndroidManifestComponents use the single schema. JadxAnalysis.inspectPackage parses with androidResultSchemas.inspect_android_package directly (the local observedPackageSchema wrapper re-declared the same components field and is removed).
  • src/domain/android/androidAnalysis.ts: components, target_definition, direct_invokes_coverage required. reference_scope stays optional: it is present only for external targets, not a historical omission.
  • src/domain/analysisView/androidPackageView.ts: summary counts drop unknown; manifest page result writes facet; the "Omitted historical declaration fields remain unknown" limitation is removed.
  • src/domain/analysisView/analysisViewResult.ts: manifest result facet required.
  • Docs: docs/guides/android/android-analysis.md; inspect_android_package contract description.

Not included: other per-site decisions from #10861 (separate slices).

Contract and boundary impact

  • Semantic owner and earliest changed stage: androidManifestComponentSchema (domain) is the only component shape; androidResultSchemas and the Android views consume it. Superseded: the observed duplicate schema, the historical default inventory and the unknown declaration coverage.
  • 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: inspect_android_package, trace_android_references and inspect_analysis_view output schemas change as above; the component-summary declaration_coverage object loses unknown.
  • Provider, bridge, target-format, or platform compatibility: none (JADX bridge protocol unchanged).
  • Evidence, artifact, provenance, or reconstruction contract: Android 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 added or updated: androidManifestComponents.test.ts (package without components refused at components; component without facets refused for exactly the ten facets), JadxExternalReferences.test.ts (results without direct_invokes_coverage or target_definition refused), androidPackageView.test.ts (view over a component without declaration_coverage refused at its path; summary counts), androidPackageSummaryMcp.test.ts (manifest page carries facet: "manifest"); fixtures updated to what producers write. The tests asserting historical omission were replaced by these refusals.

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

  • User-visible CLI/MCP output: retained Android parents missing these fields return invalid_request with the issue path under source.normalized_result.

  • Remaining proof gaps: real JADX not run (two JADX-gated tests skipped locally).

  • 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 — passes.
  • npm run docs:check — passes.
  • npm run test:focused over every test file referencing Android package/component/reference results or views (30 files) — 540 passed, 2 skipped (JADX-gated).
  • Pre-push hook (typecheck + lint) — passed.
  • After removing the observedPackageSchema wrapper: npm run check:fast passes; npm run test:focused over AndroidNativeInventory, JadxOperationTimeout, androidPackageView, JadxExternalReferences, androidManifestComponents, androidPackageSummaryMcp — 147 passed.

Compatibility, safety, and release

  • Breaking changes or migration steps (maintainer-accepted choices):
    • One component schema. The duplicate observed component schema (observedAndroidManifestComponentSchema and its inventory type) is deleted; androidManifestComponentSchema is the only shape and requires every declaration facet. Android records without components, any component facet, target_definition or direct_invokes_coverage were previously admitted with defaults (unavailable, unknown, omission); they are now malformed (invalid_request at the issue path). Such records 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.
    • declaration_coverage loses unknown. It only represented historical Evidence without facets, which is now refused, so the value is complete | partial, and the component-summary declaration_coverage counts object drops its unknown key. Callers reading declaration_coverage.unknown should remove that read (it was always 0 for current results).
    • Manifest view results always carry facet: "manifest".
  • 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.

…gregates 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.
@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:13:18.644988Z bf1d7c3 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 reviewed changes appear safe to merge, with the previous cleanup requirement satisfied.

Summary

The PR requires Android component declaration fields, reference aggregates, and facet: "manifest" in manifest views.

  • Android package records now include every component declaration facet.
  • Reference results now include the target type and invoke-position totals.
  • Manifest pages now identify themselves as the manifest facet.

Reviews (2) · Last reviewed commit: "refactor(android): parse package results..." · Reviewed by Greptile

Comment thread src/android/JadxAnalysis.ts Resolved
@morluto
morluto merged commit 54ab780 into feat/evidence-format-revision Nov 15, 2026
1 check passed
@morluto
morluto deleted the feat/android-evidence-current-format branch November 15, 2026 08:27
morluto added a commit that referenced this pull request Nov 15, 2026
…gregates 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
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 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