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:
morluto
2026-10-13 13:00:39 +08:00
parent c105391db5
commit acf75e6700
8 changed files with 331 additions and 26 deletions
+7
View File
@@ -65,4 +65,11 @@ describe("analysis profile commitments", () => {
analysisProfileSchema.parse({ ...profile, digest: "0".repeat(64) }),
).toThrow(/digest/u);
});
it("projects known provider identity fields at construction", () => {
const liveProvider = { ...PROVIDER, transient_status: "starting" };
const profile = createAnalysisProfile(liveProvider, { loader: "default" });
expect(profile.provider).toEqual(PROVIDER);
expect(analysisProfileSchema.parse(profile)).toEqual(profile);
});
});