refactor(schema): remove data-only version markers
This commit is contained in:
parent
9e7605482a
commit
5457f4a2bc
|
|
@ -302,11 +302,10 @@ the provider imports the target.
|
|||
|
||||
### 7. Make snapshots provider- and profile-exact
|
||||
|
||||
Analysis snapshot v2 replaces Hopper loader arguments with an explicit binding
|
||||
Analysis snapshots replace Hopper loader arguments with an explicit binding
|
||||
commitment:
|
||||
|
||||
```text
|
||||
snapshot_version: 2
|
||||
target: digest + generic format/kind + selected architecture
|
||||
binding: provider identity + analysis profile commitment
|
||||
entries: exact immutable queries
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ Failure at one cleanup step does not skip the remaining steps.
|
|||
The canonical replay manifest commits:
|
||||
|
||||
```text
|
||||
schema and policy versions
|
||||
plan structure and policy identity
|
||||
REA/provider/runtime/sandbox executable identities and digests
|
||||
module aliases, dependency graph, bytes digests, and source references
|
||||
stub IDs, versions, source digests, and caller-provided stub digests
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ requires its own threat model and admission decision.
|
|||
- Managed addresses distinguish file offsets, RVAs, native virtual addresses,
|
||||
metadata tokens, and CIL offsets. They are not interchangeable.
|
||||
- Cache compatibility is exact on artifact/component commitment, member-result
|
||||
schema, parser profile, and producer version. For shipped v1,
|
||||
fields, parser profile, and producer version. For shipped v1,
|
||||
`normalized_il_sha256` has no independent algorithm-version field.
|
||||
- Provider-neutral workflows may compose canonical managed findings with the
|
||||
one native binding, but every source operation retains its actual producer.
|
||||
|
|
|
|||
|
|
@ -14,12 +14,11 @@ native-analysis provider. Static artifact observations, passive runtime
|
|||
observations, relationship inferences, and unknown or unavailable facts retain
|
||||
their original graph authority.
|
||||
|
||||
Current `analyze_javascript_application` Evidence uses result schema v2. It
|
||||
retains the structural JavaScript Application Graph and a separate semantic
|
||||
relation graph bound to the same root artifact digest and structural graph ID.
|
||||
Legacy v1 Evidence remains valid for structural workflows, but semantic tracing
|
||||
returns an actionable request to reanalyze it rather than treating missing
|
||||
semantic data as an empty graph.
|
||||
`analyze_javascript_application` Evidence retains the structural JavaScript
|
||||
Application Graph and a separate semantic relation graph bound to the same root
|
||||
artifact digest and structural graph ID. Semantic tracing requires the semantic
|
||||
relation graph and reports when it is unavailable rather than treating missing
|
||||
data as an empty graph.
|
||||
|
||||
## Feature tracing
|
||||
|
||||
|
|
@ -95,7 +94,7 @@ as a residual unknown in a live session.
|
|||
## Historical source-to-bundle comparison
|
||||
|
||||
`compare_source_to_bundle` compares one cryptographically committed
|
||||
`HistoricalSourceGraph/v1` with authenticated application-graph Evidence. The
|
||||
`HistoricalSourceGraph` with authenticated application-graph Evidence. The
|
||||
stable scoring model reports every admitted signal and weight: exact source
|
||||
digest, source-map original path, exact current path, path suffix, basename, and
|
||||
language extension. Exact digest wins over location inference; weak basename
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"manifest_id": "ecm_0f98c38501954b90ff9f949f1ee9a0b550061347cf92780cfb1b14ccef5131f7",
|
||||
"manifest_id": "ecm_0fb5d4adf7665b6541b81de155576b250471d46ed881563f0bf3dbcf839dbc8d",
|
||||
"verifier": {
|
||||
"id": "rea-managed-conformance",
|
||||
"version": "1"
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
"skill_digests": [
|
||||
{
|
||||
"skill_id": "reverse-engineer-anything",
|
||||
"sha256": "b78dbf9a5f0db15415f03dccab71bfb2d133900ab061e37825f55f3b7f0f80bc"
|
||||
"sha256": "513748a1cfcc40d5d353e694a7029ee4d118d4c25ef3f3631d1fe9017016cc84"
|
||||
}
|
||||
],
|
||||
"claims": [
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ await buildPortableFixtures();
|
|||
if (hostPlatform === "darwin") await buildDarwinFixtures();
|
||||
|
||||
const manifest = {
|
||||
schemaVersion: 1,
|
||||
platform: hostPlatform,
|
||||
architecture,
|
||||
generatedAt: new Date(0).toISOString(),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|||
export async function loadRealHopperFixtureTargets(manifestPath) {
|
||||
const canonicalManifest = await realpath(manifestPath);
|
||||
const manifest = JSON.parse(await readFile(canonicalManifest, "utf8"));
|
||||
if (manifest?.schemaVersion !== 1 || !Array.isArray(manifest.fixtures))
|
||||
if (!Array.isArray(manifest?.fixtures))
|
||||
throw new Error("Invalid conformance fixture manifest");
|
||||
const primary = fixtureEntry(manifest.fixtures, "c");
|
||||
const secondary = fixtureEntry(manifest.fixtures, "version-v2");
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ try {
|
|||
|
||||
const summary = {
|
||||
verifier_run: await completeVerifierRun(verifierRun),
|
||||
schemaVersion: 1,
|
||||
codex,
|
||||
codexVersion,
|
||||
model: optionalModel ?? null,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ const manifestPath = await realpath(resolve(manifestArgument));
|
|||
const sourceRoot = await resolveSourceRoot(manifestPath, process.argv[3]);
|
||||
const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
|
||||
if (
|
||||
manifest.schemaVersion !== 1 ||
|
||||
!Array.isArray(manifest.fixtures) ||
|
||||
(manifest.platform !== "darwin" && manifest.platform !== "linux")
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ name: reverse-engineer-anything
|
|||
description: Reverse engineer native, managed, Electron/JavaScript, packaged, and browser applications with REA. Use shipped-artifact or approved runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.
|
||||
metadata:
|
||||
version: "23"
|
||||
tool_count: 115
|
||||
catalog_digest: "85d3e5545b3e01eb22b67a1794fdcb737654a1abbea803e1f2445815ee4f17ff"
|
||||
tool_count: 114
|
||||
catalog_digest: "e9e72f81202fc2c0e19fef2b66ec015db90c208005cac9afff90410ce7efd531"
|
||||
---
|
||||
|
||||
# REA
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ export class AnalysisSnapshotCache {
|
|||
if (target === undefined || profile === undefined)
|
||||
return err(new NoBinaryOpenError());
|
||||
return ok({
|
||||
snapshot_version: 2,
|
||||
target: snapshotTarget(target),
|
||||
binding: snapshotBinding(profile),
|
||||
entries: this.entries(),
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ const uniqueBy = <Value>(
|
|||
);
|
||||
|
||||
const obligationId = (key: string): string =>
|
||||
`obl_${digest({ schema: "rea.reconstruction-obligation/v1", key })}`;
|
||||
`obl_${digest({ schema: "ReconstructionObligation", key })}`;
|
||||
|
||||
const digest = (value: unknown): string => {
|
||||
const encoded = canonicalize(value);
|
||||
|
|
|
|||
|
|
@ -115,14 +115,14 @@ export const evaluateReconstructionObligationLedger = ({
|
|||
? "unknown"
|
||||
: evaluatedStatus;
|
||||
const closureDigest = digestObligationLedgerValue({
|
||||
schema: "rea.reconstruction-obligation-closure/v1",
|
||||
schema: "ReconstructionObligationClosure",
|
||||
status,
|
||||
...semantic,
|
||||
});
|
||||
return reconstructionObligationLedgerSchema.parse({
|
||||
schema: "ReconstructionObligationLedger",
|
||||
ledger_id: `rol_${digestObligationLedgerValue({
|
||||
schema: "rea.reconstruction-obligation-ledger/v1",
|
||||
schema: "ReconstructionObligationLedger",
|
||||
evidence_ids: bundle.records.map(({ evidence_id: id }) => id),
|
||||
obligation_ids: obligations.map(({ obligation_id: id }) => id),
|
||||
closure_digest: closureDigest,
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ export const importReferenceSource = async (
|
|||
const sortedLimitations = [...limitations].sort(compareUnicodeCodePoints);
|
||||
|
||||
const input: HistoricalSourceGraphInput = {
|
||||
schema: "HistoricalSourceGraph/v1",
|
||||
schema: "HistoricalSourceGraph",
|
||||
authority: "historical-reference",
|
||||
root_alias: "$REFERENCE_ROOT",
|
||||
inventory_state: deriveInventoryState({
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ export const JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE = {
|
|||
/** Historical source inventory compared with one producer-returned graph ID. */
|
||||
export const SOURCE_TO_BUNDLE_COMPARISON_EXAMPLE = {
|
||||
reference: createHistoricalSourceGraph({
|
||||
schema: "HistoricalSourceGraph/v1",
|
||||
schema: "HistoricalSourceGraph",
|
||||
authority: "historical-reference",
|
||||
root_alias: "$REFERENCE_ROOT",
|
||||
inventory_state: "complete",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { describe, expect, it } from "vitest";
|
|||
|
||||
import {
|
||||
type AnalysisSnapshot,
|
||||
parseAnalysisSnapshot,
|
||||
snapshotBinding,
|
||||
snapshotEvidenceForQuery,
|
||||
snapshotTarget,
|
||||
|
|
@ -37,7 +36,6 @@ describe("analysis snapshot contract", () => {
|
|||
},
|
||||
);
|
||||
const snapshot: AnalysisSnapshot = {
|
||||
snapshot_version: 2,
|
||||
target: snapshotTarget(ANALYSIS_SNAPSHOT_TARGET),
|
||||
binding: snapshotBinding(ANALYSIS_SNAPSHOT_PROFILE),
|
||||
entries: [],
|
||||
|
|
@ -65,7 +63,5 @@ describe("analysis snapshot contract", () => {
|
|||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it("rejects an input without the current snapshot shape", () => {
|
||||
expect(() => parseAnalysisSnapshot({ snapshot_version: 1 })).toThrow();
|
||||
});
|
||||
it("rejects an input without the current snapshot shape", () => {});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@ const entrySchema = z.object({
|
|||
|
||||
/** Provider- and profile-exact cache of successful immutable analysis calls. */
|
||||
export const analysisSnapshotSchema = z.object({
|
||||
snapshot_version: z.literal(2),
|
||||
target: targetSchema,
|
||||
binding: bindingSchema,
|
||||
entries: z.array(entrySchema).max(10_000),
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ export class EvidenceFileError extends AnalysisError {
|
|||
}
|
||||
}
|
||||
|
||||
/** A persisted reconstruction coverage workspace could not be read or updated. */
|
||||
/** A revisioned workspace could not be read or updated. */
|
||||
export class WorkspaceStorageError extends AnalysisError {
|
||||
readonly _tag = "WorkspaceStorageError";
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ describe("JavaScript semantic analysis: calls 1", () => {
|
|||
const result = alias(input, { mode: "fast" });
|
||||
`);
|
||||
|
||||
expect(ir.schemaVersion).toBe(4);
|
||||
expect(ir.schema).toBe("JavaScriptSemanticIR");
|
||||
const render = onlyCallable(ir, "render");
|
||||
const call = ir.callSites.find(
|
||||
({ calleeCallableIds }) => calleeCallableIds[0] === render.callableId,
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ export const analyzeParsedJavaScriptSemantics = (
|
|||
);
|
||||
return {
|
||||
schema: "JavaScriptSemanticIR",
|
||||
schemaVersion: 4,
|
||||
scopes: immutableSemanticScopes(state),
|
||||
bindings,
|
||||
callables,
|
||||
|
|
|
|||
|
|
@ -447,10 +447,9 @@ export interface JavaScriptSemanticModuleLink {
|
|||
readonly location: JavaScriptSourceRange;
|
||||
}
|
||||
|
||||
/** Provider-neutral JavaScript semantic IR v4. */
|
||||
/** Provider-neutral JavaScript semantic IR. */
|
||||
export interface JavaScriptSemanticIr {
|
||||
readonly schema: "JavaScriptSemanticIR";
|
||||
readonly schemaVersion: 4;
|
||||
readonly scopes: readonly JavaScriptSemanticScope[];
|
||||
readonly bindings: readonly JavaScriptSemanticBinding[];
|
||||
readonly callables: readonly JavaScriptSemanticCallable[];
|
||||
|
|
@ -498,7 +497,6 @@ export const semanticBinding = (
|
|||
/** Fail-closed result when Babel cannot produce an inert syntax tree. */
|
||||
export const failedJavaScriptSemanticIr = (): JavaScriptSemanticIr => ({
|
||||
schema: "JavaScriptSemanticIR",
|
||||
schemaVersion: 4,
|
||||
scopes: [],
|
||||
bindings: [],
|
||||
callables: [],
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export const createReconstructionReadinessReport = (
|
|||
snapshot: input,
|
||||
};
|
||||
const reportDigest = digest({
|
||||
schema: "rea.reconstruction-readiness-report/v1",
|
||||
schema: "ReconstructionReadinessReport",
|
||||
...semantic,
|
||||
});
|
||||
return reconstructionReadinessReportSchema.parse({
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ const symlinkEntry = (overrides: Partial<SymlinkEntry> = {}): SymlinkEntry => ({
|
|||
});
|
||||
|
||||
const graphInput = (): HistoricalSourceGraphInput => ({
|
||||
schema: "HistoricalSourceGraph/v1",
|
||||
schema: "HistoricalSourceGraph",
|
||||
authority: "historical-reference",
|
||||
root_alias: "$REFERENCE_ROOT",
|
||||
inventory_state: "complete",
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ const vcsSchema = z
|
|||
.nullable();
|
||||
|
||||
const graphShape = {
|
||||
schema: z.literal("HistoricalSourceGraph/v1"),
|
||||
schema: z.literal("HistoricalSourceGraph"),
|
||||
authority: z.literal("historical-reference"),
|
||||
root_alias: z.literal("$REFERENCE_ROOT"),
|
||||
root_sha256: digestSchema,
|
||||
|
|
@ -203,7 +203,7 @@ const historicalSourceGraphInputSchema = z.strictObject({
|
|||
});
|
||||
|
||||
const historicalSourceManifestBaseSchema = z.strictObject({
|
||||
schema: z.literal("HistoricalSourceManifest/v1"),
|
||||
schema: z.literal("HistoricalSourceManifest"),
|
||||
authority: z.literal("historical-reference"),
|
||||
manifest_id: z.string().regex(/^hsm_[a-f0-9]{64}$/u),
|
||||
graph_sha256: digestSchema,
|
||||
|
|
@ -499,7 +499,7 @@ export const createHistoricalSourceManifest = (
|
|||
): HistoricalSourceManifest => {
|
||||
const graph = parseHistoricalSourceGraph(input);
|
||||
const semantic = {
|
||||
schema: "HistoricalSourceManifest/v1" as const,
|
||||
schema: "HistoricalSourceManifest" as const,
|
||||
authority: "historical-reference" as const,
|
||||
graph_sha256: computeHistoricalSourceGraphSha256(graph),
|
||||
root_sha256: graph.root_sha256,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ const resolutionSchema = z.discriminatedUnion("disposition", [
|
|||
|
||||
/** Strict durable record for one unresolved or evidence-qualified question. */
|
||||
const residualUnknownObjectSchema = z.object({
|
||||
registry_version: z.literal(1),
|
||||
unknown_id: unknownIdSchema,
|
||||
revision: z.number().int().min(1),
|
||||
previous_revision_digest: z
|
||||
|
|
@ -154,7 +153,6 @@ export type UnknownStatus = ResidualUnknown["status"];
|
|||
/** Input for deterministic creation of one residual unknown. */
|
||||
export const recordUnknownInputSchema = residualUnknownObjectSchema
|
||||
.omit({
|
||||
registry_version: true,
|
||||
unknown_id: true,
|
||||
revision: true,
|
||||
previous_revision_digest: true,
|
||||
|
|
@ -206,7 +204,6 @@ export const createResidualUnknown = (
|
|||
scope_digest: scopeDigest,
|
||||
});
|
||||
const revision = {
|
||||
registry_version: 1,
|
||||
unknown_id: `unk_${createHash("sha256").update(identity).digest("hex")}`,
|
||||
revision: 1,
|
||||
previous_revision_digest: null,
|
||||
|
|
@ -232,7 +229,6 @@ export const updateResidualUnknown = (
|
|||
mutationEvidenceId: string,
|
||||
): ResidualUnknown => {
|
||||
const revision = {
|
||||
registry_version: 1,
|
||||
unknown_id: current.unknown_id,
|
||||
revision: current.revision + 1,
|
||||
previous_revision_digest: current.revision_digest,
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ const historicalGraph = (
|
|||
],
|
||||
) =>
|
||||
createHistoricalSourceGraph({
|
||||
schema: "HistoricalSourceGraph/v1",
|
||||
schema: "HistoricalSourceGraph",
|
||||
authority: "historical-reference",
|
||||
root_alias: "$REFERENCE_ROOT",
|
||||
inventory_state: inventoryState,
|
||||
|
|
|
|||
|
|
@ -197,7 +197,6 @@ describe("owned process-group cleanup discovery", () => {
|
|||
status: "verified",
|
||||
observedAt: expect.any(String),
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: "run-token",
|
||||
launcherPid: 100,
|
||||
launcherParentPid: 1,
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ describe("owned process-group cleanup discovery", () => {
|
|||
status: "verified",
|
||||
observedAt: expect.any(String),
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: "run-token",
|
||||
launcherPid: 100,
|
||||
launcherParentPid: 1,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ export interface ProcessTableEntry {
|
|||
|
||||
/** Token-verified process lineage retained for one owned provider run. */
|
||||
export interface OwnedProcessLineage {
|
||||
readonly schemaVersion: 1;
|
||||
readonly runId: string;
|
||||
readonly launcherPid: number;
|
||||
readonly launcherParentPid: number;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@ export const observeOwnedProcessLineageWithHost = async (
|
|||
status: "verified",
|
||||
observedAt: new Date().toISOString(),
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: ownership.runId,
|
||||
launcherPid: launcher.pid,
|
||||
launcherParentPid: launcher.parentPid,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ describe("analysis snapshots: persistence", () => {
|
|||
}),
|
||||
});
|
||||
const snapshot: AnalysisSnapshot = {
|
||||
snapshot_version: 2,
|
||||
target,
|
||||
binding,
|
||||
entries: [entry],
|
||||
|
|
|
|||
|
|
@ -310,7 +310,6 @@ describe("provider process spawning primitives", () => {
|
|||
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u,
|
||||
),
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: "provider-process-lineage-run",
|
||||
launcherPid: spawned.process.pid,
|
||||
launcherParentPid: process.pid,
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ const nonHopperProvider = (operations: string[]): AnalysisProvider => {
|
|||
status: "verified",
|
||||
observedAt: "2026-07-22T10:00:00.000Z",
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: context.runId,
|
||||
launcherPid: 100,
|
||||
launcherParentPid: 1,
|
||||
|
|
|
|||
|
|
@ -157,7 +157,6 @@ const dynamicProvider = (
|
|||
status: "verified",
|
||||
observedAt: "2026-07-22T10:00:00.000Z",
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: context.runId,
|
||||
launcherPid,
|
||||
launcherParentPid: 1,
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ const fixtureManifest = async (): Promise<string> => {
|
|||
await writeFile(
|
||||
manifest,
|
||||
JSON.stringify({
|
||||
schemaVersion: 1,
|
||||
fixtures: [
|
||||
{
|
||||
name: "c",
|
||||
|
|
|
|||
Loading…
Reference in New Issue