397777089e
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
901 B
JavaScript
18 lines
901 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* plan-verified-context — извлечение verified-context артефакта (§5.5) из план-md
|
|
* (решение владельца 2026-06-12 «контекст в плане»: блок ```verified-context-json```).
|
|
* Fail-safe: нет блока / битый JSON / не-массив → [] → VA-9 freeze-gate блокирует печать
|
|
* (пустой контекст не проходит) — деградация к СТРОГОСТИ. Записи дальше проверяет
|
|
* context-verity (anchor-резолв) + freeze-gate FR-1 (VF-1/SE-A1 inline).
|
|
*/
|
|
export function parseVerifiedContext(md) {
|
|
if (typeof md !== 'string') return [];
|
|
const m = md.match(/```verified-context-json\s*\n([\s\S]*?)```/);
|
|
if (!m) return [];
|
|
try {
|
|
const o = JSON.parse(m[1]);
|
|
return Array.isArray(o) ? o : [];
|
|
} catch { return []; }
|
|
}
|