fix(evidence): validate curated runtime corpus

This commit is contained in:
2026-08-25 01:59:27 +02:00
parent 9f0184388d
commit 0caa747914
11 changed files with 107 additions and 14 deletions
@@ -207,6 +207,7 @@ test("renders filesystem Evidence below the immutable revision content root with
expect(rendered.runtime_identity.workspace_revision).toBe(evidenceRevision);
expect(rendered.evidence).toEqual({
schema_version: 2,
sources: [{
type: "filesystem",
root: `/srv/registry/snapshots/${evidenceRevision}/psd-clinical/evidence`,
+20
View File
@@ -442,6 +442,26 @@ test("rejects a schema-versioned Evidence layout that acquires source documents
}, /curated/i);
});
test.each(["curated/**/*.yaml", "curated/**"])(
"rejects a schema-versioned Evidence layout that uses the non-canonical curated pattern %s",
(pattern) => {
expectSafeEvidenceError({
...withEvidence({
type: "filesystem",
uri: "psd-clinical/evidence",
}),
evidence: {
schema_version: 2,
source: {
type: "filesystem",
uri: "psd-clinical/evidence",
patterns: [pattern],
},
},
}, /curated\/\*\*\/\*\.md/i);
},
);
test("keeps evidence optional on schema v3", () => {
expect(validateWorkspaceDescriptor(validWorkspaceObject())).not.toHaveProperty("evidence");
});