From aa6ae5cc737b4f4ad8cc4053f3ae7b4ca929f62f Mon Sep 17 00:00:00 2001 From: sawyer Date: Tue, 14 Jul 2026 19:38:24 -0400 Subject: [PATCH] fix: structure cold-start branch boundary --- scripts/cold-start-contract.mjs | 7 +++---- scripts/run-cold-start-smoke.mjs | 2 +- scripts/test-cold-start-contract.mjs | 12 ++---------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/scripts/cold-start-contract.mjs b/scripts/cold-start-contract.mjs index 23df7ef..3093ce9 100644 --- a/scripts/cold-start-contract.mjs +++ b/scripts/cold-start-contract.mjs @@ -23,7 +23,7 @@ export const coldStartResponseSchema = { "promotion_status", "next_task", "proof_commands", - "branch_boundary", + "main_edits_allowed", "evidence_files" ], properties: { @@ -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" }, @@ -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); diff --git a/scripts/run-cold-start-smoke.mjs b/scripts/run-cold-start-smoke.mjs index 054aba3..efc74f3 100644 --- a/scripts/run-cold-start-smoke.mjs +++ b/scripts/run-cold-start-smoke.mjs @@ -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(" "); diff --git a/scripts/test-cold-start-contract.mjs b/scripts/test-cold-start-contract.mjs index a7de0bc..3399337 100644 --- a/scripts/test-cold-start-contract.mjs +++ b/scripts/test-cold-start-contract.mjs @@ -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", @@ -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/ @@ -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/ );