fix(evidence): reject unsupported metadata before authentication
Close persisted Evidence, bundle, profile and unknown record shapes so parsing cannot silently remove caller metadata before checking semantic identity. Keep constructor provider projection explicit and JSON payload fields open. Exercise actual MCP export/import with independent record and manifest mutations, unchanged state after rejection, and a valid round trip. Prune duplicate source assertions. Validation: focused domain/CLI/MCP/filesystem checks, converted JSON Schemas, docs and typecheck/lint.
This commit is contained in:
@@ -52,6 +52,30 @@ it("preserves omitted relationship diagnostics and authenticates reported diagno
|
||||
).toThrow("semantic identifier");
|
||||
});
|
||||
|
||||
it("projects known provider fields and preserves open JSON payloads", () => {
|
||||
const liveProvider = { ...PROVIDER, transient_status: "starting" };
|
||||
const evidence = createEvidence(TARGET, liveProvider, {
|
||||
operation: "inspect",
|
||||
parameters: { caller_metadata: { note: "kept" } },
|
||||
result: { producer_extension: { value: "kept" } },
|
||||
analysisProfile: PROFILE,
|
||||
environment: {
|
||||
id: "fixture",
|
||||
platform: "linux",
|
||||
architecture: "x86_64",
|
||||
isolation: "process",
|
||||
},
|
||||
locations: [{ kind: "address", address: "0x1000" }],
|
||||
});
|
||||
|
||||
expect(evidence.provider).toEqual(PROVIDER);
|
||||
expect(evidence.parameters).toEqual({ caller_metadata: { note: "kept" } });
|
||||
expect(evidence.normalized_result).toEqual({
|
||||
producer_extension: { value: "kept" },
|
||||
});
|
||||
expect(parseEvidence(evidence)).toEqual(evidence);
|
||||
});
|
||||
|
||||
it("preserves identity and bytes when reusing an owned immutable result", () => {
|
||||
const value = { nested: { values: ["observed", 1] } };
|
||||
const mutable = createEvidence(TARGET, PROVIDER, {
|
||||
|
||||
Reference in New Issue
Block a user