docs(evidence): publish curated-only workspace contract

This commit is contained in:
2026-08-25 01:52:27 +02:00
parent 619ac2e141
commit 9f0184388d
7 changed files with 153 additions and 14 deletions
+52
View File
@@ -390,6 +390,58 @@ test("applies filesystem and policy defaults to the canonical descriptor", () =>
});
});
test("defaults schema-versioned filesystem Evidence to curated documents only", () => {
const parsed = validateWorkspaceDescriptor({
...withEvidence({
type: "filesystem",
uri: "psd-clinical/evidence",
}),
evidence: {
schema_version: 2,
source: { type: "filesystem", uri: "psd-clinical/evidence" },
},
});
expect(parsed.evidence).toMatchObject({
schema_version: 2,
source: { patterns: ["curated/**/*.md"] },
});
});
test("rejects a schema-versioned Evidence layout that mixes source and curated runtime patterns", () => {
expectSafeEvidenceError({
...withEvidence({
type: "filesystem",
uri: "psd-clinical/evidence",
}),
evidence: {
schema_version: 2,
source: {
type: "filesystem",
uri: "psd-clinical/evidence",
patterns: ["source/**/*.md", "curated/**/*.md"],
},
},
}, /source.*curated|curated.*source/i);
});
test("rejects a schema-versioned Evidence layout that acquires source documents at runtime", () => {
expectSafeEvidenceError({
...withEvidence({
type: "filesystem",
uri: "psd-clinical/evidence",
}),
evidence: {
schema_version: 2,
source: {
type: "filesystem",
uri: "psd-clinical/evidence",
patterns: ["source/**/*.md"],
},
},
}, /curated/i);
});
test("keeps evidence optional on schema v3", () => {
expect(validateWorkspaceDescriptor(validWorkspaceObject())).not.toHaveProperty("evidence");
});