Files
portal/tools/router-config.test.mjs
T
Дмитрий 2fe4e1c4bc feat(brain): router-config + nodes.yaml capabilities (phase 2 task 8)
Phase 2 Task 8 of LLM-first router overhaul.

- tools/router-config.mjs: 4 constants (CLASSIFIER_MODEL='claude-sonnet-4-6',
  REVIEWER_MODEL='claude-opus-4-7', INHERITANCE_MAX_AGE_MIN=30,
  REVIEWER_MAX_NEIGHBOR_EPISODES=10). Sonnet 4.6 ID resolved via ProxyAPI
  /v1/models 2026-05-25 — only alias 'claude-sonnet-4-6' is exposed (no dated
  YYYYMMDD form on this reseller); alias is canonical here.
- docs/registry/nodes.yaml: capabilities: line added to all 85 nodes
  (1-2 sentences describing what each node DOES, not when to choose it —
  classifier infers selection from capabilities + user prompt). Generated
  by Sonnet subagent from CLAUDE.md §3.x + Tooling §4.X attribute blocks
  + spec §18.3 format. Spot-checked + verified no forbidden 'use when' framing.
- docs/registry/schema.json: +capabilities top-level node property
  (type:string minLength:1). G12 'permissive' note in plan was stale —
  schema had additionalProperties:false; explicit extension is the
  cleanest compliant path.

Verify (plan Step 2): nodes=85 caps=85, exit 0.
Tests: tools/router-config.test.mjs 4/4 PASS + tools/registry-load.test.mjs
11/11 PASS (Ajv schema-validate on amended schema GREEN).
2026-05-25 14:28:24 +03:00

24 lines
828 B
JavaScript

// tools/router-config.test.mjs — TDD for Phase 2 Task 8
import { describe, it, expect } from 'vitest';
import * as cfg from './router-config.mjs';
describe('router-config exports', () => {
it('CLASSIFIER_MODEL is Sonnet 4.6 (alias on ProxyAPI — no dated form exposed 2026-05-25)', () => {
expect(cfg.CLASSIFIER_MODEL).toBe('claude-sonnet-4-6');
});
it('REVIEWER_MODEL is Opus 4.7', () => {
expect(cfg.REVIEWER_MODEL).toBe('claude-opus-4-7');
});
it('INHERITANCE_MAX_AGE_MIN === 30', () => {
expect(cfg.INHERITANCE_MAX_AGE_MIN).toBe(30);
expect(typeof cfg.INHERITANCE_MAX_AGE_MIN).toBe('number');
});
it('REVIEWER_MAX_NEIGHBOR_EPISODES === 10', () => {
expect(cfg.REVIEWER_MAX_NEIGHBOR_EPISODES).toBe(10);
expect(typeof cfg.REVIEWER_MAX_NEIGHBOR_EPISODES).toBe('number');
});
});