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.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
test: routing by success rate
Corey Olson50c9f430e72e
diff --git a/test/e2e.test.js b/test/e2e.test.jsindex 05ffbca1..10a9b9a0 100644--- a/test/e2e.test.js+++ b/test/e2e.test.js@@ -470,7 +470,7 @@ test('a ladder climbs within a tier; routing history skips a rung that keeps faiconst ran = box.run(tree, 'run', '--agent-light', weak, '--agent-light', strong, '--attempts', '1', '--items', '3', '--history', history, '--minutes', '2');assert.equal(ran.code, 0, ran.err);assert.match(ran.out, /#1 attempt 1: red[\s\S]*#1 attempt 1\/1: running the light agent \(rung 2\)\n#1 attempt 1: green/);- assert.match(ran.out, /#3 skips rung 1: it failed rename 2 times and never fixed it\n#3 attempt 1\/1: running the light agent \(rung 2\)/);+ assert.match(ran.out, /#3 skips rung 1: it fixed 0 of 2 items with rename\n#3 attempt 1\/1: running the light agent \(rung 2\)/);assert.match(ran.out, /runner done: 3 submitted, 0 escalated/);const records = readFileSync(history, 'utf8').trim().split('\n').map((line) => JSON.parse(line));assert.deepEqual(records.map((record) => `${record.command === weak ? 'weak' : 'strong'}:${record.result}`), ['weak:red', 'strong:green', 'weak:red', 'strong:green', 'strong:green']);@@ -478,7 +478,7 @@ test('a ladder climbs within a tier; routing history skips a rung that keeps faiconst attempt = JSON.parse(box.run(box.repo, 'log', '1').out.split('\n').filter((line) => line.includes(' attempt ')).at(-1).replace(/^.*?(\{.*\})$/, '$1'));assert.equal(attempt.rung, 2);const only = box.run(tree, 'run', '--agent-light', weak, '--attempts', '1', '--history', history, '--minutes', '2');- assert.match(only.out, /#4 skips rung 1: it failed rename 2 times and never fixed it\n#4 escalated light -> mid, without spending an attempt/);+ assert.match(only.out, /#4 skips rung 1: it fixed 0 of 2 items with rename\n#4 escalated light -> mid, without spending an attempt/);});test('sweep files one light item per flagged file, in its lane; a second sweep skips what is open [N15]', () => {diff --git a/test/route.test.js b/test/route.test.jsindex 4417cf22..4053a7f5 100644--- a/test/route.test.js+++ b/test/route.test.js@@ -12,15 +12,18 @@ test('an item is the kind its brief names, or the rules its sweep listed [N18]',assert.deepEqual(featuresOf({ item_brief: 'Files:\n- a.js' }), ['unlabelled']);});-test('a rung is skipped only after failing a feature twice without ever fixing it, per tier [N18]', () => {+test('a rung is skipped when it fixed fewer than half of at least two items sharing a feature, per tier [N18]', () => {const red = (features, command = 'small', tier = 'light') => ({ tier, command, features, result: 'red' });const green = (features, command = 'small', tier = 'light') => ({ tier, command, features, result: 'green' });const ladder = ['small', 'large'];- assert.deepEqual(routePlan(ladder, ['camelcase'], 'light', []).map((step) => step.skip), ['', '']);- assert.deepEqual(routePlan(ladder, ['camelcase'], 'light', [red(['camelcase'])]).map((step) => step.skip), ['', '']);+ const skips = (features, tier, records) => routePlan(ladder, features, tier, records).map((step) => step.skip);+ assert.deepEqual(skips(['camelcase'], 'light', []), ['', '']);+ assert.deepEqual(skips(['camelcase'], 'light', [red(['camelcase'])]), ['', '']);const twice = [red(['camelcase', 'no-var']), red(['camelcase'])];- assert.deepEqual(routePlan(ladder, ['camelcase', 'no-var'], 'light', twice).map((step) => step.skip), ['it failed camelcase 2 times and never fixed it', '']);- assert.deepEqual(routePlan(ladder, ['no-var'], 'light', twice).map((step) => step.skip), ['', '']);- assert.deepEqual(routePlan(ladder, ['camelcase'], 'light', [...twice, green(['camelcase'])]).map((step) => step.skip), ['', '']);- assert.deepEqual(routePlan(ladder, ['camelcase'], 'mid', twice).map((step) => step.skip), ['', '']);+ assert.deepEqual(skips(['camelcase', 'no-var'], 'light', twice), ['it fixed 0 of 2 items with camelcase', '']);+ assert.deepEqual(skips(['no-var'], 'light', twice), ['', '']);+ assert.deepEqual(skips(['camelcase'], 'light', [...twice, green(['camelcase'])]), ['it fixed 1 of 3 items with camelcase', '']);+ assert.deepEqual(skips(['camelcase'], 'light', [...twice, green(['camelcase']), green(['camelcase'])]), ['', '']);+ assert.deepEqual(skips(['camelcase'], 'mid', twice), ['', '']);+ assert.deepEqual(skips(['camelcase'], 'light', [red(['camelcase'], 'large'), red(['camelcase'], 'large')]), ['', 'it fixed 0 of 2 items with camelcase']);});