Skip to content

feat(android)!: require integrity_check on a JNI library integrity failure - #11624

Merged
morluto merged 2 commits into
mainfrom
feat/jni-integrity-check-required
Nov 16, 2026
Merged

morluto merged 2 commits into
mainfrom
feat/jni-integrity-check-required

Conversation

@morluto

@morluto morluto commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refs #10510 (remaining JNI item, unblocked by #11505). A JNI library failure with kind: "integrity" must name integrity_check; other kinds may not carry one. Also removes the stale historical clause from the electron_semantics comment.

Problem and expected behavior

androidJniLibraryFailureSchema had kind: z.string() and an optional integrity_check, documented as "Evidence recorded before this field has no check". Since #11505 every ArtifactReaderFailure("integrity", ...) must name its check at the type level, so an integrity failure without one is no longer a producer state; leaving the field optional kept an ambiguous undefined for consumers.

Change and scope

  • Schema: a union of {kind: "integrity", message, integrity_check} (required) and {kind: <any other>, message} (no check).
  • Producer: jniReadFailure(cause) in AndroidJniLibraries.ts maps a read failure once; an integrity failure without a check (only reachable through the explicit-undefined rebuild constructor) throws an invariant violation instead of writing a record the schema would refuse.
  • javascriptApplicationAnalysis.ts: the electron_semantics comment no longer says it may be absent "in evidence produced before this field existed" (earlier Evidence revisions are refused); absence still means unknown, which is a live state.
  • Not included: the per-record format marker and TargetIdentity items of [Design] Version Evidence bundles and own historical format compatibility in one place #10510 (W12).

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: src/domain/android/androidJniBindings.ts (schema) and src/android/AndroidJniLibraries.ts (the one producer of a read failure record).
  • Contribution scope fit and linked maintainer decision: [Design] Version Evidence bundles and own historical format compatibility in one place #10510 direction (fields optional only for history become required).
  • CLI and MCP/tool-catalog contract: JNI library failure shape in the Android analysis result; verify:advertised-schemas reports no catalog summary change.
  • Provider, bridge, target-format, or platform compatibility: None.
  • Evidence, artifact, provenance, or reconstruction contract: Breaking for JNI Evidence whose failure is integrity without integrity_check (written before feat(android): name the reader check on a JNI library's integrity failure #11191). Evidence of earlier format revisions is already refused.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): None.
  • 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: tests/boundary/android/androidJniLibraries.test.ts "names the reader check when a selected library fails an integrity check": the checkpoint schema refuses {kind: "integrity"} without a check and {kind: "io", integrity_check}.
  • Base reproduction or other evidence: With main's androidJniBindings.ts the test fails (1 failed, 11 passed): the old schema accepts both malformed records.
  • User-visible CLI/MCP output (if applicable): None for current producers (they already wrote the check).
  • Remaining proof gaps: None.

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/android/androidJniLibraries.test.ts src/domain/android/androidJniBindings.test.ts: 43 passed; with main's schema: 1 failed.
  • npm run check:fast, npm run verify:advertised-schemas: passed. npx oxfmt; pre-commit and pre-push hooks ran.
  • Review fixes (22445c3): excludedValues for the other-kind branch (JSON Schema conversion checked with Ajv 2020; fails with the bare refine) and a test for the unnamed-check invariant (fails with the guard disabled). npm run test:focused -- tests/boundary/android/androidJniLibraries.test.ts: 13 passed; check:fast passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: BREAKING CHANGE: Android JNI Evidence whose library failure has kind integrity must name integrity_check. Records written before feat(android): name the reader check on a JNI library's integrity failure #11191 that lack it no longer parse; recreate them.
  • Real Hopper/Ghidra, browser, or OS coverage: None.
  • 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.

…ilure

A JNI library failure is now a tagged union: kind integrity carries a
required integrity_check, and no other kind carries one. The producer builds
it from the reader failure, whose integrity constructor requires the check
since #11505. Also drop the stale "evidence produced before this field"
clause from the electron_semantics comment; earlier Evidence revisions are
refused.

BREAKING CHANGE: Android JNI Evidence whose library failure has kind
"integrity" must name integrity_check. Records written before #11191 that
lack it no longer parse; recreate them.

Refs #10510
@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-16T00:26:35.191279Z
We couldn’t complete this review. Comment @codex review to try again.
2f9509f 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 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; both previous findings are addressed.

Summary

Requires integrity_check on JNI integrity failures and forbids it on other failure kinds.

  • JNI integrity failures now always name their reader check.
  • The Electron summary comment describes absence without a stale-history note.

No new actionable issues were found. Validation was source-based; tests were not rerun. Supersession could not be confirmed because GitHub access required authentication.

Reviews (3) · Last reviewed commit: "test(android): check the JNI failure uni..." · Reviewed by Greptile

Comment thread src/android/AndroidJniLibraries.ts Resolved
… unnamed-check refusal

Exclude integrity from the other failure kinds with excludedValues, so the
JSON Schema conversion declares the exclusion that a bare refine dropped.
The test checks the converted schema against the same valid and malformed
records, and drives an integrity read failure with an explicitly undefined
check: the read is refused, the reader is closed and every checkpoint parses.
@morluto
morluto merged commit 3f4953b into main Nov 16, 2026
7 of 9 checks passed
@morluto
morluto deleted the feat/jni-integrity-check-required branch November 16, 2026 00:38
@morluto morluto added enhancement New feature or request area: runtime Process capture and runtime observation labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant