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.

chore(merge): integrate accepted review admission [C7,V4]

Corey Olson2480ac4a59bd
diff --cc test/resources.test.js
index 3f80cd29,2bcf8574..34f54086
--- a/test/resources.test.js
+++ b/test/resources.test.js
@@@ -12,9 -12,9 +12,10 @@@ import { createInterface } from 'node:r
import { after, test } from 'node:test';
import { DatabaseSync } from 'node:sqlite';
import { listResources, setResourceCapacity, takeResource } from '../src/resources.js';
+import { capacityChangeCases } from './resources-capacity-fixture.js';
import { checkNeedsBrowser } from '../src/browser-admission.js';
import { releaseQueueProof } from './resources-release-fixture.js';
+ import { checkProject, verificationProject } from './resources-verify-fixture.js';
const TEMP = [];
const CHILDREN = new Set();
@@@ -1760,13 -1728,44 +1736,55 @@@ test('[Q4] a red gate releases its leas
});
+const capacityCases = capacityChangeCases({ fixture, worker, event, acquired, release, privateList, poolWorker, POOL_MODULE_WORKER, configureBrowserSlots });
+
+/** Existing queued processes observe a raised limit without restarting their holders [Q1,Q2,Q4]. */
+test("raising a busy resource's capacity admits waiters at once [Q1,Q2,Q4]", capacityCases.raising);
+
+/** A refused decrease names the live holders and leaves their leases and settings intact [Q1,Q3,Q4]. */
+test("lowering capacity never stops a running holder [Q1,Q3,Q4]", capacityCases.lowering);
+
+/** Browser capacity can grow under the same live gate lease without exceeding either limit [Q1,Q2,Q4]. */
+test("raising busy browser capacity admits only the new browser slots [Q1,Q2,Q4]", capacityCases.browser);
++
+ test('a verification with no frozen check never enters the test queue [C7,V4]', async t => {
+ const { project, box, item, reviewer } = verificationProject(t);
+ const holder = worker(box, { agent: 'empty-check-holder' });
+ await acquired(holder);
+ let completed;
+ const verifying = runFixtureChildAsync(process.execPath, [BIN, 'verify', String(item), 'accept', '--note', 'The private bar holds.', '--json'],
+ { cwd: reviewer, env: project.env }).then(result => { completed = result; return result; });
+ try {
+ await waitUntil(() => completed || privateList(box).find(row => row.name === 'gate')?.line.some(row => row.item === String(item)),
+ 'the verification to finish or enter its private queue');
+ const gate = privateList(box).find(row => row.name === 'gate');
+ assert.equal(gate.line.some(row => row.item === String(item)), false, 'an empty frozen check must not add a native waiter');
+ assert.ok(gate.holders.some(row => row.agent === 'empty-check-holder'), 'the unrelated holder remains occupied throughout verification');
+ assert.ok(completed, 'the verifier completed without waiting for that holder');
+ assert.equal(completed.status, 0, completed.failure ?? completed.stderr);
+ assert.equal(JSON.parse(completed.stdout).check, 'none');
+ assert.equal(privateList(box).find(row => row.name === 'browser')?.line.some(row => row.item === String(item)) ?? false, false,
+ 'an empty frozen check adds no browser waiter either');
+ } finally { await release(holder); await verifying; }
+ });
+
+ test('a verification with a frozen check still waits for its slot [C7,V4]', async t => {
+ const { project, box, item, reviewer, marker } = verificationProject(t, { checked: true });
+ rmSync(marker, { force: true });
+ const holder = worker(box, { agent: 'real-check-holder' });
+ await acquired(holder);
+ let completed;
+ const verifying = runFixtureChildAsync(process.execPath, [BIN, 'verify', String(item), 'accept', '--note', 'The exact frozen command passed.', '--json'],
+ { cwd: reviewer, env: project.env }).then(result => { completed = result; return result; });
+ try {
+ await waitUntil(() => completed || privateList(box).find(row => row.name === 'gate')?.line.some(row => row.item === String(item)),
+ 'the nonempty frozen check to enter its private queue');
+ assert.equal(privateList(box).find(row => row.name === 'gate').line.some(row => row.item === String(item)), true,
+ 'a real frozen command keeps the normal native admission boundary');
+ assert.equal(completed, undefined, 'the check cannot finish while its slot remains occupied');
+ assert.equal(existsSync(marker), false, 'the frozen command has not run early');
+ } finally { await release(holder); await verifying; }
+ assert.equal(completed.status, 0, completed.failure ?? completed.stderr);
+ assert.equal(JSON.parse(completed.stdout).check, 'green');
+ assert.equal(readFileSync(marker, 'utf8'), 'check-ran', 'the unchanged frozen command ran after admission');
+ });