mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-17 21:42:11 +00:00
test: cover all benchmark trigger routing paths
This commit is contained in:
1 parent
088cfa9abd
commit
cb094e9e87
1 file changed
+29
@@ -770,3 +770,32 @@ test('benchmark optimization is discoverable and loads through task context rout
|
||||
assert.ok(named.candidates.some(value => value.id === id));
|
||||
assert.equal(named.reason, 'agent-selection-required', 'Overlapping benchmark names still require selection');
|
||||
});
|
||||
|
||||
for (const [query, automatic] of [
|
||||
['turn user goal into benchmark', false],
|
||||
['optimize task completion rate', true],
|
||||
['compare implementation variants', false],
|
||||
['improve correctness with fixed evaluation', true],
|
||||
['reduce cost per resolved task', true],
|
||||
['run bounded recursive optimization', true],
|
||||
['verify improvement on independent cases', true],
|
||||
['keep best measured admissible result', true],
|
||||
]) {
|
||||
test('benchmark trigger preserves routing admission: ' + query, () => {
|
||||
const id = 'skill:benchmark-optimization-loop';
|
||||
const entry = routingEntries().entries.find(value => value.id === id);
|
||||
assert.ok(entry.triggers.includes(query), 'The curated phrase must remain registered');
|
||||
const result = resolveTaskContext({ task: task({ query }), load: true });
|
||||
assert.ok(result.candidates.some(value => value.id === id));
|
||||
assert.deepEqual(result.selectedIds, automatic ? [id] : []);
|
||||
assert.deepEqual(result.loadedIds, automatic ? [id] : []);
|
||||
assert.equal(result.reason, automatic ? 'auto-selection' : 'agent-selection-required');
|
||||
assert.equal(result.nativeInvocation, 'unobserved');
|
||||
if (!automatic) {
|
||||
const approved = resolveTaskContext({ task: task({ query, proposedIds: [id] }), load: true });
|
||||
assert.deepEqual(approved.selectedIds, [id]);
|
||||
assert.deepEqual(approved.loadedIds, [id]);
|
||||
assert.equal(approved.nativeInvocation, 'unobserved');
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user