refactor(domain): remove provider-specific target and snapshot state
Move Hopper loader derivation and compatibility projection into the Hopper adapter so BinaryTarget carries only provider-neutral identity and format metadata. Introduce bounded canonical analysis-profile commitments, exact provider/profile snapshot v2 bindings, legacy snapshot rejection guidance, and backward-compatible profiled Evidence v2 records. Partition cache and replay behavior by target, concrete provider build, and profile while preserving custom Hopper loader overrides. Propagate profiles consistently through CLI, MCP, composed workflows, and session lifecycle; preserve the 78-tool contract and legacy loaderArgs response projection. Add migration documentation, generated API updates, property regressions, package verification, and real Hopper coverage.
This commit is contained in:
@@ -1,26 +1,35 @@
|
||||
import { z } from "zod";
|
||||
import canonicalize from "canonicalize";
|
||||
|
||||
import { evidenceSchema, parseEvidence, type Evidence } from "./evidence.js";
|
||||
import {
|
||||
evidenceEnvelopeSchema,
|
||||
evidenceRecordSchema,
|
||||
parseEvidence,
|
||||
providerSchema,
|
||||
type Evidence,
|
||||
} from "./evidence.js";
|
||||
import {
|
||||
residualUnknownSchema,
|
||||
type ResidualUnknown,
|
||||
} from "./residualUnknown.js";
|
||||
|
||||
const artifactManifestSchema = evidenceSchema.shape.subject.unwrap().pick({
|
||||
digest: true,
|
||||
format: true,
|
||||
architecture: true,
|
||||
});
|
||||
const providerManifestSchema = evidenceSchema.shape.provider;
|
||||
const environmentManifestSchema = evidenceSchema.shape.environment.unwrap();
|
||||
const artifactManifestSchema = evidenceEnvelopeSchema.shape.subject
|
||||
.unwrap()
|
||||
.pick({
|
||||
digest: true,
|
||||
format: true,
|
||||
architecture: true,
|
||||
});
|
||||
const providerManifestSchema = providerSchema;
|
||||
const environmentManifestSchema =
|
||||
evidenceEnvelopeSchema.shape.environment.unwrap();
|
||||
const scenarioManifestSchema = z.object({
|
||||
evidence_id: evidenceSchema.shape.evidence_id,
|
||||
evidence_id: evidenceEnvelopeSchema.shape.evidence_id,
|
||||
operation: z.string().min(1),
|
||||
authority: z.literal("controlled-replay"),
|
||||
});
|
||||
const captureManifestSchema = z.object({
|
||||
evidence_id: evidenceSchema.shape.evidence_id,
|
||||
evidence_id: evidenceEnvelopeSchema.shape.evidence_id,
|
||||
predicate_type: z.string().min(1),
|
||||
});
|
||||
|
||||
@@ -32,7 +41,7 @@ export const evidenceBundleSchema = z.object({
|
||||
scenarios: z.array(scenarioManifestSchema),
|
||||
captures: z.array(captureManifestSchema),
|
||||
unknowns: z.array(residualUnknownSchema),
|
||||
records: z.array(evidenceSchema),
|
||||
records: z.array(evidenceRecordSchema),
|
||||
});
|
||||
|
||||
export type EvidenceBundle = z.infer<typeof evidenceBundleSchema>;
|
||||
|
||||
Reference in New Issue
Block a user