Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/eval-controls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
run: shellcheck --version
- name: Check whole-repository analysis and references
run: bun run quality:structure
- name: Check workflow gate honesty
run: bun run quality:workflow-honesty
- name: Test gate honesty and verify real execution count
run: bun run test:gate-honesty
- name: Test quality checks and challenge executor
run: bun run test:system-quality
- name: Challenge actual repository checks
Expand Down Expand Up @@ -57,14 +61,15 @@ jobs:
- name: Run deterministic controls
shell: bash
run: |
set +e
failed=0
bun evals/policy-evaluation/controls.mts || failed=1
if ! bun evals/policy-evaluation/controls.mts; then
failed=1
fi
for suite in \
skills-cli-materialization; do
echo "::group::evals/$suite"
bash "evals/$suite/controls.sh"
rc=$?
rc=0
bash "evals/$suite/controls.sh" || rc=$?
echo "::endgroup::"
if [ "$rc" -ne 0 ]; then
echo "::error title=Eval failure::$suite returned exit $rc"
Expand Down
1 change: 1 addition & 0 deletions evals/policy-evaluation/controls.mts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const contracts: ReadonlyArray<readonly [label: string, command: 'bun' | 'bash',
['placement routing contract', 'bun', 'text-contracts.mts', ['execution-placement-contract']],
['Herdr orchestration contract', 'bun', 'text-contracts.mts', ['herdr-orchestration-contract']],
['constitutional refinement controls', 'bun', 'constitutional-refinement-controls.mts', []],
['gate honesty controls', 'bun', 'gate-honesty-controls.mts', []],
];
for (const [label, interpreter, path, args] of contracts) {
const cmd = interpreter === 'bun' ? process.execPath : 'bash';
Expand Down
95 changes: 95 additions & 0 deletions evals/policy-evaluation/gate-honesty-controls.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/usr/bin/env -S bun
import assert from "node:assert/strict";
import { spawnSync } from "node:child_process";
import { join, resolve } from "node:path";
import {
checkTestExecution,
checkWorkflowsDirectory,
verifyCssMirror,
verifySchemaIndexes,
verifyTapOutput,
} from "../../scripts/gate-honesty/index.mts";

const root = resolve(import.meta.dirname, "../..");

// 1. All repository GitHub Actions workflows pass workflow honesty checks
const workflows = checkWorkflowsDirectory(join(root, ".github/workflows"));
assert.ok(workflows.filesChecked.length >= 3, "expected >= 3 workflow files");
assert.deepEqual(
workflows.findings,
[],
`workflow honesty findings: ${JSON.stringify(workflows.findings)}`,
);

// 2. Real node --test TAP execution count >= 1 verification
const tapRun = spawnSync(
"node",
["--test", "--test-reporter=tap", join(root, "scripts/gate-honesty/gate-honesty.test.mts")],
{ encoding: "utf8", cwd: root },
);
assert.equal(tapRun.status, 0, tapRun.stderr || tapRun.stdout);
const tapCheck = verifyTapOutput(tapRun.stdout ?? "", {
partition: "gate-honesty",
exitCode: tapRun.status ?? 1,
minPassedRequired: 1,
});
assert.equal(tapCheck.verdict, "VERIFIED", JSON.stringify(tapCheck.findings));

// 3. Negative controls must fail closed
assert.equal(
checkTestExecution({
partition: "silent-pass",
exitCode: 0,
reportedSuccess: true,
numCollectedFiles: 1,
numTotalTests: 10,
numPassedTests: 0,
numFailedTests: 0,
numSkippedTests: 0,
}).verdict,
"SILENT_PASS_DEFECT",
);
assert.equal(
checkTestExecution({
partition: "failed-zero-exit",
exitCode: 0,
reportedSuccess: false,
numCollectedFiles: 1,
numTotalTests: 5,
numPassedTests: 4,
numFailedTests: 1,
numSkippedTests: 0,
}).verdict,
"FAIL",
);
assert.ok(
verifyCssMirror({
subject: "readmark-76-negative",
cssText: ".rm-reader-scroll { padding: 20px 0 60vh; }",
expectations: [
{
constantName: "FIT_WIDTH_PADDING_PX",
selectors: [".rm-reader-scroll"],
expectedProperty: "padding",
expectedValue: "48px",
},
],
}).some((f) => f.code === "UNVERIFIED_PROSE_MIRROR"),
);
assert.ok(
verifySchemaIndexes({
subject: "readmark-72-negative",
dexieSchema: { bookmarks: "++id, [documentId+pageIndex]" },
claims: [
{
queryName: "listBookmarks",
table: "bookmarks",
columns: ["documentId", "sourceFingerprint"],
},
],
}).some((f) => f.code === "FALLBACK_CONTRADICTS_CLAIM"),
);

console.log(
`gate-honesty controls OK (${workflows.filesChecked.length} workflows verified, real TAP execution verified)`,
);
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"delivery-status": "node scripts/delivery-status/delivery-status.mts",
"test:supervisor-boundary": "node --test templates/supervisor-boundary/guard.test.mts",
"quality:structure": "node scripts/quality/check.mts",
"quality:workflow-honesty": "node scripts/gate-honesty/cli.mts workflow --workflows-dir .github/workflows",
"test:gate-honesty": "node scripts/gate-honesty/cli.mts run-and-verify --partition gate-honesty --floor 1 -- node --test --test-reporter=tap scripts/gate-honesty/gate-honesty.test.mts scripts/quality/check-gate-honesty.test.mts",
"test:system-quality": "node --test evals/system-quality/*.test.mts evals/code-structure/*.test.mts scripts/quality/*.test.mts",
"quality:challenge": "node evals/system-quality/challenge.mts"
},
Expand Down
Loading
Loading