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
2 changes: 2 additions & 0 deletions .github/workflows/eval-controls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
run: bun run test:eval-regressions
- name: Test TypeScript release batching controls
run: bun run test:release-batching
- name: Test release scope and authority reconciliation controls
run: bun run test:scope-authority
- name: Test TypeScript interaction and Linear controls
run: |
bun run test:interaction
Expand Down
189 changes: 189 additions & 0 deletions evals/scope-authority/controls.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
#!/usr/bin/env -S bun
import { spawnSync } from "node:child_process";
import { accessSync, constants } from "node:fs";
import { join } from "node:path";

interface ScopeAuthorityControlCase {
readonly label: string;
readonly fixture: string;
readonly expected: "PASS" | "FAIL";
readonly expectedViolations?: readonly string[];
}

const dir = import.meta.dirname;
const grader = join(dir, "grade.mts");

const cases: readonly ScopeAuthorityControlCase[] = [
{
label: "positive design-research draft",
fixture: "fixtures/positive-design-research-draft.json",
expected: "PASS",
},
{
label: "positive reconciled owner decision",
fixture: "fixtures/positive-reconciled-owner-decision.json",
expected: "PASS",
},
{
label: "positive bulk close with evidence",
fixture: "fixtures/positive-bulk-close-with-evidence.json",
expected: "PASS",
},
{
label: "positive release ready clean",
fixture: "fixtures/positive-release-ready-clean.json",
expected: "PASS",
},
{
label: "positive release complete merged",
fixture: "fixtures/positive-release-complete-merged.json",
expected: "PASS",
},
{
label: "negative Aulymo scope drift",
fixture: "fixtures/negative-aulymo-unapproved-scope-drift.json",
expected: "FAIL",
expectedViolations: [
"VIOL UNAPPROVED_SCOPE_DRIFT:",
"VIOL UNRECONCILED_SINGLE_SOURCE:",
],
},
{
label: "negative draft cross-release bypass",
fixture: "fixtures/negative-draft-cross-release-bypass.json",
expected: "FAIL",
expectedViolations: ["VIOL UNAPPROVED_SCOPE_DRIFT:"],
},
{
label: "negative draft blocker escalation",
fixture: "fixtures/negative-draft-blocker-escalation.json",
expected: "FAIL",
expectedViolations: ["VIOL UNAPPROVED_SCOPE_DRIFT:"],
},
{
label: "negative same-release intent escalation",
fixture: "fixtures/negative-same-release-intent-escalation.json",
expected: "FAIL",
expectedViolations: ["VIOL PROGRESS_CONFLATED_WITH_BLOCKER:"],
},
{
label: "negative stale owner snapshot",
fixture: "fixtures/negative-stale-owner-snapshot.json",
expected: "FAIL",
expectedViolations: ["VIOL STALE_OWNER_DECISION_SNAPSHOT:"],
},
{
label: "negative future decision revision",
fixture: "fixtures/negative-future-decision-revision.json",
expected: "FAIL",
expectedViolations: ["VIOL INVALID_FUTURE_DECISION_REVISION:"],
},
{
label: "negative agent rev bump bypass",
fixture: "fixtures/negative-agent-revision-bump-staleness-bypass.json",
expected: "FAIL",
expectedViolations: [
"VIOL INVALID_FUTURE_DECISION_REVISION:",
"VIOL SELF_ATTESTED_OWNER_APPROVAL:",
],
},
{
label: "negative self-attested approval",
fixture: "fixtures/negative-self-attested-approval.json",
expected: "FAIL",
expectedViolations: ["VIOL SELF_ATTESTED_OWNER_APPROVAL:"],
},
{
label: "negative unreconciled single source",
fixture: "fixtures/negative-unreconciled-single-source.json",
expected: "FAIL",
expectedViolations: ["VIOL UNRECONCILED_SINGLE_SOURCE:"],
},
{
label: "negative bulk close unimplemented",
fixture: "fixtures/negative-bulk-close-unimplemented.json",
expected: "FAIL",
expectedViolations: [
"VIOL BULK_CLOSE_WITHOUT_EVIDENCE:",
"VIOL UNAPPROVED_SCOPE_DRIFT:",
],
},
{
label: "negative release ready blockers",
fixture: "fixtures/negative-release-ready-open-blockers.json",
expected: "FAIL",
expectedViolations: ["VIOL RELEASE_INCOMPLETE_BLOCKERS_OR_PRS:"],
},
{
label: "negative release complete unmerged",
fixture: "fixtures/negative-release-complete-unmerged-main.json",
expected: "FAIL",
expectedViolations: ["VIOL RELEASE_BRANCH_CONFLATED_WITH_MAIN:"],
},
{
label: "negative release commits ahead",
fixture: "fixtures/negative-release-complete-commits-ahead.json",
expected: "FAIL",
expectedViolations: ["VIOL RELEASE_BRANCH_UNMERGED_DRIFT:"],
},
{
label: "negative invalid evidence URL/SHA",
fixture: "fixtures/negative-invalid-evidence-url-sha.json",
expected: "FAIL",
expectedViolations: ["VIOL INVALID_EVIDENCE_REFERENCE:"],
},
{
label: "negative unknown scope intent",
fixture: "fixtures/negative-unknown-scope-intent.json",
expected: "FAIL",
expectedViolations: ["VIOL INVALID_INPUT_SCHEMA:"],
},
];

