Skip to content

build(scripts): type-check the managed app manifest verifier - #11592

Merged
morluto merged 1 commit into
build/typecheck-evidence-scriptsfrom
build/typecheck-managed-manifest-scripts
Nov 15, 2026
Merged

morluto merged 1 commit into
build/typecheck-evidence-scriptsfrom
build/typecheck-managed-manifest-scripts

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Third #11545 slice, and the first managed-conformance sub-slice. typecheck now checks scripts/verify/managed/manifest-parser.mjs, scripts/verify/managed/manifest.mjs and scripts/lib/verifier-artifact-scope.mjs against src; that fixed 84 errors. Stacked on #11579, which now carries #11590. Refs #11545.

Problem and expected behavior

The managed conformance closure (scripts/verify/managed/* and the verifier libraries it loads) has 326 errors with the main compiler options, up from the ~180 measured earlier because the closure now pulls in more scripts/lib modules. This sub-slice takes the dependency-closed manifest part. Besides implicit-any parameters, it had two real gaps:

  • The hand-written manifest validators returned their input untyped, so nothing tied a checked field to its later use.
  • The application-graph projection read normalized_result.graph/.summary from JsonValue Evidence.

Change and scope

  • manifest-parser.mjs: ensure is an assertion function. The validators take unknown and return the type they checked, so ManagedAppManifest is inferred from the parser and exported as a typedef. The object check uses the shared isRecord owner. Integer checks also require typeof value === "number"; Number.isInteger already refused non-numbers, so the accepted values do not change. Messages are unchanged.
  • manifest.mjs: typed parameters through the src types (BinaryTarget, ArtifactResourceScope, the inspector results). The graph projection reads its result through managedApplicationGraphResultSchema, the managed graph owner's schema, which JavaScriptApplicationEvidenceGraph already uses for the same Evidence.
  • verifier-artifact-scope.mjs: withVerifierArtifactScope is generic over the operation's result.
  • tsconfig.scripts.json: lists the three files.

Not included: oracles.mjs and completion-report.mjs (~72 errors), then conformance.mjs, support.mjs, the scripts/lib/verifier-* modules and scripts/fixtures/managed/* (~170). Those are the next sub-slices.

Contract and boundary impact

  • Semantic owner and earliest changed stage: verification scripts only; no runtime source changes.
  • Contribution scope fit and linked maintainer decision: [Design] Type-check the JavaScript verification scripts that import domain modules #11545 (build/test tooling).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: none.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • node scripts/run-typescript.mjs --noEmit -p tsconfig.scripts.json reported 84 errors in these files with only the imports aliased; it reports 0 now.
  • tests/boundary/process/managedManifestAdmission.test.ts and tests/boundary/process/verifierArtifactScope.test.ts cover the parser and scope through the #dist alias.

Validation performed

All on macOS (arm64), Node 24.22.1:

  • npm run check:fast (typecheck including tsconfig.scripts.json, lint, architecture guards): passed.
  • npx oxfmt --check on the 4 changed files: clean.
  • npm run test:focused -- tests/boundary/process/managedManifestAdmission.test.ts tests/boundary/process/verifierArtifactScope.test.ts: 9 passed.
  • Not run: the managed conformance run itself (scripts/verify/managed/conformance.mjs against built fixtures).

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • 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.

@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-15T23:35:54.523172Z
We couldn’t complete this review. Comment @codex review to try again.
64b2ad3 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

[Low impact] The changes appear safe to merge; no blocking issues were found.

Summary

Adds source-based type checking for the managed manifest verifier and its cleanup helper.

  • Managed manifests now keep their checked field types.
  • Managed manifest checks now carry source-defined types through verification.
  • Verifier cleanup keeps each operation's return type.

Reviews (2) · Last reviewed commit: "build(scripts): type-check the managed a..." · Reviewed by Greptile

@morluto
morluto merged commit 33a9e77 into build/typecheck-evidence-scripts Nov 15, 2026
1 check passed
@morluto
morluto deleted the build/typecheck-managed-manifest-scripts branch November 15, 2026 23:41
morluto added a commit that referenced this pull request Nov 16, 2026
…src (#11579)

* build(scripts): type-check the Evidence verification scripts against src

Six JavaScript callers kept passing `undefined` as an Evidence subject
after `createEvidence` stopped accepting it (#11536); `npm run typecheck`
saw only the TypeScript callers. The scripts import built modules by
relative `../dist/` paths, which a checker resolves to the built JavaScript
(or nothing, before a build) rather than the source types.

A package-private `#dist/*` import alias resolves to `./dist/*` at run
time, and `tsconfig.scripts.json` maps it to `./src/*` and checks the
listed scripts with `checkJs` under the main compiler options. `typecheck`,
and so `check:fast`, runs it; turbo's typecheck inputs include the scripts
and the new config.

First slice: `verify-package-evidence.mjs` (its evidence-bundle import
becomes static), `verify/javascript/output.mjs` and
`verify/javascript/digests.mjs`, with the JSDoc types the check required.

Refs #11545

* build(scripts): type-check the MCP verifier results and Ghidra snapshot lifecycle helpers (#11590)

* build(scripts): type-check the managed app manifest verifier (#11592)

* build(scripts): type-check the managed oracles and completion report (#11605)

oracles.mjs and completion-report.mjs join tsconfig.scripts.json (72 errors). ensureIlspy is an assertion function, the ILSpy import returns the imported Evidence and reads its normalized result through managedReconstructionImportResultSchema, the manifest-rejection controls are named records walked by a checked field lookup, and the completion report names its input.
@morluto morluto added the area: build Build, CI, packaging, and publishing label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant