refactor(providers)!: key Ghidra and Hopper analysis profiles on the 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
This commit is contained in:
morluto authored and GitHub committed 2026-11-16 05:37:57 +08:00
1 parent 960a387731
commit d87be930c4
65 files changed
+441 -419

No files matched your search

+1 -1
View File
@@ -5,6 +5,7 @@ import {
withArtifactRegularFile,
ArtifactReaderFailure,
ArtifactResourceScope,
normalizeArtifactPath,
} from "../../resources/index.js";
import { fileSnapshotPartialObservationSchema } from "../../domain/fileSnapshotObservation.js";
import { OwnedDirectoryHandle } from "../../filesystem/OwnedDirectoryHandle.js";
@@ -18,7 +19,6 @@ import {
writeFile,
} from "node:fs/promises";
import { basename, dirname, isAbsolute, join, relative, sep } from "node:path";
import { normalizeArtifactPath } from "../../resources/index.js";
import {
AnalysisAccessDeniedError,
AnalysisArtifactChangedError,
+4 -2
View File
@@ -4,8 +4,10 @@ import {
createAnalysisExecution,
type ExecutionOptions,
} from "../../ports/AnalysisProvider.js";
import type { SafeOutputTree } from "../../resources/index.js";
import type { ArtifactResourceScope } from "../../resources/index.js";
import type {
SafeOutputTree,
ArtifactResourceScope,
} from "../../resources/index.js";
import {
AnalysisArtifactChangedError,
AnalysisCapabilityUnavailableError,
+4 -2
View File
@@ -1,7 +1,9 @@
import { join } from "node:path";
import { Readable } from "node:stream";
import type { SafeOutputTree } from "../../resources/index.js";
import type { ArtifactResourceScope } from "../../resources/index.js";
import type {
SafeOutputTree,
ArtifactResourceScope,
} from "../../resources/index.js";
import { AnalysisOutputError } from "../../domain/analysisErrorCore.js";
import {
javascriptRecoveryResultSchema,
+1 -3
View File
@@ -3,12 +3,10 @@ import { safeParseUtf8Json } from "../../domain/safeJson.js";
import {
ArtifactReaderFailure,
type ArtifactResourceScope,
} from "../../resources/index.js";
import type { AnalysisCapturedOutput } from "../../domain/analysisErrorBase.js";
import {
normalizeArtifactPath,
ArtifactPathRegistry,
} from "../../resources/index.js";
import type { AnalysisCapturedOutput } from "../../domain/analysisErrorBase.js";
import {
AnalysisAccessDeniedError,
AnalysisArtifactChangedError,