mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-01 06:23:28 +08:00
test: report instruction guardrails independently
This commit is contained in:
committed by
Affaan Mustafa
parent
b6a7f8ab0c
commit
99177e81ea
@@ -79,15 +79,15 @@ function run() {
|
|||||||
let passed = 0;
|
let passed = 0;
|
||||||
let failed = 0;
|
let failed = 0;
|
||||||
|
|
||||||
if (test('flagged instruction artifacts keep scoped safety sections', () => {
|
for (const guardrail of guardrails) {
|
||||||
for (const guardrail of guardrails) {
|
if (test(`${guardrail.path} keeps scoped safety guardrails`, () => {
|
||||||
const source = read(guardrail.path);
|
const source = read(guardrail.path);
|
||||||
assert.ok(source.includes(guardrail.heading), `${guardrail.path} missing ${guardrail.heading}`);
|
assert.ok(source.includes(guardrail.heading), `${guardrail.path} missing ${guardrail.heading}`);
|
||||||
for (const pattern of guardrail.requiredPatterns) {
|
for (const pattern of guardrail.requiredPatterns) {
|
||||||
assert.ok(pattern.test(source), `${guardrail.path} missing ${pattern}`);
|
assert.ok(pattern.test(source), `${guardrail.path} missing ${pattern}`);
|
||||||
}
|
}
|
||||||
}
|
})) passed++; else failed++;
|
||||||
})) passed++; else failed++;
|
}
|
||||||
|
|
||||||
console.log(`\nPassed: ${passed}`);
|
console.log(`\nPassed: ${passed}`);
|
||||||
console.log(`Failed: ${failed}`);
|
console.log(`Failed: ${failed}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user