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
7 changes: 3 additions & 4 deletions scripts/cold-start-contract.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const coldStartResponseSchema = {
"promotion_status",
"next_task",
"proof_commands",
"branch_boundary",
"main_edits_allowed",
"evidence_files"
],
properties: {
Expand All @@ -36,7 +36,7 @@ export const coldStartResponseSchema = {
items: { type: "string" },
minItems: REQUIRED_PROOF_COMMANDS.length
},
branch_boundary: { type: "string" },
main_edits_allowed: { type: "boolean" },
evidence_files: {
type: "array",
items: { type: "string" },
Expand Down Expand Up @@ -90,8 +90,7 @@ export function verifyColdStartResponse(
throw new Error("cold-start response reported the wrong next task");
}
requireExactArrayValues(response.proof_commands, REQUIRED_PROOF_COMMANDS, "proof commands");
const boundary = String(response.branch_boundary || "").toLowerCase();
if (!/(branch|worktree)/.test(boundary) || !boundary.includes("main") || !/(do not|don't|avoid|not edit|prohibit)/.test(boundary)) {
if (response.main_edits_allowed !== false) {
throw new Error("cold-start response did not preserve the protected branch boundary");
}
requireEvidenceFiles(response.evidence_files);
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-cold-start-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const prompt = [
"This is a cold-start readback: use only current Git state and files inside this repository.",
"Do not rely on prior sessions, chat history, saved checkpoints, or external memory.",
"Begin by reading AGENTS.md, then follow its restart instructions.",
"Identify the exact current HEAD commit, frozen comparison baseline, promotion decision, first unfinished task, complete candidate proof commands, protected-branch boundary, and repository files that prove the answer.",
"Identify the exact current HEAD commit, frozen comparison baseline, promotion decision, first unfinished task, complete candidate proof commands, whether meaningful edits on main are allowed, and repository files that prove the answer.",
"Do not edit files. Return only the structured response requested by the output schema."
].join(" ");

Expand Down
12 changes: 2 additions & 10 deletions scripts/test-cold-start-contract.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const valid = {
"npm run benchmark:sealed",
"npm run benchmark:trajectories"
],
branch_boundary: "Create a branch or worktree; do not edit main.",
main_edits_allowed: false,
evidence_files: [
"AGENTS.md",
"docs/plans/adaptive-harness-candidate.md",
Expand Down Expand Up @@ -76,14 +76,6 @@ assert.equal(
}).source_evidence_complete,
true
);
assert.equal(
verifyColdStartResponse({
...valid,
branch_boundary: "Meaningful edits remain prohibited on main; use this worktree."
}).protected_branch_boundary,
true
);

assert.throws(
() => verifyColdStartResponse({ ...valid, source_commit: FROZEN_BASELINE_COMMIT }),
/source commit/
Expand All @@ -105,7 +97,7 @@ assert.throws(
/proof commands/
);
assert.throws(
() => verifyColdStartResponse({ ...valid, branch_boundary: "Edit main directly." }),
() => verifyColdStartResponse({ ...valid, main_edits_allowed: true }),
/branch boundary/
);

Expand Down
Loading