Files
brain/tools/registry-initial-inputs.mjs
T
Дмитрий a5d30f38a3 feat(registry): живой охват 2c — данности, граф, coverage-wiring, врезка в гейт
Этап 2c эпика роутер-реестр: оживление машины охвата как замена цепочкам L.
- registry-initial-inputs.mjs: токены-данности (category:given) для initialInputs.
- registry-graph-health.test.mjs: граф ацикличен, рёбра producer-consumer.
- coverage-wiring.mjs: мост recommended skills -> readinessChecklist -> {cards, ready, holes}; ready=нет-дыр.
- enforce-judge-gate.mjs: coverageCardsFor/coverageGate — карточки + стоп при дыре (инъекция-выкл).
- замок словаря (vocabTokens) на живом пути; гайд по стене: автономность + уроки сессии.
Регрессия: 4375 passed (канонический свод владельца).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 15:18:22 +03:00

21 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env node
/**
* registry-initial-inputs — токены-данности задачи (initialInputs для машины охвата).
* Источник истины — словарь capability-vocabulary.json (поле category:"given"): входы,
* которые не производит ни один навык (приходят от задачи). Чистая выборка, без LLM.
*/
import fsDefault from 'node:fs';
/** Данности задачи = токены словаря с category:"given". Чистая, пустой/битый словарь → []. */
export function givenTokens(vocabRaw) {
const toks = vocabRaw && Array.isArray(vocabRaw.tokens) ? vocabRaw.tokens : [];
return toks
.filter((t) => t && t.category === 'given' && typeof t.token === 'string' && t.token.trim())
.map((t) => t.token);
}
/** Загрузить данности с диска (fs инъектируется). Бросает на битом JSON / отсутствии файла. */
export function loadInitialInputs({ path = 'docs/registry/capability-vocabulary.json', fsImpl = fsDefault } = {}) {
return givenTokens(JSON.parse(fsImpl.readFileSync(path, 'utf8')));
}