[GH-ISSUE #2852] Main compile: optional Jadx schema output is incompatible with JsonValue #1017

Closed
opened 2026-10-15 18:30:22 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @N0zoM1z0 on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/2852

Originally assigned to: @N0zoM1z0 on GitHub.

Problem

Main fails compilation at the traceReferences JSON-producing boundary in src/android/JadxAnalysis.ts:366. It returns the result of androidResultSchemas.trace_android_references.parse(...) from a function declared Promise<JsonValue>.

The inferred schema output includes direct_invokes_exhaustive?: boolean | null | undefined, which is not assignable to the JSON object value contract.

The producer already constructs this field as reference.direct_invokes_exhaustive ?? null at line 383. This report does not demonstrate a runtime undefined value. The mismatch is between the validated schema's inferred output type and JsonValue: src/domain/android/androidAnalysis.ts:191 declares z.boolean().nullable().optional().

This compile failure blocks runtime preparation and compiled boundary tests before they start.

Independent reproduction

  • Baseline: b17487f482ce0769dd0c1415297f9c3e1bb7509f, the parent of merged #2692 (21aa877e5ae3164cfbfab6f6db27967995ebc8c3).
  • Isolated clean detached worktree, with npm ci from the baseline/merged lockfile.
  • Pinned Node v24.18.0, npm 11.16.0, Linux x64.
  • The package, lockfile, compiler config, JSON type, Android producer and Android result schema are unchanged between baseline and merged commits.
npm ci
npm run compile

Exit status 2 on the independently checked parent and merged snapshot:

src/android/JadxAnalysis.ts(366,3): error TS2322:
Property 'references' is incompatible with index signature.
Property 'direct_invokes_exhaustive' is incompatible with index signature.
Type 'boolean | null | undefined' is not assignable to type 'JsonValue'.
Type 'undefined' is not assignable to type 'JsonValue'.

On the merged snapshot with locked dependencies, six selected source files passed 139 cases. test:focused stopped during this prerequisite compilation and executed none of its selected process/provider boundary cases. Partial compiler output was cleaned afterward.

At inspection, main 94072364c still retains the Android change introduced in #2439 (c45d912c9). None of #2692's ten files modifies this Android boundary or its schema.

Correction and verification

Reconcile validated output typing with the JSON-producing contract at its owner. Preserve the documented meanings of omitted/null unknown coverage and observed true/false, together with compatibility for existing results. Do not weaken the JSON type or cast away the error. Adding another ?? null to the input object would not address the existing schema-output mismatch.

Verify omitted, null, false and true exhaustiveness through the contract/producer boundary. Run the pinned compile and relevant Android checks, then rerun the previously blocked compiled boundary prerequisites. Preserve discovery and fail-closed report gates.

This is independently reproduced on the pre-#2692 main baseline. It is not attributed to the deadline/skill change. The initial report's producer-undefined characterization has been corrected after inspecting the actual producer and schema.

Originally created by @N0zoM1z0 on GitHub (Oct 13, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/2852 Originally assigned to: @N0zoM1z0 on GitHub. ## Problem Main fails compilation at the `traceReferences` JSON-producing boundary in `src/android/JadxAnalysis.ts:366`. It returns the result of `androidResultSchemas.trace_android_references.parse(...)` from a function declared `Promise<JsonValue>`. The inferred schema output includes `direct_invokes_exhaustive?: boolean | null | undefined`, which is not assignable to the JSON object value contract. The producer **already** constructs this field as `reference.direct_invokes_exhaustive ?? null` at line 383. This report does not demonstrate a runtime undefined value. The mismatch is between the validated schema's inferred output type and `JsonValue`: `src/domain/android/androidAnalysis.ts:191` declares `z.boolean().nullable().optional()`. This compile failure blocks runtime preparation and compiled boundary tests before they start. ## Independent reproduction - Baseline: `b17487f482ce0769dd0c1415297f9c3e1bb7509f`, the parent of merged #2692 (`21aa877e5ae3164cfbfab6f6db27967995ebc8c3`). - Isolated clean detached worktree, with `npm ci` from the baseline/merged lockfile. - Pinned Node `v24.18.0`, npm `11.16.0`, Linux x64. - The package, lockfile, compiler config, JSON type, Android producer and Android result schema are unchanged between baseline and merged commits. ```sh npm ci npm run compile ``` Exit status **2** on the independently checked parent and merged snapshot: ```text src/android/JadxAnalysis.ts(366,3): error TS2322: Property 'references' is incompatible with index signature. Property 'direct_invokes_exhaustive' is incompatible with index signature. Type 'boolean | null | undefined' is not assignable to type 'JsonValue'. Type 'undefined' is not assignable to type 'JsonValue'. ``` On the merged snapshot with locked dependencies, six selected source files passed 139 cases. `test:focused` stopped during this prerequisite compilation and executed none of its selected process/provider boundary cases. Partial compiler output was cleaned afterward. At inspection, main `94072364c` still retains the Android change introduced in #2439 (`c45d912c9`). None of #2692's ten files modifies this Android boundary or its schema. ## Correction and verification Reconcile validated output typing with the JSON-producing contract at its owner. Preserve the documented meanings of omitted/null unknown coverage and observed true/false, together with compatibility for existing results. Do not weaken the JSON type or cast away the error. Adding another `?? null` to the input object would not address the existing schema-output mismatch. Verify omitted, null, false and true exhaustiveness through the contract/producer boundary. Run the pinned compile and relevant Android checks, then rerun the previously blocked compiled boundary prerequisites. Preserve discovery and fail-closed report gates. This is independently reproduced on the pre-#2692 main baseline. It is not attributed to the deadline/skill change. The initial report's producer-undefined characterization has been corrected after inspecting the actual producer and schema.
bsakaguchi 2026-10-15 18:30:22 +00:00
Author
Owner

@N0zoM1z0 commented on GitHub (Oct 15, 2026):

The schema now makes direct_invokes_exhaustive required and nullable, and the producer supplies null for unknown coverage. Current main compilation passes in CI: https://github.com/morluto/rea/actions/runs/38728643222 . Closing as resolved.

<!-- gh-comment-id:6191470420 --> @N0zoM1z0 commented on GitHub (Oct 15, 2026): The schema now makes direct_invokes_exhaustive required and nullable, and the producer supplies null for unknown coverage. Current main compilation passes in CI: https://github.com/morluto/rea/actions/runs/38728643222 . Closing as resolved.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1017
No description provided.