let failures = 0;

for (const testCase of cases) {
const fixturePath = join(dir, testCase.fixture);
try {
accessSync(fixturePath, constants.R_OK);
} catch {
console.error(
` FAIL ${testCase.label.padEnd(38)} -> missing fixture ${fixturePath}`,
);
failures++;
continue;
}

const result = spawnSync(process.execPath, [grader, fixturePath], {
encoding: "utf8",
});
const output = (result.stdout ?? "") + (result.stderr ?? "");
const last = output.trimEnd().split("\n").at(-1) ?? "";
const statusOk =
testCase.expected === "PASS"
? result.status === 0 && last === "EVAL PASS"
: result.status !== 0 && last === "EVAL FAIL";
const missingViolations = (testCase.expectedViolations ?? []).filter(
(needle) => !output.includes(needle),
);

if (statusOk && missingViolations.length === 0) {
console.log(` ok ${testCase.label.padEnd(38)} -> ${last}`);
} else {
console.error(
` FAIL ${testCase.label.padEnd(38)} -> ${last} (wanted ${testCase.expected}, rc=${String(result.status)})`,
);
if (missingViolations.length > 0) {
console.error(` missing expected violations: ${missingViolations.join(", ")}`);
}
console.error(output);
failures++;
}
}

console.log(
failures
? "CONTROLS BROKEN: scope-authority eval controls failed"
: `controls OK: ${cases.length} scope-authority fixtures verified`,
);
process.exitCode = failures ? 1 : 0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"id": "negative-agent-revision-bump-staleness-bypass",
"item": "#145",
"changeClass": "move-feature-to-release",
"requestedTargetRelease": "release-4-0-0",
"canonicalTargetRelease": "release-4-1-0",
"requestedIntent": "land-to-release",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 3,
"ownerDecisions": [
{
"revision": 2,
"decidedAt": "2026-10-30",
"actor": "rebuildup",
"provenance": "human-owner-direct",
"sourceKind": "github-issue-comment",
"targetRelease": "release-4-0-0",
"allowedIntent": "land-to-release",
"evidenceUrl": "https://github.com/rebuildup/Aulymo_v04/issues/59",
"items": ["#145"]
},
{
"revision": 3,
"decidedAt": "2026-10-31",
"actor": "agent-bot",
"provenance": "agent-self-attested",
"sourceKind": "agent-summary",
"targetRelease": "release-4-0-0",
"allowedIntent": "release-blocker",
"evidenceUrl": "https://github.com/rebuildup/Aulymo_v04/issues/59",
"items": ["#145"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "negative-aulymo-unapproved-scope-drift",
"item": "#109",
"changeClass": "move-feature-to-release",
"requestedTargetRelease": "release-4-0-0",
"canonicalTargetRelease": "release-4-1-0",
"requestedIntent": "land-to-release",
"sourceKind": "single-pr-or-doc",
"evaluatedDecisionRevision": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"id": "negative-bulk-close-unimplemented",
"item": "batch-close-my-web-741",
"changeClass": "close-issue-batch",
"requestedTargetRelease": "release-0-8-0",
"canonicalTargetRelease": "release-0-8-0",
"requestedIntent": "preserve-progress",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 1,
"closedItems": [
{
"item": "#741-idea-a",
"disposition": "completed",
"implemented": false
},
{
"item": "#741-idea-b",
"disposition": "absorbed",
"rationale": "Assumed absorbed during cleanup"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "negative-draft-blocker-escalation",
"item": "#109",
"changeClass": "design-research-draft",
"requestedTargetRelease": "release-4-1-0",
"canonicalTargetRelease": "release-4-1-0",
"requestedIntent": "release-blocker",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "negative-draft-cross-release-bypass",
"item": "#109",
"changeClass": "design-research-draft",
"requestedTargetRelease": "release-4-0-0",
"canonicalTargetRelease": "release-4-1-0",
"requestedIntent": "preserve-progress",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"id": "negative-future-decision-revision",
"item": "#145",
"changeClass": "move-feature-to-release",
"requestedTargetRelease": "release-4-0-0",
"canonicalTargetRelease": "release-4-1-0",
"requestedIntent": "land-to-release",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 3,
"latestOwnerDecision": {
"revision": 2,
"decidedAt": "2026-10-30",
"actor": "rebuildup",
"provenance": "human-owner-direct",
"sourceKind": "github-issue-comment",
"targetRelease": "release-4-0-0",
"allowedIntent": "land-to-release",
"evidenceUrl": "https://github.com/rebuildup/Aulymo_v04/issues/59",
"items": ["#145"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"id": "negative-invalid-evidence-url-sha",
"item": "#145",
"changeClass": "move-feature-to-release",
"requestedTargetRelease": "release-4-0-0",
"canonicalTargetRelease": "release-4-1-0",
"requestedIntent": "land-to-release",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 2,
"latestOwnerDecision": {
"revision": 2,
"decidedAt": "2026-10-30",
"actor": "rebuildup",
"provenance": "human-owner-direct",
"sourceKind": "github-issue-comment",
"targetRelease": "release-4-0-0",
"allowedIntent": "land-to-release",
"evidenceUrl": "not-a-valid-url",
"evidenceSha": "not-a-sha",
"items": ["#145"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"id": "negative-release-complete-commits-ahead",
"item": "release-0-4-0",
"changeClass": "claim-release-complete",
"requestedTargetRelease": "release-0-4-0",
"canonicalTargetRelease": "release-0-4-0",
"requestedIntent": "land-to-release",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 1,
"releasePrToMainMerged": true,
"releaseBranchCommitsAhead": 5,
"latestOwnerDecision": {
"revision": 1,
"decidedAt": "2026-11-01",
"actor": "rebuildup",
"provenance": "human-owner-direct",
"sourceKind": "github-pr-comment",
"targetRelease": "release-0-4-0",
"allowedIntent": "land-to-release",
"evidenceUrl": "https://github.com/rebuildup/xyt-media/pull/191",
"items": ["release-0-4-0"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"id": "negative-release-complete-unmerged-main",
"item": "release-0-4-0",
"changeClass": "claim-release-complete",
"requestedTargetRelease": "release-0-4-0",
"canonicalTargetRelease": "release-0-4-0",
"requestedIntent": "land-to-release",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 1,
"releasePrToMainMerged": false,
"releaseBranchCommitsAhead": 633,
"latestOwnerDecision": {
"revision": 1,
"decidedAt": "2026-11-01",
"actor": "rebuildup",
"provenance": "human-owner-direct",
"sourceKind": "github-pr-comment",
"targetRelease": "release-0-4-0",
"allowedIntent": "land-to-release",
"evidenceUrl": "https://github.com/rebuildup/xyt-media/pull/191",
"items": ["release-0-4-0"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "negative-release-ready-open-blockers",
"item": "release-pr-679",
"changeClass": "mark-release-ready",
"requestedTargetRelease": "release-0-8-0",
"canonicalTargetRelease": "release-0-8-0",
"requestedIntent": "land-to-release",
"canonicalIntent": "land-to-release",
"sourceKind": "reconciled-canonical",
"evaluatedDecisionRevision": 1,
"openBlockers": ["#720", "#741", "#732"],
"unmergedReadyPrs": ["#698", "#740"]
}
Loading
Loading