Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix(main-red): main comparisons take a slot on main's checkout [C7,V1]

Corey Olson31786e0fc544
diff --git a/src/main-red.js b/src/main-red.js
index 0ee8b1a5..d644ebdf 100644
--- a/src/main-red.js
+++ b/src/main-red.js
@@ -185,19 +185,18 @@ export async function compareMainFailures(root, profile, onWait, output = '') {
let failed = null;
for (const path of missing) {
try {
- await withGateSlot(root, async lease => {
- const measured = await withMainCheckout(root, main.commit, async checkout => {
- const command = `${policy.config.affectedTests.trimEnd()} ${shellWord('./' + path)}`;
- const run = await runProfiledShellAsync(checkout, command, { gateLease: lease, waitMs: lease.waitMs });
- return { result: run.isGreen ? 'green' : 'red' };
- });
- if (measured.unavailable) throw new Error(measured.unavailable);
- // The cache lease excludes other comparisons; persist each result before yielding again.
- cache = readCache(file);
- cache.entries[main.commit] ??= {};
- cache.entries[main.commit][path] = measured;
- writeCache(file, cache);
- }, { diagnostic: true, browser: true, agent: process.env.PULLBOARD_AGENT, kind: 'main-red', onWait });
+ // The slot is taken on the clean main checkout, so a runner can take it even when this worktree is dirty.
+ const measured = await withMainCheckout(root, main.commit, checkout => withGateSlot(checkout, async lease => {
+ const command = `${policy.config.affectedTests.trimEnd()} ${shellWord('./' + path)}`;
+ const run = await runProfiledShellAsync(checkout, command, { gateLease: lease, waitMs: lease.waitMs });
+ return { result: run.isGreen ? 'green' : 'red' };
+ }, { diagnostic: true, browser: true, agent: process.env.PULLBOARD_AGENT, kind: 'main-red', onWait }));
+ if (measured.unavailable) throw new Error(measured.unavailable);
+ // The cache lease excludes other comparisons; persist each result before yielding again.
+ cache = readCache(file);
+ cache.entries[main.commit] ??= {};
+ cache.entries[main.commit][path] = measured;
+ writeCache(file, cache);
}
catch (error) { failed ??= error; }
}