// retoor export const meta = { name: 'full-docs-refactor', description: 'Documentation reality audit: verify every falsifiable claim in README.md, the root CLAUDE.md, every nested CLAUDE.md, and the entire /docs site (prose + docs_api) against the actual source, fix drift in place, and confirm role-gating. Every agent owns a disjoint set of files so there are never write conflicts.', phases: [ { title: 'Ground truth', detail: 'extract authoritative facts (routes, CLI, env, deps, test count, package layout, docs registry) from source' }, { title: 'Root docs', detail: 'audit README.md plus every CLAUDE.md (root and nested per-subsystem) in parallel - one file per agent' }, { title: 'Docs site', detail: 'audit the docs_api package and every /docs prose section in parallel - disjoint template ownership' }, { title: 'Gating + validate', detail: 'verify role-gating and run the full validation sweep (import, template compile, em-dash, broken links)' }, ], } const REPORT_SCHEMA = { type: 'object', additionalProperties: false, required: ['target', 'changed', 'changes', 'verifiedAccurate'], properties: { target: { type: 'string' }, changed: { type: 'boolean' }, changes: { type: 'array', items: { type: 'object', additionalProperties: false, required: ['location', 'wrong', 'fixed'], properties: { location: { type: 'string' }, wrong: { type: 'string' }, fixed: { type: 'string' }, source: { type: 'string' }, }, }, }, verifiedAccurate: { type: 'array', items: { type: 'string' } }, gatingIssues: { type: 'array', items: { type: 'string' } }, unverifiable: { type: 'array', items: { type: 'string' } }, }, } const VALIDATE_SCHEMA = { type: 'object', additionalProperties: false, required: ['appImports', 'docsApiValid', 'templatesCompile', 'emDashClean', 'brokenLinks', 'gatingClean'], properties: { appImports: { type: 'boolean' }, docsApiValid: { type: 'boolean' }, templatesCompile: { type: 'boolean' }, emDashClean: { type: 'boolean' }, brokenLinks: { type: 'array', items: { type: 'string' } }, gatingClean: { type: 'boolean' }, gatingFixes: { type: 'array', items: { type: 'string' } }, notes: { type: 'string' }, }, } const SHARED_RULES = 'RULES (all mandatory):\n' + '- The CODE is the source of truth. When docs disagree with code, fix the DOCS, never the code. Do not invent or aspirationally document features. If docs describe something removed/renamed, correct or remove it.\n' + '- Use Read/Grep/Glob/Bash to CONFIRM every claim before you edit it. Never edit on assumption.\n' + '- NEVER introduce an em-dash character or its HTML entity; use a hyphen. Replace any em-dash in a passage you rewrite.\n' + '- Be surgical: change only what is verifiably wrong or verifiably missing from a list/table meant to be complete. Preserve tone, structure, and formatting.\n' + '- Do not corrupt markdown tables, HTML, or Jinja.\n' + 'DOCS PROSE STRUCTURE (for /docs/*.html templates): the body is
rendered to HTML SERVER-SIDE from markdown; example markup shown as code INSIDE that block stays HTML-entity-escaped (<...>). Real live-demo markup and its