Skip to content

refactor(providers): key Kuna exports and the Native AOT profile on the producer identity - #11353

Merged
morluto merged 1 commit into
feat/producer-identity-cache-keyfrom
refactor/producer-identity-revisions
Nov 15, 2026
Merged

morluto merged 1 commit into
feat/producer-identity-cache-keyfrom
refactor/producer-identity-revisions

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Retires the last two hand-bumped revision markers W12 found: NATIVE_AOT_PROFILE_CONTRACT_REVISION (Ghidra PE analysis profile) and Kuna's CACHE_LAYOUT. Both now rely on the producer identity that #11320 introduced. Stacked on #11320. Refs #10510.

Problem and expected behavior

#11320 made the Ghidra and Hopper analysis profiles commit to ProducerIdentity (REA release plus packaged bridge digest), so REA code changes invalidate them without markers. Two markers remained:

  • native_aot_metadata.contract_revision (rtr-9.1-x64-pe-read-only-v11) in the Ghidra PE profile. It versions REA's own TypeScript Native AOT metadata interpretation, which the profile's producer.rea_version already covers.
  • CACHE_LAYOUT = 3 in KunaProjectCache, bumped by hand whenever the entry layout or manifest meaning changed. Both are REA code.

Change and scope

  • src/filesystem/ProducerIdentity.ts: ReleaseProducerIdentity ({ rea_version }) and releaseProducerIdentity() cover producers implemented entirely in REA's own code. ProducerIdentity is that identity plus sources_sha256.
  • Ghidra: NATIVE_AOT_PROFILE_CONTRACT_REVISION and native_aot_metadata.contract_revision are deleted. The limits stay in the profile.
  • Kuna: the cache key and manifest carry producer: { rea_version } instead of layout. A manifest from another REA release, or with the old layout field, is refused, so the entry is rebuilt and retired through the existing owned-cache cleanup, as layout bumps were before. docs/kuna-provider.md says so.
  • Not included: the Native AOT limit constants in the profile (runtime-relevant facts, unchanged).

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/filesystem/ProducerIdentity.ts; src/kuna/KunaProjectCache.ts; src/ghidra/GhidraAnalysisProfile.ts.
  • Contribution scope fit and linked maintainer decision: structural cleanup plan W12 step 1 follow-up (coordinator, 2026-11-15).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: Ghidra PE profile digests change (already changing in refactor(providers)!: key Ghidra and Hopper analysis profiles on the producer identity instead of hand-bumped markers #11320). Kuna exports cached by earlier releases are rebuilt once.
  • Evidence, artifact, provenance, or reconstruction contract: Ghidra PE analysis profiles lose native_aot_metadata.contract_revision.
  • Target selection, authority, upstream behavior, and cleanup details: Kuna retirement uses the existing cleanup path; unrelated cache resources are untouched (tested).
  • Generated metadata, package, or installation impact: none.

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

  • kunaProjectCache.test.ts: the transition test now also covers the layout 3 manifest that current releases write, and a manifest in the new format from another REA release. Each is rebuilt once and retired without touching unrelated cache resources. The publish test checks that the manifest names the current release.
  • GhidraProvider.behavior.test.ts: the PE profile expectation no longer carries contract_revision.
  • Accepted limitation (as in refactor(providers)!: key Ghidra and Hopper analysis profiles on the producer identity instead of hand-bumped markers #11320): between releases, a TypeScript-only change does not change rea_version, so a development build can reuse a Kuna export or Ghidra profile from an earlier build of the same version.

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 check:fast: passed
  • npm run test:focused -- tests/boundary/providers/kuna/kunaProjectCache.test.ts src/ghidra/GhidraProvider.behavior.test.ts: 2 files, 348 passed
  • npm run test:focused -- producerIdentity, GhidraRawProfileDigest, GhidraSnapshotCache, hopperAnalysisProfile and seven Kuna boundary tests (hash owner, provider, concurrency, single-function runs, selected command, publication cleanup, cleanup concurrency): 11 files, 121 passed
  • npm run docs:check: passed

Compatibility, safety, and release

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-15T16:45:29.292417Z
We couldn’t complete this review. Comment @codex review to try again.
7c19eab 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

[Medium impact] The PR appears safe to merge; no actionable issue was found.

Summary

Replaces Kuna's hand-bumped cache layout marker with the REA release identity and removes the redundant Native AOT profile revision.

  • Kuna cache entries now belong to the REA release that made them.
  • Ghidra PE profiles no longer carry a separate Native AOT revision.

Reviews (1) · Last reviewed commit: "refactor(providers): key Kuna exports an..." · Reviewed by Greptile

@morluto
morluto merged commit d8c6f32 into feat/producer-identity-cache-key Nov 15, 2026
1 check passed
@morluto
morluto deleted the refactor/producer-identity-revisions branch November 15, 2026 16:48
morluto added a commit that referenced this pull request Nov 15, 2026
…producer identity instead of hand-bumped markers (#11320)

* refactor(ghidra)!: key analysis profiles on the producer identity instead of hand-bumped markers

Ghidra snapshot validity depended on 53 hand-maintained "-vN" semantic
markers in the analysis profile; a behaviour fix that forgot to bump its
marker left old snapshots admissible (#3664). #10562 added a digest of the
bridge sources, but TypeScript projection changes still needed a bump and
the REA release was not committed.

- src/filesystem/ProducerIdentity.ts owns the producer identity: the REA
  release plus a framed SHA-256 of a producer's packaged scripts, read once
  per process.
- Ghidra profiles commit `producer` in place of `bridge_sources_sha256` and
  the constant revision markers (shared semantics block, load-image, entry
  seed, PDB, jump-table, DOL import, MIPS ISA-mode markers) are removed.
- Runtime-selected values keep their meaning without a revision suffix
  (language_selection, annotation_policy, relocation/no-return/launch
  policy, MIPS/PowerPC/PSP lanes, MIPS ABI basis). Bridge wire policy ids
  shared with the Java scripts (ilp32-prototype-v1,
  o32-soft-float-prototype-v1) are unchanged.

BREAKING CHANGE: Ghidra Evidence `analysis_profile.parameters` replace the
semantic marker keys and `bridge_sources_sha256` with `producer`
({rea_version, sources_sha256}), and selection values lose their "-vN"
suffix (for example `language_selection: "provider-pinned"`). Ghidra
Evidence IDs and profile digests change, and analysis snapshots saved by
earlier builds are refused at open. Migration: open the target without the
old snapshot and save a fresh one; consumers reading the removed marker keys
should read `producer` instead.

* fix(hopper)!: commit the REA release and bridge script in Hopper analysis profiles (#11324)

Hopper analysis profiles committed the launcher digest and one hand-bumped
marker (function_dossier_coverage "...-v1"), but neither the REA release
nor bridge/hopper_bridge.py. A snapshot saved before a bridge or REA change
replayed results the current bridge would not produce.

HopperBridgeSources owns the packaged bridge script URL (used to launch it)
and hopperProducerIdentity() on the shared ProducerIdentity owner; the
profile commits `producer` in place of the marker.

BREAKING CHANGE: Hopper Evidence `analysis_profile.parameters` replace
`function_dossier_coverage` with `producer` ({rea_version, sources_sha256}).
Hopper profile digests and Evidence IDs change, and analysis snapshots saved
by earlier builds are refused at open. Migration: open the target without
the old snapshot and save a fresh one.

* fix(ghidra): build the legacy reference snapshot from another producer and use the shared temp directory

* refactor(providers): key Kuna exports and the Native AOT profile on the producer identity (#11353)

* fix(ghidra): keep the bridge source table import-free for the Node-loaded verifier

scripts/verify-ghidra-bridge-sources.mjs loads GhidraBridgeSources.ts with
Node type stripping, which does not resolve .js specifiers to .ts sources.
The producer identity import made every verifier run fail with
ERR_MODULE_NOT_FOUND; the identity now lives in GhidraProducerIdentity.ts.

* fix(artifacts): import the moved file source and abort check from their resources owner after merging main
@morluto morluto added area: providers Provider and capability discovery, including provider proposal triage provider: kuna Analysis provider / engine: kuna labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: providers Provider and capability discovery, including provider proposal triage provider: kuna Analysis provider / engine: kuna

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant