Improve audit pipeline and outreach review
This commit is contained in:
@@ -202,3 +202,90 @@ test("audit-generation validators are declared", () => {
|
||||
"auditGenerationStage should include qualityReview.",
|
||||
);
|
||||
});
|
||||
|
||||
test("auditFindings table stores verified specialist findings with evidence refs", () => {
|
||||
const { section, objectBlock } = extractTableSection("auditFindings");
|
||||
|
||||
assertHas(
|
||||
/auditId:\s*v\.id\(["']audits["']\)/,
|
||||
objectBlock,
|
||||
"auditFindings.auditId must be required audit id.",
|
||||
);
|
||||
assertHas(
|
||||
/runId:\s*v\.id\(["']agentRuns["']\)/,
|
||||
objectBlock,
|
||||
"auditFindings.runId must be required run id.",
|
||||
);
|
||||
assertHas(
|
||||
/skillId:\s*v\.string\(\)/,
|
||||
objectBlock,
|
||||
"auditFindings.skillId must identify the source specialist skill.",
|
||||
);
|
||||
assertHas(
|
||||
/claim:\s*v\.string\(\)/,
|
||||
objectBlock,
|
||||
"auditFindings.claim must store the verified claim.",
|
||||
);
|
||||
assertHas(
|
||||
/recommendation:\s*v\.string\(\)/,
|
||||
objectBlock,
|
||||
"auditFindings.recommendation must store the concrete fix.",
|
||||
);
|
||||
assertHas(
|
||||
/customerBenefit:\s*v\.string\(\)/,
|
||||
objectBlock,
|
||||
"auditFindings.customerBenefit must store customer-facing impact.",
|
||||
);
|
||||
assertHas(
|
||||
/severity:\s*v\.union\(\s*v\.literal\(1\),\s*v\.literal\(2\),\s*v\.literal\(3\)\s*\)/,
|
||||
objectBlock,
|
||||
"auditFindings.severity should be a 1-3 literal union.",
|
||||
);
|
||||
assertHas(
|
||||
/confidence:\s*v\.number\(\)/,
|
||||
objectBlock,
|
||||
"auditFindings.confidence must be persisted for review calibration.",
|
||||
);
|
||||
assertHas(
|
||||
/evidenceRefs:\s*v\.array\(\s*auditFindingEvidenceRef\s*\)/,
|
||||
objectBlock,
|
||||
"auditFindings.evidenceRefs must persist typed evidence refs.",
|
||||
);
|
||||
assertHas(
|
||||
/reviewStatus:\s*auditFindingReviewStatus/,
|
||||
objectBlock,
|
||||
"auditFindings.reviewStatus should use a review-status validator.",
|
||||
);
|
||||
assertHas(
|
||||
/index\("by_auditId",\s*\["auditId"\]\)/,
|
||||
section,
|
||||
"auditFindings should have by_auditId index.",
|
||||
);
|
||||
assertHas(
|
||||
/index\("by_runId",\s*\["runId"\]\)/,
|
||||
section,
|
||||
"auditFindings should have by_runId index.",
|
||||
);
|
||||
assertHas(
|
||||
/index\("by_auditId_and_reviewStatus",\s*\["auditId",\s*"reviewStatus"\]\)/,
|
||||
section,
|
||||
"auditFindings should support review-status filtering per audit.",
|
||||
);
|
||||
});
|
||||
|
||||
test("specialist fan-out audit stages are declared in domain", () => {
|
||||
for (const stage of [
|
||||
"localSeoSpecialist",
|
||||
"conversionUxSpecialist",
|
||||
"visualTrustSpecialist",
|
||||
"critiqueSpecialist",
|
||||
"performanceAccessibilitySpecialist",
|
||||
"evidenceVerifier",
|
||||
]) {
|
||||
assertHas(
|
||||
new RegExp(`AUDIT_GENERATION_STAGES\\s*=\\s*\\[[\\s\\S]*["']${stage}["'][\\s\\S]*\\]`),
|
||||
domainSource,
|
||||
`auditGenerationStage should include ${stage}.`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user