From b19c0ef61c5e8ce073d4353f9313bc201c279a5e Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 08:03:17 +0000 Subject: [PATCH] (janitor/comments) Remove section banner comments in auto-routing-benchmark --- .../auto-routing-benchmark/src/admin.test.ts | 38 ------------ .../src/datasets/classifier-cases.ts | 54 ----------------- .../src/datasets/decider-cases.ts | 59 ------------------- .../auto-routing-benchmark/src/db.test.ts | 12 ---- services/auto-routing-benchmark/src/db.ts | 36 ----------- .../src/profiles.test.ts | 19 ------ 6 files changed, 218 deletions(-) diff --git a/services/auto-routing-benchmark/src/admin.test.ts b/services/auto-routing-benchmark/src/admin.test.ts index f52f00ba8e..6b257285ca 100644 --- a/services/auto-routing-benchmark/src/admin.test.ts +++ b/services/auto-routing-benchmark/src/admin.test.ts @@ -61,10 +61,8 @@ const TEST_CONFIG_ROWS = { excludedAutoDeciderModels: [], }; -// --------------------------------------------------------------------------- // Stubs: the db module is mocked at its function boundary (drizzle generates // the SQL, so statement-level stubbing would couple tests to its internals). -// --------------------------------------------------------------------------- vi.mock('./db', async importOriginal => { const actual = await importOriginal(); @@ -165,10 +163,6 @@ function authedPut(path: string, body: unknown, extraHeaders: Record { vi.clearAllMocks(); tokenGet.mockResolvedValue('bench-token'); @@ -201,10 +195,6 @@ beforeEach(() => { queueSendBatch.mockResolvedValue(undefined); }); -// --------------------------------------------------------------------------- -// Auth guard -// --------------------------------------------------------------------------- - describe('auth middleware', () => { it('rejects requests without a bearer token', async () => { const res = await request('/admin/config'); @@ -220,10 +210,6 @@ describe('auth middleware', () => { }); }); -// --------------------------------------------------------------------------- -// GET /admin/config -// --------------------------------------------------------------------------- - describe('GET /admin/config', () => { it('returns a null config when the DB rows are absent', async () => { // getConfigRows already returns null config by default @@ -273,10 +259,6 @@ describe('GET /admin/config', () => { }); }); -// --------------------------------------------------------------------------- -// PUT /admin/config -// --------------------------------------------------------------------------- - describe('PUT /admin/config', () => { it('rejects a non-JSON body', async () => { const res = await request('/admin/config', { @@ -358,10 +340,6 @@ describe('PUT /admin/config', () => { }); }); -// --------------------------------------------------------------------------- -// GET /admin/runs -// --------------------------------------------------------------------------- - describe('GET /admin/runs', () => { it('returns an empty runs array when the table is empty', async () => { const res = await authedGet('/admin/runs'); @@ -376,10 +354,6 @@ describe('GET /admin/runs', () => { }); }); -// --------------------------------------------------------------------------- -// POST /admin/runs -// --------------------------------------------------------------------------- - describe('POST /admin/runs', () => { it('rejects a non-JSON body', async () => { const res = await request('/admin/runs', { @@ -622,10 +596,6 @@ describe('POST /admin/runs', () => { }); }); -// --------------------------------------------------------------------------- -// GET /admin/routing-table -// --------------------------------------------------------------------------- - describe('GET /admin/routing-table', () => { it('returns {table: null, publishedAt: null} when no rows exist', async () => { const res = await authedGet('/admin/routing-table'); @@ -663,10 +633,6 @@ describe('GET /admin/routing-table', () => { }); }); -// --------------------------------------------------------------------------- -// GET /admin/classifier-winner -// --------------------------------------------------------------------------- - describe('GET /admin/classifier-winner', () => { it('returns {winner: null} when no completed classifier run exists', async () => { const res = await authedGet('/admin/classifier-winner'); @@ -690,10 +656,6 @@ describe('GET /admin/classifier-winner', () => { }); }); -// --------------------------------------------------------------------------- -// POST /admin/profiles/register + /admin/profiles/status -// --------------------------------------------------------------------------- - describe('POST /admin/profiles/register', () => { it('returns 400 when benchmark config is not set', async () => { const res = await authedPost('/admin/profiles/register', { diff --git a/services/auto-routing-benchmark/src/datasets/classifier-cases.ts b/services/auto-routing-benchmark/src/datasets/classifier-cases.ts index 7866c762c1..d4ae8faad0 100644 --- a/services/auto-routing-benchmark/src/datasets/classifier-cases.ts +++ b/services/auto-routing-benchmark/src/datasets/classifier-cases.ts @@ -45,9 +45,6 @@ function chat( // code, service config, or request contracts; low = read-only, test-only, // docs-only, or isolated reversible code. export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ - // --------------------------------------------------------------------------- - // implementation / feature_development - // --------------------------------------------------------------------------- { id: 'impl-feat-members-endpoint', input: chat( @@ -117,9 +114,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // implementation / code_generation - // --------------------------------------------------------------------------- { id: 'impl-gen-semver-helper', input: chat( @@ -189,9 +183,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // implementation / test_creation - // --------------------------------------------------------------------------- { id: 'impl-test-slugify-units', input: chat( @@ -261,9 +252,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // debugging / bug_fixing - // --------------------------------------------------------------------------- { id: 'debug-fix-import-mismatch', input: chat( @@ -333,9 +321,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // debugging / test_repair - // --------------------------------------------------------------------------- { id: 'debug-repair-bcrypt-stub', input: chat( @@ -405,9 +390,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // debugging / root_cause_analysis - // --------------------------------------------------------------------------- { id: 'debug-rca-sidebar-overflow', input: chat( @@ -477,9 +459,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // refactoring / code_cleanup - // --------------------------------------------------------------------------- { id: 'refactor-cleanup-rename-total', input: chat( @@ -549,9 +528,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // refactoring / architecture_improvement - // --------------------------------------------------------------------------- { id: 'refactor-arch-order-service', input: chat( @@ -621,9 +597,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // refactoring / migration - // --------------------------------------------------------------------------- { id: 'refactor-migrate-async-await', input: chat( @@ -693,9 +666,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // planning_design / architecture_design - // --------------------------------------------------------------------------- { id: 'plan-arch-express-structure', input: chat( @@ -765,9 +735,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // planning_design / technical_planning - // --------------------------------------------------------------------------- { id: 'plan-steps-optimistic-ui', input: chat( @@ -837,9 +804,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // planning_design / system_design - // --------------------------------------------------------------------------- { id: 'plan-system-catalog-caching', input: chat( @@ -909,9 +873,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // investigation / repo_exploration - // --------------------------------------------------------------------------- { id: 'invest-repo-feature-flags', input: chat( @@ -981,9 +942,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // investigation / codebase_understanding - // --------------------------------------------------------------------------- { id: 'invest-code-cart-reducer', input: chat( @@ -1053,9 +1011,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // investigation / external_research - // --------------------------------------------------------------------------- { id: 'invest-ext-stripe-webhooks', input: chat( @@ -1125,9 +1080,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // agentic_execution / tool_usage - // --------------------------------------------------------------------------- { id: 'agentic-tool-pricing-toggle', input: chat( @@ -1197,9 +1149,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // agentic_execution / terminal_operations - // --------------------------------------------------------------------------- { id: 'agentic-term-run-tests', input: chat( @@ -1272,9 +1221,6 @@ export const CLASSIFIER_CASES: readonly ClassifierCase[] = [ }, }, - // --------------------------------------------------------------------------- - // agentic_execution / multi_step_execution - // --------------------------------------------------------------------------- { id: 'agentic-multi-cut-release', input: chat( diff --git a/services/auto-routing-benchmark/src/datasets/decider-cases.ts b/services/auto-routing-benchmark/src/datasets/decider-cases.ts index 3760bc1624..6a031a34c1 100644 --- a/services/auto-routing-benchmark/src/datasets/decider-cases.ts +++ b/services/auto-routing-benchmark/src/datasets/decider-cases.ts @@ -27,9 +27,6 @@ const AGENT_SYS = // tools inside the benchmark container (node:22-slim, no repo, no network) and // every command involved is deterministic there. export const DECIDER_CASES: readonly DeciderCase[] = [ - // --------------------------------------------------------------------------- - // implementation / feature_development - // --------------------------------------------------------------------------- { id: 'impl-feat-ternary-parity', taskType: 'implementation', @@ -76,9 +73,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '0' }, }, - // --------------------------------------------------------------------------- - // implementation / code_generation - // --------------------------------------------------------------------------- { id: 'impl-gen-package-manifest', taskType: 'implementation', @@ -119,9 +113,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ }, }, - // --------------------------------------------------------------------------- - // implementation / test_creation - // --------------------------------------------------------------------------- { id: 'impl-test-sort-expectation', taskType: 'implementation', @@ -159,9 +150,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '6' }, }, - // --------------------------------------------------------------------------- - // debugging / bug_fixing - // --------------------------------------------------------------------------- { id: 'debug-fix-parseint-suffix', taskType: 'debugging', @@ -201,9 +189,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: 'true false' }, }, - // --------------------------------------------------------------------------- - // debugging / test_repair - // --------------------------------------------------------------------------- { id: 'debug-repair-compound-assign', taskType: 'debugging', @@ -247,9 +232,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '0.30000000000000004' }, }, - // --------------------------------------------------------------------------- - // debugging / root_cause_analysis - // --------------------------------------------------------------------------- { id: 'debug-rca-async-order', taskType: 'debugging', @@ -287,9 +269,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: 'false' }, }, - // --------------------------------------------------------------------------- - // refactoring / code_cleanup - // --------------------------------------------------------------------------- { id: 'refactor-cleanup-loop-to-reduce', taskType: 'refactoring', @@ -327,9 +306,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '2' }, }, - // --------------------------------------------------------------------------- - // refactoring / architecture_improvement - // --------------------------------------------------------------------------- { id: 'refactor-arch-import-updates', taskType: 'refactoring', @@ -367,9 +343,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'json_equal', value: { deleted: 2, remaining: 4 } }, }, - // --------------------------------------------------------------------------- - // refactoring / migration - // --------------------------------------------------------------------------- { id: 'refactor-migrate-substr-slice', taskType: 'refactoring', @@ -407,9 +380,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'regex', pattern: '^\\s*0\\s*,\\s*1\\s*,\\s*2\\s*$', flags: 'm' }, }, - // --------------------------------------------------------------------------- - // planning_design / architecture_design - // --------------------------------------------------------------------------- { id: 'plan-arch-three-layer', taskType: 'planning_design', @@ -447,9 +417,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'json_equal', value: { totalMs: 350, withinBudget: false } }, }, - // --------------------------------------------------------------------------- - // planning_design / technical_planning - // --------------------------------------------------------------------------- { id: 'plan-steps-rollout-order', taskType: 'planning_design', @@ -487,9 +454,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '10' }, }, - // --------------------------------------------------------------------------- - // planning_design / system_design - // --------------------------------------------------------------------------- { id: 'plan-system-write-quorum', taskType: 'planning_design', @@ -554,9 +518,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '6' }, }, - // --------------------------------------------------------------------------- - // investigation / repo_exploration - // --------------------------------------------------------------------------- { id: 'invest-repo-test-file-count', taskType: 'investigation', @@ -594,9 +555,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '4' }, }, - // --------------------------------------------------------------------------- - // investigation / codebase_understanding - // --------------------------------------------------------------------------- { id: 'invest-code-char-count', taskType: 'investigation', @@ -634,9 +592,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '7' }, }, - // --------------------------------------------------------------------------- - // investigation / external_research - // --------------------------------------------------------------------------- { id: 'invest-ext-http-created', taskType: 'investigation', @@ -675,9 +630,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '1' }, }, - // --------------------------------------------------------------------------- - // agentic_execution / tool_usage - // --------------------------------------------------------------------------- { id: 'agentic-tool-json-read', taskType: 'agentic_execution', @@ -715,9 +667,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '93' }, }, - // --------------------------------------------------------------------------- - // agentic_execution / terminal_operations - // --------------------------------------------------------------------------- { id: 'agentic-term-node-major', taskType: 'agentic_execution', @@ -755,9 +704,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: 'fd99e6a4' }, }, - // --------------------------------------------------------------------------- - // agentic_execution / multi_step_execution - // --------------------------------------------------------------------------- { id: 'agentic-multi-seq-sum', taskType: 'agentic_execution', @@ -794,9 +740,6 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ 'Create a file /tmp/bench-in.json containing exactly this JSON array: [3, 1, 4, 1, 5, 9, 2, 6, 5, 3]. Then write and run a Node.js script that reads the file, computes the sum of the distinct values in the array, and prints it. Answer with only the number.', check: { kind: 'exact', value: '30' }, }, - // --------------------------------------------------------------------------- - // Supplemental taxonomy-route coverage - // --------------------------------------------------------------------------- { id: 'supp-impl-feat-clamp', taskType: 'implementation', @@ -1121,9 +1064,7 @@ export const DECIDER_CASES: readonly DeciderCase[] = [ check: { kind: 'exact', value: '42' }, }, - // --------------------------------------------------------------------------- // Additional taxonomy-route coverage to keep every pair at 10+ cases - // --------------------------------------------------------------------------- { id: 'supp2-impl-feat-nullish-total', taskType: 'implementation', diff --git a/services/auto-routing-benchmark/src/db.test.ts b/services/auto-routing-benchmark/src/db.test.ts index 6adecd0f3d..e7e40108ca 100644 --- a/services/auto-routing-benchmark/src/db.test.ts +++ b/services/auto-routing-benchmark/src/db.test.ts @@ -15,10 +15,6 @@ import { variantToStorage, } from './reasoning-effort'; -// --------------------------------------------------------------------------- -// mapSummaryRow -// --------------------------------------------------------------------------- - describe('variant storage helpers', () => { it('round-trips null and empty as the D1 null/default convention', () => { expect(variantToStorage(null)).toBe(''); @@ -103,10 +99,6 @@ describe('mapSummaryRow', () => { }); }); -// --------------------------------------------------------------------------- -// mapRunRow -// --------------------------------------------------------------------------- - describe('mapRunRow', () => { it('maps a RunRow and attaches its summaries', () => { const runRow = { @@ -177,10 +169,6 @@ describe('mapRunRow', () => { }); }); -// --------------------------------------------------------------------------- -// routingTableToRows / rowsToRoutingTable round-trip -// --------------------------------------------------------------------------- - const candidate = (model: string): RankedCandidate => ({ model, accuracy: 0.9, diff --git a/services/auto-routing-benchmark/src/db.ts b/services/auto-routing-benchmark/src/db.ts index 26b005d4cc..34a28085f6 100644 --- a/services/auto-routing-benchmark/src/db.ts +++ b/services/auto-routing-benchmark/src/db.ts @@ -80,10 +80,6 @@ function batchRows(rows: readonly T[]): T[][] { return batches; } -// --------------------------------------------------------------------------- -// Row mapping helpers -// --------------------------------------------------------------------------- - export function mapSummaryRow(row: ModelSummaryRow): BenchmarkModelSummary { return { model: row.model, @@ -126,10 +122,6 @@ export function mapRunRow(row: RunRow, summaries: BenchmarkModelSummary[]): Benc }; } -// --------------------------------------------------------------------------- -// Config -// --------------------------------------------------------------------------- - export async function getConfigRows(db: D1Database): Promise<{ config: typeof benchmarkConfig.$inferSelect | null; classifierModels: string[]; @@ -216,10 +208,6 @@ export async function replaceAutoDeciderModels( await orm.batch(stmts); } -// --------------------------------------------------------------------------- -// Runs -// --------------------------------------------------------------------------- - /** Which registry queue a run drains: the platform decider list, or owner pools. */ export type { BenchmarkRunPurpose }; @@ -313,10 +301,6 @@ export async function getRunWithModels( return { run, models }; } -// --------------------------------------------------------------------------- -// Case results -// --------------------------------------------------------------------------- - export async function upsertCaseResult(db: D1Database, row: CaseResultRow): Promise { await drizzle(db) .insert(caseResults) @@ -398,10 +382,6 @@ export async function getExistingCaseResultIds( return new Set(rows.map(row => row.case_id)); } -// --------------------------------------------------------------------------- -// Model summaries -// --------------------------------------------------------------------------- - export async function replaceModelSummaries( db: D1Database, runId: string, @@ -756,10 +736,6 @@ export async function markProfilesFailedForEntries( } } -// --------------------------------------------------------------------------- -// Lane failures (dead-lettered queue messages) -// --------------------------------------------------------------------------- - export type RunLaneFailureRow = typeof runLaneFailures.$inferSelect; /** @@ -1174,10 +1150,6 @@ export async function listStaleRunningDeciderRuns( return rows.map(r => ({ id: r.id, purpose: r.purpose === 'user' ? 'user' : 'platform' })); } -// --------------------------------------------------------------------------- -// Latest summaries per model (for skip logic and classifier winner) -// --------------------------------------------------------------------------- - // What the most recent completed run measured for an exact Pool entry, plus // the benchmark identity it was measured under. startRun carries these // summaries into a new run only when the identity (engine + repetitions + @@ -1270,10 +1242,6 @@ export async function getLatestSummariesByModel( return byPair; } -// --------------------------------------------------------------------------- -// Routing table — pure helpers for explode/reassemble -// --------------------------------------------------------------------------- - type RoutingTableRow = typeof routingTables.$inferSelect; type RoutingTableCandidateRow = typeof routingTableCandidates.$inferSelect; @@ -1423,10 +1391,6 @@ export async function getLatestRoutingTable( return { table: parsed.data, publishedAt: tableRow.published_at }; } -// --------------------------------------------------------------------------- -// Classifier winner -// --------------------------------------------------------------------------- - export async function getClassifierWinner(db: D1Database): Promise { const orm = drizzle(db); // Find the latest completed classifier run. diff --git a/services/auto-routing-benchmark/src/profiles.test.ts b/services/auto-routing-benchmark/src/profiles.test.ts index 194821ad64..3792bde9cf 100644 --- a/services/auto-routing-benchmark/src/profiles.test.ts +++ b/services/auto-routing-benchmark/src/profiles.test.ts @@ -5,11 +5,8 @@ import type * as DrizzleOrmModule from 'drizzle-orm'; import type { ProfileRow } from './profiles'; import type * as RunModule from './run'; -// --------------------------------------------------------------------------- -// In-memory D1/drizzle stand-in for admission + status tests. // Honestly models ON CONFLICT WHERE (failed-only), onConflictDoNothing, // INSERT...SELECT...WHERE NOT EXISTS charge guards, and post-batch reads. -// --------------------------------------------------------------------------- type EventRow = { id: number; @@ -463,10 +460,6 @@ beforeEach(() => { vi.mocked(computeEngineIdentity).mockReturnValue(ENGINE); }); -// --------------------------------------------------------------------------- -// Currency predicate -// --------------------------------------------------------------------------- - describe('isCurrentBenchmarkProfile', () => { const current = { engineIdentity: ENGINE, repetitions: REPS }; const e = entry('m/a', 'xhigh'); @@ -547,10 +540,6 @@ describe('isCurrentBenchmarkProfile', () => { }); }); -// --------------------------------------------------------------------------- -// Pure admission classification -// --------------------------------------------------------------------------- - describe('classifyProfileAdmission', () => { const current = { engineIdentity: ENGINE, repetitions: REPS }; const e = entry('m'); @@ -628,10 +617,6 @@ describe('computeQuotaRetryAt', () => { }); }); -// --------------------------------------------------------------------------- -// registerProfiles (atomic admission) -// --------------------------------------------------------------------------- - describe('registerProfiles', () => { it('admits a missing pair once; a second owner is not charged', async () => { const entries = [entry('openai/gpt-4o', 'xhigh')]; @@ -939,10 +924,6 @@ describe('registerProfiles', () => { }); }); -// --------------------------------------------------------------------------- -// lookupProfileStatuses -// --------------------------------------------------------------------------- - describe('lookupProfileStatuses', () => { it('returns current statuses without charging', async () => { store.seedProfile(profileRow({ model: 'a/ready', status: 'ready' }));