@orkestrel/guide 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/core/index.cjs +5 -28
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +0 -21
- package/dist/src/core/index.d.ts +0 -21
- package/dist/src/core/index.js +7 -29
- package/dist/src/core/index.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["holds","INTRINSICS","isBoundedJSONRecord","literalOf","recordOf","isString","arrayOf","unionOf","isString","isCodeSpanNode","isEmphasisNode","isLinkNode","isImageNode","walkNodes","flattenText","coalesceText","isNonEmptyString","isHeadingNode","isTableNode","isCodeBlockNode","isBlockquoteNode","isParagraphNode","renderMarkdown","createMarkdown","createMarkdown","isTableNode","flattenText","isEmptyString","isNonEmptyArray","objectShape","stringShape","literalShape","optionalShape","arrayShape","unionShape","createMarkdown","isHeadingNode","flattenText","isNonEmptyString","createContract"],"sources":["../../../src/core/constants.ts","../../../src/core/errors.ts","../../../src/core/validators.ts","../../../src/core/helpers.ts","../../../src/core/parsers.ts","../../../src/core/shapers.ts","../../../src/core/Guide.ts","../../../src/core/sources/Source.ts","../../../src/core/sources/SourceManager.ts","../../../src/core/Parity.ts","../../../src/core/factories.ts"],"sourcesContent":["/**\n * Lists the declaration keywords a documented or exported symbol carries, in the order the\n * reflection grammar names them — the frozen population `ExportKeyword`, `isExportKeyword`, and\n * `surfaceSymbolShape` all derive from.\n *\n * @remarks\n * One frozen list feeds the type, the guard, and the shape, so a keyword cannot be admitted by one\n * and refused by another. Comment and template payload is excluded before reflection, and `enum`\n * is outside this population rather than forbidden by general package policy.\n */\nexport const EXPORT_KEYWORDS = Object.freeze([\n\t'type',\n\t'interface',\n\t'const',\n\t'function',\n\t'class',\n] satisfies ReadonlyArray<'type' | 'interface' | 'const' | 'function' | 'class'>)\n\n/**\n * Lists the compared sites a {@link Drift} can describe.\n */\nexport const DRIFT_CATEGORIES = Object.freeze([\n\t'summary',\n\t'signature',\n\t'example',\n] satisfies ReadonlyArray<'summary' | 'signature' | 'example'>)\n\n/**\n * Names the `## Surface` heading text a guide's documented exports section is keyed on.\n */\nexport const SURFACE: string = 'Surface'\n\n/**\n * Lists the codes a {@link GuideError} carries: a refused Surface `header` or empty `signature`\n * cell, a name two modules of one manifest entry declare (`collision`), and the compiler faults —\n * a failed `compile`, an `empty` emit, a `timeout`, and an output `overflow`.\n */\nexport const GUIDE_CODES = Object.freeze([\n\t'header',\n\t'signature',\n\t'collision',\n\t'compile',\n\t'empty',\n\t'timeout',\n\t'overflow',\n] satisfies ReadonlyArray<\n\t'header' | 'signature' | 'collision' | 'compile' | 'empty' | 'timeout' | 'overflow'\n>)\n\n/** Names the cross-copy identity marker of a Guide error. */\nexport const GUIDE_ERROR_BRAND = Symbol.for('@orkestrel/guide.GuideError')\n\n/**\n * Names the `## Methods` heading text a guide's documented interface-methods section is keyed on.\n */\nexport const METHODS: string = 'Methods'\n\n/**\n * Names the `## Tests` heading text a guide's documented test-link section is keyed on.\n */\nexport const TESTS: string = 'Tests'\n\n/**\n * Names the header text of the column a `## Surface` table's declaration keyword is read from.\n */\nexport const KIND: string = 'Kind'\n\n/**\n * Names the header text of the column a `## Surface` table's TypeScript signature is read from.\n */\nexport const SIGNATURE: string = 'Signature'\n\n/**\n * Names the header text of the column a `## Surface` or `## Methods` table's compared\n * description paragraph is read from.\n */\nexport const SUMMARY: string = 'Summary'\n\n/**\n * Names the header text of a `## Surface` or `## Methods` table's first column, the symbol name.\n */\nexport const NAME: string = 'Name'\n\n/**\n * Lists the uniform `## Surface` table header, column by column, that guide construction requires.\n */\nexport const SURFACE_HEADER: readonly string[] = Object.freeze([NAME, KIND, SIGNATURE, SUMMARY])\n\n/**\n * Names the `## By concept` heading text the manifest's run-map table is keyed on.\n */\nexport const MANIFEST: string = 'By concept'\n\n/**\n * Holds the default character budget a rewritten doc block's description paragraph wraps\n * inside — the greatest number of characters a re-wrapped line may carry, counted from the\n * line's first character with a tab counting as one, so a wrapped line reads\n * `${indent} * ${text}` and never passes that count.\n *\n * @remarks\n * The budget counts characters, not rendered columns. A block indented with tabs therefore\n * measures each tab as one character, and a formatter that renders a tab wider reads the same\n * line as longer; a caller whose formatter measures differently passes its own width instead of\n * taking this default. A doc block's own wrapping is not recoverable from its text either — the\n * blocks this package's own source carries are hand-wrapped, and no single greedy width\n * reproduces them — so a rewrite cannot infer a per-block width and falls back to this budget.\n */\nexport const WRAP_WIDTH: number = 100\n\n/**\n * Lists the link `href` schemes a guides-parity link check skips as external — a link\n * with one of these prefixes (or a bare `#` anchor, handled separately in\n * `isExternalLink`) is never resolved against the filesystem.\n */\nexport const EXTERNAL_SCHEMES: readonly string[] = Object.freeze([\n\t'http:',\n\t'https:',\n\t'mailto:',\n\t'tel:',\n])\n","import type { GuideCode, GuideErrorOptions } from './types.js'\nimport type { JSONRecord } from '@orkestrel/contract'\nimport { holds, INTRINSICS, isBoundedJSONRecord } from '@orkestrel/contract'\nimport { GUIDE_CODES, GUIDE_ERROR_BRAND } from './constants.js'\n\n/** Carries a coded refusal of a guide, a manifest entry, or a module compile. */\nexport class GuideError extends Error {\n\toverride readonly name: string = 'GuideError'\n\treadonly code: GuideCode\n\treadonly context: JSONRecord | undefined\n\n\tconstructor(message: string, code: GuideCode, options?: GuideErrorOptions) {\n\t\tsuper(message, options)\n\t\tthis.code = code\n\t\tthis.context = options?.context\n\t\tINTRINSICS.define(this, GUIDE_ERROR_BRAND, { value: this })\n\t}\n}\n\n/**\n * Checks whether a value carries the Guide error brand and declared members across package copies.\n *\n * @example\n * ```ts\n * isGuideError(new GuideError('Invalid Surface header', 'header')) // true\n * ```\n */\nexport function isGuideError(value: unknown): value is GuideError {\n\treturn holds(() => {\n\t\tif (!(value instanceof INTRINSICS.error)) return false\n\t\tif (INTRINSICS.prototype(value) === INTRINSICS.error.prototype) return false\n\t\tif (INTRINSICS.describe(value, GUIDE_ERROR_BRAND)?.value !== value) return false\n\t\tconst code: unknown = INTRINSICS.reflect.read(value, 'code')\n\t\tconst context: unknown = INTRINSICS.reflect.read(value, 'context')\n\t\treturn (\n\t\t\tGUIDE_CODES.some((candidate) => candidate === code) &&\n\t\t\t(context === undefined || isBoundedJSONRecord(context)) &&\n\t\t\ttypeof INTRINSICS.reflect.read(value, 'name') === 'string' &&\n\t\t\ttypeof INTRINSICS.reflect.read(value, 'message') === 'string'\n\t\t)\n\t})\n}\n","import type { Guard } from '@orkestrel/contract'\nimport type {\n\tDrift,\n\tDriftCategory,\n\tExportKeyword,\n\tManifestEntry,\n\tMethodEntry,\n\tMethodGroup,\n\tSourceExample,\n\tSurfaceSymbol,\n} from './types.js'\nimport { arrayOf, isString, literalOf, recordOf, unionOf } from '@orkestrel/contract'\nimport { DRIFT_CATEGORIES, EXPORT_KEYWORDS } from './constants.js'\n\n// AGENTS.md § Design laws: guards are total. Every guard here validates an arbitrary\n// `unknown` value crossing an untrusted boundary (parsed guide/manifest data)\n// against a data type's full shape, composed from @orkestrel/contract\n// combinators and hoisted as module-level values (compiled once, not per call).\n\n/**\n * Checks whether `value` is one of the documented {@link ExportKeyword}\n * literals — the guard behind extracting a Surface table's `Kind` cell into a\n * typed symbol.\n *\n * @param value - The candidate value\n * @returns True if `value` is a valid {@link ExportKeyword}; false otherwise\n *\n * @example\n * ```ts\n * isExportKeyword('class') // true\n * isExportKeyword('enum') // false\n * ```\n */\nexport const isExportKeyword: Guard<ExportKeyword> = literalOf(EXPORT_KEYWORDS)\n\n/** Checks whether `value` names a supported drift category. */\nexport const isDriftCategory: Guard<DriftCategory> = literalOf(DRIFT_CATEGORIES)\n\n/**\n * Checks whether `value` is a well-formed {@link SurfaceSymbol} — a `name`\n * string paired with a valid {@link ExportKeyword}, and optional `signature` and `summary` strings.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link SurfaceSymbol}; false otherwise\n *\n * @example\n * ```ts\n * isSurfaceSymbol({ name: 'Markdown', keyword: 'class' }) // true\n * isSurfaceSymbol({ name: 'Markdown', keyword: 'enum' }) // false\n * ```\n */\nexport const isSurfaceSymbol: Guard<SurfaceSymbol> = recordOf(\n\t{\n\t\tname: isString,\n\t\tkeyword: isExportKeyword,\n\t\tsignature: isString,\n\t\tsummary: isString,\n\t},\n\t['signature', 'summary'],\n)\n\n/**\n * Checks whether `value` is a well-formed {@link MethodEntry} — a `name` string with an\n * optional `summary`.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link MethodEntry}; false otherwise\n *\n * @example\n * ```ts\n * isMethodEntry({ name: 'walk' }) // true\n * isMethodEntry({ name: 1 }) // false\n * ```\n */\nexport const isMethodEntry: Guard<MethodEntry> = recordOf(\n\t{\n\t\tname: isString,\n\t\tsummary: isString,\n\t},\n\t['summary'],\n)\n\n/**\n * Checks whether `value` is a well-formed {@link SourceExample} — a `name` and `code`\n * string with an optional `title` and `language`.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link SourceExample}; false otherwise\n *\n * @example\n * ```ts\n * isSourceExample({ name: 'walk', code: 'walk()' }) // true\n * isSourceExample({ name: 'walk' }) // false\n * ```\n */\nexport const isSourceExample: Guard<SourceExample> = recordOf(\n\t{\n\t\tname: isString,\n\t\ttitle: isString,\n\t\tcode: isString,\n\t\tlanguage: isString,\n\t},\n\t['title', 'language'],\n)\n\n/**\n * Checks whether `value` is a well-formed {@link Drift} — a compared `key` with an optional\n * `guide` and `source` text.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link Drift}; false otherwise\n *\n * @example\n * ```ts\n * isDrift({ key: 'class Widget', category: 'summary', guide: 'A widget.' }) // true\n * isDrift({ guide: 'A widget.' }) // false\n * ```\n */\nexport const isDrift: Guard<Drift> = recordOf(\n\t{\n\t\tkey: isString,\n\t\tcategory: isDriftCategory,\n\t\tguide: isString,\n\t\tsource: isString,\n\t},\n\t['guide', 'source'],\n)\n\n/**\n * Checks whether `value` is a well-formed {@link MethodGroup} — a backticked\n * `interface` name paired with its documented {@link MethodEntry} rows.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link MethodGroup}; false otherwise\n *\n * @example\n * ```ts\n * isMethodGroup({ interface: 'MarkdownInterface', methods: [{ name: 'walk' }] }) // true\n * isMethodGroup({ interface: 'MarkdownInterface', methods: [1] }) // false\n * ```\n */\nexport const isMethodGroup: Guard<MethodGroup> = recordOf({\n\tinterface: isString,\n\tmethods: arrayOf(isMethodEntry),\n})\n\n/**\n * Checks whether `value` is a well-formed {@link ManifestEntry} — a\n * `## By concept` manifest row, its `source` accepting either a single directory\n * or several.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link ManifestEntry}; false otherwise\n *\n * @example\n * ```ts\n * isManifestEntry({ concept: 'Markdown', spec: 'guides/src/markdown.md', source: 'src/core', tests: 'tests/src/core' }) // true\n * isManifestEntry({ concept: 1 }) // false\n * ```\n */\nexport const isManifestEntry: Guard<ManifestEntry> = recordOf({\n\tconcept: isString,\n\tspec: isString,\n\tsource: unionOf(isString, arrayOf(isString)),\n\ttests: isString,\n})\n","import type {\n\tBlockNode,\n\tBlockquoteNode,\n\tCodeBlockNode,\n\tInlineNode,\n\tMarkdownDocument,\n\tMarkdownSpan,\n\tTableNode,\n} from '@orkestrel/markdown'\nimport type {\n\tDeclaration,\n\tDeclarationHead,\n\tDeclarationKeyword,\n\tDrift,\n\tFenceImport,\n\tGuideFence,\n\tGuideInterface,\n\tGuideModule,\n\tMethodEntry,\n\tMethodGroup,\n\tParityFinding,\n\tSourceComment,\n\tSourceExample,\n\tSourceInterface,\n\tSourceLine,\n\tSourceProjection,\n\tSurfaceSymbol,\n} from './types.js'\nimport {\n\tcoalesceText,\n\tcreateMarkdown,\n\tflattenText,\n\tisBlockquoteNode,\n\tisCodeBlockNode,\n\tisCodeSpanNode,\n\tisEmphasisNode,\n\tisHeadingNode,\n\tisImageNode,\n\tisLinkNode,\n\tisParagraphNode,\n\tisTableNode,\n\trenderMarkdown,\n\twalkNodes,\n} from '@orkestrel/markdown'\nimport { isNonEmptyString, isString } from '@orkestrel/contract'\nimport {\n\tEXTERNAL_SCHEMES,\n\tKIND,\n\tMETHODS,\n\tNAME,\n\tSIGNATURE,\n\tSUMMARY,\n\tSURFACE,\n\tSURFACE_HEADER,\n\tTESTS,\n\tWRAP_WIDTH,\n} from './constants.js'\nimport { GuideError } from './errors.js'\nimport { isExportKeyword } from './validators.js'\n\n/**\n * Extracts aligned physical source-line records in one character traversal.\n * Real line and block comments and complete template tokens become spaces in\n * {@link SourceLine.code}, while ordinary code, quoted strings, and recognized\n * regex literals retain their columns. Genuine JSDoc opened from reflection\n * code is retained span by span at its exact physical column in\n * {@link SourceLine.jsdoc}; faux openers in comments and templates are\n * excluded. Membership remains each consumer's separate anchored grammar.\n *\n * @remarks\n * Regex recognition is a bounded lexical goal rather than TypeScript parser\n * grammar. Literal ECMAScript Unicode identifiers participate in slash-state\n * recognition, including private identifiers, without decoding escaped\n * identifier spellings. Slash after bare `}` is division, and a post-brace\n * regex statement requires an explicit `;`. General semicolonless\n * declaration/ASI classification is outside this finite projector, so callers\n * place an explicit `;` before a slash-leading statement after such a\n * declaration.\n *\n * @param source - The TypeScript source text to project\n * @returns One aligned terminator-free record per LF or CRLF physical line, including the final line\n *\n * @example Project source into physical code lines\n * ```ts\n * import { extractSourceLines } from '@orkestrel/guide'\n *\n * extractSourceLines('export const visible = true // note\\n')\n * // [{ source: 'export const visible = true // note', code: 'export const visible = true ', jsdoc: undefined }]\n * // … one record per remaining line\n * ```\n */\nexport function extractSourceLines(source: string): readonly SourceLine[] {\n\tconst lines: SourceLine[] = []\n\tconst tokens: Array<{ readonly code: string; readonly jsdoc?: string }> = []\n\tconst identifier = /#?[$_\\p{ID_Start}][$_\\u200C\\u200D\\p{ID_Continue}]*/uy\n\tconst numeric = /[A-Za-z0-9_$.]+/y\n\tconst final = source.split('').reduce<SourceProjection>(\n\t\t(state, character, offset) => {\n\t\t\tif (offset < state.offset) return state\n\t\t\tconst next = source[offset + 1]\n\t\t\tconst crlf = character === '\\r' && next === '\\n'\n\t\t\tif (character === '\\n' || crlf) {\n\t\t\t\tconst parts = tokens.slice(state.token)\n\t\t\t\tconst code = parts.map((part) => part.code).join('')\n\t\t\t\tlines.push({\n\t\t\t\t\tsource: source.slice(state.start, offset),\n\t\t\t\t\tcode,\n\t\t\t\t\tjsdoc:\n\t\t\t\t\t\tstate.present || state.jsdoc\n\t\t\t\t\t\t\t? parts.map((part) => part.jsdoc ?? ' '.repeat(part.code.length)).join('')\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t})\n\t\t\t\tconst regular = state.mode === 'single' || state.mode === 'double'\n\t\t\t\tconst quoted = state.mode === 'templateSingle' || state.mode === 'templateDouble'\n\t\t\t\tconst reset =\n\t\t\t\t\tstate.mode === 'regex' || state.mode === 'templateLine' || state.mode === 'templateRegex'\n\t\t\t\tconst mode =\n\t\t\t\t\tstate.mode === 'line'\n\t\t\t\t\t\t? state.line\n\t\t\t\t\t\t\t? 'templateCode'\n\t\t\t\t\t\t\t: 'code'\n\t\t\t\t\t\t: state.mode === 'regex'\n\t\t\t\t\t\t\t? 'code'\n\t\t\t\t\t\t\t: state.mode === 'templateLine' || state.mode === 'templateRegex'\n\t\t\t\t\t\t\t\t? 'templateCode'\n\t\t\t\t\t\t\t\t: regular && !state.escaped\n\t\t\t\t\t\t\t\t\t? 'code'\n\t\t\t\t\t\t\t\t\t: quoted && !state.escaped\n\t\t\t\t\t\t\t\t\t\t? 'templateCode'\n\t\t\t\t\t\t\t\t\t\t: state.mode\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + (crlf ? 2 : 1),\n\t\t\t\t\tstart: offset + (crlf ? 2 : 1),\n\t\t\t\t\ttoken: tokens.length,\n\t\t\t\t\tmode,\n\t\t\t\t\tescaped: false,\n\t\t\t\t\tregex: reset ? false : state.regex,\n\t\t\t\t\toperand:\n\t\t\t\t\t\tstate.restricted !== undefined || reset || ((regular || quoted) && !state.escaped)\n\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t: state.operand,\n\t\t\t\t\tmember: state.restricted !== undefined ? false : state.member,\n\t\t\t\t\trole: state.restricted !== undefined ? undefined : state.role,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: state.mode !== 'template' ? true : state.separated,\n\t\t\t\t\tpresent: state.jsdoc,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (state.mode === 'line' || state.mode === 'templateLine') {\n\t\t\t\ttokens.push({ code: ' ' })\n\t\t\t\treturn state\n\t\t\t}\n\t\t\tif (state.mode === 'block' || state.mode === 'templateBlock') {\n\t\t\t\tconst closes = character === '*' && next === '/'\n\t\t\t\ttokens.push({\n\t\t\t\t\tcode: closes ? ' ' : ' ',\n\t\t\t\t\t...(state.jsdoc ? { jsdoc: closes ? '*/' : character } : {}),\n\t\t\t\t})\n\t\t\t\treturn closes\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\t\t\tjsdoc: false,\n\t\t\t\t\t\t\tmode: state.block ? 'templateCode' : 'code',\n\t\t\t\t\t\t}\n\t\t\t\t\t: state\n\t\t\t}\n\t\t\tif (\n\t\t\t\tstate.mode === 'single' ||\n\t\t\t\tstate.mode === 'double' ||\n\t\t\t\tstate.mode === 'templateSingle' ||\n\t\t\t\tstate.mode === 'templateDouble'\n\t\t\t) {\n\t\t\t\tconst template = state.mode === 'templateSingle' || state.mode === 'templateDouble'\n\t\t\t\ttokens.push({ code: template ? ' ' : character })\n\t\t\t\tif (state.escaped) return { ...state, escaped: false }\n\t\t\t\tif (character === '\\\\') return { ...state, escaped: true }\n\t\t\t\tconst closes =\n\t\t\t\t\tstate.mode === 'single' || state.mode === 'templateSingle'\n\t\t\t\t\t\t? character === \"'\"\n\t\t\t\t\t\t: character === '\"'\n\t\t\t\treturn closes\n\t\t\t\t\t? { ...state, mode: template ? 'templateCode' : 'code', operand: false }\n\t\t\t\t\t: state\n\t\t\t}\n\t\t\tif (state.mode === 'regex' || state.mode === 'templateRegex') {\n\t\t\t\ttokens.push({ code: state.mode === 'templateRegex' ? ' ' : character })\n\t\t\t\tif (state.escaped) return { ...state, escaped: false }\n\t\t\t\tif (character === '\\\\') return { ...state, escaped: true }\n\t\t\t\tif (character === '[') return { ...state, regex: true }\n\t\t\t\tif (character === ']') return { ...state, regex: false }\n\t\t\t\tif (character === '/' && !state.regex)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\tmode: state.mode === 'templateRegex' ? 'templateCode' : 'code',\n\t\t\t\t\t\toperand: false,\n\t\t\t\t\t}\n\t\t\t\treturn state\n\t\t\t}\n\t\t\tif (state.mode === 'template') {\n\t\t\t\tconst interpolation = !state.escaped && character === '$' && next === '{'\n\t\t\t\ttokens.push({ code: interpolation ? ' ' : ' ' })\n\t\t\t\tif (state.escaped) return { ...state, escaped: false }\n\t\t\t\tif (character === '\\\\') return { ...state, escaped: true }\n\t\t\t\tif (interpolation)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\t\ttemplates: state.templates === undefined ? undefined : { ...state.templates, depth: 1 },\n\t\t\t\t\t\tmode: 'templateCode',\n\t\t\t\t\t\toperand: true,\n\t\t\t\t\t\tmember: false,\n\t\t\t\t\t\trole: undefined,\n\t\t\t\t\t}\n\t\t\t\tif (character === '\\x60') {\n\t\t\t\t\tconst templates = state.templates?.previous\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\ttemplates,\n\t\t\t\t\t\tmode: templates === undefined ? 'code' : 'templateCode',\n\t\t\t\t\t\toperand: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn state\n\t\t\t}\n\t\t\tconst template = state.mode === 'templateCode'\n\t\t\tif (character === '/' && next === '/') {\n\t\t\t\ttokens.push({ code: ' ' })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\tline: template,\n\t\t\t\t\tmode: template ? 'templateLine' : 'line',\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === '/' && next === '*') {\n\t\t\t\tconst jsdoc = !template && source[offset + 2] === '*'\n\t\t\t\ttokens.push({ code: ' ', ...(jsdoc ? { jsdoc: '/*' } : {}) })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\tblock: template,\n\t\t\t\t\tmode: template ? 'templateBlock' : 'block',\n\t\t\t\t\tjsdoc: jsdoc || state.jsdoc,\n\t\t\t\t\tpresent: jsdoc || state.present,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === \"'\" || character === '\"' || character === '\\x60') {\n\t\t\t\ttokens.push({ code: template || character === '\\x60' ? ' ' : character })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tmode:\n\t\t\t\t\t\tcharacter === '\\x60'\n\t\t\t\t\t\t\t? 'template'\n\t\t\t\t\t\t\t: character === \"'\"\n\t\t\t\t\t\t\t\t? template\n\t\t\t\t\t\t\t\t\t? 'templateSingle'\n\t\t\t\t\t\t\t\t\t: 'single'\n\t\t\t\t\t\t\t\t: template\n\t\t\t\t\t\t\t\t\t? 'templateDouble'\n\t\t\t\t\t\t\t\t\t: 'double',\n\t\t\t\t\ttemplates:\n\t\t\t\t\t\tcharacter === '\\x60' ? { depth: 0, previous: state.templates } : state.templates,\n\t\t\t\t\tescaped: false,\n\t\t\t\t\tseparated: false,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst visible = template ? ' ' : character\n\t\t\tif (character === '/' && next === '=' && !state.operand) {\n\t\t\t\ttokens.push({ code: template ? ' ' : '/=' })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\toperand: true,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === '/') {\n\t\t\t\ttokens.push({ code: visible })\n\t\t\t\treturn state.operand\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\tmode: template ? 'templateRegex' : 'regex',\n\t\t\t\t\t\t\tescaped: false,\n\t\t\t\t\t\t\tregex: false,\n\t\t\t\t\t\t\tseparated: false,\n\t\t\t\t\t\t\trestricted: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\toperand: true,\n\t\t\t\t\t\t\tmember: false,\n\t\t\t\t\t\t\trole: undefined,\n\t\t\t\t\t\t\tseparated: false,\n\t\t\t\t\t\t\trestricted: undefined,\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tidentifier.lastIndex = offset\n\t\t\tconst matched = identifier.exec(source)\n\t\t\tif (matched !== null) {\n\t\t\t\tconst token = matched[0]\n\t\t\t\ttokens.push({ code: template ? ' '.repeat(token.length) : token })\n\t\t\t\tconst stepped = {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + token.length,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t\tconst frame = state.parentheses\n\t\t\t\tif (token.startsWith('#'))\n\t\t\t\t\treturn { ...stepped, operand: false, member: false, role: undefined }\n\t\t\t\tif (state.member) return { ...stepped, member: false, operand: false, role: undefined }\n\t\t\t\tif (state.restricted === 'label')\n\t\t\t\t\treturn { ...stepped, operand: false, role: undefined, restricted: 'complete' }\n\t\t\t\tif (/^(?:if|while|with)$/.test(token))\n\t\t\t\t\treturn { ...stepped, role: 'statement', operand: true }\n\t\t\t\tif (token === 'for') return { ...stepped, role: 'for', operand: true }\n\t\t\t\tif (token === 'export') return { ...stepped, role: 'export', operand: true }\n\t\t\t\tif (token === 'default' && state.role === 'export')\n\t\t\t\t\treturn { ...stepped, role: undefined, operand: true }\n\t\t\t\tif (/^(?:switch|catch)$/.test(token)) return { ...stepped, role: 'block', operand: true }\n\t\t\t\tif (token === 'await' && state.role === 'for') return { ...stepped, operand: true }\n\t\t\t\tif (\n\t\t\t\t\t/^(?:return|throw|case|delete|void|typeof|new|await|yield|else|do|extends|in|instanceof)$/.test(\n\t\t\t\t\t\ttoken,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\treturn { ...stepped, role: undefined, operand: true }\n\t\t\t\tif (/^(?:break|continue)$/.test(token))\n\t\t\t\t\treturn { ...stepped, role: undefined, operand: false, restricted: 'label' }\n\t\t\t\tif (token === 'debugger')\n\t\t\t\t\treturn { ...stepped, role: undefined, operand: false, restricted: 'complete' }\n\t\t\t\tif (\n\t\t\t\t\ttoken === 'of' &&\n\t\t\t\t\tframe?.role === 'for' &&\n\t\t\t\t\tframe.phase === 'left' &&\n\t\t\t\t\t!frame.binding &&\n\t\t\t\t\t!state.operand\n\t\t\t\t)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...stepped,\n\t\t\t\t\t\tparentheses: { ...frame, phase: 'right' },\n\t\t\t\t\t\toperand: true,\n\t\t\t\t\t\trole: undefined,\n\t\t\t\t\t}\n\t\t\t\tif (/^(?:const|let|var)$/.test(token) && frame?.role === 'for' && frame.phase === 'left')\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...stepped,\n\t\t\t\t\t\tparentheses: { ...frame, binding: true },\n\t\t\t\t\t\toperand: true,\n\t\t\t\t\t\trole: undefined,\n\t\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses: frame?.binding === true ? { ...frame, binding: false } : frame,\n\t\t\t\t\toperand: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (/[0-9]/.test(character)) {\n\t\t\t\tnumeric.lastIndex = offset\n\t\t\t\tconst token = numeric.exec(source)?.[0] ?? character\n\t\t\t\ttokens.push({ code: template ? ' '.repeat(token.length) : token })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + token.length,\n\t\t\t\t\toperand: false,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((character === '!' || character === '=') && next === '=') {\n\t\t\t\tconst width = source[offset + 2] === '=' ? 3 : 2\n\t\t\t\ttokens.push({ code: template ? ' '.repeat(width) : source.slice(offset, offset + width) })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + width,\n\t\t\t\t\toperand: true,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((character === '+' && next === '+') || (character === '-' && next === '-')) {\n\t\t\t\ttokens.push({ code: template ? ' ' : character + next })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\toperand: state.separated ? true : state.operand,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === '.' && next === '.' && source[offset + 2] === '.') {\n\t\t\t\ttokens.push({ code: template ? ' ' : '...' })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 3,\n\t\t\t\t\toperand: true,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === '?' && next === '.') {\n\t\t\t\ttokens.push({ code: template ? ' ' : '?.' })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\toperand: false,\n\t\t\t\t\tmember: true,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\ttokens.push({ code: visible })\n\t\t\tif (/\\s/.test(character)) return state\n\t\t\tconst stepped = {\n\t\t\t\t...state,\n\t\t\t\tseparated: false,\n\t\t\t\trestricted: undefined,\n\t\t\t\trole: undefined,\n\t\t\t\tmember: false,\n\t\t\t}\n\t\t\tconst frame = state.parentheses\n\t\t\tif (character === '(')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses: {\n\t\t\t\t\t\trole: state.role ?? 'plain',\n\t\t\t\t\t\tphase: 'left',\n\t\t\t\t\t\tbinding: false,\n\t\t\t\t\t\tprevious: frame,\n\t\t\t\t\t},\n\t\t\t\t\toperand: true,\n\t\t\t\t}\n\t\t\tif (character === ')')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses: frame?.previous,\n\t\t\t\t\toperand: frame?.role === 'statement' || frame?.role === 'for',\n\t\t\t\t}\n\t\t\tif (character === ';')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses:\n\t\t\t\t\t\tframe?.role === 'for' && frame.phase === 'left'\n\t\t\t\t\t\t\t? { ...frame, phase: 'classic' }\n\t\t\t\t\t\t\t: frame,\n\t\t\t\t\toperand: true,\n\t\t\t\t}\n\t\t\tif (character === '.') return { ...stepped, operand: false, member: true }\n\t\t\tconst parentheses =\n\t\t\t\t(character === ']' || character === '}') &&\n\t\t\t\tframe?.role === 'for' &&\n\t\t\t\tframe.phase === 'left' &&\n\t\t\t\tframe.binding\n\t\t\t\t\t? { ...frame, binding: false }\n\t\t\t\t\t: frame\n\t\t\tif (character === ']') return { ...stepped, parentheses, operand: false }\n\t\t\tconst top = state.templates\n\t\t\tif (character === '}')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses,\n\t\t\t\t\toperand: false,\n\t\t\t\t\ttemplates: template && top !== undefined ? { ...top, depth: top.depth - 1 } : top,\n\t\t\t\t\tmode: template && top?.depth === 1 ? 'template' : state.mode,\n\t\t\t\t}\n\t\t\tif (character === '{')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses,\n\t\t\t\t\toperand: true,\n\t\t\t\t\ttemplates: template && top !== undefined ? { ...top, depth: top.depth + 1 } : top,\n\t\t\t\t}\n\t\t\treturn { ...stepped, parentheses, operand: character !== '!' ? true : state.operand }\n\t\t},\n\t\t{\n\t\t\toffset: 0,\n\t\t\tstart: 0,\n\t\t\ttoken: 0,\n\t\t\tmode: 'code',\n\t\t\tescaped: false,\n\t\t\tregex: false,\n\t\t\toperand: true,\n\t\t\tmember: false,\n\t\t\trole: undefined,\n\t\t\trestricted: undefined,\n\t\t\tseparated: false,\n\t\t\tblock: false,\n\t\t\tline: false,\n\t\t\tjsdoc: false,\n\t\t\tpresent: false,\n\t\t\tparentheses: undefined,\n\t\t\ttemplates: undefined,\n\t\t},\n\t)\n\tconst parts = tokens.slice(final.token)\n\tconst code = parts.map((part) => part.code).join('')\n\tlines.push({\n\t\tsource: source.slice(final.start),\n\t\tcode,\n\t\tjsdoc:\n\t\t\tfinal.present || final.jsdoc\n\t\t\t\t? parts.map((part) => part.jsdoc ?? ' '.repeat(part.code.length)).join('')\n\t\t\t\t: undefined,\n\t})\n\treturn lines\n}\n\n/**\n * Checks whether an opaque inventory key contains only canonical slash-separated\n * segments. Empty, `.` and `..` segments are rejected without rewriting the\n * key; ordinary dotfile segments remain valid.\n *\n * @param key - The opaque inventory key to inspect\n * @returns True if every segment is canonical; false otherwise\n *\n * @example\n * ```ts\n * hasCanonicalSegments('src/.hidden.ts') // true\n * hasCanonicalSegments('src/../alias.ts') // false\n * ```\n */\nexport function hasCanonicalSegments(key: string): boolean {\n\treturn key.split('/').every((segment) => segment !== '' && segment !== '.' && segment !== '..')\n}\n\n/**\n * Normalizes a module scope to its canonical directory list. `'.'` represents\n * workspace root; empty, trailing, and dot-segment spellings reduce through\n * {@link resolvePath}, and duplicates are removed in first-seen order.\n *\n * @param module - The module scope to normalize\n * @returns The directory list `module` denotes\n *\n * @example\n * ```ts\n * normalizeDirectories('src/core') // ['src/core']\n * normalizeDirectories(['src/core', 'src/browser']) // ['src/core', 'src/browser']\n * ```\n */\nexport function normalizeDirectories(module: GuideModule): readonly string[] {\n\tconst directories: string[] = []\n\tconst seen = new Set<string>()\n\tfor (const value of isString(module) ? [module] : module) {\n\t\tconst directory = resolvePath('.', value)\n\t\tif (seen.has(directory)) continue\n\t\tseen.add(directory)\n\t\tdirectories.push(directory)\n\t}\n\treturn directories\n}\n\n/**\n * Computes the stable cache key for a {@link GuideModule}. Directories normalize before\n * joining, so equivalent module spellings share one key. The NUL separator\n * cannot occur in filesystem-backed canonical-segment inventory keys, so no\n * directory boundary can collide with directory text.\n *\n * @param module - The module scope to key\n * @returns The normalized directories joined by NUL\n *\n * @example\n * ```ts\n * computeModuleKey(['src/core', 'src/browser']) // 'src/core\\0src/browser'\n * ```\n */\nexport function computeModuleKey(module: GuideModule): string {\n\treturn normalizeDirectories(module).join('\\0')\n}\n\n/**\n * Selects the exact opaque file-inventory keys belonging under any canonical\n * {@link GuideModule} directory, sorted. `'.'` selects canonical root-relative\n * keys without accepting `/`, `./`, or `../` aliases. Every selected exact\n * `index.ts` and every `.test.ts` key is excluded independent of scope order.\n *\n * @param files - The workspace file inventory, root-relative path → file text\n * @param module - The module scope to filter to\n * @returns The scope's file keys, root-relative and sorted\n *\n * @example\n * ```ts\n * selectModuleKeys({ 'src/core/Guide.ts': '', 'src/core/index.ts': '' }, 'src/core') // ['src/core/Guide.ts']\n * ```\n */\nexport function selectModuleKeys(\n\tfiles: Readonly<Record<string, string>>,\n\tmodule: GuideModule,\n): readonly string[] {\n\tconst dirs = normalizeDirectories(module)\n\tconst indexes = new Set(dirs.map((directory) => resolvePath(directory, 'index.ts')))\n\tconst keys: string[] = []\n\n\tfor (const key of Object.keys(files)) {\n\t\tif (!hasCanonicalSegments(key)) continue\n\t\tif (!key.endsWith('.ts')) continue\n\t\tif (key.endsWith('.test.ts')) continue\n\t\tif (\n\t\t\t!dirs.some((directory) => directory === '.' || key.startsWith(`${directory}/`)) ||\n\t\t\tindexes.has(key)\n\t\t) {\n\t\t\tcontinue\n\t\t}\n\n\t\tkeys.push(key)\n\t}\n\n\treturn keys.sort()\n}\n\n/**\n * Computes the bijection key for a surface symbol — `${keyword} ${name}` — so a symbol-set\n * comparison diffs (name, keyword) pairs rather than names alone.\n *\n * @param symbol - The symbol to key\n * @returns The `${keyword} ${name}` key\n *\n * @example\n * ```ts\n * computeSymbolKey({ name: 'Markdown', keyword: 'class' }) // 'class Markdown'\n * ```\n */\nexport function computeSymbolKey(symbol: SurfaceSymbol): string {\n\treturn `${symbol.keyword} ${symbol.name}`\n}\n\n/**\n * Finds the names present in `names` but absent from `source` — the set-difference\n * behind a both-directions bijection assertion.\n *\n * @param names - The candidate names\n * @param source - The names to compare against\n * @returns The names in `names` that are not in `source`\n *\n * @example\n * ```ts\n * findMissing(['a', 'b'], ['a']) // ['b']\n * ```\n */\nexport function findMissing(\n\tnames: readonly string[],\n\tsource: readonly string[],\n): readonly string[] {\n\tconst existing = new Set(source)\n\treturn names.filter((name) => !existing.has(name))\n}\n\n/**\n * Finds the fences whose language is absent from the caller's listed languages.\n * Untagged fences are always returned because they have no language to list.\n *\n * @param fences - The guide fences to check\n * @param languages - The listed language tags\n * @returns The unlisted fences in input order\n *\n * @example\n * ```ts\n * findUnlisted([{ language: 'typescript', code: 'walk()' }], ['ts'])\n * // [{ language: 'typescript', code: 'walk()' }]\n * ```\n */\nexport function findUnlisted(\n\tfences: readonly GuideFence[],\n\tlanguages: readonly string[],\n): readonly GuideFence[] {\n\tconst listed = new Set(languages)\n\treturn fences.filter((fence) => fence.language === undefined || !listed.has(fence.language))\n}\n\n/**\n * Finds the symbol-key set-difference between two symbol lists — `symbols` present but\n * absent from `source`, compared by {@link computeSymbolKey} so a symbol can drift in\n * neither name nor keyword.\n *\n * @param symbols - The candidate symbols\n * @param source - The symbols to compare against\n * @returns The symbol keys in `symbols` that are not in `source`\n *\n * @example\n * ```ts\n * findMissingSymbols([{ name: 'X', keyword: 'class', signature: '`new () => X`' }], []) // ['class X']\n * ```\n */\nexport function findMissingSymbols(\n\tsymbols: readonly SurfaceSymbol[],\n\tsource: readonly SurfaceSymbol[],\n): readonly string[] {\n\treturn findMissing(symbols.map(computeSymbolKey), source.map(computeSymbolKey))\n}\n\n/**\n * Checks whether a source declares at least one behavioural member — a `class` or `interface`\n * in its surface that carries a call-signature member — so a guide owes a `## Methods` group only\n * where the source has one to document.\n *\n * @param source - The reflected source under parity\n * @returns True if a surface `class` or `interface` declares a member; false otherwise\n *\n * @example\n * ```ts\n * hasBehaviouralSurface(createSource({ files: { 'src/types.ts': 'export interface Widget { render(): void }' }, module: 'src' })) // true\n * hasBehaviouralSurface(createSource({ files: { 'src/constants.ts': 'export const NAMES = Object.freeze({})' }, module: 'src' })) // false\n * ```\n */\nexport function hasBehaviouralSurface(source: SourceInterface): boolean {\n\treturn source\n\t\t.surface()\n\t\t.some(\n\t\t\t(symbol) =>\n\t\t\t\t(symbol.keyword === 'class' || symbol.keyword === 'interface') &&\n\t\t\t\tsource.methods(symbol.name).length > 0,\n\t\t)\n}\n\n/**\n * Finds the names in `names` that have no example — a fence containing the name at a\n * word boundary in `fences`, or a membership in `examples`, both count as\n * \"has an example\"; presence-only, fence and JSDoc content are never checked.\n *\n * @param names - The candidate symbol/member names to check\n * @param fences - The guide's ```ts Patterns fence bodies to search\n * @param examples - The names already known to carry an `@example` JSDoc block\n * @returns The names in `names` with no fence mention and no `@example`\n *\n * @example\n * ```ts\n * findUnexampled(['walk', 'fold'], ['walk()'], []) // ['fold']\n * findUnexampled(['walk'], [], ['walk']) // []\n * ```\n */\nexport function findUnexampled(\n\tnames: readonly string[],\n\tfences: readonly string[],\n\texamples: readonly string[],\n): readonly string[] {\n\tconst exampled = new Set(examples)\n\treturn names.filter((name) => {\n\t\tif (exampled.has(name)) return false\n\t\tconst boundary = new RegExp(`\\\\b${escapeRegExp(name)}\\\\b`)\n\t\treturn !fences.some((fence) => boundary.test(fence))\n\t})\n}\n\n/**\n * Parses a fence's brace `import` statements into per-specifier imported identifier names —\n * `import type`, mixed multiline braces, and `x as y` aliases all count, each alias resolved to\n * the exported name `x` because that is the name the checked barrel surface must hold. Brace\n * bindings only: a default, namespace, side-effect, or mixed `import Default, { named }`\n * statement is not surfaced.\n *\n * @param fence - A ```ts Patterns fence's verbatim body text\n * @returns One entry per `import ... from 'specifier'` statement, in fence order\n *\n * @example\n * ```ts\n * extractFenceImports(\"import { a, b as c } from 'x'\\n\") // [{ specifier: 'x', names: ['a', 'b'] }]\n * ```\n */\nexport function extractFenceImports(fence: string): readonly FenceImport[] {\n\tconst results: FenceImport[] = []\n\tconst pattern = /import\\s+(?:type\\s+)?\\{([^}]*)\\}\\s*from\\s*['\"]([^'\"]+)['\"]/gs\n\n\tfor (const match of fence.matchAll(pattern)) {\n\t\tconst body = match[1]\n\t\tconst specifier = match[2]\n\t\tif (body === undefined || specifier === undefined) continue\n\n\t\tconst names = body\n\t\t\t.split(',')\n\t\t\t.map((part) => part.trim())\n\t\t\t.filter((part) => part.length > 0)\n\t\t\t.map((part) => part.replace(/^type\\s+/, ''))\n\t\t\t.map((part) => {\n\t\t\t\tconst asMatch = part.match(/^(\\w+)\\s+as\\s+\\w+$/)\n\t\t\t\treturn asMatch?.[1] ?? part\n\t\t\t})\n\t\t\t.filter((part) => /^\\w+$/.test(part))\n\n\t\tresults.push({ specifier, names })\n\t}\n\n\treturn results\n}\n\n/**\n * Checks whether a guides-parity link check skips a link `href` — an external\n * scheme ({@link EXTERNAL_SCHEMES}) or a bare in-document `#` anchor.\n *\n * @param href - The link destination\n * @returns True if a link check leaves the href unresolved against the filesystem; false otherwise\n *\n * @example\n * ```ts\n * isExternalLink('https://example.com') // true\n * isExternalLink('../helpers.ts') // false\n * ```\n */\nexport function isExternalLink(href: string): boolean {\n\tif (href.startsWith('#')) return true\n\treturn EXTERNAL_SCHEMES.some((scheme) => href.startsWith(scheme))\n}\n\n/**\n * Resolves a relative `target` from a root-relative `directory`, normalizing\n * forward-slash dot segments without filesystem or extension inference. A\n * parent pops only a retained real component; every excess leading parent is\n * preserved.\n *\n * @param directory - The root-relative directory to resolve from\n * @param target - The relative target to resolve\n * @returns The normalized path, or `'.'` when no segment remains, retaining every excess parent\n *\n * @example\n * ```ts\n * resolvePath('guides/src', '../../src/core/helpers.ts') // 'src/core/helpers.ts'\n * resolvePath('.', '../../outside.ts') // '../../outside.ts'\n * ```\n */\nexport function resolvePath(directory: string, target: string): string {\n\tconst combined = `${directory}/${target}`\n\tconst segments: string[] = []\n\n\tfor (const segment of combined.split('/')) {\n\t\tif (segment === '' || segment === '.') continue\n\t\tif (segment === '..') {\n\t\t\tconst previous = segments[segments.length - 1]\n\t\t\tif (previous !== undefined && previous !== '..') segments.pop()\n\t\t\telse segments.push(segment)\n\t\t\tcontinue\n\t\t}\n\t\tsegments.push(segment)\n\t}\n\n\treturn segments.length === 0 ? '.' : segments.join('/')\n}\n\n/**\n * Resolves a relative `target` from the directory containing a root-relative\n * declaring `file`. A slashless file belongs to the workspace root; path\n * reduction is delegated to {@link resolvePath}.\n *\n * @param file - The root-relative declaring file\n * @param target - The relative link destination to resolve\n * @returns The normalized path, retaining every excess leading parent\n *\n * @example\n * ```ts\n * resolveLink('guides/src/guide.md', '../../src/core/helpers.ts') // 'src/core/helpers.ts'\n * resolveLink('index.ts', './root.ts') // 'root.ts'\n * ```\n */\nexport function resolveLink(file: string, target: string): string {\n\tconst index = file.lastIndexOf('/')\n\tconst directory = index < 0 ? '.' : file.slice(0, index)\n\treturn resolvePath(directory, target)\n}\n\n/**\n * Finds the first code-span value by descending an inline node list, following\n * into `emphasis` / `link` / `image` children — the extraction rule behind a\n * Surface or Methods table row's first-column identifier.\n *\n * @param nodes - The inline nodes to search\n * @returns The first code span's literal text, or `undefined` when none is found\n *\n * @example\n * ```ts\n * findFirstCode([{ element: 'codeSpan', value: 'Markdown' }]) // 'Markdown'\n * ```\n */\nexport function findFirstCode(nodes: readonly InlineNode[]): string | undefined {\n\tfor (const node of nodes) {\n\t\tif (isCodeSpanNode(node)) return node.value\n\t\tif (isEmphasisNode(node) || isLinkNode(node) || isImageNode(node)) {\n\t\t\tconst value = findFirstCode(node.children)\n\t\t\tif (value !== undefined) return value\n\t\t}\n\t}\n\treturn undefined\n}\n\n/**\n * Extracts the link hrefs within one table cell's inline content, in walk order.\n *\n * @param cell - The cell's inline nodes\n * @returns The cell's link hrefs, in walk order\n *\n * @example\n * ```ts\n * extractCellLinks([{ element: 'link', href: 'x.ts', children: [] }]) // ['x.ts']\n * ```\n */\nexport function extractCellLinks(cell: readonly InlineNode[]): readonly string[] {\n\tconst links: string[] = []\n\tfor (const node of walkNodes({ element: 'paragraph', children: cell })) {\n\t\tif (isLinkNode(node)) links.push(node.href)\n\t}\n\treturn links\n}\n\n/**\n * Returns the identifier prefix of a code-span text — everything before its first `<`,\n * trimmed. Guide cells and headings may annotate a generic-parameterized name\n * (`MarkdownHandler<TNode, T>`) for readability, but the bijection key is the\n * bare identifier the source scanner captures, so both sides must normalize\n * the same way.\n *\n * @param code - A code span's literal text\n * @returns The identifier prefix, or an empty string when `code` is empty\n *\n * @example\n * ```ts\n * normalizeIdentifier('MarkdownHandler<TNode, T>') // 'MarkdownHandler'\n * normalizeIdentifier('fold') // 'fold'\n * ```\n */\nexport function normalizeIdentifier(code: string): string {\n\tconst index = code.indexOf('<')\n\treturn (index < 0 ? code : code.slice(0, index)).trim()\n}\n\n/**\n * Extracts compared inline content — the text of a table cell or candidate entity heading\n * flattened with every code span kept as a code span, so `` `Widget` `` reads the same wherever\n * the parity reader compares it. Emphasis drops to its text, a link drops to its text, an image\n * drops to its alternative text, and the markdown parser has already unescaped `\\|`.\n *\n * @param cell - The inline nodes to flatten\n * @returns The compared text, code spans included\n *\n * @example\n * ```ts\n * extractCellText([{ element: 'codeSpan', value: 'Widget' }]) // '`Widget`'\n * ```\n */\nexport function extractCellText(cell: readonly InlineNode[]): string {\n\treturn Iterator.from(cell)\n\t\t.map((node) => {\n\t\t\tif (isCodeSpanNode(node)) return `\\`${node.value}\\``\n\t\t\tif (isEmphasisNode(node) || isLinkNode(node) || isImageNode(node)) {\n\t\t\t\treturn extractCellText(node.children)\n\t\t\t}\n\t\t\treturn flattenText(node)\n\t\t})\n\t\t.toArray()\n\t\t.join('')\n}\n\n/**\n * Builds one table cell's inline content from its compared text — the inverse of\n * {@link extractCellText}. A single-backtick run whose text carries no inner backtick and\n * neither a leading nor a trailing space becomes a code span; every other character, a backtick\n * included, becomes literal text, which `renderMarkdown` escapes so the rendered cell parses back\n * to the text this function was given.\n *\n * @remarks\n * The compared form spells every code span with one backtick per side, because\n * {@link extractCellText} emits `` `${value}` `` whatever delimiter the source used. A run this\n * function refuses is therefore a run no parsed cell produced, and emitting it as text is what\n * keeps the projection total: reading the rendered cell back through {@link extractCellText}\n * returns the text, so a rendered row and a hand-written row compare the same. A code span whose\n * own text carries a backtick or a boundary space is outside the compared form's fidelity in\n * either direction, and this function writes it as text rather than guessing a delimiter.\n *\n * @param text - The cell's compared text, as {@link extractCellText} returns it\n * @returns The cell's inline nodes, in text order\n *\n * @example\n * ```ts\n * buildCell('Holds a `Widget`.')\n * // [{ element: 'text', value: 'Holds a ' }, { element: 'codeSpan', value: 'Widget' }, { element: 'text', value: '.' }]\n * ```\n */\nexport function buildCell(text: string): readonly InlineNode[] {\n\tconst nodes: InlineNode[] = []\n\tconst cursor = Iterator.from(text.matchAll(/`([^`]+)`/g)).reduce((previous, span) => {\n\t\tconst value = span[1]\n\t\tif (value === undefined) return previous\n\t\tif (span.index > previous) {\n\t\t\tnodes.push({ element: 'text', value: text.slice(previous, span.index) })\n\t\t}\n\t\tnodes.push(\n\t\t\tvalue.trim() === value ? { element: 'codeSpan', value } : { element: 'text', value: span[0] },\n\t\t)\n\t\treturn span.index + span[0].length\n\t}, 0)\n\tif (cursor < text.length) nodes.push({ element: 'text', value: text.slice(cursor) })\n\treturn coalesceText(nodes)\n}\n\n/**\n * Finds the index of the column whose header text is `header` so a table's columns survive\n * reordering. The match is exact and case-sensitive — a table without that exact header\n * contributes nothing to the projection reading it, so a `## Surface` table with no\n * {@link SUMMARY} column leaves every row's summary absent and {@link findDrift} reports each\n * of those rows, never agreement.\n *\n * @param table - The table to inspect\n * @param header - The exact header text to locate, for example `Kind`\n * @returns The column's index, or `undefined` when the table has no such header\n *\n * @example\n * ```ts\n * findColumnIndex(table, 'Kind') // 1, or undefined\n * ```\n */\nexport function findColumnIndex(table: TableNode, header: string): number | undefined {\n\tfor (const index of table.header.keys()) {\n\t\tconst cell = table.header[index]\n\t\tif (\n\t\t\tcell !== undefined &&\n\t\t\tflattenText({ element: 'paragraph', children: cell }).trim() === header\n\t\t) {\n\t\t\treturn index\n\t\t}\n\t}\n\treturn undefined\n}\n\n/**\n * Extracts the module-scope exports declared in one file's source text — the declaration keys\n * {@link collectKeys} reports, each split back into the keyword and name that built it, deduped by\n * (keyword, name).\n *\n * @remarks\n * That one grammar matches `export (async)? (function(\\*)?|class|const|interface|type) Name`; a\n * generator export (`export function* walk`) keys as the `function` keyword, its trailing `*`\n * stripped before the {@link ExportKeyword} check. Scanning uses {@link extractSourceLines}, so\n * comment and template payload is excluded while its uninterrupted column-zero head remains\n * required; preserved columns do not grant membership to leading/interrupted comment forms. The\n * population is exactly `type`, `interface`, `const`, `function`, and `class`; `enum` is outside\n * this reflection contract, not forbidden by general package policy.\n *\n * @param source - The file's source text\n * @returns The file's exported symbols, in file order\n *\n * @example\n * ```ts\n * extractExports('export class Markdown {}\\n') // [{ name: 'Markdown', keyword: 'class' }]\n * extractExports('export function* walk() {}\\n') // [{ name: 'walk', keyword: 'function' }]\n * ```\n */\nexport function extractExports(source: string): readonly SurfaceSymbol[] {\n\tconst symbols: SurfaceSymbol[] = []\n\tconst seen = new Set<string>()\n\tconst lines = extractSourceLines(source)\n\tconst summaries = collectSummaries(lines)\n\tconst keys = collectKeys(lines)\n\n\tfor (const line of lines) {\n\t\tconst key = keys.get(line)\n\t\tif (key === undefined || seen.has(key)) continue\n\n\t\t// A declaration key is `${keyword} ${name}`, so its one space splits it back into the pair\n\t\t// that built it. A member key carries no space, so its keyword reads empty and the keyword\n\t\t// guard drops it here — no second head pattern excludes it.\n\t\tconst space = key.indexOf(' ')\n\t\tconst keyword = key.slice(0, Math.max(space, 0))\n\t\tif (!isExportKeyword(keyword)) continue\n\n\t\tseen.add(key)\n\t\tconst name = key.slice(space + 1)\n\t\tconst summary = summaries.get(line)\n\t\tsymbols.push({ name, keyword, ...(summary === undefined ? {} : { summary }) })\n\t}\n\n\treturn symbols\n}\n\n/**\n * Extracts the module-scope declarations lacking the `export` keyword in one file's source text —\n * the mirror image of {@link extractExports}'s grammar, anchored the same way (column 0, so an\n * indented inner declaration never matches).\n *\n * @remarks\n * Scans only the {@link ExportKeyword} keywords (`function` / `class` / `const` / `interface` /\n * `type`) — a module-scope `let` or `var` is outside this scanner's declaration-keyword grammar\n * and out of this check's contract. Scanning uses {@link extractSourceLines}, so comment and\n * template payload is excluded while its uninterrupted column-zero head remains required;\n * preserved columns do not widen membership. `enum` is likewise outside this reflection\n * population, not forbidden by general package policy.\n *\n * @param source - The file's source text\n * @returns The file's hidden (non-exported) symbols, in file order\n *\n * @example\n * ```ts\n * extractHidden('function secretHelper() {}\\n') // [{ name: 'secretHelper', keyword: 'function' }]\n * extractHidden('export class X {}\\n') // []\n * ```\n */\nexport function extractHidden(source: string): readonly SurfaceSymbol[] {\n\tconst symbols: SurfaceSymbol[] = []\n\tconst seen = new Set<string>()\n\tconst lines = extractSourceLines(source)\n\tconst summaries = collectSummaries(lines)\n\n\tfor (const line of lines) {\n\t\tif (line.code.startsWith('export ')) continue\n\t\tconst match = line.code.match(/^(?:async )?(function\\*?|class|const|interface|type) (\\w+)/)\n\t\tconst rawKeyword = match?.[1]\n\t\tconst name = match?.[2]\n\t\tconst keyword = rawKeyword === undefined ? undefined : rawKeyword.replace(/\\*$/, '')\n\t\tif (!isNonEmptyString(keyword) || !isNonEmptyString(name) || !isExportKeyword(keyword)) continue\n\n\t\tconst key = `${keyword} ${name}`\n\t\tif (seen.has(key)) continue\n\t\tseen.add(key)\n\t\tconst summary = summaries.get(line)\n\t\tsymbols.push({ name, keyword, ...(summary === undefined ? {} : { summary }) })\n\t}\n\n\treturn symbols\n}\n\n/**\n * Computes the bracket depth of every character of projected declaration code: an opening `(`,\n * `[`, `{`, or `<` and its closing partner carry the depth outside the pair, the characters\n * between them one more, and every character of a quoted string, its quotes included, `-1`.\n *\n * @remarks\n * The `>` of an `=>` arrow closes nothing. A backslash escapes the next character inside a\n * quoted string. Template literal text is outside the reading, because\n * {@link extractSourceLines} masks it to spaces in the code this function reads.\n *\n * @param code - The projected code of one declaration\n * @returns One depth per UTF-16 code unit of `code`\n *\n * @example\n * ```ts\n * computeDepths(\"f(a, 'b')\") // [0, 0, 1, 1, 1, -1, -1, -1, 0]\n * ```\n */\nexport function computeDepths(code: string): readonly number[] {\n\tconst depths: number[] = []\n\tcode.split('').reduce<{\n\t\treadonly depth: number\n\t\treadonly quote: string | undefined\n\t\treadonly escaped: boolean\n\t}>(\n\t\t(state, character, index) => {\n\t\t\tif (state.quote !== undefined) {\n\t\t\t\tdepths.push(-1)\n\t\t\t\tif (state.escaped) return { ...state, escaped: false }\n\t\t\t\tif (character === '\\\\') return { ...state, escaped: true }\n\t\t\t\treturn character === state.quote ? { ...state, quote: undefined } : state\n\t\t\t}\n\t\t\tif (character === \"'\" || character === '\"') {\n\t\t\t\tdepths.push(-1)\n\t\t\t\treturn { ...state, quote: character }\n\t\t\t}\n\t\t\tif (')]}'.includes(character) || (character === '>' && code[index - 1] !== '=')) {\n\t\t\t\tconst depth = Math.max(0, state.depth - 1)\n\t\t\t\tdepths.push(depth)\n\t\t\t\treturn { ...state, depth }\n\t\t\t}\n\t\t\tdepths.push(state.depth)\n\t\t\treturn '([{<'.includes(character) ? { ...state, depth: state.depth + 1 } : state\n\t\t},\n\t\t{ depth: 0, quote: undefined, escaped: false },\n\t)\n\treturn depths\n}\n\n/**\n * Finds the index of the bracket closing the opener at `start`: the first later character whose\n * {@link computeDepths} depth equals the opener's.\n *\n * @param depths - The depths {@link computeDepths} returned for the code\n * @param start - The index of an opening `(`, `[`, `{`, or `<`\n * @returns The closing bracket's index, or `undefined` when the opener never closes\n *\n * @example\n * ```ts\n * findClosing(computeDepths('<T>(x: T)'), 3) // 8\n * ```\n */\nexport function findClosing(depths: readonly number[], start: number): number | undefined {\n\tconst depth = depths[start]\n\tif (depth === undefined || depth < 0) return undefined\n\tconst index = depths.findIndex((value, position) => position > start && value === depth)\n\treturn index < 0 ? undefined : index\n}\n\n/**\n * Finds every index at which `separator` sits at `depth` outside quoted text, in code order.\n *\n * @param code - The projected code to search\n * @param depths - The depths {@link computeDepths} returned for `code`\n * @param separator - The single character to find\n * @param depth - The bracket depth the separator must sit at\n * @returns The separator indices, in code order\n *\n * @example\n * ```ts\n * findSeparators('a, f(b, c)', computeDepths('a, f(b, c)'), ',', 0) // [1]\n * ```\n */\nexport function findSeparators(\n\tcode: string,\n\tdepths: readonly number[],\n\tseparator: string,\n\tdepth: number,\n): readonly number[] {\n\treturn depths\n\t\t.keys()\n\t\t.filter((index) => depths[index] === depth && code[index] === separator)\n\t\t.toArray()\n}\n\n/**\n * Renders one emitted interface member as its signature entry: a property as its name, an\n * optional one with `?`, a method as `name()` or `name?()`, an accessor as its name, and a call,\n * construct, or index signature as its own text with whitespace collapsed.\n *\n * @remarks\n * `code` is the member's projected code and `source` its text at the same columns, both without\n * the terminating `;`. A leading `readonly` modifier never enters a name. A computed name keeps\n * its brackets, and a quoted name keeps its quotes.\n *\n * @param code - The member's projected code\n * @param source - The member's source text, aligned with `code`\n * @returns The member's entry, or `undefined` when the member is empty\n *\n * @example\n * ```ts\n * renderMember('readonly name?: string', 'readonly name?: string') // 'name?'\n * renderMember('walk(depth: number): void', 'walk(depth: number): void') // 'walk()'\n * renderMember('[key: string]: number', '[key: string]: number') // '[key: string]: number'\n * ```\n */\nexport function renderMember(code: string, source: string): string | undefined {\n\tconst text = source.replace(/\\s+/g, ' ').trim()\n\tif (text.length === 0) return undefined\n\tconst leading = code.length - code.trimStart().length\n\tconst modifier = leading + (/^readonly\\s+/.exec(code.slice(leading))?.[0].length ?? 0)\n\tconst rest = code.slice(modifier)\n\tif (/^(?:new\\s*)?[(<]/.test(rest)) return text\n\tconst depths = computeDepths(rest)\n\tconst bracket = rest.startsWith('[') ? findClosing(depths, 0) : undefined\n\tif (\n\t\tbracket !== undefined &&\n\t\tfindSeparators(rest, depths, ':', 1).some((index) => index < bracket)\n\t) {\n\t\treturn text\n\t}\n\n\tconst accessor = /^(?:get|set)\\s+(?=[^\\s(:?<])/.exec(rest)?.[0].length ?? 0\n\tconst named = rest.slice(accessor)\n\tconst computed = named.startsWith('[') ? findClosing(computeDepths(named), 0) : undefined\n\tconst length =\n\t\tcomputed === undefined\n\t\t\t? (/^(?:\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|[^\\s?(:<]+)/.exec(named)?.[0].length ?? 0)\n\t\t\t: computed + 1\n\tif (length === 0) return text\n\n\tconst offset = modifier + accessor\n\tconst tail = named.slice(length)\n\tconst optional = tail.startsWith('?')\n\tconst method = accessor === 0 && /^\\??\\s*[(<]/.test(tail)\n\treturn `${source.slice(offset, offset + length)}${optional ? '?' : ''}${method ? '()' : ''}`\n}\n\n/**\n * Extracts one emitted declaration's signature: the symbol its column-zero `export` head names,\n * carrying the type text the compiler emitted for it.\n *\n * @remarks\n * `code` is the declaration's projected code and `source` its text at the same columns, each\n * physical line trimmed and the lines joined with single spaces. The forms:\n *\n * - `function`: `<T>(params) => RET` from `NAME<T>(params): RET`.\n * - `class`: `new <T>(params) => YIELD` per `constructor(params)`, several as an intersection of\n * parenthesized signatures, none as `new <T>() => YIELD`. `YIELD` is the first `implements`\n * type, else the class's own name with its type parameter names. Every other member is ignored.\n * - `interface`: `{ entries }` from {@link renderMember} over its own members, in emitted order,\n * each entry once, or `{}` when it declares none. The `extends` clause is not read.\n * - `type`: the text after `=` to the terminating `;`, type parameters omitted.\n * - `const`: the text after `NAME:` to the `;`, or after `NAME =` for a literal the compiler\n * emitted as the constant's type.\n *\n * @param code - The declaration's projected code\n * @param source - The declaration's source text, aligned with `code`\n * @returns The declared symbol with its signature, or `undefined` when no supported head opens it\n *\n * @example\n * ```ts\n * const text = 'export declare function walk<T>(node: T): void;'\n * extractSignature(text, text) // { name: 'walk', keyword: 'function', signature: '<T>(node: T) => void' }\n * ```\n */\nexport function extractSignature(code: string, source: string): SurfaceSymbol | undefined {\n\tconst head =\n\t\t/^export (?:declare )?(?:abstract )?(function|class|interface|type|const(?! enum\\b)) ([^\\s<(:=;{]+)/.exec(\n\t\t\tcode,\n\t\t)\n\tconst keyword = head?.[1]\n\tconst name = head?.[2]\n\tif (head === null || name === undefined || !isExportKeyword(keyword)) return undefined\n\n\tconst depths = computeDepths(code)\n\tconst start = head[0].length\n\tconst generic = code[start] === '<' ? findClosing(depths, start) : undefined\n\tconst typed = generic === undefined ? start : generic + 1\n\tconst generics = source.slice(start, typed)\n\tconst end = findSeparators(code, depths, ';', 0).find((index) => index >= typed) ?? code.length\n\n\tif (keyword === 'function') {\n\t\tconst close = code[typed] === '(' ? findClosing(depths, typed) : undefined\n\t\tif (close === undefined) return undefined\n\t\tconst colon = /^\\s*:/.exec(code.slice(close + 1))?.[0].length\n\t\tif (colon === undefined) return undefined\n\t\tconst returns = source.slice(close + 1 + colon, end).trim()\n\t\treturn {\n\t\t\tname,\n\t\t\tkeyword,\n\t\t\tsignature: `${generics}(${source.slice(typed + 1, close)}) => ${returns}`,\n\t\t}\n\t}\n\n\tif (keyword === 'const' || keyword === 'type') {\n\t\t// The separator alone, because the spaces after it can be masked template text.\n\t\tconst assigned = (keyword === 'const' ? /^\\s*[:=]/ : /^\\s*=/).exec(code.slice(typed))\n\t\tif (assigned === null) return undefined\n\t\treturn { name, keyword, signature: source.slice(typed + assigned[0].length, end).trim() }\n\t}\n\n\tconst open = findSeparators(code, depths, '{', 0).find((index) => index >= typed)\n\tconst close = open === undefined ? undefined : findClosing(depths, open)\n\tif (open === undefined || close === undefined) return undefined\n\tconst boundaries = [\n\t\topen,\n\t\t...findSeparators(code, depths, ';', 1).filter((index) => index > open && index < close),\n\t\tclose,\n\t]\n\tconst members = boundaries.slice(0, -1).map((boundary, position) => {\n\t\tconst next = boundaries[position + 1] ?? close\n\t\treturn { code: code.slice(boundary + 1, next), source: source.slice(boundary + 1, next) }\n\t})\n\n\tif (keyword === 'interface') {\n\t\tconst entries = Array.from(\n\t\t\tnew Set(\n\t\t\t\tmembers\n\t\t\t\t\t.map((member) => renderMember(member.code, member.source))\n\t\t\t\t\t.filter((entry) => entry !== undefined),\n\t\t\t),\n\t\t)\n\t\treturn { name, keyword, signature: entries.length === 0 ? '{}' : `{ ${entries.join(', ')} }` }\n\t}\n\n\tconst heritage = /\\bimplements\\b/.exec(code.slice(typed, open))\n\tconst implemented =\n\t\theritage === null || depths[typed + heritage.index] !== 0\n\t\t\t? undefined\n\t\t\t: typed + heritage.index + heritage[0].length\n\tconst comma =\n\t\timplemented === undefined\n\t\t\t? undefined\n\t\t\t: findSeparators(code, depths, ',', 0).find((index) => index > implemented && index < open)\n\tconst parameters =\n\t\tgeneric === undefined\n\t\t\t? []\n\t\t\t: [start, ...findSeparators(code, depths, ',', 1).filter((index) => index < generic)].map(\n\t\t\t\t\t(boundary, position, list) =>\n\t\t\t\t\t\t/^\\s*(?:(?:const|in|out)\\s+)*([^\\s=,>]+)/.exec(\n\t\t\t\t\t\t\tcode.slice(boundary + 1, list[position + 1] ?? generic),\n\t\t\t\t\t\t)?.[1] ?? '',\n\t\t\t\t)\n\tconst yielded =\n\t\timplemented === undefined\n\t\t\t? `${name}${parameters.length === 0 ? '' : `<${parameters.join(', ')}>`}`\n\t\t\t: source.slice(implemented, comma ?? open).trim()\n\tconst constructors = members\n\t\t.filter((member) =>\n\t\t\t/^\\s*(?:(?:public|private|protected)\\s+)?constructor\\s*\\(/.test(member.code),\n\t\t)\n\t\t.map((member) => {\n\t\t\tconst parenthesis = member.code.indexOf('(')\n\t\t\tconst closed = findClosing(computeDepths(member.code), parenthesis) ?? member.code.length\n\t\t\treturn `new ${generics}(${member.source.slice(parenthesis + 1, closed)}) => ${yielded}`\n\t\t})\n\treturn {\n\t\tname,\n\t\tkeyword,\n\t\tsignature:\n\t\t\tconstructors.length === 0\n\t\t\t\t? `new ${generics}() => ${yielded}`\n\t\t\t\t: constructors.length === 1\n\t\t\t\t\t? (constructors[0] ?? '')\n\t\t\t\t\t: constructors.map((entry) => `(${entry})`).join(' & '),\n\t}\n}\n\n/**\n * Extracts every signature one compiler-emitted declaration file declares: each column-zero\n * `export` head read through {@link extractSignature}, an overload set's emitted heads joined in\n * order as an intersection of parenthesized signatures.\n *\n * @remarks\n * The text is read through {@link extractSourceLines}, so comment and template payload never\n * opens or closes a bracket. Each physical line is trimmed and a declaration's lines are joined\n * with single spaces, so a multi-line emitted type reads as one line. A head the projector does\n * not support, such as an `enum` or a re-export, contributes nothing. Every other repeated head\n * keeps its first signature.\n *\n * @param declaration - The emitted `.d.ts` text\n * @returns The declared symbols with their signatures, in first-seen order\n *\n * @example\n * ```ts\n * extractSignatures('export declare function open(id: string): boolean;\\nexport declare function open(ids: readonly string[]): boolean;\\n')\n * // [{ name: 'open', keyword: 'function', signature: '((id: string) => boolean) & ((ids: readonly string[]) => boolean)' }]\n * ```\n */\nexport function extractSignatures(declaration: string): readonly SurfaceSymbol[] {\n\tconst records = extractSourceLines(declaration)\n\t\t.map((line) => {\n\t\t\tconst start = line.code.length - line.code.trimStart().length\n\t\t\tconst end = line.code.trimEnd().length\n\t\t\treturn {\n\t\t\t\tcode: line.code.slice(start, end),\n\t\t\t\tsource: line.source.slice(start, end),\n\t\t\t\thead: start === 0 && line.code.startsWith('export '),\n\t\t\t}\n\t\t})\n\t\t.filter((record) => record.code.length > 0)\n\tconst heads = records\n\t\t.keys()\n\t\t.filter((index) => records[index]?.head === true)\n\t\t.toArray()\n\tconst symbols = heads\n\t\t.map((head, position) => {\n\t\t\tconst segment = records.slice(head, heads[position + 1] ?? records.length)\n\t\t\treturn extractSignature(\n\t\t\t\tsegment.map((record) => record.code).join(' '),\n\t\t\t\tsegment.map((record) => record.source).join(' '),\n\t\t\t)\n\t\t})\n\t\t.filter((symbol) => symbol !== undefined)\n\n\treturn Array.from(new Set(symbols.map(computeSymbolKey))).flatMap((key) => {\n\t\tconst declared = symbols.filter((symbol) => computeSymbolKey(symbol) === key)\n\t\tconst [first] = declared\n\t\tif (first === undefined) return []\n\t\tif (first.keyword !== 'function' || declared.length === 1) return [first]\n\t\treturn [\n\t\t\t{\n\t\t\t\t...first,\n\t\t\t\tsignature: declared.map((symbol) => `(${symbol.signature ?? ''})`).join(' & '),\n\t\t\t},\n\t\t]\n\t})\n}\n\n/**\n * Joins the declaration head starting at `start` into one space-separated\n * line, consuming lines until the first that opens a body: one that ends with\n * `{`, or one that closes an empty body with `{}` or `{ }`.\n *\n * @remarks\n * A line ending with `{}` closes an empty body only when every angle, round,\n * and square bracket the head opened outside quoted text has closed; inside\n * one, `{}` is a type or an argument, and an arrow's `=>` closes nothing. A\n * head that reaches the next column-zero `export` line opens no body.\n *\n * @param lines - The file's source lines\n * @param start - The index of the head's first line\n * @returns The joined head, or `undefined` when no line opens a body\n *\n * @example\n * ```ts\n * joinHead(['export class X {'], 0) // { text: 'export class X {', end: 0 }\n * joinHead(['export interface Y extends X {}'], 0) // { text: 'export interface Y extends X {}', end: 0 }\n * ```\n */\nexport function joinHead(lines: readonly string[], start: number): DeclarationHead | undefined {\n\tconst parts: string[] = []\n\tfor (const distance of Array.prototype.keys.call({\n\t\tget length() {\n\t\t\treturn Math.max(0, Math.ceil(lines.length - start))\n\t\t},\n\t})) {\n\t\tconst index = start + distance\n\t\tconst line = lines[index]\n\t\tif (line === undefined) break\n\t\tconst text = line.trimEnd()\n\t\tif (index > start && text.startsWith('export ')) return undefined\n\t\tparts.push(index === start ? text : text.trimStart())\n\t\tif (text.endsWith('{')) return { text: parts.join(' '), end: index }\n\t\tconst bare = parts.join(' ').replace(/'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"/g, '')\n\t\tconst closed =\n\t\t\t(bare.match(/</g)?.length ?? 0) <= (bare.match(/(?<!=)>/g)?.length ?? 0) &&\n\t\t\t(bare.match(/\\(/g)?.length ?? 0) <= (bare.match(/\\)/g)?.length ?? 0) &&\n\t\t\t(bare.match(/\\[/g)?.length ?? 0) <= (bare.match(/\\]/g)?.length ?? 0)\n\t\tif (closed && /\\{\\s*\\}$/.test(text)) return { text: parts.join(' '), end: index }\n\t}\n\treturn undefined\n}\n\n/**\n * Escapes every regex metacharacter in a literal string so it reads as text\n * inside a larger `RegExp` source rather than as syntax.\n *\n * @remarks\n * A caller-supplied name reaches a `RegExp` through this: {@link\n * findUnexampled} splices it into a word-boundary search, so a name carrying\n * `$`, `(`, `[`, or `.` matches that character literally instead of throwing or\n * matching text it does not name. Pure and total; never throws.\n *\n * @param value - The literal string to escape\n * @returns `value` with every regex metacharacter backslash-escaped\n *\n * @example\n * ```ts\n * escapeRegExp('A.B') // 'A\\\\.B'\n * new RegExp(`^${escapeRegExp('A.B')}$`).test('AxB') // false\n * ```\n */\nexport function escapeRegExp(value: string): string {\n\treturn value.replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n}\n\n/**\n * Collects every `export class` / `export interface` declaration one file's source text declares,\n * each keyed `${keyword} ${name}` and carrying the body lines and the base identifiers read from\n * its own head, so a body and a heritage clause always come from the same declaration.\n *\n * @remarks\n * The whole file is projected once through {@link extractSourceLines} and every head is read from\n * that one projection, so a scope resolving many names reads each file once rather than once per\n * name. A head is a column-zero `export class` / `export interface` line, an oxfmt-wrapped\n * signature joined through {@link joinHead}, with an optional generic parameter list and an\n * optional heritage clause between the identifier and the opening `{`; the identifier is the head's\n * own run up to that list or clause, so it enters the key as literal text and no name reaches a\n * `RegExp`. Body lines are the raw source between the head and the first projected column-zero `}`,\n * keeping JSDoc evidence intact; a head whose last line closes its own body with `{}` or `{ }`\n * records an empty body. Every balanced `<...>` span is removed from the head before its\n * `extends` clause is read, so a `T extends Base` type parameter is never a base and `Base<T>`\n * reads as `Base`; a class's `implements` clause and everything after it is excluded, and a\n * qualified base such as `namespace.Base` is returned verbatim. The first head of a key that opens\n * a column-zero close answers for that key: a head that opens none records nothing, and a later\n * head of a key already collected adds nothing unless the earlier head recorded neither a body\n * nor bases, which declares nothing as {@link Source} reads it, so the later head replaces it.\n *\n * @param source - The file's source text to read\n * @returns One entry per collected declaration, keyed `${keyword} ${name}`\n *\n * @example\n * ```ts\n * collectDeclarations('export interface X extends Y {\\n\\twalk(): void\\n}\\n').get('interface X')\n * // { body: ['\\twalk(): void'], bases: ['Y'] }\n * ```\n */\nexport function collectDeclarations(source: string): ReadonlyMap<string, Declaration> {\n\tconst declarations = new Map<string, Declaration>()\n\tconst opener = /^export (?:class|interface) /\n\tconst grammar = /^export (class|interface) ([^\\s<]+)(?:<.*>)?(?: .*)? \\{(?:\\s*\\})?$/\n\tconst lines = extractSourceLines(source)\n\tconst projected = lines.map((line) => line.code)\n\n\tfor (const index of projected.keys()) {\n\t\tconst line = projected[index]\n\t\tif (line === undefined || !opener.test(line)) continue\n\n\t\tconst head = joinHead(projected, index)\n\t\tif (head === undefined) continue\n\t\tconst declared = grammar.exec(head.text)\n\t\tconst keyword = declared?.[1]\n\t\tconst name = declared?.[2]\n\t\tif (keyword === undefined || name === undefined) continue\n\n\t\tconst key = `${keyword} ${name}`\n\t\tconst known = declarations.get(key)\n\t\t// A head with neither a body nor bases declares nothing, as Source reads it, so a later head answers.\n\t\tif (known !== undefined && (known.body.length > 0 || known.bases.length > 0)) continue\n\n\t\tconst visible: string[] = []\n\t\tIterator.from(head.text.slice(`export ${key}`.length, head.text.lastIndexOf('{'))).reduce(\n\t\t\t(depth, character) => {\n\t\t\t\tif (character === '<') return depth + 1\n\t\t\t\tif (character === '>') return Math.max(0, depth - 1)\n\t\t\t\tif (depth === 0) visible.push(character)\n\t\t\t\treturn depth\n\t\t\t},\n\t\t\t0,\n\t\t)\n\t\tconst flat = visible.join('')\n\t\tconst clause = flat.replace(/\\bimplements\\b[\\s\\S]*$/, '').match(/\\bextends\\b([\\s\\S]*)$/)?.[1]\n\t\tconst bases =\n\t\t\tclause === undefined\n\t\t\t\t? []\n\t\t\t\t: clause\n\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t.map((base) => base.trim())\n\t\t\t\t\t\t.filter(isNonEmptyString)\n\n\t\t// joinHead ends a head on `}` only where its line closes an empty body, so no close follows it.\n\t\tif (head.text.endsWith('}')) {\n\t\t\tdeclarations.set(key, { body: [], bases })\n\t\t\tcontinue\n\t\t}\n\n\t\tconst close = Array.prototype.keys\n\t\t\t.call({ length: projected.length - head.end - 1 })\n\t\t\t.map((distance) => head.end + 1 + distance)\n\t\t\t.find((candidate) => projected[candidate] === '}')\n\t\tif (close !== undefined)\n\t\t\tdeclarations.set(key, {\n\t\t\t\tbody: lines.slice(head.end + 1, close).map((record) => record.source),\n\t\t\t\tbases,\n\t\t\t})\n\n\t\t// An unterminated body records nothing — keep scanning in case a later head closes.\n\t}\n\n\treturn declarations\n}\n\n/**\n * Locates the named `export class` / `export interface` declaration in one file's source text\n * and returns its body lines and its base identifiers read from that one head, so a body and a\n * heritage clause always come from the same declaration, or `undefined` when the file declares\n * no such head.\n *\n * @remarks\n * The one named lookup over {@link collectDeclarations}, which owns the head grammar, the body\n * window, and the base reading. This lookup spells the map's `${keyword} ${name}` key for its\n * caller, so a consumer reading one name never writes that convention itself. `name` is compared\n * as literal text against the identifier the head itself carries, so a metacharacter in `name`\n * names that character rather than matching text it does not name. Every call collects the whole\n * file afresh: a consumer reading many names from one file calls {@link collectDeclarations} once\n * and reads the map, and {@link Source} holds one such map per module scope.\n *\n * @param source - The file's source text to search\n * @param keyword - Whether to look for a `class` or an `interface`\n * @param name - The declaration's identifier\n * @returns Its body and bases, or `undefined` when `source` declares no such head\n *\n * @example\n * ```ts\n * extractDeclaration('export interface X extends Y {\\n\\twalk(): void\\n}\\n', 'interface', 'X')\n * // { body: ['\\twalk(): void'], bases: ['Y'] }\n * ```\n */\nexport function extractDeclaration(\n\tsource: string,\n\tkeyword: DeclarationKeyword,\n\tname: string,\n): Declaration | undefined {\n\treturn collectDeclarations(source).get(`${keyword} ${name}`)\n}\n\n/**\n * Selects the member lines declaring a callable member: plain, `async`, generator\n * (`*`), and optional (`records?(`) methods all count; getters, setters,\n * `static` members, and `#` privates never do (their keyword or `#` breaks\n * the `name(` shape). The grammar is {@link collectKeys}'s, read once over\n * {@link extractBodyLines}'s projection of the body, so commented method-like payload never\n * becomes eligible and each member keys to the owner head that projection supplies. Each member\n * carries its own doc block's description paragraph, read through {@link collectSummaries}; the\n * first declaration of a name answers for it.\n *\n * @param lines - A declaration's body lines\n * @returns The declared members, deduplicated by name and sorted by name\n *\n * @example\n * ```ts\n * extractMemberMethods(['\\tmap(): void', '\\tfilter(): void']) // [{ name: 'filter' }, { name: 'map' }]\n * ```\n */\nexport function extractMemberMethods(lines: readonly string[]): readonly MethodEntry[] {\n\tconst methods = new Map<string, MethodEntry>()\n\tconst projected = extractBodyLines(lines)\n\tconst summaries = collectSummaries(projected)\n\tconst keys = collectKeys(projected)\n\n\tfor (const line of projected) {\n\t\t// A member key is `${owner}.${member}`, so its dot splits the member name back out and a\n\t\t// declaration key, which carries none, drops out here.\n\t\tconst key = keys.get(line) ?? ''\n\t\tconst dot = key.indexOf('.')\n\t\tif (dot < 0) continue\n\n\t\tconst name = key.slice(dot + 1)\n\t\tif (methods.has(name)) continue\n\t\tconst summary = summaries.get(line)\n\t\tmethods.set(name, { name, ...(summary === undefined ? {} : { summary }) })\n\t}\n\n\treturn Array.from(methods.values()).sort((a, b) =>\n\t\ta.name === b.name ? 0 : a.name < b.name ? -1 : 1,\n\t)\n}\n\n/**\n * Selects the block nodes under the named `##` heading, up to the next `##`-or-higher\n * heading (or the document's end) — the section-scoping window `extractSurface` /\n * `extractMethods` walk over.\n *\n * @param document - The parsed guide document\n * @param heading - The `##` heading text to scope to, for example `Surface`\n * @returns The blocks belonging to that section, in document order\n *\n * @example\n * ```ts\n * selectSectionBlocks(document, 'Surface') // the blocks between `## Surface` and the next `##`\n * ```\n */\nexport function selectSectionBlocks(\n\tdocument: MarkdownDocument,\n\theading: string,\n): readonly BlockNode[] {\n\tconst scanned: Array<{\n\t\treadonly block: BlockNode\n\t\treadonly active: boolean\n\t\treadonly heading: boolean\n\t}> = []\n\tfor (const block of document.children) {\n\t\tconst active = scanned.at(-1)?.active ?? false\n\t\tif (isHeadingNode(block) && block.level <= 2) {\n\t\t\tif (block.level === 2 && flattenText(block).trim() === heading) {\n\t\t\t\tscanned.push({ block, active: true, heading: true })\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (active) break\n\t\t}\n\t\tscanned.push({ block, active, heading: false })\n\t}\n\treturn scanned.filter((entry) => entry.active && !entry.heading).map((entry) => entry.block)\n}\n\n/**\n * Validates every `## Surface` table a guide carries: each header must be exactly\n * {@link SURFACE_HEADER}, and each row that keys a symbol must carry a non-empty `Signature` cell.\n *\n * @remarks\n * Reads each `## Surface` section through {@link selectSectionBlocks}, a repeated section\n * included, and refuses at the first offending table in document order, through {@link GuideError} with code\n * `header` for a nonuniform header and `signature` for a keyed empty cell. Header and row text in\n * the message is JSON-encoded and capped at 200 characters.\n *\n * @param document - The parsed guide document\n * @throws {@link GuideError} at the first nonuniform header or keyed empty Signature cell\n *\n * @example\n * ```ts\n * validateSurface(createMarkdown('## Surface\\n\\n| Name | Kind |\\n| --- | --- |').document)\n * // throws GuideError: ## Surface table 1 has header \"Name | Kind\"; expected \"Name | Kind | Signature | Summary\".\n * ```\n */\nexport function validateSurface(document: MarkdownDocument): void {\n\tconst expected = SURFACE_HEADER.join(' | ')\n\tconst signed = SURFACE_HEADER.indexOf(SIGNATURE)\n\tconst tables = new Set(\n\t\tdocument.children\n\t\t\t.flatMap((block, start) =>\n\t\t\t\tisHeadingNode(block) && block.level === 2 && flattenText(block).trim() === SURFACE\n\t\t\t\t\t? selectSectionBlocks({ ...document, children: document.children.slice(start) }, SURFACE)\n\t\t\t\t\t: [],\n\t\t\t)\n\t\t\t.filter(isTableNode),\n\t)\n\tfor (const [index, table] of Array.from(tables).entries()) {\n\t\tconst header = table.header.map((children) =>\n\t\t\tflattenText({ element: 'paragraph', children }).trim(),\n\t\t)\n\t\tif (\n\t\t\theader.length !== SURFACE_HEADER.length ||\n\t\t\t!SURFACE_HEADER.every((name, column) => header[column] === name)\n\t\t) {\n\t\t\tthrow new GuideError(\n\t\t\t\t`## Surface table ${index + 1} has header ${JSON.stringify(header.join(' | ').slice(0, 200))}; expected ${JSON.stringify(expected)}.`,\n\t\t\t\t'header',\n\t\t\t)\n\t\t}\n\t\tfor (const position of table.rows.keys()) {\n\t\t\tconst symbol = extractRowSymbol(table, position)\n\t\t\tif (symbol === undefined) continue\n\t\t\tconst cell = table.rows[position]?.[signed]\n\t\t\tif (\n\t\t\t\tcell !== undefined &&\n\t\t\t\tflattenText({ element: 'paragraph', children: cell }).trim().length > 0\n\t\t\t)\n\t\t\t\tcontinue\n\t\t\tthrow new GuideError(\n\t\t\t\t`## Surface table ${index + 1} row ${position + 1} (${JSON.stringify(`${symbol.keyword} ${symbol.name}`.slice(0, 200))}) has an empty Signature cell; expected a non-empty TypeScript signature code span under ${JSON.stringify(expected)}.`,\n\t\t\t\t'signature',\n\t\t\t)\n\t\t}\n\t}\n}\n\n/**\n * Validates that the modules one manifest entry spans declare disjoint exports: one name exported\n * from two modules, whatever its keyword, is one capability split across environments.\n *\n * @remarks\n * Each source file answers for the most specific listed module directory that contains it, so a\n * nested module listed beside its parent never collides with itself. Logic that serves several\n * environments lives once in its layer's `core` directory, such as `src/core` or `app/core`;\n * environments whose internals differ each export a distinct name. Every colliding name is\n * reported in one refusal, in key order, each with every module that declares it; name and module\n * text is JSON-encoded and capped at 200 characters.\n *\n * @param files - The workspace-relative inventory the modules are read from\n * @param module - The manifest entry's source scope\n * @throws {@link GuideError} with code `collision` naming each name and the modules that declare it\n *\n * @example\n * ```ts\n * validateModules(\n * \t{ 'src/core/a.ts': 'export function open() {}', 'src/server/a.ts': 'export function open() {}' },\n * \t['src/core', 'src/server'],\n * )\n * // throws GuideError: \"open\" is declared in \"src/core\" and \"src/server\"; …\n * ```\n */\nexport function validateModules(\n\tfiles: Readonly<Record<string, string>>,\n\tmodule: GuideModule,\n): void {\n\tconst directories = normalizeDirectories(module)\n\tconst declared = selectModuleKeys(files, directories).flatMap((key) => {\n\t\tconst owner = directories\n\t\t\t.filter((directory) => directory === '.' || key.startsWith(`${directory}/`))\n\t\t\t.reduce((current, directory) => (directory.length > current.length ? directory : current), '')\n\t\treturn extractExports(files[key] ?? '').map((symbol) => ({\n\t\t\tkey: symbol.name,\n\t\t\towner,\n\t\t}))\n\t})\n\tconst collisions = Array.from(new Set(declared.map((entry) => entry.key)))\n\t\t.sort()\n\t\t.map((key) => ({\n\t\t\tkey,\n\t\t\towners: directories.filter((directory) =>\n\t\t\t\tdeclared.some((entry) => entry.key === key && entry.owner === directory),\n\t\t\t),\n\t\t}))\n\t\t.filter((collision) => collision.owners.length > 1)\n\tif (collisions.length === 0) return\n\tconst named = collisions.map(\n\t\t(collision) =>\n\t\t\t`${JSON.stringify(collision.key.slice(0, 200))} is declared in ${collision.owners.map((owner) => JSON.stringify(owner.slice(0, 200))).join(' and ')}`,\n\t)\n\tconst cores = Array.from(\n\t\tnew Set(\n\t\t\tcollisions.flatMap((collision) =>\n\t\t\t\tcollision.owners\n\t\t\t\t\t.filter((owner) => owner !== '.')\n\t\t\t\t\t.map((owner) => `${owner.replace(/\\/.*$/u, '').slice(0, 200)}/core`),\n\t\t\t),\n\t\t),\n\t).sort()\n\tthrow new GuideError(\n\t\t`${named.join('; ')}; one name exported from two environments is a conflict. Declare logic both environments share once in ${cores.join(' or ')}, and give each environment's own logic a distinct name.`,\n\t\t'collision',\n\t\t{\n\t\t\tcontext: {\n\t\t\t\tcollisions: collisions.map((collision) => ({\n\t\t\t\t\tname: collision.key,\n\t\t\t\t\tmodules: collision.owners,\n\t\t\t\t})),\n\t\t\t},\n\t\t},\n\t)\n}\n\n/**\n * Extracts one `## Surface` table row's symbol — its column 0 code span as the name, its\n * {@link KIND} column as the keyword, and its exact `Signature` and {@link SUMMARY} columns as\n * normalized text when those columns exist. Empty cells remain absent. A row with no code-span\n * name and a row whose `Kind` text is\n * no {@link ExportKeyword} have no symbol to key, so each returns `undefined`.\n *\n * @param table - The table to read\n * @param row - The index of the row within {@link TableNode.rows}\n * @returns The row's symbol, or `undefined` when the row keys none\n *\n * @example\n * ```ts\n * extractRowSymbol(table, 0) // { name: 'walk', keyword: 'function', summary: 'Walks the tree.' }\n * ```\n */\nexport function extractRowSymbol(table: TableNode, row: number): SurfaceSymbol | undefined {\n\tconst cells = table.rows[row]\n\tif (cells === undefined) return undefined\n\n\tconst nameCell = cells[0]\n\tconst rawName = nameCell === undefined ? undefined : findFirstCode(nameCell)\n\tconst name = rawName === undefined ? undefined : normalizeIdentifier(rawName)\n\tif (name === undefined) return undefined\n\n\tconst column = findColumnIndex(table, KIND)\n\tconst kindCell = column === undefined ? undefined : cells[column]\n\tconst keyword =\n\t\tkindCell === undefined ? '' : flattenText({ element: 'paragraph', children: kindCell }).trim()\n\tif (!isExportKeyword(keyword)) return undefined\n\n\tconst summary = extractRowSummary(table, row)\n\tconst signed = findColumnIndex(table, SIGNATURE)\n\tconst signatureCell = signed === undefined ? undefined : cells[signed]\n\tconst signature =\n\t\tsignatureCell === undefined ? '' : normalizeSummary(extractCellText(signatureCell))\n\treturn {\n\t\tname,\n\t\tkeyword,\n\t\t...(signature.length === 0 ? {} : { signature }),\n\t\t...(summary === undefined ? {} : { summary }),\n\t}\n}\n\n/**\n * Extracts one `## Methods` table row's entry — its column 0 code span as the name and its\n * {@link SUMMARY} column as the compared summary when the table has that column. A row with no\n * code-span name has no member to key, so it returns `undefined`.\n *\n * @param table - The table to read\n * @param row - The index of the row within {@link TableNode.rows}\n * @returns The row's entry, or `undefined` when the row keys none\n *\n * @example\n * ```ts\n * extractRowEntry(table, 0) // { name: 'walk', summary: 'Walks the tree.' }\n * ```\n */\nexport function extractRowEntry(table: TableNode, row: number): MethodEntry | undefined {\n\tconst cells = table.rows[row]\n\tif (cells === undefined) return undefined\n\n\tconst cell = cells[0]\n\tconst rawName = cell === undefined ? undefined : findFirstCode(cell)\n\tconst name = rawName === undefined ? undefined : normalizeIdentifier(rawName)\n\tif (name === undefined) return undefined\n\n\tconst summary = extractRowSummary(table, row)\n\treturn { name, ...(summary === undefined ? {} : { summary }) }\n}\n\n/**\n * Extracts one row's compared summary — its {@link SUMMARY} column read through\n * {@link extractCellText} and {@link normalizeSummary}. A table with no such column and a row\n * whose cell is empty each carry no summary and return `undefined` rather than an empty string,\n * so {@link findDrift} reports the absence.\n *\n * @param table - The table to read\n * @param row - The index of the row within {@link TableNode.rows}\n * @returns The row's compared summary, or `undefined` when it carries none\n *\n * @example\n * ```ts\n * extractRowSummary(table, 0) // 'Walks the tree.'\n * ```\n */\nexport function extractRowSummary(table: TableNode, row: number): string | undefined {\n\tconst described = findColumnIndex(table, SUMMARY)\n\tconst cells = table.rows[row]\n\tconst cell = described === undefined || cells === undefined ? undefined : cells[described]\n\tconst summary = cell === undefined ? '' : normalizeSummary(extractCellText(cell))\n\treturn summary.length === 0 ? undefined : summary\n}\n\n/**\n * Extracts every `## Surface` identifier the guide documents — each table row's column 0\n * code span (the name) paired with its `Kind` column (located by header text), unioned with every\n * H3 entity heading whose trimmed compared inline content is exactly its backticked code-span\n * name, deduped by {@link computeSymbolKey}. A row with no code-span name has no name to key a\n * symbol on, so this reader skips it and {@link extractUnnamed} reports it; a row with an\n * unrecognized `Kind` text is skipped. A row also carries its {@link SUMMARY} column's compared\n * text when the table has that column; a table without it leaves every row's summary absent,\n * which {@link findDrift} reports. The exact `Signature` column contributes normalized signature\n * text, including code spans, when present and non-empty; no other header supplies it.\n *\n * @remarks\n * The heading boundary compares {@link extractCellText} with the raw value from\n * {@link findFirstCode} before {@link normalizeIdentifier} strips a generic annotation.\n * Surrounding spaces, emphasis, and links preserve that identity. This reader refuses a heading\n * carrying any other visible text or an additional code span. Entries retain encounter order, and\n * the first-seen name + keyword wins: a genuine heading before its table row keeps the heading's\n * class entry without signature or summary, while a preceding table row keeps both cells.\n *\n * @param document - The parsed guide document\n * @returns The documented surface, in encounter order\n *\n * @example\n * ```ts\n * extractSurface(document) // [{ name: 'Markdown', keyword: 'class' }, ...]\n * ```\n */\nexport function extractSurface(document: MarkdownDocument): readonly SurfaceSymbol[] {\n\tconst symbols: SurfaceSymbol[] = []\n\tconst seen = new Set<string>()\n\n\tfor (const block of selectSectionBlocks(document, SURFACE)) {\n\t\tif (isTableNode(block)) {\n\t\t\tfor (const row of block.rows.keys()) {\n\t\t\t\tconst symbol = extractRowSymbol(block, row)\n\t\t\t\tif (symbol === undefined) continue\n\t\t\t\tconst key = computeSymbolKey(symbol)\n\t\t\t\tif (seen.has(key)) continue\n\t\t\t\tseen.add(key)\n\t\t\t\tsymbols.push(symbol)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif (isHeadingNode(block) && block.level === 3) {\n\t\t\tconst rawName = findFirstCode(block.children)\n\t\t\tif (rawName === undefined || extractCellText(block.children).trim() !== `\\`${rawName}\\``) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst name = normalizeIdentifier(rawName)\n\t\t\tconst symbol: SurfaceSymbol = { name, keyword: 'class' }\n\t\t\tconst key = computeSymbolKey(symbol)\n\t\t\tif (seen.has(key)) continue\n\t\t\tseen.add(key)\n\t\t\tsymbols.push(symbol)\n\t\t}\n\t}\n\n\treturn symbols\n}\n\n/**\n * Extracts one {@link MethodGroup} per documented behavioral interface in `## Methods` —\n * an H4 with a code span sets the current interface, and the table immediately\n * following becomes its documented methods. A row with no code-span name has no name to key a\n * member on, so this reader skips it and {@link extractUnnamed} reports it. Each row carries its\n * {@link SUMMARY} column's compared text when the table has that column.\n *\n * @param document - The parsed guide document\n * @returns The documented method groups, in document order\n *\n * @example\n * ```ts\n * extractMethods(document) // [{ interface: 'MarkdownInterface', methods: [{ name: 'walk' }] }]\n * ```\n */\nexport function extractMethods(document: MarkdownDocument): readonly MethodGroup[] {\n\tconst groups: MethodGroup[] = []\n\n\tfor (const [table, name] of collectGroups(document)) {\n\t\tconst methods: MethodEntry[] = []\n\t\tfor (const row of table.rows.keys()) {\n\t\t\tconst entry = extractRowEntry(table, row)\n\t\t\tif (entry !== undefined) methods.push(entry)\n\t\t}\n\t\tgroups.push({ interface: name, methods })\n\t}\n\n\treturn groups\n}\n\n/**\n * Collects each `## Methods` table keyed to the interface its `####` heading names — an H4\n * carrying a code span sets the current interface and the table immediately following claims it,\n * so a heading with no table and a table with no heading before it contribute nothing. The map\n * iterates in document order and a node keys itself, so a repeated identical table keeps its own\n * entry.\n *\n * @param document - The parsed guide document\n * @returns One entry per documented `## Methods` table, in document order\n *\n * @example\n * ```ts\n * collectGroups(document).values().next().value // 'GuideInterface'\n * ```\n */\nexport function collectGroups(document: MarkdownDocument): ReadonlyMap<TableNode, string> {\n\tconst groups: Array<readonly [TableNode, string]> = []\n\tselectSectionBlocks(document, METHODS).reduce<string | undefined>((current, block) => {\n\t\tif (isHeadingNode(block) && block.level === 4) {\n\t\t\tconst name = findFirstCode(block.children)\n\t\t\treturn name === undefined ? undefined : normalizeIdentifier(name)\n\t\t}\n\t\tif (isTableNode(block) && current !== undefined) {\n\t\t\tgroups.push([block, current])\n\t\t\treturn undefined\n\t\t}\n\t\treturn current\n\t}, undefined)\n\treturn new Map(groups)\n}\n\n/**\n * Extracts every `## Surface` or `## Methods` table row whose first cell carries no code span.\n * {@link extractSurface} and {@link extractMethods} skip such a row, because a row with no\n * name gives them nothing to key a symbol or a member on, and this projection is what reports\n * the skip. Each entry is the row's cells read through {@link extractCellText} and joined\n * by ` | `, so a reader can locate the row in the guide; the `## Surface` rows come first,\n * then the `## Methods` rows, each in document order. {@link GuideInterface.unnamed} caches it.\n *\n * @param document - The parsed guide document\n * @returns One entry per row carrying no code-span name\n *\n * @example\n * ```ts\n * extractUnnamed(document) // ['Widget | class | Represents a widget.']\n * ```\n */\nexport function extractUnnamed(document: MarkdownDocument): readonly string[] {\n\tconst unnamed: string[] = []\n\n\tfor (const heading of [SURFACE, METHODS]) {\n\t\tfor (const block of selectSectionBlocks(document, heading)) {\n\t\t\tif (!isTableNode(block)) continue\n\t\t\tfor (const row of block.rows) {\n\t\t\t\tconst cell = row[0]\n\t\t\t\tif (cell !== undefined && findFirstCode(cell) !== undefined) continue\n\t\t\t\tunnamed.push(row.map((content) => extractCellText(content)).join(' | '))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn unnamed\n}\n\n/**\n * Extracts every link href in the guide document, including table cells — a full,\n * depth-first walk of the whole AST.\n *\n * @param document - The parsed guide document\n * @returns Every link's href, in walk order\n *\n * @example\n * ```ts\n * extractLinks(document) // ['../../src/core/helpers.ts', 'https://example.com']\n * ```\n */\nexport function extractLinks(document: MarkdownDocument): readonly string[] {\n\tconst links: string[] = []\n\tfor (const node of walkNodes(document)) {\n\t\tif (isLinkNode(node)) links.push(node.href)\n\t}\n\treturn links\n}\n\n/**\n * Extracts the relative test links declared under `## Tests` — every link href found\n * within that section only.\n *\n * @param document - The parsed guide document\n * @returns The `## Tests` section's link hrefs, in walk order\n *\n * @example\n * ```ts\n * extractTests(document) // ['../../tests/src/core/Markdown.test.ts', ...]\n * ```\n */\nexport function extractTests(document: MarkdownDocument): readonly string[] {\n\tconst links: string[] = []\n\tfor (const block of selectSectionBlocks(document, TESTS)) {\n\t\tfor (const node of walkNodes(block)) {\n\t\t\tif (isLinkNode(node)) links.push(node.href)\n\t\t}\n\t}\n\treturn links\n}\n\n/**\n * Returns the canonical body of one genuine JSDoc span — the `/**` opener, the closing\n * marker, each line's continuation marker, and the block's leading indentation removed,\n * with per-line trailing whitespace trimmed and the surrounding blank lines dropped. A\n * line's own indentation beyond the marker is kept, so an `@example` fence body keeps the\n * shape it was written in.\n *\n * @param comment - One complete genuine JSDoc span's raw text\n * @returns The span's unwrapped body\n *\n * @example\n * ```ts\n * normalizeComment('/**' + ' Creates a widget. *' + '/') // 'Creates a widget.'\n * ```\n */\nexport function normalizeComment(comment: string): string {\n\treturn unwrapComment(comment).join('\\n').replace(/^\\n+/, '').replace(/\\n+$/, '')\n}\n\n/**\n * Unwraps one genuine JSDoc span into one content line per physical line — the `/**` opener,\n * the closing marker, each line's continuation marker, and per-line trailing whitespace removed,\n * with a line's own indentation past the marker kept. The result is aligned with\n * `comment.split('\\n')`, so an index found in it addresses the same physical line of the span it\n * was built from, which is what lets a rewrite keep every line it does not replace.\n * {@link normalizeComment} is this projection joined and trimmed at its ends.\n *\n * @param comment - One complete genuine JSDoc span's raw text\n * @returns One content line per physical line of the span\n *\n * @example\n * ```ts\n * unwrapComment('/**' + '\\n * Walks.\\n *' + '/') // ['', 'Walks.', '']\n * ```\n */\nexport function unwrapComment(comment: string): readonly string[] {\n\tconst body = /^[ \\t]*\\/\\*([\\s\\S]*?)\\*\\/[ \\t]*$/.exec(comment)?.[1] ?? comment\n\treturn body.split('\\n').map((line) => line.replace(/^[ \\t]*\\*[ \\t]?/, '').replace(/[ \\t]+$/, ''))\n}\n\n/**\n * Returns the canonical compared form of a description paragraph. `{@link Target}` and\n * `{@link Target | label}` become the code token of the target text, or of the label where one is\n * written; a target's module part — the inline import form `import('./module.js').` and TSDoc's\n * package-qualified form `@scope/pkg#` — is dropped first. Every run of whitespace, including a\n * collapsed continuation marker and a line break, becomes one space, the ends trim, and a code\n * span keeps its delimiters while its own boundary whitespace goes. The guide's side and the\n * source's side read through this one form.\n *\n * @remarks\n * The clauses land in a fixed order, because each one decides what the next one sees. Every\n * single-backtick code span — one backtick per side, no inner backtick, no adjacent backtick —\n * is located first, so a delimiter the `{@link}` expansion inserts afterwards is never mistaken\n * for an authored one. The expansion then runs outside those spans\n * only, so a `{@link}` written inside a code span stays literal on both sides. Whitespace\n * collapses next, which is what makes a span wrapped across two physical lines comparable at\n * all. The boundary trim runs last, inside each located span: the markdown parser strips one\n * space from each end of a code span it reads, and this trim is the symmetric rule that meets\n * it, so `` ` | ` ``, `` ` |` ``, and `` `|` `` all reach `` `|` `` from either side. A span\n * whose content is all whitespace keeps one space, because a parser strips nothing from that\n * one.\n *\n * A target's module part is the inline import form `import('./module.js').` or TSDoc's\n * package-qualified form `@scope/pkg#`, and the expansion drops it, so a cross-file link and the\n * code token a guide cell documents it with reach the same text. A package qualifier carries `@`\n * or `/`; text before a `#` carrying neither is JSDoc's member reference, so `{@link Owner#member}`\n * and `{@link #member}` travel whole and a guide cell documents each as written. An unscoped\n * package name is spelled like an owner, so `{@link pkg#Name}` travels whole too — write the\n * scoped or the path form where a cell must drop the package. Everything after a module part\n * travels: `Owner.member` keeps its owner, and a dotted target no module part precedes is\n * untouched. A label is text rather than a target, so `{@link Target | label}` renders its label\n * whole.\n *\n * A code span delimited by more than one backtick is outside the compared form's representable\n * set and travels untouched, as does a code span whose own text carries a backtick: the form\n * spells every span with one backtick per side, so neither can be written back. A summary that\n * needs one of those constructs takes another shape: name the construct in prose rather than\n * expecting the comparison to converge it.\n *\n * @param text - A doc block's description paragraph, or a guide cell's flattened text\n * @returns The compared form of that text\n *\n * @example\n * ```ts\n * normalizeSummary('Creates a\\n{@link Widget}.') // 'Creates a `Widget`.'\n * normalizeSummary(\"Reads {@link import('./widgets.js').Widget}.\") // 'Reads `Widget`.'\n * normalizeSummary('Reads {@link @scope/widgets#Widget}.') // 'Reads `Widget`.'\n * normalizeSummary('Reads {@link Widget#render}.') // 'Reads `Widget#render`.'\n * normalizeSummary('cells joined by ` | `.') // 'cells joined by `|`.'\n * ```\n */\nexport function normalizeSummary(text: string): string {\n\tconst normalized = text\n\t\t.split(/((?<!`)`[^`]+`(?!`))/)\n\t\t.map((part, index) => {\n\t\t\tif (index % 2 === 0) {\n\t\t\t\treturn part\n\t\t\t\t\t.replace(/\\{@link\\s+[^}|]*\\|\\s*([^}]*?)\\s*\\}/g, '`$1`')\n\t\t\t\t\t.replace(\n\t\t\t\t\t\t/\\{@link\\s+(?:import\\([^)]*\\)\\.|[^}|#\\s]*[@/][^}|#\\s]*#)?([^}|]*?)\\s*\\}/g,\n\t\t\t\t\t\t'`$1`',\n\t\t\t\t\t)\n\t\t\t}\n\t\t\tconst value = part.slice(1, -1).replace(/\\s+/g, ' ').trim()\n\t\t\treturn `\\`${value.length === 0 ? ' ' : value}\\``\n\t\t})\n\t\t.join('')\n\treturn normalized.replace(/\\s+/g, ' ').trim()\n}\n\n/**\n * Wraps one paragraph into greedy lines no longer than `width` characters. Every run of\n * whitespace separates words, and a word longer than `width` takes its own line rather than\n * being split, so a long code token or URL survives the wrap intact.\n *\n * @param text - The paragraph to wrap\n * @param width - The greatest length a returned line may reach\n * @returns The wrapped lines, in order, or an empty list when `text` carries no word\n *\n * @example\n * ```ts\n * wrapText('one two three', 8) // ['one two', 'three']\n * ```\n */\nexport function wrapText(text: string, width: number): readonly string[] {\n\tconst words = text.split(/\\s+/).filter((word) => word.length > 0)\n\tconst lines: string[] = []\n\tconst final = words.reduce(\n\t\t(previous, word, index) => {\n\t\t\tif (index === previous.start) return { start: index, length: word.length }\n\t\t\tif (previous.length + 1 + word.length <= width) {\n\t\t\t\treturn { start: previous.start, length: previous.length + 1 + word.length }\n\t\t\t}\n\t\t\tlines.push(words.slice(previous.start, index).join(' '))\n\t\t\treturn { start: index, length: word.length }\n\t\t},\n\t\t{ start: 0, length: 0 },\n\t)\n\tif (words.length > 0) lines.push(words.slice(final.start).join(' '))\n\treturn lines\n}\n\n/**\n * Builds one genuine JSDoc span from its content lines — the inverse of {@link unwrapComment}.\n * Each line is emitted at `indent` behind a continuation marker, an empty line as the bare\n * marker so no line carries trailing whitespace, and the leading and trailing empty lines are\n * dropped because the opener and the closer take those physical lines.\n *\n * @param lines - The span's content lines, as {@link unwrapComment} returns them\n * @param indent - The whitespace the span opens at\n * @returns The span's raw text, opener and closer included\n *\n * @example\n * ```ts\n * buildComment(['Walks.'], '') // '/**\\n * Walks.\\n *' + '/'\n * ```\n */\nexport function buildComment(lines: readonly string[], indent: string): string {\n\tconst content = [...lines]\n\twhile (content[0] === '') content.shift()\n\twhile (content[content.length - 1] === '') content.pop()\n\n\tconst raw = [`${indent}/**`]\n\tfor (const line of content) raw.push(line.length === 0 ? `${indent} *` : `${indent} * ${line}`)\n\traw.push(`${indent} */`)\n\n\treturn raw.join('\\n')\n}\n\n/**\n * Returns one doc block's unwrapped text with every fenced body replaced by aligned spaces,\n * so a tag search reads the block's structure and never its example code. A line opening with\n * three or more backticks or tildes opens a body, the first line opening with a run of the same\n * character at least as long closes it, an unclosed body runs to the end, and the marker lines\n * themselves stay. The projection preserves every line and every column, so an index found in\n * it addresses the same character of the text it was built from.\n *\n * @param text - One doc block's unwrapped text, as {@link normalizeComment} returns it\n * @returns The same text with each fenced body's characters replaced by spaces\n *\n * @example\n * ```ts\n * maskFences('@example\\n~~~\\n@decorator()\\n~~~').split('\\n')[2] // ' '\n * ```\n */\nexport function maskFences(text: string): string {\n\tconst masked: string[] = []\n\ttext.split('\\n').reduce<string | undefined>((marker, line) => {\n\t\tconst fence = /^[ \\t]*(`{3,}|~{3,})/.exec(line)?.[1]\n\t\tif (marker === undefined) {\n\t\t\tmasked.push(line)\n\t\t\treturn fence\n\t\t}\n\t\tconst closed = fence !== undefined && fence.startsWith(marker)\n\t\tmasked.push(closed ? line : ' '.repeat(line.length))\n\t\treturn closed ? undefined : marker\n\t}, undefined)\n\treturn masked.join('\\n')\n}\n\n/**\n * Extracts every eligible genuine JSDoc block paired with the physical record it documents.\n *\n * @remarks\n * An opener is eligible only when it is the first non-whitespace source material of its record; a\n * leading whitespace-separated span chain is last-span authoritative; intervening source material\n * severs association, while a leading JSDoc on the next record replaces pending state. Any other\n * next physical record is returned once and consumes it. This parser walks aligned records without\n * rescanning source syntax or applying declaration/member grammar, and every reader of a doc\n * block's text — the description paragraph, the `@example` blocks, the member summaries — reads it\n * through this one walk.\n *\n * @param lines - Aligned physical source-line records\n * @returns One record per documented physical line, in source order\n *\n * @example\n * ```ts\n * extractSourceComments(extractSourceLines('/**' + ' Walks. *' + '/\\nexport function walk() {}'))\n * // [{ text: 'Walks.', line: the `export function walk() {}` SourceLine }]\n * ```\n */\nexport function extractSourceComments(lines: readonly SourceLine[]): readonly SourceComment[] {\n\tconst comments: SourceComment[] = []\n\tIterator.from(lines).reduce<{\n\t\treadonly block: boolean\n\t\treadonly eligible: boolean\n\t\treadonly span: string[]\n\t\treadonly pending: string | undefined\n\t}>(\n\t\t(previous, line) => {\n\t\t\tconst projection = line.jsdoc\n\t\t\tconst first = projection?.indexOf('/**') ?? -1\n\t\t\tif (\n\t\t\t\tprevious.pending !== undefined &&\n\t\t\t\t!(!previous.block && first >= 0 && line.source.slice(0, first).trim() === '')\n\t\t\t) {\n\t\t\t\tcomments.push({ text: previous.pending, line })\n\t\t\t}\n\t\t\tconst state = { ...previous, pending: undefined }\n\t\t\tif (projection === undefined) return state\n\t\t\tconst close = state.block ? projection.indexOf('*/') : -1\n\t\t\tconst end = close < 0 ? projection.length : close + 2\n\t\t\tif (state.block) state.span.push(projection.slice(0, end))\n\t\t\tif (state.block && close < 0) return state\n\t\t\tconst opener = state.block ? projection.indexOf('/**', close + 2) : first\n\t\t\tconst whitespace = state.block\n\t\t\t\t? line.source.slice(close + 2, opener < 0 ? line.source.length : opener).trim() === ''\n\t\t\t\t: line.source.slice(0, first).trim() === ''\n\t\t\tconst eligible = state.block ? state.eligible && whitespace : whitespace\n\t\t\tif (opener < 0)\n\t\t\t\treturn state.block\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\tblock: false,\n\t\t\t\t\t\t\tpending: eligible ? normalizeComment(state.span.join('\\n')) : undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: state\n\t\t\tconst spans = /\\/\\*(?=\\*)[\\s\\S]*?(?:\\*\\/|$)/g\n\t\t\tspans.lastIndex = opener\n\t\t\treturn Iterator.from(projection.matchAll(spans)).reduce<typeof previous>(\n\t\t\t\t(current, match) => {\n\t\t\t\t\tconst cursor = match.index\n\t\t\t\t\tconst closing = projection.indexOf('*/', cursor + 2)\n\t\t\t\t\tconst finish = closing < 0 ? projection.length : closing + 2\n\t\t\t\t\tconst span = [projection.slice(cursor, finish)]\n\t\t\t\t\tif (closing < 0) return { ...current, span, block: true }\n\t\t\t\t\tconst next = projection.indexOf('/**', closing + 2)\n\t\t\t\t\tconst gap =\n\t\t\t\t\t\tline.source.slice(closing + 2, next < 0 ? line.source.length : next).trim() === ''\n\t\t\t\t\tif (next < 0)\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...current,\n\t\t\t\t\t\t\tspan,\n\t\t\t\t\t\t\tblock: false,\n\t\t\t\t\t\t\tpending: current.eligible && gap ? normalizeComment(span.join('\\n')) : undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\treturn { ...current, span, block: false, eligible: current.eligible && gap }\n\t\t\t\t},\n\t\t\t\t{ ...state, block: false, eligible },\n\t\t\t)\n\t\t},\n\t\t{ block: false, eligible: false, span: [], pending: undefined },\n\t)\n\treturn comments\n}\n\n/**\n * Selects the next physical record after an eligible genuine JSDoc whose final\n * authoritative span carries an `@example` tag opening a line at its first non-blank column —\n * the {@link extractSourceComments} walk filtered to the blocks that carry one. Title\n * text is allowed, and {@link maskFences} keeps a fenced body's own lines out of the search.\n *\n * @param lines - Aligned physical source-line records\n * @returns The immediately following candidate lines, in source order\n *\n * @example\n * ```ts\n * extractExampleLines(extractSourceLines('/**' + ' @example *' + '/\\nexport function walk() {}'))\n * // the `export function walk() {}` SourceLine\n * ```\n */\nexport function extractExampleLines(lines: readonly SourceLine[]): readonly SourceLine[] {\n\treturn extractSourceComments(lines)\n\t\t.filter((comment) => /^[ \\t]*@example(?=[ \\t]|$)/m.test(maskFences(comment.text)))\n\t\t.map((comment) => comment.line)\n}\n\n/**\n * Collects the description paragraph of every documented physical record — a doc block's\n * text before its first block tag, in {@link normalizeSummary}'s compared form — keyed by the\n * record it documents. A record whose block carries no description contributes no entry, so\n * an absent summary stays absent rather than becoming an empty string.\n *\n * @param lines - Aligned physical source-line records\n * @returns One entry per documented record carrying a description paragraph\n *\n * @example\n * ```ts\n * collectSummaries(extractSourceLines('/**' + ' Walks. *' + '/\\nexport function walk() {}')).size // 1\n * ```\n */\nexport function collectSummaries(lines: readonly SourceLine[]): ReadonlyMap<SourceLine, string> {\n\tconst summaries = new Map<SourceLine, string>()\n\n\tfor (const comment of extractSourceComments(lines)) {\n\t\tconst tag = maskFences(comment.text).search(/^[ \\t]*@\\w/m)\n\t\tconst summary = normalizeSummary(tag < 0 ? comment.text : comment.text.slice(0, tag))\n\t\tif (summary.length > 0) summaries.set(comment.line, summary)\n\t}\n\n\treturn summaries\n}\n\n/**\n * Extracts the aligned physical records of a declaration's body, read inside an owner head this\n * function supplies, so a callable member in the body carries the `Owner.member` key\n * {@link collectKeys} reports for it, and that head's own record opens the projection. A body\n * read on its own carries no head, and the member grammar attaches a member to the head\n * enclosing it.\n *\n * @remarks\n * The supplied head is an `export interface` line, so the projection opens with that head's own\n * record and every body line follows it in order. A column-zero `}` among the body lines closes\n * the supplied head and leaves every later member unkeyed; a body {@link extractDeclaration}\n * returns carries none, because that reader ends a body at the first one.\n *\n * @param lines - A declaration's body lines\n * @returns The supplied head's record, then one record per body line\n *\n * @example\n * ```ts\n * extractBodyLines(['\\twalk(): void'])[1]?.code // '\\twalk(): void'\n * ```\n */\nexport function extractBodyLines(lines: readonly string[]): readonly SourceLine[] {\n\treturn extractSourceLines(['export interface Owner {', ...lines].join('\\n'))\n}\n\n/**\n * Collects the compared key of every physical record a key names — a {@link computeSymbolKey}\n * symbol key for a column-zero `export` declaration head, an `Owner.member` key for a one-tab\n * callable member inside one — keyed by the record itself. The owner closes at the first\n * column-zero `}` or at a column-zero `export` declaration carrying another keyword, and a\n * record no key names contributes no entry.\n *\n * @remarks\n * This is the package's one key grammar, and each keyed reader projects its own part back out of\n * it: {@link extractExports} splits a declaration key at its one space,\n * {@link extractMemberMethods} and {@link extractExampleMethods} split a member key at its dot,\n * and {@link locateComment} matches a caller's key against the whole map. A change to the head\n * shape or to the member shape reaches every one of them at once.\n *\n * An owner opens at a column-zero `export class`, `export abstract class`, or `export interface`\n * head and closes at the\n * first column-zero `}`, so a member declared past that brace keys nothing. A column-zero `export` declaration carrying any other keyword closes the owner it follows,\n * because a member belongs to the head enclosing it. Reading runs over {@link extractSourceLines}'s\n * projection, so a head or\n * a member written inside a comment or a template literal keys nothing.\n *\n * @param lines - Aligned physical source-line records\n * @returns One entry per record a key names, in file order\n *\n * @example\n * ```ts\n * const keys = collectKeys(extractSourceLines('export class Widget {\\n\\twalk(): void\\n}'))\n * Array.from(keys.values()) // ['class Widget', 'Widget.walk']\n * ```\n */\nexport function collectKeys(lines: readonly SourceLine[]): ReadonlyMap<SourceLine, string> {\n\tconst keys: Array<readonly [SourceLine, string]> = []\n\tIterator.from(lines).reduce<string | undefined>((owner, line) => {\n\t\tconst head =\n\t\t\t/^export (?:async )?(?:abstract )?(function\\*?|class|const|interface|type) (\\w+)/.exec(\n\t\t\t\tline.code,\n\t\t\t)\n\t\tconst keyword = head?.[1]?.replace(/\\*$/, '')\n\t\tconst name = head?.[2]\n\t\tif (isNonEmptyString(keyword) && isNonEmptyString(name) && isExportKeyword(keyword)) {\n\t\t\tkeys.push([line, computeSymbolKey({ name, keyword })])\n\t\t\treturn keyword === 'class' || keyword === 'interface' ? name : undefined\n\t\t}\n\t\tif (line.code === '}') return undefined\n\t\tconst member = /^\\t(?:async )?\\*?(\\w+)\\??(?:<.*>)?\\(/.exec(line.code)?.[1]\n\t\tif (owner !== undefined && isNonEmptyString(member)) keys.push([line, `${owner}.${member}`])\n\t\treturn owner\n\t}, undefined)\n\treturn new Map(keys)\n}\n\n/**\n * Collects the `@example` blocks one doc block's unwrapped text carries, each named for the\n * declaration or member the block documents. The text after the tag becomes the block's\n * `title`; a body opening with a fence contributes that fence's language and its verbatim\n * body, and a body with no fence contributes its own trimmed text as the code.\n *\n * @param comment - One doc block's unwrapped text, as {@link normalizeComment} returns it\n * @param name - The declaration or member the block documents\n * @returns The block's `@example` entries, in block order\n *\n * @example\n * ```ts\n * collectExamples('@example Walking\\n```ts\\nwalk()\\n```', 'walk')\n * // [{ name: 'walk', title: 'Walking', code: 'walk()', language: 'ts' }]\n * ```\n */\nexport function collectExamples(comment: string, name: string): readonly SourceExample[] {\n\tconst examples: SourceExample[] = []\n\tconst masked = maskFences(comment)\n\tconst tags = /^[ \\t]*@example(?=[ \\t]|$)[ \\t]*(.*)$/gm\n\n\tfor (const tag of masked.matchAll(tags)) {\n\t\tconst title = (tag[1] ?? '').trim()\n\t\tconst start = tag.index + tag[0].length\n\t\tconst rest = comment.slice(start).replace(/^\\n/, '')\n\t\tconst next = masked\n\t\t\t.slice(start)\n\t\t\t.replace(/^\\n/, '')\n\t\t\t.search(/^[ \\t]*@\\w+/m)\n\t\tconst body = (next < 0 ? rest : rest.slice(0, next)).replace(/^\\n+/, '').replace(/\\n+$/, '')\n\t\tconst fence = /^```(\\S*)\\n([\\s\\S]*?)\\n?```/.exec(body)\n\t\tconst language = fence?.[1] ?? ''\n\t\tconst code = fence?.[2] ?? body\n\n\t\texamples.push({\n\t\t\tname,\n\t\t\t...(title.length === 0 ? {} : { title }),\n\t\t\tcode,\n\t\t\t...(language.length === 0 ? {} : { language }),\n\t\t})\n\t}\n\n\treturn examples\n}\n\n/**\n * Extracts the `@example` blocks carried by the exported declaration heads in one file's source\n * text, each named for the declaration its block documents. Shared adjacency comes from\n * {@link extractSourceComments} and each block is read by {@link collectExamples}; head\n * membership is the {@link collectKeys} key of the documented record under every keyword that\n * grammar admits at column zero, so comment and template payload cannot qualify and the head\n * grammar stays the one every reader here shares. A member key carries a dot and a head key\n * does not, so a member's block belongs to {@link extractExampleMethods} instead. A head\n * carrying several blocks contributes each.\n *\n * @param source - The file's source text\n * @returns The exported declaration heads' `@example` blocks, in file order, deduplicated by name and title\n *\n * @example\n * ```ts\n * const block = ['/**', ' * @example', ' * new Widget()', ' *' + '/', 'export class Widget {}', ''].join('\\n')\n * extractExamples(block) // [{ name: 'Widget', code: 'new Widget()' }]\n * extractExamples('export class Widget {}\\n') // []\n * ```\n */\nexport function extractExamples(source: string): readonly SourceExample[] {\n\tconst examples: SourceExample[] = []\n\tconst seen = new Set<string>()\n\tconst lines = extractSourceLines(source)\n\tconst keys = collectKeys(lines)\n\n\tfor (const comment of extractSourceComments(lines)) {\n\t\t// A head key is `${keyword} ${name}` and a member key is `Owner.member`, so the dot is\n\t\t// what separates them and the block's name is the text past the head's one space.\n\t\tconst key = keys.get(comment.line)\n\t\tif (key === undefined || key.includes('.')) continue\n\n\t\tconst name = key.slice(key.indexOf(' ') + 1)\n\t\tfor (const example of collectExamples(comment.text, name)) {\n\t\t\tconst entry = `${name}\\n${example.title ?? ''}`\n\t\t\tif (seen.has(entry)) continue\n\t\t\tseen.add(entry)\n\t\t\texamples.push(example)\n\t\t}\n\t}\n\n\treturn examples\n}\n\n/**\n * Extracts the `@example` blocks carried by the callable members of a declaration body (per\n * {@link collectKeys}' grammar, the same one {@link extractMemberMethods} reads), each named for\n * the member its block documents. Shared adjacency comes from {@link extractSourceComments} and\n * each block is read by {@link collectExamples}; member membership is the key\n * {@link extractBodyLines}'s projection gives the documented record.\n *\n * @param lines - A declaration's body lines\n * @returns The members' `@example` blocks, deduplicated by name and title and sorted by name\n *\n * @example\n * ```ts\n * extractExampleMethods(['\\t/**', '\\t * @example', '\\t * walk()', '\\t *' + '/', '\\twalk(): void'])\n * // [{ name: 'walk', code: 'walk()' }]\n * ```\n */\nexport function extractExampleMethods(lines: readonly string[]): readonly SourceExample[] {\n\tconst examples: SourceExample[] = []\n\tconst seen = new Set<string>()\n\tconst projected = extractBodyLines(lines)\n\tconst keys = collectKeys(projected)\n\n\tfor (const comment of extractSourceComments(projected)) {\n\t\tconst key = keys.get(comment.line) ?? ''\n\t\tconst dot = key.indexOf('.')\n\t\tif (dot < 0) continue\n\n\t\tconst name = key.slice(dot + 1)\n\t\tfor (const example of collectExamples(comment.text, name)) {\n\t\t\tconst entry = `${name}\\n${example.title ?? ''}`\n\t\t\tif (seen.has(entry)) continue\n\t\t\tseen.add(entry)\n\t\t\texamples.push(example)\n\t\t}\n\t}\n\n\treturn examples.sort((a, b) => (a.name === b.name ? 0 : a.name < b.name ? -1 : 1))\n}\n\n/**\n * Extracts every fenced code block anywhere in the guide document. A full AST walk\n * includes fences nested inside blockquotes and lists, and the same walk carries each\n * fence's nearest preceding heading as its `title` — the key an `@example` block pairs on.\n * A heading's text is flattened, so a title written with a code span pairs with a plain\n * `@example` title.\n *\n * @param document - The parsed guide document\n * @returns Every fence's language, verbatim code, and title, in document order\n *\n * @example\n * ```ts\n * extractFences(document) // [{ language: 'ts', code: \"import { X } from './x.js'\\nX()\" }]\n * ```\n */\nexport function extractFences(document: MarkdownDocument): readonly GuideFence[] {\n\treturn Array.from(collectFences(document).values())\n}\n\n/**\n * Collects each fenced code block keyed by its own node, paired with the {@link GuideFence}\n * {@link extractFences} reports for it — the node-addressed form a rewrite needs, so a caller\n * that located a fence by title can read that node's source region back from the parser. The map\n * iterates in document order and a node keys itself, so a repeated identical fence keeps its own\n * entry.\n *\n * @param document - The parsed guide document\n * @returns One entry per fenced code block, in document order\n *\n * @example\n * ```ts\n * Array.from(collectFences(document).values()) // [{ language: 'ts', code: 'walk()' }]\n * ```\n */\nexport function collectFences(document: MarkdownDocument): ReadonlyMap<CodeBlockNode, GuideFence> {\n\tconst fences: Array<readonly [CodeBlockNode, GuideFence]> = []\n\tIterator.from(walkNodes(document)).reduce((title, node) => {\n\t\tif (isHeadingNode(node)) return flattenText(node).trim()\n\t\tif (isCodeBlockNode(node)) {\n\t\t\tfences.push([\n\t\t\t\tnode,\n\t\t\t\t{\n\t\t\t\t\tlanguage: node.lang,\n\t\t\t\t\tcode: node.code,\n\t\t\t\t\t...(title.length === 0 ? {} : { title }),\n\t\t\t\t},\n\t\t\t])\n\t\t}\n\t\treturn title\n\t}, '')\n\treturn new Map(fences)\n}\n\n/**\n * Extracts the guide's tagline — the text of the blockquote following the document's H1,\n * with every code span kept as a code span and whitespace collapsed. A heading before the\n * blockquote ends the window, so a blockquote elsewhere in the document is not the tagline.\n *\n * @param document - The parsed guide document\n * @returns The tagline, or `undefined` when no blockquote follows an H1 before the next heading\n *\n * @example\n * ```ts\n * extractTagline(document) // 'A pure, I/O-free guides-parity toolkit'\n * ```\n */\nexport function extractTagline(document: MarkdownDocument): string | undefined {\n\tconst scanned: Array<{\n\t\treadonly block: BlockNode\n\t\treadonly opened: boolean\n\t\treadonly selected: BlockquoteNode | undefined\n\t}> = []\n\tfor (const block of document.children) {\n\t\tconst opened = scanned.at(-1)?.opened ?? false\n\t\tif (isHeadingNode(block)) {\n\t\t\tif (opened) break\n\t\t\tscanned.push({ block, opened: block.level === 1, selected: undefined })\n\t\t\tcontinue\n\t\t}\n\t\tconst selected = opened && isBlockquoteNode(block) ? block : undefined\n\t\tscanned.push({ block, opened, selected })\n\t\tif (selected !== undefined) break\n\t}\n\tconst selected = scanned.find((entry) => entry.selected !== undefined)?.selected\n\tif (selected === undefined) return undefined\n\tconst text = normalizeSummary(\n\t\tselected.children\n\t\t\t.filter(isParagraphNode)\n\t\t\t.map((paragraph) => extractCellText(paragraph.children))\n\t\t\t.join(' '),\n\t)\n\treturn text.length === 0 ? undefined : text\n}\n\n/**\n * Computes the drift between one compared key's guide text and source text. A pair agrees\n * only when both sides carry the same text, and every other state is a drift: guide text\n * alone reports the guide's side, source text alone reports the source's, and neither side\n * carrying text reports the key by itself. A side carrying no text is absent from the result,\n * so a documented symbol with no doc block reports as a drift naming the guide's text alone,\n * and a row a table has no `Summary` column for against a declaration with no doc block\n * reports as `{ key }`.\n *\n * @param key - The compared pair's key\n * @param category - The compared site the drift came from\n * @param guide - The guide's text there, or `undefined` when it carries none\n * @param source - The source's text there, or `undefined` when it carries none\n * @returns The drift, or `undefined` when both sides carry the same text\n *\n * @example\n * ```ts\n * computeDrift('function walk', 'summary', 'Walks the tree.', 'Walks a tree.')\n * // { key: 'function walk', category: 'summary', guide: 'Walks the tree.', source: 'Walks a tree.' }\n * ```\n */\nexport function computeDrift(\n\tkey: string,\n\tcategory: Drift['category'],\n\tguide: string | undefined,\n\tsource: string | undefined,\n): Drift | undefined {\n\tif (guide !== undefined && guide === source) return undefined\n\treturn {\n\t\tkey,\n\t\tcategory,\n\t\t...(guide === undefined ? {} : { guide }),\n\t\t...(source === undefined ? {} : { source }),\n\t}\n}\n\n/**\n * Compares documented and declared membership exactly after sorting copies, preserving duplicates.\n *\n * @param spec - The guide inventory key the finding belongs to\n * @param name - The declaration whose membership is compared\n * @param documented - The documented member names\n * @param declared - The declared member names\n * @returns The membership finding, or `undefined` when the sorted populations match\n *\n * @example Compare declaration membership\n * ```ts\n * import { compareMembership } from '@orkestrel/guide'\n *\n * compareMembership('guides/widget.md', 'WidgetInterface', ['open'], ['open']) // undefined\n * ```\n */\nexport function compareMembership(\n\tspec: string,\n\tname: string,\n\tdocumented: readonly string[],\n\tdeclared: readonly string[],\n): ParityFinding | undefined {\n\tconst left = [...documented].sort()\n\tconst right = [...declared].sort()\n\tif (JSON.stringify(left) === JSON.stringify(right)) return undefined\n\treturn {\n\t\tspec,\n\t\ttext: `${spec} ${name} documents ${JSON.stringify(left)} and declares ${JSON.stringify(right)}.`,\n\t}\n}\n\n/**\n * Computes a category-separated identity for a guide finding.\n *\n * @param spec - The guide inventory key the drift belongs to\n * @param drift - The categorized disagreement\n * @returns The inventory key, category, and compared key separated by line feeds\n *\n * @example Identify categorized drift\n * ```ts\n * import { identifyDrift } from '@orkestrel/guide'\n *\n * identifyDrift('guides/widget.md', { category: 'summary', key: 'function open' })\n * // 'guides/widget.md\\nsummary\\nfunction open'\n * ```\n */\nexport function identifyDrift(spec: string, drift: Drift): string {\n\treturn `${spec}\\n${drift.category}\\n${drift.key}`\n}\n\n/**\n * Formats present parity text as a JSON string and absent text as `absent`.\n *\n * @param value - The compared side's text, or `undefined` when absent\n * @returns The developer-facing side text\n *\n * @example Format a parity side\n * ```ts\n * import { formatSide } from '@orkestrel/guide'\n *\n * formatSide('Walks.') // '\"Walks.\"'\n * formatSide(undefined) // 'absent'\n * ```\n */\nexport function formatSide(value: string | undefined): string {\n\treturn value === undefined ? 'absent' : JSON.stringify(value)\n}\n\n/**\n * Formats a categorized drift with its guide and source sides.\n *\n * @param drift - The categorized disagreement to format\n * @returns The complete developer-facing drift text\n *\n * @example Format categorized drift\n * ```ts\n * import { formatDrift } from '@orkestrel/guide'\n *\n * formatDrift({ category: 'summary', key: 'function walk', guide: 'Walks.', source: 'Walks a tree.' })\n * // 'summary function walk: guide \"Walks.\" source \"Walks a tree.\"'\n * ```\n */\nexport function formatDrift(drift: Drift): string {\n\treturn `${drift.category} ${drift.key}: guide ${formatSide(drift.guide)} source ${formatSide(drift.source)}`\n}\n\n/**\n * Finds every disagreement between a guide and the source it documents, naming both sites:\n * each `## Surface` row against its declaration's description paragraph, each present\n * `Signature` cell against the declaration's computed signature written as a code span, each\n * `## Methods` row against its member's, and the first titled guide fence of a heading against the\n * `@example` block of the same title. An example's compared text is its language on the first\n * line and its body beneath, so a fence that names another language drifts on its own.\n *\n * @remarks\n * Only a pair present on both sides is compared, so a symbol, a member, or a title one side\n * lacks entirely is left to the bijection checks that own it and is never reported twice.\n * {@link computeDrift} rules each compared pair, so a pair whose sides carry different text, a\n * pair where one side carries none, and a pair where neither side carries text are all drift.\n * The pairing is per title across the whole document, not per heading: the first fence a title\n * reaches is the compared one, and every later fence of that title is outside the comparison,\n * whether it sits under the same heading or under a second heading of the same text. A signature\n * is compared only when both sides carry one, so an H3 entity heading, which carries no cell, and\n * a source reflected without emitted declarations stay outside that comparison.\n *\n * @param guide - The parsed guide\n * @param source - The reflected source the guide documents\n * @returns One entry per disagreement: each Surface row's summary then signature, then Methods\n * rows, then examples\n *\n * @example\n * ```ts\n * findDrift(guide, source) // [{ key: 'function walk', category: 'summary', guide: 'Walks.', source: 'Walks a tree.' }]\n * ```\n */\nexport function findDrift(guide: GuideInterface, source: SourceInterface): readonly Drift[] {\n\tconst drifts: Drift[] = []\n\tconst declared = new Map(source.surface().map((symbol) => [computeSymbolKey(symbol), symbol]))\n\n\tfor (const symbol of guide.surface()) {\n\t\tconst key = computeSymbolKey(symbol)\n\t\tconst match = declared.get(key)\n\t\tif (match === undefined) continue\n\t\tconst drift = computeDrift(key, 'summary', symbol.summary, match.summary)\n\t\tif (drift !== undefined) drifts.push(drift)\n\t\tif (symbol.signature === undefined || match.signature === undefined) continue\n\t\tconst computed = normalizeSummary(\n\t\t\textractCellText([{ element: 'codeSpan', value: match.signature }]),\n\t\t)\n\t\tconst signed = computeDrift(key, 'signature', symbol.signature, computed)\n\t\tif (signed !== undefined) drifts.push(signed)\n\t}\n\n\tfor (const group of guide.methods()) {\n\t\tconst members = new Map(source.methods(group.interface).map((entry) => [entry.name, entry]))\n\t\tfor (const entry of group.methods) {\n\t\t\tconst member = members.get(entry.name)\n\t\t\tif (member === undefined) continue\n\t\t\tconst drift = computeDrift(\n\t\t\t\t`${group.interface}.${entry.name}`,\n\t\t\t\t'summary',\n\t\t\t\tentry.summary,\n\t\t\t\tmember.summary,\n\t\t\t)\n\t\t\tif (drift !== undefined) drifts.push(drift)\n\t\t}\n\t}\n\n\tconst examples = collectTitles(guide, source)\n\tconst compared = new Set<string>()\n\tfor (const fence of guide.fences()) {\n\t\tif (fence.title === undefined || compared.has(fence.title)) continue\n\t\tcompared.add(fence.title)\n\t\tconst example = examples.get(fence.title)\n\t\tif (example === undefined) continue\n\t\tconst drift = computeDrift(\n\t\t\tfence.title,\n\t\t\t'example',\n\t\t\t`${fence.language ?? ''}\\n${fence.code}`,\n\t\t\t`${example.language ?? ''}\\n${example.code}`,\n\t\t)\n\t\tif (drift !== undefined) drifts.push(drift)\n\t}\n\n\treturn drifts\n}\n\n/**\n * Collects the titled `@example` blocks a guide's documented surface reaches — the module's\n * exported declaration heads, plus the own members of every documented `class` and `interface` —\n * keyed by title, the first block of a title answering for it.\n *\n * @param guide - The parsed guide naming the documented declarations\n * @param source - The reflected source to read the blocks from\n * @returns One entry per distinct `@example` title\n *\n * @example\n * ```ts\n * collectTitles(guide, source).get('Walk a tree') // { name: 'walk', title: 'Walk a tree', code: 'walk()' }\n * ```\n */\nexport function collectTitles(\n\tguide: GuideInterface,\n\tsource: SourceInterface,\n): ReadonlyMap<string, SourceExample> {\n\tconst titled = new Map<string, SourceExample>()\n\tconst owners = guide\n\t\t.surface()\n\t\t.filter((symbol) => symbol.keyword === 'class' || symbol.keyword === 'interface')\n\tconst examples = [\n\t\t...source.examples(),\n\t\t...owners.flatMap((symbol) => source.examples(symbol.name)),\n\t]\n\n\tfor (const example of examples) {\n\t\tif (example.title === undefined || titled.has(example.title)) continue\n\t\ttitled.set(example.title, example)\n\t}\n\n\treturn titled\n}\n\n/**\n * Builds a copy of `table` with one cell's inline content replaced by `cell`. Every other cell\n * keeps its own nodes, so a rewrite touches the one cell it names and the header and the\n * alignment row travel unchanged.\n *\n * @param table - The table to copy\n * @param row - The index of the row to rewrite within {@link TableNode.rows}\n * @param column - The index of the cell to rewrite within that row\n * @param cell - The cell's new inline content, such as {@link buildCell} returns\n * @returns The rewritten table\n *\n * @example\n * ```ts\n * buildTable(table, 0, 3, buildCell('Walks the tree.')).rows[0]?.[3] // [{ element: 'text', value: 'Walks the tree.' }]\n * ```\n */\nexport function buildTable(\n\ttable: TableNode,\n\trow: number,\n\tcolumn: number,\n\tcell: readonly InlineNode[],\n): TableNode {\n\treturn {\n\t\telement: 'table',\n\t\theader: table.header,\n\t\trows: table.rows.map((cells, index) =>\n\t\t\tindex === row\n\t\t\t\t? cells.map((current, position) => (position === column ? cell : current))\n\t\t\t\t: cells,\n\t\t),\n\t\talign: table.align,\n\t}\n}\n\n/**\n * Builds the fenced code block one `@example` block renders as — its code inside a fence\n * carrying its language, and an untagged fence when the block names none.\n *\n * @param example - The block to render\n * @returns The fence node\n *\n * @example\n * ```ts\n * buildFence({ name: 'walk', code: 'walk()', language: 'ts' }) // { element: 'codeBlock', code: 'walk()', lang: 'ts' }\n * ```\n */\nexport function buildFence(example: SourceExample): CodeBlockNode {\n\treturn {\n\t\telement: 'codeBlock',\n\t\tcode: example.code,\n\t\t...(example.language === undefined ? {} : { lang: example.language }),\n\t}\n}\n\n/**\n * Splices `replacement` into `source` over the region `span` addresses, and returns the result.\n * The text before the region and the text after it travel byte for byte, so a rewrite that\n * addresses one node's region changes nothing else in the document.\n *\n * @param source - The text to rewrite\n * @param span - The half-open region to replace: the region `MarkdownInterface.span` reports\n * for a markdown node, or the one {@link locateComment} reports for a doc block\n * @param replacement - The text to write over that region\n * @returns The rewritten text\n *\n * @example\n * ```ts\n * spliceSpan('one two three', { start: 4, end: 7 }, 'TWO') // 'one TWO three'\n * ```\n */\nexport function spliceSpan(source: string, span: MarkdownSpan, replacement: string): string {\n\treturn source.slice(0, span.start) + replacement + source.slice(span.end)\n}\n\n/**\n * Renders a uniform `Name | Kind | Signature | Summary` table with one row per symbol, the name\n * as a code span, the keyword as text, and the signature and summary through {@link buildCell}.\n * An absent signature or summary renders an empty cell, which {@link extractSurface} reads back\n * as absent. Guide construction refuses an empty signature cell.\n *\n * @remarks\n * The render carries no `## Surface` heading, because a guide documents its surface in several\n * tables under their own sub-headings and one of them is what this function produces. Reading the\n * render back therefore parses it under that heading. `renderMarkdown` pads every cell to one\n * space, so the render is not the committed column-aligned bytes; the checkout's formatter\n * re-aligns the table and the reader compares parsed entries rather than bytes.\n *\n * @param symbols - The symbols to document, in row order\n * @returns The table's markdown source, with no trailing newline\n *\n * @example\n * ```ts\n * renderSurface([{ name: 'walk', keyword: 'function', summary: 'Walks the tree.' }])\n * // '| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `walk` | function | | Walks the tree. |'\n * ```\n */\nexport function renderSurface(symbols: readonly SurfaceSymbol[]): string {\n\treturn renderMarkdown({\n\t\telement: 'table',\n\t\theader: [\n\t\t\t[{ element: 'text', value: NAME }],\n\t\t\t[{ element: 'text', value: KIND }],\n\t\t\t[{ element: 'text', value: SIGNATURE }],\n\t\t\t[{ element: 'text', value: SUMMARY }],\n\t\t],\n\t\trows: symbols.map((symbol) => [\n\t\t\t[{ element: 'codeSpan', value: symbol.name }],\n\t\t\t[{ element: 'text', value: symbol.keyword }],\n\t\t\tbuildCell(symbol.signature ?? ''),\n\t\t\tbuildCell(symbol.summary ?? ''),\n\t\t]),\n\t\talign: [null, null, null, null],\n\t})\n}\n\n/**\n * Renders one `## Methods` group — the `####` heading naming the interface as a code span, then\n * a `Name` and {@link SUMMARY} table with one row per documented member. A member carrying no\n * summary renders an empty cell, which {@link extractMethods} reads back as an absent summary.\n *\n * @remarks\n * The render carries no `## Methods` heading, for the reason {@link renderSurface} states:\n * a guide documents one group per interface under that one section heading.\n *\n * @param group - The interface and its members\n * @returns The heading and table's markdown source, with no trailing newline\n *\n * @example\n * ```ts\n * renderMethods({ interface: 'WidgetInterface', methods: [{ name: 'walk', summary: 'Walks.' }] })\n * // '#### `WidgetInterface`\\n\\n| Name | Summary |\\n| --- | --- |\\n| `walk` | Walks. |'\n * ```\n */\nexport function renderMethods(group: MethodGroup): string {\n\treturn renderMarkdown({\n\t\telement: 'document',\n\t\tchildren: [\n\t\t\t{ element: 'heading', level: 4, children: [{ element: 'codeSpan', value: group.interface }] },\n\t\t\t{\n\t\t\t\telement: 'table',\n\t\t\t\theader: [[{ element: 'text', value: NAME }], [{ element: 'text', value: SUMMARY }]],\n\t\t\t\trows: group.methods.map((entry) => [\n\t\t\t\t\t[{ element: 'codeSpan', value: entry.name }],\n\t\t\t\t\tbuildCell(entry.summary ?? ''),\n\t\t\t\t]),\n\t\t\t\talign: [null, null],\n\t\t\t},\n\t\t],\n\t})\n}\n\n/**\n * Renders one `@example` block as the guide fence it pairs with — an H3 heading carrying the\n * block's title, then a fence carrying its language and its code. An untitled block renders the\n * fence alone, because a fence pairs on its nearest preceding heading and an untitled block\n * claims none.\n *\n * @remarks\n * The title renders as literal text rather than markdown, so a title carrying backticks or\n * emphasis reads back through {@link extractFences} as the text the `@example` tag carried.\n * The heading level is 3 because a guide documents its examples one level under a `##` section;\n * {@link extractFences} pairs on the nearest preceding heading of any level, so the level is\n * presentation rather than pairing.\n *\n * @param example - The block to render\n * @returns The heading and fence's markdown source, with no trailing newline\n *\n * @example\n * ```ts\n * renderExample({ name: 'walk', title: 'Walk a tree', code: 'walk()', language: 'ts' })\n * // an H3 heading of 'Walk a tree', then a fence tagged `ts` carrying `walk()`\n * ```\n */\nexport function renderExample(example: SourceExample): string {\n\tconst fence = buildFence(example)\n\treturn renderMarkdown({\n\t\telement: 'document',\n\t\tchildren:\n\t\t\texample.title === undefined\n\t\t\t\t? [fence]\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telement: 'heading',\n\t\t\t\t\t\t\tlevel: 3,\n\t\t\t\t\t\t\tchildren: [{ element: 'text', value: example.title }],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfence,\n\t\t\t\t\t],\n\t})\n}\n\n/**\n * Replaces one compared cell in a guide's text and returns the whole guide back. `key` names the\n * row the way {@link findDrift} names it — a {@link computeSymbolKey} key for a `## Surface` row,\n * an `Owner.member` key for a `## Methods` row — and the row's cell under the `column` header\n * becomes `cell`. Only the table's own source region is rewritten, so every byte outside it\n * travels unchanged; a key reaching no cell returns `undefined`, and a row already carrying that\n * cell returns the guide byte for byte.\n *\n * @remarks\n * A row the key does not reach, a table carrying no `column` header, and a document whose parse\n * recorded no region for the table are each a miss, and a miss returns `undefined` rather than\n * throwing, so a caller reports the key it could not place — the one meaning `undefined` carries\n * in every replacer here. A row already carrying `cell` returns the guide byte for byte, because\n * a rewrite would re-pad the whole table for no change; that identity reads both cells through\n * {@link extractCellText} and {@link normalizeSummary}, so a caller passing text the compared form\n * still moves is a fixed point on the second run rather than a row rewritten forever. The\n * rewritten table renders one-space padded whatever padding it carried, so the checkout's\n * formatter re-aligns it, and a code span renders with every `|` written `\\|` and a longer\n * backtick fence when its text holds a backtick.\n *\n * @param guide - The guide's markdown source\n * @param key - The compared key naming the row\n * @param column - The header text of the column to write, {@link SUMMARY} or {@link SIGNATURE}\n * @param cell - The cell's new inline content, such as {@link buildCell} returns\n * @returns The guide's text with that cell replaced, or `undefined` when the key reaches no cell\n *\n * @example\n * ```ts\n * replaceCell('## Surface\\n\\n| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `walk` | function | `() => void` | Walks. |', 'function walk', SUMMARY, buildCell('Walks a tree.'))\n * // '## Surface\\n\\n| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `walk` | function | `() => void` | Walks a tree. |'\n * ```\n */\nexport function replaceCell(\n\tguide: string,\n\tkey: string,\n\tcolumn: string,\n\tcell: readonly InlineNode[],\n): string | undefined {\n\tconst markdown = createMarkdown(guide)\n\tconst document = markdown.document\n\tconst surface = Iterator.from(selectSectionBlocks(document, SURFACE))\n\t\t.filter(isTableNode)\n\t\t.flatMap((table) =>\n\t\t\ttable.rows.keys().map((index) => ({ table, index, symbol: extractRowSymbol(table, index) })),\n\t\t)\n\t\t.find((row) => row.symbol !== undefined && computeSymbolKey(row.symbol) === key)\n\tconst groups = collectGroups(document)\n\tconst selected =\n\t\tsurface ??\n\t\tIterator.from(groups)\n\t\t\t.flatMap(([table, owner]) =>\n\t\t\t\ttable.rows.keys().map((index) => ({\n\t\t\t\t\ttable,\n\t\t\t\t\tindex,\n\t\t\t\t\towner,\n\t\t\t\t\tentry: extractRowEntry(table, index),\n\t\t\t\t})),\n\t\t\t)\n\t\t\t.find((row) => row.entry !== undefined && `${row.owner}.${row.entry.name}` === key)\n\tif (selected === undefined) return undefined\n\tconst { table, index } = selected\n\tconst position = findColumnIndex(table, column)\n\tif (position === undefined) return undefined\n\tconst current = normalizeSummary(extractCellText(table.rows[index]?.[position] ?? []))\n\tif (current === normalizeSummary(extractCellText(cell))) return guide\n\tconst span = markdown.span(table)\n\tif (span === undefined) return undefined\n\treturn spliceSpan(guide, span, renderMarkdown(buildTable(table, index, position, cell)))\n}\n\n/**\n * Replaces one titled fence in a guide's text and returns the whole guide back. The first fence\n * carrying `title` — the pairing {@link findDrift} compares on — takes `example`'s language and\n * code. Only the fence's own source region is rewritten, so every byte outside it travels\n * unchanged; a title no fence carries returns `undefined`, and a fence already carrying that\n * body returns the guide byte for byte.\n *\n * @remarks\n * A title no fence carries and a document whose parse recorded no region for the fence are each a\n * miss, and a miss returns `undefined` rather than throwing — the one meaning `undefined` carries\n * in every replacer here. A fence already carrying that language and code returns the guide\n * byte for byte. A later fence of the same title is outside the pairing and is never rewritten,\n * which is the rule {@link findDrift} compares under.\n *\n * @param guide - The guide's markdown source\n * @param title - The heading text the fence pairs on\n * @param example - The block whose language and code the fence takes\n * @returns The guide's text with that fence replaced, or `undefined` when no fence carries the title\n *\n * @example\n * ```ts\n * replaceFence(guide, 'Walk', { name: 'walk', title: 'Walk', code: 'walk()', language: 'ts' })\n * // the guide's text with the fence under its `### Walk` heading carrying `walk()`\n * ```\n */\nexport function replaceFence(\n\tguide: string,\n\ttitle: string,\n\texample: SourceExample,\n): string | undefined {\n\tconst markdown = createMarkdown(guide)\n\tconst selected = Iterator.from(collectFences(markdown.document)).find(\n\t\t([, fence]) => fence.title === title,\n\t)\n\tif (selected === undefined) return undefined\n\tconst [located, current] = selected\n\tif (current.code === example.code && current.language === example.language) return guide\n\n\tconst span = markdown.span(located)\n\tif (span === undefined) return undefined\n\treturn spliceSpan(guide, span, renderMarkdown(buildFence(example)))\n}\n\n/**\n * Replaces one doc block's description paragraph with `summary` and returns the whole block back.\n * The paragraph is the block's text before its first block tag, and it re-wraps inside `width`;\n * the blank line before the first tag, every tag line, the block's indentation, and its\n * continuation markers all survive. A block already carrying the summary returns byte for byte,\n * and a text that is no doc block and a summary carrying no word each return `undefined`.\n *\n * @remarks\n * A miss returns `undefined`, the one meaning `undefined` carries in every replacer here, so a\n * caller reports the block it could not rewrite. Text that opens with no\n * `/**` is no doc block: a single-star `/*` comment reaches this function only by a caller's\n * mistake, and reshaping it into a doc block would be a silent edit. A `summary` carrying no word\n * names no paragraph to write, and deleting the block's description on that argument would erase\n * documentation on the strength of an absent value — a caller with nothing to write writes\n * nothing.\n *\n * A block already carrying `summary` returns byte for byte, which is what keeps a propagation\n * that finds no drift from rewriting the file: a doc block's own wrapping is not recoverable from\n * its text, so re-wrapping an unchanged paragraph would move most blocks this package's source\n * carries. That identity reads both sides through {@link normalizeSummary}, and it holds for a\n * block carrying no tag as much as for a block carrying several. A block written on one physical\n * line stays on one line while `summary` still fits inside `width`, and expands otherwise.\n *\n * `width` counts characters from the line's first, a tab counting as one, so a wrapped line reads\n * `${indent} * ${text}` and never passes that count. A caller whose formatter measures a tab as\n * more than one column passes a smaller width rather than taking the default.\n *\n * @param comment - One complete genuine JSDoc span's raw text, as it sits in the file\n * @param summary - The block's new description paragraph\n * @param width - The character budget a re-wrapped line stays inside. Default: {@link WRAP_WIDTH}\n * @returns The block's raw text with that paragraph replaced, or `undefined` for a text that is\n * no doc block and for a `summary` carrying no word\n *\n * @example\n * ```ts\n * replaceSummary('/**' + ' Walks. *' + '/', 'Walks a tree.') // '/**' + ' Walks a tree. *' + '/'\n * ```\n */\nexport function replaceSummary(\n\tcomment: string,\n\tsummary: string,\n\twidth: number = WRAP_WIDTH,\n): string | undefined {\n\tif (!/^[ \\t]*\\/\\*\\*/.test(comment)) return undefined\n\tconst content = unwrapComment(comment)\n\tconst indent = /^[ \\t]*/.exec(comment)?.[0] ?? ''\n\tconst wrapped = wrapText(summary, width - indent.length - 3)\n\tif (wrapped.length === 0) return undefined\n\n\tconst masked = maskFences(content.join('\\n')).split('\\n')\n\tconst tag = masked.findIndex((line) => /^[ \\t]*@\\w/.test(line))\n\n\tconst described = content.slice(0, tag < 0 ? content.length : tag).join('\\n')\n\tif (normalizeSummary(described) === normalizeSummary(summary)) return comment\n\n\tconst tail = tag < 0 ? [] : content.slice(tag)\n\tif (tail.length === 0 && wrapped.length === 1 && content.length === 1) {\n\t\tconst single = `${indent}/** ${wrapped[0] ?? ''} */`\n\t\tif (single.length <= width) return single\n\t}\n\n\tconst lines = [...wrapped]\n\tif (tail.length > 0) lines.push('')\n\treturn buildComment([...lines, ...tail], indent)\n}\n\n/**\n * Replaces the body of one titled `@example` tag in a doc block's raw text and returns the whole\n * block back. The tag carrying `example`'s title takes a fence of its language and its code;\n * every other tag, the description paragraph, the block's indentation, and its continuation\n * markers all survive. A text that is no doc block, a title no tag carries, and a language or\n * code the emitted three-backtick fence cannot enclose or the doc block cannot hold each return\n * `undefined`.\n *\n * @remarks\n * A miss returns `undefined`, the one meaning `undefined` carries in every replacer here, so a\n * caller reports the block it could not rewrite. Text that opens with no\n * `/**` is no doc block, for the reason {@link replaceSummary} states. A block carrying no\n * `@example` tag of that title has nowhere to write, so an untitled tag and a tag carrying\n * another title are each left alone, and an `example` naming no title misses a block whose tags\n * all carry one. Code carrying a run of three or more backticks is a body the emitted fence\n * cannot enclose: the fence is three backticks, {@link maskFences} ends a body at the first line\n * opening a run at least as long, and {@link collectExamples} reads to the first such run\n * whatever column it sits at, so writing that body would truncate it and turn a following\n * `@`-line into a tag. A language or code carrying the doc-comment terminator is a body the\n * block itself cannot hold: the terminator closes the block where it lands and the file stops\n * parsing there. Refusing keeps the rewrite total over the bodies it can spell.\n *\n * A tag already carrying that language and code returns byte for byte. {@link maskFences} keeps\n * the current body's own lines out of the tag search, so a fenced body carrying a tag-shaped line\n * does not end the body early. The body ends at its last line carrying text, so the blank line\n * separating it from the next tag survives.\n *\n * @param comment - One complete genuine JSDoc span's raw text, as it sits in the file\n * @param example - The block whose language and code the tag's body takes\n * @returns The block's raw text with that body replaced, or `undefined` for a text that is no\n * doc block, for a title no `@example` tag carries, and for a language or code the emitted\n * fence cannot enclose or the doc block cannot hold — a body carrying the doc-comment terminator\n *\n * @example\n * ```ts\n * replaceExample('/**' + '\\n * @example Walk\\n * old()\\n *' + '/', { name: 'walk', title: 'Walk', code: 'walk()', language: 'ts' })\n * // the same block, its `@example Walk` body now a fence tagged `ts` carrying `walk()`\n * ```\n */\nexport function replaceExample(comment: string, example: SourceExample): string | undefined {\n\tif (!/^[ \\t]*\\/\\*\\*/.test(comment)) return undefined\n\tconst spelled = [example.language ?? '', ...example.code.split('\\n')]\n\tif (spelled.some((line) => line.includes('```') || line.includes('*/'))) return undefined\n\tconst content = unwrapComment(comment)\n\tconst masked = maskFences(content.join('\\n')).split('\\n')\n\tconst title = example.title ?? ''\n\tconst start = masked.findIndex((line) => {\n\t\tconst tag = /^[ \\t]*@example(?=[ \\t]|$)[ \\t]*(.*)$/.exec(line)\n\t\treturn tag !== null && (tag[1] ?? '').trim() === title\n\t})\n\tif (start < 0) return undefined\n\n\tconst current = collectExamples(content.join('\\n'), example.name).find(\n\t\t(entry) => (entry.title ?? '') === title,\n\t)\n\tif (\n\t\tcurrent !== undefined &&\n\t\tcurrent.code === example.code &&\n\t\tcurrent.language === example.language\n\t) {\n\t\treturn comment\n\t}\n\n\tconst next = masked.findIndex((line, index) => index > start && /^[ \\t]*@\\w/.test(line))\n\tconst boundary = next < 0 ? content.length : next\n\tconst last = content.findLastIndex(\n\t\t(line, index) => index > start && index < boundary && line.length > 0,\n\t)\n\tconst end = last < 0 ? start + 1 : last + 1\n\n\tconst indent = /^[ \\t]*/.exec(comment)?.[0] ?? ''\n\tconst body = [`\\`\\`\\`${example.language ?? ''}`, ...example.code.split('\\n'), '```']\n\treturn buildComment([...content.slice(0, start + 1), ...body, ...content.slice(end)], indent)\n}\n\n/**\n * Locates the doc block a compared key attaches to inside one file's text and returns the block's\n * own character region, so a caller can `slice` the block, rewrite it through\n * {@link replaceSummary} or {@link replaceExample}, and write the result back through\n * {@link spliceSpan}. `key` names the pair the way {@link findDrift} names it — a\n * {@link computeSymbolKey} key for a declaration, an `Owner.member` key for an interface or class\n * member; the region covers the block's own indentation, and no block carrying the key returns\n * `undefined`.\n *\n * @remarks\n * Attachment is {@link extractSourceComments}'s, not a second reading of the file: that walk\n * pairs each eligible block with the physical record it documents, and this function keeps the\n * record {@link collectKeys} gives `key`. The keys are that one grammar's — the map\n * {@link extractExports} and {@link extractMemberMethods} each read their own part out of — so\n * this function runs no head pattern, no member pattern, and no owner-close rule of its own, and\n * a change to any of them reaches the locator too. Every block {@link collectSummaries} reports\n * a summary for is reachable by its key, and a block carrying only block tags is reachable too although it carries no summary.\n * A block it misses is one the comparison never had: a block a blank line separates from its\n * declaration attaches to the blank line, and a block written inside a template literal or a\n * string is no genuine span at all. The first block whose record carries the key answers for it,\n * as the first declaration of a name does everywhere else.\n *\n * The region runs from the start of the opener's line, the block's indentation included, to the\n * character past its closing marker — the raw text {@link replaceSummary} and\n * {@link replaceExample} each document as the span \"as it sits in the file\", so a caller slices,\n * rewrites, and splices with no adjustment and the rewrite keeps the indentation it found. A\n * block that source material precedes on its own line starts at the opener instead. The region\n * is read off the aligned JSDoc projection rather than searched for in the text, so an opener\n * written inside a string never yields one, and line offsets come from\n * {@link extractSourceLines}'s own records under its stated LF-or-CRLF terminator rule, so a\n * CRLF file reports the offsets its own bytes carry.\n *\n * @param text - One file's whole source text\n * @param key - The compared key naming the declaration or the member\n * @returns The block's half-open character region, or `undefined` when no block carries the key\n *\n * @example\n * ```ts\n * const text = '/**' + ' Walks. *' + '/\\nexport function walk(): void {}\\n'\n * locateComment(text, 'function walk') // { start: 0, end: 13 }\n * ```\n */\nexport function locateComment(text: string, key: string): MarkdownSpan | undefined {\n\tconst lines = extractSourceLines(text)\n\tconst keys = collectKeys(lines)\n\tconst records: Array<{\n\t\treadonly line: SourceLine\n\t\treadonly index: number\n\t\treadonly offset: number\n\t\treadonly next: number\n\t}> = []\n\tfor (const [index, line] of lines.entries()) {\n\t\tconst offset = records.at(-1)?.next ?? 0\n\t\tconst after = offset + line.source.length\n\t\trecords.push({ line, index, offset, next: after + (text.startsWith('\\r\\n', after) ? 2 : 1) })\n\t}\n\tconst offsets = records.map((record) => record.offset)\n\tconst positions = new Map(records.map((record) => [record.line, record.index]))\n\tfor (const comment of extractSourceComments(lines)) {\n\t\tif (keys.get(comment.line) !== key) continue\n\t\tconst close = (positions.get(comment.line) ?? 0) - 1\n\t\tconst closing = lines[close]?.jsdoc\n\t\tconst end = closing === undefined ? -1 : closing.lastIndexOf('*/')\n\t\tif (end < 0) continue\n\t\tconst first =\n\t\t\tlines\n\t\t\t\t.keys()\n\t\t\t\t.take(close)\n\t\t\t\t.map((index) => close - index)\n\t\t\t\t.find((index) => lines[index - 1]?.jsdoc === undefined) ?? 0\n\t\tconst found = Array.prototype.keys\n\t\t\t.call({ length: close - first + 1 })\n\t\t\t.map((distance) => first + distance)\n\t\t\t.reduce(\n\t\t\t\t(state, index) => {\n\t\t\t\t\tconst projection = lines[index]?.jsdoc ?? ''\n\t\t\t\t\treturn Iterator.from(projection.matchAll(/(?=\\/\\*\\*|\\*\\/)/g)).reduce(\n\t\t\t\t\t\t(current, match) => {\n\t\t\t\t\t\t\tconst at = match.index\n\t\t\t\t\t\t\tif (at < current.cursor || !projection.startsWith(current.inside ? '*/' : '/**', at))\n\t\t\t\t\t\t\t\treturn current\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinside: !current.inside,\n\t\t\t\t\t\t\t\tline: current.inside ? current.line : index,\n\t\t\t\t\t\t\t\tcolumn: current.inside ? current.column : at,\n\t\t\t\t\t\t\t\tcursor: at + (current.inside ? 2 : 3),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ ...state, cursor: 0 },\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\t{ inside: false, line: -1, column: -1, cursor: 0 },\n\t\t\t)\n\t\tif (found.line < 0) continue\n\t\tconst source = lines[found.line]?.source ?? ''\n\t\tconst start = source.slice(0, found.column).trim() === '' ? 0 : found.column\n\t\treturn { start: (offsets[found.line] ?? 0) + start, end: (offsets[close] ?? 0) + end + 2 }\n\t}\n\treturn undefined\n}\n","import type { ManifestEntry } from './types.js'\nimport { createMarkdown, flattenText, isTableNode } from '@orkestrel/markdown'\nimport { isEmptyString, isNonEmptyArray } from '@orkestrel/contract'\nimport { MANIFEST } from './constants.js'\nimport {\n\textractCellLinks,\n\tnormalizeDirectories,\n\tresolvePath,\n\tselectSectionBlocks,\n} from './helpers.js'\n\n/**\n * Parses a `## By concept` manifest table into its {@link ManifestEntry} rows —\n * each row's Concept cell (flattened text), Spec / Tests cells (a single link\n * href, resolved against `directory`), and Source cell (every link href,\n * resolved against `directory`; Source links canonicalize through\n * {@link normalizeDirectories}, one directory collapses to a `string`, and several become\n * a `readonly string[]`). A row missing a concept, spec link, tests link, or\n * source link is skipped as malformed.\n *\n * @param markdown - The manifest markdown source, for example the content of `guides/README.md`\n * @param directory - The root-relative directory containing the manifest\n * @returns The manifest's entries, in row order\n *\n * @example\n * ```ts\n * parseManifest(readme, 'guides') // [{ concept: 'Markdown', spec: 'guides/src/markdown.md', ... }]\n * ```\n */\nexport function parseManifest(markdown: string, directory: string): readonly ManifestEntry[] {\n\tconst document = createMarkdown(markdown).document\n\tconst entries: ManifestEntry[] = []\n\n\tfor (const block of selectSectionBlocks(document, MANIFEST)) {\n\t\tif (!isTableNode(block)) continue\n\n\t\tfor (const row of block.rows) {\n\t\t\tconst conceptCell = row[0]\n\t\t\tconst specCell = row[1]\n\t\t\tconst sourceCell = row[2]\n\t\t\tconst testsCell = row[3]\n\t\t\tif (\n\t\t\t\tconceptCell === undefined ||\n\t\t\t\tspecCell === undefined ||\n\t\t\t\tsourceCell === undefined ||\n\t\t\t\ttestsCell === undefined\n\t\t\t) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst concept = flattenText({ element: 'paragraph', children: conceptCell }).trim()\n\t\t\tif (isEmptyString(concept)) continue\n\n\t\t\tconst specHref = extractCellLinks(specCell)[0]\n\t\t\tconst testsHref = extractCellLinks(testsCell)[0]\n\t\t\tif (specHref === undefined || testsHref === undefined) continue\n\n\t\t\tconst sourceHrefs = normalizeDirectories(\n\t\t\t\textractCellLinks(sourceCell).map((href) => resolvePath(directory, href)),\n\t\t\t)\n\t\t\tif (!isNonEmptyArray<string>(sourceHrefs)) continue\n\t\t\tconst [firstSource] = sourceHrefs\n\t\t\tconst source = sourceHrefs.length === 1 ? firstSource : sourceHrefs\n\n\t\t\tentries.push({\n\t\t\t\tconcept,\n\t\t\t\tspec: resolvePath(directory, specHref),\n\t\t\t\tsource,\n\t\t\t\ttests: resolvePath(directory, testsHref),\n\t\t\t})\n\t\t}\n\t}\n\n\treturn entries\n}\n","import {\n\tarrayShape,\n\tliteralShape,\n\tobjectShape,\n\toptionalShape,\n\tstringShape,\n\tunionShape,\n} from '@orkestrel/contract'\nimport { DRIFT_CATEGORIES, EXPORT_KEYWORDS } from './constants.js'\n\n// AGENTS.md § Design laws: shapers are `ContractShape` values, not functions\n// or types - a JSON-Schema blueprint the compilers (factories.ts) turn into a\n// guard / parser / schema / generator in lockstep. Every documented data type\n// here is non-recursive, so each shapes directly (no `lazyOf` gate needed).\n\n/**\n * Shapes a {@link SurfaceSymbol} — a documented / exported symbol's `name`\n * paired with its {@link ExportKeyword}, optional `signature`, and optional compared `summary`.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { surfaceSymbolShape } from '@orkestrel/guide'\n *\n * const surfaceSymbol = createContract(surfaceSymbolShape)\n * surfaceSymbol.is({ name: 'Markdown', keyword: 'class' }) // true\n * ```\n */\nexport const surfaceSymbolShape = objectShape({\n\tname: stringShape(),\n\tkeyword: literalShape(EXPORT_KEYWORDS),\n\tsignature: optionalShape(stringShape()),\n\tsummary: optionalShape(stringShape()),\n})\n\n/**\n * Shapes a {@link MethodEntry} — one documented method's `name` paired with its optional\n * compared `summary`.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { methodEntryShape } from '@orkestrel/guide'\n *\n * const methodEntry = createContract(methodEntryShape)\n * methodEntry.is({ name: 'walk' }) // true\n * ```\n */\nexport const methodEntryShape = objectShape({\n\tname: stringShape(),\n\tsummary: optionalShape(stringShape()),\n})\n\n/**\n * Shapes a {@link SourceExample} — one `@example` block's `name`, its optional pairing\n * `title`, its `code`, and its optional fence `language`.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { sourceExampleShape } from '@orkestrel/guide'\n *\n * const sourceExample = createContract(sourceExampleShape)\n * sourceExample.is({ name: 'walk', code: 'walk()' }) // true\n * ```\n */\nexport const sourceExampleShape = objectShape({\n\tname: stringShape(),\n\ttitle: optionalShape(stringShape()),\n\tcode: stringShape(),\n\tlanguage: optionalShape(stringShape()),\n})\n\n/**\n * Shapes a {@link Drift} — one disagreement's compared `key` with the optional text each\n * side carries there.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { driftShape } from '@orkestrel/guide'\n *\n * const drift = createContract(driftShape)\n * drift.is({ key: 'class Widget', category: 'summary', guide: 'A widget.' }) // true\n * ```\n */\nexport const driftShape = objectShape({\n\tkey: stringShape(),\n\tcategory: literalShape(DRIFT_CATEGORIES),\n\tguide: optionalShape(stringShape()),\n\tsource: optionalShape(stringShape()),\n})\n\n/**\n * Shapes a {@link MethodGroup} — a backticked `interface` name paired with\n * its documented `methods`.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { methodGroupShape } from '@orkestrel/guide'\n *\n * const methodGroup = createContract(methodGroupShape)\n * methodGroup.is({ interface: 'MarkdownInterface', methods: ['walk'] }) // true\n * ```\n */\nexport const methodGroupShape = objectShape({\n\tinterface: stringShape(),\n\tmethods: arrayShape(methodEntryShape),\n})\n\n/**\n * Shapes a {@link ManifestEntry} — one `## By concept` manifest row, `source`\n * accepting either a single directory or several.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { manifestEntryShape } from '@orkestrel/guide'\n *\n * const manifestEntry = createContract(manifestEntryShape)\n * manifestEntry.is({ concept: 'Markdown', spec: 'guides/src/markdown.md', source: 'src/core', tests: 'tests/src/core' }) // true\n * ```\n */\nexport const manifestEntryShape = objectShape({\n\tconcept: stringShape(),\n\tspec: stringShape(),\n\tsource: unionShape(stringShape(), arrayShape(stringShape())),\n\ttests: stringShape(),\n})\n","import type { GuideFence, GuideInterface, MethodGroup, SurfaceSymbol } from './types.js'\nimport { createMarkdown, flattenText, isHeadingNode } from '@orkestrel/markdown'\nimport {\n\textractFences,\n\textractLinks,\n\textractMethods,\n\textractSurface,\n\textractTagline,\n\textractTests,\n\textractUnnamed,\n\tvalidateSurface,\n} from './helpers.js'\n\n/**\n * Presents a pure, structured view over one parsed guide — the documented\n * projections (`sections` / `tagline` / `surface` / `methods` / `unnamed` / `links` /\n * `tests` / `fences`) are extracted once at construction and cached.\n *\n * @remarks\n * Parses `source` once through `@orkestrel/markdown` and never touches the\n * filesystem — `Guide` reads only the markdown text it is given and records\n * nothing about where the guide came from. Every accessor returns the same\n * cached, readonly array on every call. Before caching, refuses the first Surface table with\n * a header other than `Name | Kind | Signature | Summary` or a keyed empty Signature cell,\n * through {@link validateSurface}.\n *\n * @example\n * ```ts\n * import { Guide } from '@orkestrel/guide'\n *\n * const guide = new Guide('## Surface\\n\\n| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `X` | class | `new () => X` | |')\n * guide.surface() // [{ name: 'X', keyword: 'class', signature: '`new () => X`' }]\n * ```\n */\nexport class Guide implements GuideInterface {\n\treadonly #sections: readonly string[]\n\treadonly #tagline: string | undefined\n\treadonly #surface: readonly SurfaceSymbol[]\n\treadonly #methods: readonly MethodGroup[]\n\treadonly #unnamed: readonly string[]\n\treadonly #links: readonly string[]\n\treadonly #tests: readonly string[]\n\treadonly #fences: readonly GuideFence[]\n\n\tconstructor(source: string) {\n\t\tconst document = createMarkdown(source).document\n\t\tvalidateSurface(document)\n\n\t\tthis.#sections = document.children\n\t\t\t.filter(isHeadingNode)\n\t\t\t.filter((heading) => heading.level === 2)\n\t\t\t.map((heading) => flattenText(heading).trim())\n\t\tthis.#tagline = extractTagline(document)\n\t\tthis.#surface = extractSurface(document)\n\t\tthis.#methods = extractMethods(document)\n\t\tthis.#unnamed = extractUnnamed(document)\n\t\tthis.#links = extractLinks(document)\n\t\tthis.#tests = extractTests(document)\n\t\tthis.#fences = extractFences(document)\n\t}\n\n\tsections(): readonly string[] {\n\t\treturn this.#sections\n\t}\n\n\ttagline(): string | undefined {\n\t\treturn this.#tagline\n\t}\n\n\tsurface(): readonly SurfaceSymbol[] {\n\t\treturn this.#surface\n\t}\n\n\tmethods(): readonly MethodGroup[] {\n\t\treturn this.#methods\n\t}\n\n\tunnamed(): readonly string[] {\n\t\treturn this.#unnamed\n\t}\n\n\tlinks(): readonly string[] {\n\t\treturn this.#links\n\t}\n\n\ttests(): readonly string[] {\n\t\treturn this.#tests\n\t}\n\n\tfences(): readonly GuideFence[] {\n\t\treturn this.#fences\n\t}\n}\n","import type {\n\tDeclaration,\n\tDeclarationKeyword,\n\tMethodEntry,\n\tSourceExample,\n\tSourceInterface,\n\tSourceOptions,\n\tSurfaceSymbol,\n} from '../types.js'\nimport {\n\tcollectDeclarations,\n\tcomputeSymbolKey,\n\textractExampleMethods,\n\textractExamples,\n\textractExports,\n\textractHidden,\n\textractMemberMethods,\n\textractSignatures,\n\textractSourceLines,\n\thasCanonicalSegments,\n\tnormalizeDirectories,\n\tresolveLink,\n\tresolvePath,\n\tselectModuleKeys,\n} from '../helpers.js'\n\n/**\n * Reflects, as a pure `SourceInterface`, a module scope's intentional direct declarations,\n * conventional barrel-reachable surface, and member methods over a consumer-supplied file\n * inventory, using text-only line scanners rather than the TypeScript compiler API or the\n * filesystem. `Source` never touches disk:\n * the consumer gathers the inventory however their environment allows\n * (`node:fs` in a Node script, `import.meta.glob` in a browser/vitest run) and\n * passes it in as `files`.\n *\n * @remarks\n * Conventional barrel traversal recurses through both\n * exact workspace-root `index.ts` and nested `/index.ts` targets. `'.'` is the\n * canonical workspace-root module, module spellings normalize once at\n * construction, and exact opaque inventory keys are never rewritten; keys with\n * empty, `.` or `..` segments stay outside both initial and resolved barrel\n * inventory entrances after relative-row reduction; canonical parent hops\n * remain valid. `methods` resolves a declaration's members through its\n * `extends` chain within the same module scope, keeping the keyword it started\n * from; a base the scope does not declare contributes nothing. One declaration\n * answers under each keyword: the first file in sorted key order that declares\n * the head supplies its members and its bases, and a second file declaring the\n * same name under that keyword adds nothing. The interface answers for a name,\n * and the class when no interface declares it; one file declaring the name as\n * both shapes, a TypeScript declaration merge, answers with both, own members\n * ahead of inherited ones and the interface's own first. Every reading derives once per instance from the immutable\n * inventory and is reused — the scope's declaration map on the first `methods`\n * or `examples` lookup, then each name's members and each example collection\n * under the name asked for — so a reader asking twice reads the files once and\n * receives the same records, and a second instance over the same inventory\n * derives the same readings of its own. Source projection preserves columns\n * without widening direct/hidden column-zero heads. Literal ECMAScript Unicode\n * identifiers participate in bounded slash-state recognition without escape\n * decoding. Regex recognition is bounded: slash after bare `}` is division, so\n * a post-brace regex statement requires an explicit `;`. General semicolonless\n * declaration/ASI classification is also outside the finite projector, so a\n * slash-leading statement after such a declaration requires an explicit `;`.\n *\n * @example\n * ```ts\n * import { Source } from '@orkestrel/guide'\n *\n * const source = new Source({\n * \tfiles: {\n * \t\t'src/core/index.ts': \"export * from './Guide.js'\\nexport * from './types.js'\\n\",\n * \t\t'src/core/Guide.ts': 'export class Guide {}\\n',\n * \t\t'src/core/types.ts': 'export interface GuideInterface {\\n\\tsections(): void\\n}\\n',\n * \t},\n * \tmodule: 'src/core',\n * })\n * source.exports() // [{ name: 'Guide', keyword: 'class' }, { name: 'GuideInterface', keyword: 'interface' }]\n * source.surface() // [{ name: 'Guide', keyword: 'class' }, { name: 'GuideInterface', keyword: 'interface' }]\n * source.methods('GuideInterface') // [{ name: 'sections' }]\n * source.exists('src/core/Guide.ts') // true\n * ```\n */\nexport class Source implements SourceInterface {\n\treadonly #files: Readonly<Record<string, string>>\n\treadonly #directories: readonly string[]\n\treadonly #methods = new Map<string, readonly MethodEntry[]>()\n\treadonly #examples = new Map<string | undefined, readonly SourceExample[]>()\n\t#exports: readonly SurfaceSymbol[] | undefined\n\t#surface: readonly SurfaceSymbol[] | undefined\n\t#hidden: readonly SurfaceSymbol[] | undefined\n\t#declarations: ReadonlyMap<string, Declaration> | undefined\n\treadonly #origins = new Map<string, string>()\n\treadonly #emitted: Readonly<Record<string, string>> | undefined\n\treadonly #signed = new Map<string, readonly SurfaceSymbol[]>()\n\n\tconstructor(options: SourceOptions) {\n\t\tthis.#files = options.files\n\t\tthis.#directories = normalizeDirectories(options.module)\n\t\tthis.#emitted = options.declarations\n\t}\n\n\t// The module's exports are computed once on first access and cached —\n\t// every subsequent call reuses the same scan of an immutable inventory.\n\texports(): readonly SurfaceSymbol[] {\n\t\tif (this.#exports === undefined)\n\t\t\tthis.#exports = this.#scanSymbols((key, text) => this.#scanExports(key, text))\n\t\treturn this.#exports\n\t}\n\n\t// The conventional barrel surface is computed once on first access and\n\t// cached independently from the intentional direct-declaration inventory.\n\tsurface(): readonly SurfaceSymbol[] {\n\t\tif (this.#surface === undefined) this.#surface = this.#scanSurface()\n\t\treturn this.#surface\n\t}\n\n\t// A name's members are computed once per instance and cached under that name, so a\n\t// reader asking twice resolves one `extends` chain rather than two.\n\tmethods(name: string): readonly MethodEntry[] {\n\t\tconst cached = this.#methods.get(name)\n\t\tif (cached !== undefined) return cached\n\n\t\tconst members = this.#scanMethods(name)\n\t\tthis.#methods.set(name, members)\n\t\treturn members\n\t}\n\n\texists(relative: string): boolean {\n\t\tconst keys = Object.keys(this.#files)\n\t\treturn keys.some((key) => key === relative || key.startsWith(`${relative}/`))\n\t}\n\n\t// The module's hidden declarations are computed once on first access and\n\t// cached — mirrors `exports()`'s caching.\n\thidden(): readonly SurfaceSymbol[] {\n\t\tif (this.#hidden === undefined)\n\t\t\tthis.#hidden = this.#scanSymbols((_key, text) => extractHidden(text))\n\t\treturn this.#hidden\n\t}\n\n\t// Each reading is computed once per instance and cached under the name it was asked\n\t// for, the module-wide collection under the absent name.\n\texamples(): readonly SourceExample[]\n\texamples(name: string): readonly SourceExample[]\n\texamples(name?: string): readonly SourceExample[] {\n\t\tconst cached = this.#examples.get(name)\n\t\tif (cached !== undefined) return cached\n\n\t\tconst examples = name === undefined ? this.#scanExamples() : this.#exampleMembers(name)\n\t\tthis.#examples.set(name, examples)\n\t\treturn examples\n\t}\n\n\t// TypeScript merges a class and an interface only inside one module, so one file declaring a\n\t// name as both shapes answers with both member sets: each shape's own members ahead of\n\t// inherited ones, the interface's own first, as in `#exampleMembers`. Shapes from two files are\n\t// separate declarations, so the interface answers and the class answers only when no interface\n\t// declares the name. A class's members arrive without the `constructor` no guide documents.\n\t#scanMethods(name: string): readonly MethodEntry[] {\n\t\tconst fromInterface = this.#members('interface', name, new Set<string>())\n\t\tconst fromClass = this.#members('class', name, new Set<string>())?.filter(\n\t\t\t(entry) => entry.name !== 'constructor',\n\t\t)\n\t\tconst origin = this.#origin('interface', name)\n\t\tif (origin === undefined || origin !== this.#origin('class', name))\n\t\t\treturn fromInterface ?? fromClass ?? []\n\n\t\tconst methods = new Map<string, MethodEntry>()\n\t\tfor (const entry of [\n\t\t\t...extractMemberMethods(this.#locate('interface', name)?.body ?? []),\n\t\t\t...extractMemberMethods(this.#locate('class', name)?.body ?? []),\n\t\t\t...(fromInterface ?? []),\n\t\t\t...(fromClass ?? []),\n\t\t])\n\t\t\tif (entry.name !== 'constructor' && !methods.has(entry.name)) methods.set(entry.name, entry)\n\n\t\treturn Array.from(methods.values()).sort((a, b) =>\n\t\t\ta.name === b.name ? 0 : a.name < b.name ? -1 : 1,\n\t\t)\n\t}\n\n\t// The union of exported declaration heads' `@example` blocks across the module's\n\t// files, deduped by name and title in first-seen order — mirrors `#scanSymbols`,\n\t// but over the `@example` scanner rather than a `SurfaceSymbol` one.\n\t#scanExamples(): readonly SourceExample[] {\n\t\tconst examples: SourceExample[] = []\n\t\tconst seen = new Set<string>()\n\n\t\tfor (const key of selectModuleKeys(this.#files, this.#directories)) {\n\t\t\tconst text = this.#files[key]\n\t\t\tif (text === undefined) continue\n\n\t\t\tfor (const example of extractExamples(text)) {\n\t\t\t\tconst identity = `${example.name}\\n${example.title ?? ''}`\n\t\t\t\tif (seen.has(identity)) continue\n\t\t\t\tseen.add(identity)\n\t\t\t\texamples.push(example)\n\t\t\t}\n\t\t}\n\n\t\treturn examples\n\t}\n\n\t// The graph closure of each selected directory's conventional root barrel,\n\t// deduped with the same identity and ordering as the direct export scan.\n\t#scanSurface(): readonly SurfaceSymbol[] {\n\t\tconst symbols: SurfaceSymbol[] = []\n\t\tconst seen = new Set<string>()\n\t\tconst visited = new Set<string>()\n\n\t\tfor (const directory of this.#directories) {\n\t\t\tthis.#collectSurface(resolvePath(directory, 'index.ts'), visited, symbols, seen)\n\t\t}\n\n\t\treturn symbols.sort((a, b) => (a.name === b.name ? 0 : a.name < b.name ? -1 : 1))\n\t}\n\n\t// Traverse one exact canonical index inventory key. Only complete\n\t// conventional relative `.js` star rows whose reduced targets are canonical\n\t// enter the graph; every other line is outside the reflected population and\n\t// remains validation-owned by policy and builds.\n\t#collectSurface(\n\t\tindex: string,\n\t\tvisited: Set<string>,\n\t\tsymbols: SurfaceSymbol[],\n\t\tseen: Set<string>,\n\t): void {\n\t\tif (!hasCanonicalSegments(index)) return\n\t\tif (visited.has(index)) return\n\t\tvisited.add(index)\n\n\t\tconst source = this.#files[index]\n\t\tif (source === undefined) return\n\n\t\tfor (const line of extractSourceLines(source)) {\n\t\t\tconst row = line.code.match(\n\t\t\t\t/^\\s*export\\s+\\*\\s+from\\s+(?:'(\\.\\.?\\/[^']+\\.js)'|\"(\\.\\.?\\/[^\"]+\\.js)\")\\s*;?\\s*(?:\\/\\/.*)?$/,\n\t\t\t)\n\t\t\tconst target = row?.[1] ?? row?.[2]\n\t\t\tif (target === undefined) continue\n\n\t\t\tconst path = resolveLink(index, `${target.slice(0, -3)}.ts`)\n\t\t\tif (!hasCanonicalSegments(path)) continue\n\t\t\tif (path === 'index.ts' || path.endsWith('/index.ts')) {\n\t\t\t\tthis.#collectSurface(path, visited, symbols, seen)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (visited.has(path)) continue\n\t\t\tvisited.add(path)\n\n\t\t\tconst text = this.#files[path]\n\t\t\tif (text === undefined) continue\n\t\t\tfor (const symbol of this.#scanExports(path, text)) {\n\t\t\t\tconst identity = computeSymbolKey(symbol)\n\t\t\t\tif (seen.has(identity)) continue\n\t\t\t\tseen.add(identity)\n\t\t\t\tsymbols.push(symbol)\n\t\t\t}\n\t\t}\n\t}\n\n\t// The `@example` blocks of the interface-or-class declaration body named\n\t// `name`, unioning both shapes (an implementer may carry its own `@example` a\n\t// documented interface member does not, or vice versa). The interface's own\n\t// block answers first for a member both shapes document.\n\t#exampleMembers(name: string): readonly SourceExample[] {\n\t\tconst members = new Map<string, SourceExample>()\n\n\t\tfor (const example of [\n\t\t\t...extractExampleMethods(this.#locate('interface', name)?.body ?? []),\n\t\t\t...extractExampleMethods(this.#locate('class', name)?.body ?? []),\n\t\t]) {\n\t\t\tconst identity = `${example.name}\\n${example.title ?? ''}`\n\t\t\tif (members.has(identity)) continue\n\t\t\tmembers.set(identity, example)\n\t\t}\n\n\t\treturn Array.from(members.values()).sort((a, b) =>\n\t\t\ta.name === b.name ? 0 : a.name < b.name ? -1 : 1,\n\t\t)\n\t}\n\n\t// The pure union-and-dedupe-and-sort composition behind `exports()` and\n\t// `hidden()` — kept as a private method because it orchestrates a scanner\n\t// across every file of the module scope rather than being a self-contained\n\t// leaf.\n\t#scanSymbols(\n\t\tscan: (key: string, source: string) => readonly SurfaceSymbol[],\n\t): readonly SurfaceSymbol[] {\n\t\tconst symbols: SurfaceSymbol[] = []\n\t\tconst seen = new Set<string>()\n\n\t\tfor (const key of selectModuleKeys(this.#files, this.#directories)) {\n\t\t\tconst text = this.#files[key]\n\t\t\tif (text === undefined) continue\n\n\t\t\tfor (const symbol of scan(key, text)) {\n\t\t\t\tconst identity = computeSymbolKey(symbol)\n\t\t\t\tif (seen.has(identity)) continue\n\t\t\t\tseen.add(identity)\n\t\t\t\tsymbols.push(symbol)\n\t\t\t}\n\t\t}\n\n\t\treturn symbols.sort((a, b) => (a.name === b.name ? 0 : a.name < b.name ? -1 : 1))\n\t}\n\n\t// One file's exports, each carrying the signature its emitted declaration projects when the\n\t// options supply one, read once per inventory key and reused by `exports()` and `surface()`.\n\t#scanExports(key: string, text: string): readonly SurfaceSymbol[] {\n\t\tconst cached = this.#signed.get(key)\n\t\tif (cached !== undefined) return cached\n\n\t\tconst declaration = this.#emitted?.[`${key.slice(0, -3)}.d.ts`]\n\t\tconst signatures = new Map(\n\t\t\t(declaration === undefined ? [] : extractSignatures(declaration)).map((symbol) => [\n\t\t\t\tcomputeSymbolKey(symbol),\n\t\t\t\tsymbol.signature,\n\t\t\t]),\n\t\t)\n\t\tconst symbols = extractExports(text).map((symbol) => {\n\t\t\tconst signature = signatures.get(computeSymbolKey(symbol))\n\t\t\treturn signature === undefined\n\t\t\t\t? symbol\n\t\t\t\t: {\n\t\t\t\t\t\tname: symbol.name,\n\t\t\t\t\t\tkeyword: symbol.keyword,\n\t\t\t\t\t\tsignature,\n\t\t\t\t\t\t...(symbol.summary === undefined ? {} : { summary: symbol.summary }),\n\t\t\t\t\t}\n\t\t})\n\t\tthis.#signed.set(key, symbols)\n\t\treturn symbols\n\t}\n\n\t// The declared members of the `keyword` declaration named `name` unioned with\n\t// those of every declaration it extends, each carrying its own doc block's\n\t// description paragraph. `undefined` states one fact only — the module scope\n\t// declares no such head — which is what sends `methods()` on to the class\n\t// shape; a name already on the visit path is declared and returns an empty\n\t// union, so a cycle and a diamond each collapse to one visit. A base the scope\n\t// does not declare contributes nothing, and a member the declaration itself\n\t// documents answers ahead of the base it overrides.\n\t#members(\n\t\tkeyword: DeclarationKeyword,\n\t\tname: string,\n\t\tvisited: Set<string>,\n\t): readonly MethodEntry[] | undefined {\n\t\tif (visited.has(name)) return []\n\t\tvisited.add(name)\n\n\t\tconst declaration = this.#locate(keyword, name)\n\t\tif (declaration === undefined) return undefined\n\n\t\tconst methods = new Map<string, MethodEntry>()\n\t\tfor (const entry of extractMemberMethods(declaration.body)) methods.set(entry.name, entry)\n\t\tfor (const base of declaration.bases) {\n\t\t\tfor (const member of this.#members(keyword, base, visited) ?? []) {\n\t\t\t\tif (!methods.has(member.name)) methods.set(member.name, member)\n\t\t\t}\n\t\t}\n\n\t\treturn Array.from(methods.values()).sort((a, b) =>\n\t\t\ta.name === b.name ? 0 : a.name < b.name ? -1 : 1,\n\t\t)\n\t}\n\n\t// The one declaration that answers for `name`, read from the scope's declaration map,\n\t// which is collected once on first lookup and reused by every later one.\n\t#locate(keyword: DeclarationKeyword, name: string): Declaration | undefined {\n\t\tif (this.#declarations === undefined) this.#declarations = this.#scanDeclarations()\n\t\treturn this.#declarations.get(`${keyword} ${name}`)\n\t}\n\n\t// The inventory key of the file whose head answers for `name` under `keyword`, recorded by\n\t// the same scan as the declaration map.\n\t#origin(keyword: DeclarationKeyword, name: string): string | undefined {\n\t\treturn this.#locate(keyword, name) === undefined\n\t\t\t? undefined\n\t\t\t: this.#origins.get(`${keyword} ${name}`)\n\t}\n\n\t// The scope's declarations, keyed `${keyword} ${name}` — one `collectDeclarations`\n\t// pass per file in sorted key order, so a scope reads each file once however many\n\t// names it resolves. The first file whose located head has a body or bases answers\n\t// for a key, its body and bases read together, so a later file declaring the same\n\t// name contributes nothing. A located head with neither a body nor bases does not\n\t// declare; the scan continues past it to a later file or leaves the key unanswered.\n\t#scanDeclarations(): ReadonlyMap<string, Declaration> {\n\t\tconst declarations = new Map<string, Declaration>()\n\n\t\tfor (const key of selectModuleKeys(this.#files, this.#directories)) {\n\t\t\tconst text = this.#files[key]\n\t\t\tif (text === undefined) continue\n\n\t\t\tfor (const [identity, declaration] of collectDeclarations(text)) {\n\t\t\t\tif (declarations.has(identity)) continue\n\t\t\t\tif (declaration.body.length === 0 && declaration.bases.length === 0) continue\n\t\t\t\tdeclarations.set(identity, declaration)\n\t\t\t\tthis.#origins.set(identity, key)\n\t\t\t}\n\t\t}\n\n\t\treturn declarations\n\t}\n}\n","import type { SourceInterface, SourceManagerInterface, SourceManagerOptions } from '../types.js'\nimport { computeModuleKey } from '../helpers.js'\nimport { Source } from './Source.js'\n\n/**\n * Resolves a consumer-owned import-specifier policy into pure source views and\n * caches those views by module, so aliases for one module share one entity.\n * Unmapped specifiers remain foreign to the consumer and return `undefined`.\n * `sources()` enumerates the same shared views, one per distinct module the\n * policy maps.\n *\n * @example\n * ```ts\n * import { SourceManager } from '@orkestrel/guide'\n *\n * const sources = new SourceManager({\n * \tfiles: { 'src/core/index.ts': \"export * from './types.js'\" },\n * \tmodules: { '@scope/package': 'src/core' },\n * })\n * sources.source('@scope/package')?.surface()\n * sources.sources() // [the same shared view]\n * ```\n */\nexport class SourceManager implements SourceManagerInterface {\n\treadonly #files: Readonly<Record<string, string>>\n\treadonly #modules: SourceManagerOptions['modules']\n\treadonly #sources = new Map<string, SourceInterface>()\n\n\tconstructor(options: SourceManagerOptions) {\n\t\tthis.#files = options.files\n\t\tthis.#modules = options.modules\n\t}\n\n\tsource(specifier: string): SourceInterface | undefined {\n\t\tif (!Object.hasOwn(this.#modules, specifier)) return undefined\n\t\tconst module = this.#modules[specifier]\n\t\tif (module === undefined) return undefined\n\n\t\tconst key = computeModuleKey(module)\n\t\tconst existing = this.#sources.get(key)\n\t\tif (existing !== undefined) return existing\n\n\t\tconst source = new Source({ files: this.#files, module })\n\t\tthis.#sources.set(key, source)\n\t\treturn source\n\t}\n\n\tsources(): readonly SourceInterface[] {\n\t\tconst views: SourceInterface[] = []\n\t\tconst seen = new Set<SourceInterface>()\n\n\t\tfor (const specifier of Object.keys(this.#modules)) {\n\t\t\tconst view = this.source(specifier)\n\t\t\tif (view === undefined || seen.has(view)) continue\n\t\t\tseen.add(view)\n\t\t\tviews.push(view)\n\t\t}\n\n\t\treturn views\n\t}\n}\n","import type { MarkdownSpan } from '@orkestrel/markdown'\nimport type {\n\tDrift,\n\tManifestEntry,\n\tParityExampleResult,\n\tParityFinding,\n\tParityInterface,\n\tParityOptions,\n\tParityResult,\n\tParityRewriteResult,\n\tParityRow,\n\tSourceExample,\n} from './types.js'\nimport { isNonEmptyString } from '@orkestrel/contract'\nimport {\n\tbuildCell,\n\tcollectExamples,\n\tcollectTitles,\n\tcompareMembership,\n\tcomputeSymbolKey,\n\textractFenceImports,\n\tfindDrift,\n\tfindMissing,\n\tfindMissingSymbols,\n\tfindUnexampled,\n\tfindUnlisted,\n\tformatDrift,\n\tformatSide,\n\thasBehaviouralSurface,\n\tidentifyDrift,\n\tisExternalLink,\n\tlocateComment,\n\tnormalizeDirectories,\n\tnormalizeComment,\n\treplaceCell,\n\treplaceExample,\n\treplaceFence,\n\treplaceSummary,\n\tresolveLink,\n\tselectModuleKeys,\n\tspliceSpan,\n\tvalidateModules,\n} from './helpers.js'\nimport { METHODS, SIGNATURE, SUMMARY, SURFACE, TESTS } from './constants.js'\nimport { Guide } from './Guide.js'\nimport { GuideError, isGuideError } from './errors.js'\nimport { Source } from './sources/Source.js'\nimport { SourceManager } from './sources/SourceManager.js'\n\n/**\n * Composes generic guide-parity inspection and explicit in-memory rewrites over a caller inventory.\n */\nexport class Parity implements ParityInterface {\n\treadonly #options: ParityOptions\n\treadonly #rows: readonly ParityRow[]\n\n\tconstructor(options: ParityOptions) {\n\t\tthis.#options = {\n\t\t\tfiles: { ...options.files },\n\t\t\tentries: options.entries.map((entry) => ({ ...entry })),\n\t\t\tmodules: { ...options.modules },\n\t\t\tlanguages: [...options.languages],\n\t\t\tlanguage: options.language,\n\t\t\t...(options.pitch === undefined ? {} : { pitch: { ...options.pitch } }),\n\t\t\t...(options.declarations === undefined ? {} : { declarations: { ...options.declarations } }),\n\t\t}\n\t\tthis.#rows = this.#createRows(this.#options.files)\n\t}\n\n\trows(): readonly ParityRow[] {\n\t\treturn this.#rows\n\t}\n\n\tinspect(): ParityResult {\n\t\tconst input: ParityFinding[] = []\n\t\tconst sections: ParityFinding[] = []\n\t\tconst surface: ParityFinding[] = []\n\t\tconst methods: ParityFinding[] = []\n\t\tconst declarations: ParityFinding[] = []\n\t\tconst links: ParityFinding[] = []\n\t\tconst tests: ParityFinding[] = []\n\t\tconst fences: ParityFinding[] = []\n\t\tconst exampleFences: ParityFinding[] = []\n\t\tconst exampleFunctions: ParityFinding[] = []\n\t\tconst exampleMethods: ParityFinding[] = []\n\t\tconst exampleTitles: ParityFinding[] = []\n\t\tconst examples: ParityExampleResult = {\n\t\t\tfences: exampleFences,\n\t\t\tfunctions: exampleFunctions,\n\t\t\tmethods: exampleMethods,\n\t\t\ttitles: exampleTitles,\n\t\t}\n\t\tconst imports: ParityFinding[] = []\n\t\tconst drift: ParityFinding[] = []\n\t\tconst pitch: ParityFinding[] = []\n\n\t\tthis.#inspectInput(input)\n\t\tfor (const row of this.#rows) {\n\t\t\tthis.#inspectSections(row, sections)\n\t\t\tthis.#inspectSurface(row, surface)\n\t\t\tthis.#inspectMethods(row, methods)\n\t\t\tthis.#inspectDeclarations(row, declarations)\n\t\t\tthis.#inspectLinks(row, links, tests)\n\t\t\tthis.#inspectFences(row, fences)\n\t\t\tthis.#inspectExamples(row, exampleFences, exampleFunctions, exampleMethods, exampleTitles)\n\t\t\tthis.#inspectImports(row, imports)\n\t\t\tthis.#inspectDrift(row, drift)\n\t\t}\n\t\tthis.#inspectPitch(pitch)\n\n\t\treturn {\n\t\t\tinput,\n\t\t\tsections,\n\t\t\tsurface,\n\t\t\tmethods,\n\t\t\tdeclarations,\n\t\t\tlinks,\n\t\t\ttests,\n\t\t\tfences,\n\t\t\texamples,\n\t\t\timports,\n\t\t\tdrift,\n\t\t\tpitch,\n\t\t}\n\t}\n\n\tdocument(): ParityRewriteResult {\n\t\treturn this.#rewrite((row, drift, files) => this.#rewriteGuide(row, drift, files))\n\t}\n\n\tannotate(): ParityRewriteResult {\n\t\treturn this.#rewrite((row, drift, files) => this.#rewriteSource(row, drift, files))\n\t}\n\n\t#rewrite(\n\t\tapply: (row: ParityRow, drift: Drift, files: Map<string, string>) => string | undefined,\n\t): ParityRewriteResult {\n\t\tconst files = new Map(Object.entries(this.#options.files))\n\t\tconst reasons = new Map<string, string>()\n\t\tconst requested = new Set<string>()\n\n\t\tfor (const row of this.#rows) {\n\t\t\tfor (const drift of findDrift(row.guide, row.source)) {\n\t\t\t\tconst identity = identifyDrift(row.entry.spec, drift)\n\t\t\t\trequested.add(identity)\n\t\t\t\tconst reason = apply(row, drift, files)\n\t\t\t\tif (reason !== undefined) reasons.set(identity, reason)\n\t\t\t}\n\t\t}\n\n\t\tconst inventory = Object.fromEntries(files)\n\t\tconst remaining: ParityFinding[] = []\n\t\tconst result = new Parity({ ...this.#options, files: inventory })\n\t\tremaining.push(...result.inspect().input)\n\t\tfor (const row of result.rows()) {\n\t\t\tfor (const drift of findDrift(row.guide, row.source)) {\n\t\t\t\tconst identity = identifyDrift(row.entry.spec, drift)\n\t\t\t\tif (!requested.has(identity)) continue\n\t\t\t\tremaining.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${formatDrift(drift)}; ${reasons.get(identity) ?? 'the requested destination still disagrees'}`,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tconst changes = Array.from(files.entries())\n\t\t\t.filter(([path, content]) => this.#options.files[path] !== content)\n\t\t\t.sort(([left], [right]) => left.localeCompare(right))\n\t\t\t.map(([path, content]) => ({ path, content }))\n\t\treturn { changes, findings: remaining }\n\t}\n\n\t#createRows(files: Readonly<Record<string, string>>): readonly ParityRow[] {\n\t\tconst rows: ParityRow[] = []\n\t\tfor (const entry of this.#options.entries) {\n\t\t\tconst text = files[entry.spec]\n\t\t\tif (text === undefined) continue\n\t\t\tconst guide = this.#attribute(entry.spec, () => new Guide(text))\n\t\t\tthis.#attribute(entry.spec, () => validateModules(files, entry.source))\n\t\t\trows.push({\n\t\t\t\tentry,\n\t\t\t\tguide,\n\t\t\t\tsource: new Source({\n\t\t\t\t\tfiles,\n\t\t\t\t\tmodule: entry.source,\n\t\t\t\t\t...(this.#options.declarations === undefined\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { declarations: this.#options.declarations }),\n\t\t\t\t}),\n\t\t\t})\n\t\t}\n\t\treturn rows\n\t}\n\n\t// Runs one step over the guide at `spec` and names that guide in a coded refusal the step\n\t// raises, keeping the refusal's code and context and carrying it as the cause.\n\t#attribute<T>(spec: string, step: () => T): T {\n\t\ttry {\n\t\t\treturn step()\n\t\t} catch (error) {\n\t\t\tif (!isGuideError(error)) throw error\n\t\t\tthrow new GuideError(`${JSON.stringify(spec.slice(0, 200))}: ${error.message}`, error.code, {\n\t\t\t\tcause: error,\n\t\t\t\t...(error.context === undefined ? {} : { context: error.context }),\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectInput(findings: ParityFinding[]): void {\n\t\tif (this.#options.entries.length === 0) {\n\t\t\tfindings.push({ text: 'The manifest has no guide entries.' })\n\t\t}\n\t\tfor (const entry of this.#options.entries) {\n\t\t\tif (this.#options.files[entry.spec] !== undefined) continue\n\t\t\tfindings.push({ spec: entry.spec, text: `${entry.spec} is absent from the inventory.` })\n\t\t}\n\t}\n\n\t#inspectSections(row: ParityRow, findings: ParityFinding[]): void {\n\t\tconst sections = row.guide.sections()\n\t\tfor (const heading of [SURFACE, METHODS, TESTS]) {\n\t\t\tif (sections.includes(heading)) continue\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no ## ${heading} section.`,\n\t\t\t})\n\t\t}\n\t\tif (row.guide.methods().length === 0 && hasBehaviouralSurface(row.source)) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no documented method groups.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectSurface(row: ParityRow, findings: ParityFinding[]): void {\n\t\tif (row.guide.surface().length === 0) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} has no documented surface.` })\n\t\t}\n\t\tfor (const unnamed of row.guide.unnamed()) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has an unnamed row: ${unnamed}`,\n\t\t\t})\n\t\t}\n\t\tfor (const key of findMissingSymbols(row.source.exports(), row.source.surface())) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} does not re-export ${key}.` })\n\t\t}\n\t\tfor (const key of findMissingSymbols(row.source.surface(), row.source.exports())) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} barrel exposes no direct ${key}.`,\n\t\t\t})\n\t\t}\n\t\tfor (const key of findMissingSymbols(row.source.surface(), row.guide.surface())) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} does not document ${key}.` })\n\t\t}\n\t\tfor (const key of findMissingSymbols(row.guide.surface(), row.source.surface())) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} documents no barrel ${key}.` })\n\t\t}\n\t\tfor (const symbol of row.source.hidden()) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} source hides ${computeSymbolKey(symbol)}.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectMethods(row: ParityRow, findings: ParityFinding[]): void {\n\t\tfor (const group of row.guide.methods()) {\n\t\t\tconst documented = group.methods.map((entry) => entry.name)\n\t\t\tconst declared = row.source.methods(group.interface).map((entry) => entry.name)\n\t\t\tif (documented.length === 0) {\n\t\t\t\tfindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} ${group.interface} has no documented methods.`,\n\t\t\t\t})\n\t\t\t}\n\t\t\tfor (const name of findMissing(declared, documented)) {\n\t\t\t\tfindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} does not document ${group.interface}.${name}.`,\n\t\t\t\t})\n\t\t\t}\n\t\t\tfor (const name of findMissing(documented, declared)) {\n\t\t\t\tfindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} documents no source ${group.interface}.${name}.`,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst entity = group.interface.replace(/Interface$/, '')\n\t\t\tif (entity === group.interface) continue\n\t\t\tfor (const name of findMissing(\n\t\t\t\trow.source.methods(entity).map((entry) => entry.name),\n\t\t\t\tdocumented,\n\t\t\t)) {\n\t\t\t\tfindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} ${entity}.${name} is outside the ${group.interface} contract.`,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\t#inspectDeclarations(row: ParityRow, findings: ParityFinding[]): void {\n\t\tconst groups = row.guide.methods()\n\t\tconst documented = groups.map((group) => group.interface)\n\t\tconst declared = new Set(row.source.surface().map((symbol) => symbol.name))\n\t\tconst classes = new Set(\n\t\t\trow.source\n\t\t\t\t.surface()\n\t\t\t\t.filter((symbol) => symbol.keyword === 'class')\n\t\t\t\t.map((symbol) => symbol.name),\n\t\t)\n\n\t\tfor (const group of groups) {\n\t\t\tconst finding = compareMembership(\n\t\t\t\trow.entry.spec,\n\t\t\t\tgroup.interface,\n\t\t\t\tgroup.methods.map((entry) => entry.name),\n\t\t\t\trow.source.methods(group.interface).map((entry) => entry.name),\n\t\t\t)\n\t\t\tif (finding !== undefined) findings.push(finding)\n\t\t}\n\n\t\tfor (const symbol of row.source.surface()) {\n\t\t\tif (symbol.keyword !== 'interface' && symbol.keyword !== 'class') continue\n\t\t\t// A barrel exports a class and an interface of one name only as a declaration merge,\n\t\t\t// because two modules exporting the name would conflict, so the class answers for it.\n\t\t\tif (symbol.keyword === 'interface' && classes.has(symbol.name)) continue\n\t\t\tconst members = row.source.methods(symbol.name).map((entry) => entry.name)\n\t\t\tif (members.length === 0) continue\n\t\t\tconst contract = `${symbol.name}Interface`\n\t\t\tconst implementing = symbol.keyword === 'class' && declared.has(contract)\n\t\t\tif (implementing) {\n\t\t\t\tconst finding = compareMembership(\n\t\t\t\t\trow.entry.spec,\n\t\t\t\t\tsymbol.name,\n\t\t\t\t\trow.source.methods(contract).map((entry) => entry.name),\n\t\t\t\t\tmembers,\n\t\t\t\t)\n\t\t\t\tif (finding !== undefined) findings.push(finding)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (documented.includes(symbol.name)) continue\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} ${symbol.name} declares members and carries no method table.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectLinks(row: ParityRow, links: ParityFinding[], tests: ParityFinding[]): void {\n\t\tif (row.guide.links().length === 0) {\n\t\t\tlinks.push({ spec: row.entry.spec, text: `${row.entry.spec} has no links.` })\n\t\t}\n\t\tfor (const href of row.guide.links()) {\n\t\t\tif (isExternalLink(href)) continue\n\t\t\tconst path = resolveLink(row.entry.spec, href)\n\t\t\tif (row.source.exists(path)) continue\n\t\t\tlinks.push({ spec: row.entry.spec, text: `${row.entry.spec} has a broken link: ${href}.` })\n\t\t}\n\t\tif (row.guide.tests().length === 0) {\n\t\t\ttests.push({ spec: row.entry.spec, text: `${row.entry.spec} has no test links.` })\n\t\t}\n\t\tfor (const href of row.guide.tests()) {\n\t\t\tconst path = resolveLink(row.entry.spec, href)\n\t\t\tif (row.source.exists(path)) continue\n\t\t\ttests.push({ spec: row.entry.spec, text: `${row.entry.spec} has a missing test: ${href}.` })\n\t\t}\n\t}\n\n\t#inspectFences(row: ParityRow, findings: ParityFinding[]): void {\n\t\tfor (const fence of findUnlisted(row.guide.fences(), this.#options.languages)) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has an unlisted fence language under ${fence.title ?? 'no heading'}: ${fence.language ?? 'absent'}.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectExamples(\n\t\trow: ParityRow,\n\t\tfencesFindings: ParityFinding[],\n\t\tfunctionFindings: ParityFinding[],\n\t\tmethodFindings: ParityFinding[],\n\t\ttitleFindings: ParityFinding[],\n\t): void {\n\t\tconst fences = row.guide\n\t\t\t.fences()\n\t\t\t.filter((fence) => fence.language === this.#options.language)\n\t\t\t.map((fence) => fence.code)\n\t\tif (fences.length === 0) {\n\t\t\tfencesFindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no ${this.#options.language} example fence.`,\n\t\t\t})\n\t\t}\n\t\tconst functions = row.guide\n\t\t\t.surface()\n\t\t\t.filter((symbol) => symbol.keyword === 'function')\n\t\t\t.map((symbol) => symbol.name)\n\t\tfor (const name of findUnexampled(\n\t\t\tfunctions,\n\t\t\tfences,\n\t\t\trow.source.examples().map((example) => example.name),\n\t\t)) {\n\t\t\tfunctionFindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no example for ${name}.`,\n\t\t\t})\n\t\t}\n\n\t\tfor (const group of row.guide.methods()) {\n\t\t\tconst entity = group.interface.replace(/Interface$/, '')\n\t\t\tconst examples = row.source.examples(group.interface).map((example) => example.name)\n\t\t\tif (entity !== group.interface) {\n\t\t\t\texamples.push(...row.source.examples(entity).map((example) => example.name))\n\t\t\t}\n\t\t\tfor (const name of findUnexampled(\n\t\t\t\tgroup.methods.map((entry) => entry.name),\n\t\t\t\tfences,\n\t\t\t\texamples,\n\t\t\t)) {\n\t\t\t\tmethodFindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} has no example for ${group.interface}.${name}.`,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tconst guide = row.guide\n\t\t\t.fences()\n\t\t\t.map((fence) => fence.title)\n\t\t\t.filter(isNonEmptyString)\n\t\tconst source = row.source\n\t\t\t.examples()\n\t\t\t.map((example) => example.title)\n\t\t\t.filter(isNonEmptyString)\n\t\tif (!guide.some((title) => source.includes(title))) {\n\t\t\ttitleFindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no top-level example-title pair: guide ${JSON.stringify(guide)} source ${JSON.stringify(source)}.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectImports(row: ParityRow, findings: ParityFinding[]): void {\n\t\tconst sources = new SourceManager({\n\t\t\tfiles: this.#options.files,\n\t\t\tmodules: this.#options.modules,\n\t\t})\n\t\tconst compared = Iterator.from(row.guide.fences()).reduce((previous, fence) => {\n\t\t\tif (fence.language !== this.#options.language) return previous\n\t\t\treturn Iterator.from(extractFenceImports(fence.code)).reduce((matched, imported) => {\n\t\t\t\tconst source = sources.source(imported.specifier)\n\t\t\t\tif (source === undefined) return matched\n\t\t\t\tconst surface = source.surface().map((symbol) => symbol.name)\n\t\t\t\tfor (const name of findMissing(imported.names, surface)) {\n\t\t\t\t\tfindings.push({\n\t\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\t\ttext: `${row.entry.spec} imports missing ${name} from ${imported.specifier}.`,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t}, previous)\n\t\t}, false)\n\t\tif (!compared) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} has no mapped self import.` })\n\t\t}\n\t}\n\n\t#inspectDrift(row: ParityRow, findings: ParityFinding[]): void {\n\t\tfor (const drift of findDrift(row.guide, row.source)) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: formatDrift(drift) })\n\t\t}\n\t}\n\n\t#inspectPitch(findings: ParityFinding[]): void {\n\t\tconst pitch = this.#options.pitch\n\t\tif (pitch === undefined) return\n\t\tconst readme = this.#options.files[pitch.readme]\n\t\tconst spec = this.#options.files[pitch.spec]\n\t\tif (readme === undefined) {\n\t\t\tfindings.push({ spec: pitch.readme, text: `${pitch.readme} is absent from the inventory.` })\n\t\t\treturn\n\t\t}\n\t\tif (spec === undefined) {\n\t\t\tfindings.push({ spec: pitch.spec, text: `${pitch.spec} is absent from the inventory.` })\n\t\t\treturn\n\t\t}\n\t\tconst left = this.#attribute(pitch.readme, () => new Guide(readme)).tagline()\n\t\tconst right = this.#attribute(pitch.spec, () => new Guide(spec)).tagline()\n\t\tif (left !== undefined && left === right) return\n\t\tfindings.push({\n\t\t\tspec: pitch.spec,\n\t\t\ttext: `${pitch.spec} pitch: README ${formatSide(left)} guide ${formatSide(right)}.`,\n\t\t})\n\t}\n\n\t#rewriteGuide(row: ParityRow, drift: Drift, files: Map<string, string>): string | undefined {\n\t\tif (drift.source === undefined) return 'source authority is absent'\n\t\tconst current = files.get(row.entry.spec)\n\t\tif (current === undefined) return 'the guide inventory text is absent'\n\n\t\tif (drift.category === 'summary') {\n\t\t\tconst replacement = replaceCell(current, drift.key, SUMMARY, buildCell(drift.source))\n\t\t\tif (replacement === undefined)\n\t\t\t\treturn 'the guide summary cell or its provenance is unavailable'\n\t\t\tfiles.set(row.entry.spec, replacement)\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (drift.category === 'signature') {\n\t\t\tconst signature = row.source\n\t\t\t\t.surface()\n\t\t\t\t.find((symbol) => computeSymbolKey(symbol) === drift.key)?.signature\n\t\t\tif (signature === undefined) return 'the computed signature is unavailable'\n\t\t\tconst replacement = replaceCell(current, drift.key, SIGNATURE, [\n\t\t\t\t{ element: 'codeSpan', value: signature },\n\t\t\t])\n\t\t\tif (replacement === undefined)\n\t\t\t\treturn 'the guide signature cell or its provenance is unavailable'\n\t\t\tfiles.set(row.entry.spec, replacement)\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst example = collectTitles(row.guide, row.source).get(drift.key)\n\t\tif (example === undefined) return 'the paired source example is unavailable'\n\t\tconst replacement = replaceFence(current, drift.key, example)\n\t\tif (replacement === undefined) return 'the titled guide fence or its provenance is unavailable'\n\t\tfiles.set(row.entry.spec, replacement)\n\t\treturn undefined\n\t}\n\n\t#rewriteSource(row: ParityRow, drift: Drift, files: Map<string, string>): string | undefined {\n\t\tif (drift.category === 'signature') return 'a signature is computed from the source declaration'\n\t\tif (drift.guide === undefined) return 'guide authority is absent'\n\t\tif (drift.category === 'summary') {\n\t\t\tconst located = this.#locateSource(row.entry, drift.key, files)\n\t\t\tif (located === undefined) return 'the source doc block or its provenance is unavailable'\n\t\t\tconst comment = located.text.slice(located.span.start, located.span.end)\n\t\t\tconst replacement = replaceSummary(comment, drift.guide)\n\t\t\tif (replacement === undefined) return 'the source summary cannot be represented safely'\n\t\t\tfiles.set(located.path, spliceSpan(located.text, located.span, replacement))\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst fence = row.guide.fences().find((entry) => entry.title === drift.key)\n\t\tconst located = this.#locateExample(row, drift.key, files)\n\t\tif (fence === undefined || located === undefined) {\n\t\t\treturn 'the paired source example or its provenance is unavailable'\n\t\t}\n\t\tconst comment = located.text.slice(located.span.start, located.span.end)\n\t\tconst example: SourceExample = {\n\t\t\tname: located.example.name,\n\t\t\ttitle: drift.key,\n\t\t\tcode: fence.code,\n\t\t\t...(fence.language === undefined ? {} : { language: fence.language }),\n\t\t}\n\t\tconst replacement = replaceExample(comment, example)\n\t\tif (replacement === undefined) return 'the guide example cannot be represented safely'\n\t\tfiles.set(located.path, spliceSpan(located.text, located.span, replacement))\n\t\treturn undefined\n\t}\n\n\t#locateSource(\n\t\tentry: ManifestEntry,\n\t\tkey: string,\n\t\tfiles: ReadonlyMap<string, string>,\n\t): { readonly path: string; readonly text: string; readonly span: MarkdownSpan } | undefined {\n\t\tconst inventory = Object.fromEntries(files)\n\t\tfor (const path of selectModuleKeys(inventory, normalizeDirectories(entry.source))) {\n\t\t\tconst text = files.get(path)\n\t\t\tif (text === undefined) continue\n\t\t\tconst span = locateComment(text, key)\n\t\t\tif (span !== undefined) return { path, text, span }\n\t\t}\n\t\treturn undefined\n\t}\n\n\t#locateExample(\n\t\trow: ParityRow,\n\t\ttitle: string,\n\t\tfiles: ReadonlyMap<string, string>,\n\t):\n\t\t| {\n\t\t\t\treadonly path: string\n\t\t\t\treadonly text: string\n\t\t\t\treadonly span: MarkdownSpan\n\t\t\t\treadonly example: SourceExample\n\t\t }\n\t\t| undefined {\n\t\tconst target = collectTitles(row.guide, row.source).get(title)\n\t\tif (target === undefined) return undefined\n\t\tconst keys: string[] = []\n\t\tfor (const symbol of row.source.exports()) {\n\t\t\tif (symbol.name === target.name) keys.push(computeSymbolKey(symbol))\n\t\t}\n\t\tfor (const owner of row.guide.surface()) {\n\t\t\tif (owner.keyword !== 'class' && owner.keyword !== 'interface') continue\n\t\t\tconst matched = row.source\n\t\t\t\t.examples(owner.name)\n\t\t\t\t.some((example) => example.name === target.name && example.title === title)\n\t\t\tif (matched) keys.push(`${owner.name}.${target.name}`)\n\t\t}\n\n\t\tconst inventory = Object.fromEntries(files)\n\t\tfor (const path of selectModuleKeys(inventory, normalizeDirectories(row.entry.source))) {\n\t\t\tconst text = files.get(path)\n\t\t\tif (text === undefined) continue\n\t\t\tconst selected = keys.reduce<\n\t\t\t\t{ readonly span: MarkdownSpan; readonly example: SourceExample } | undefined\n\t\t\t>((previous, key) => {\n\t\t\t\tconst span = locateComment(text, key)\n\t\t\t\tif (span === undefined) return previous\n\t\t\t\tconst comment = normalizeComment(text.slice(span.start, span.end))\n\t\t\t\tconst example = collectExamples(comment, target.name).find((entry) => entry.title === title)\n\t\t\t\tif (example === undefined) return previous\n\t\t\t\treturn previous === undefined || span.start < previous.span.start\n\t\t\t\t\t? { span, example }\n\t\t\t\t\t: previous\n\t\t\t}, undefined)\n\t\t\tif (selected !== undefined) return { path, text, ...selected }\n\t\t}\n\t\treturn undefined\n\t}\n}\n","import type { ContractInterface } from '@orkestrel/contract'\nimport type {\n\tDrift,\n\tGuideInterface,\n\tManifestEntry,\n\tMethodEntry,\n\tMethodGroup,\n\tSourceExample,\n\tSourceInterface,\n\tSourceManagerInterface,\n\tSourceManagerOptions,\n\tSourceOptions,\n\tSurfaceSymbol,\n} from './types.js'\nimport { createContract } from '@orkestrel/contract'\nimport { Guide } from './Guide.js'\nimport {\n\tdriftShape,\n\tmanifestEntryShape,\n\tmethodEntryShape,\n\tmethodGroupShape,\n\tsourceExampleShape,\n\tsurfaceSymbolShape,\n} from './shapers.js'\nimport { Source } from './sources/Source.js'\nimport { SourceManager } from './sources/SourceManager.js'\n\n/**\n * Creates a structured {@link GuideInterface} view over one guide's markdown\n * source — parses once and caches its `sections` / `surface` / `methods` /\n * `links` / `tests` / `fences` projections.\n *\n * @param source - The guide's markdown source text\n * @returns A working {@link GuideInterface}\n * @throws {@link GuideError} when a Surface header is nonuniform or a keyed Signature cell is empty.\n *\n * @example Construct a Guide from markdown text\n * ```ts\n * import { createGuide } from '@orkestrel/guide'\n *\n * const guide = createGuide(\n * \t'## Surface\\n\\n| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `X` | class | `new () => X` | |',\n * )\n * guide.surface() // [{ name: 'X', keyword: 'class', signature: '`new () => X`' }]\n * guide.sections() // ['Surface']\n * ```\n */\nexport function createGuide(source: string): GuideInterface {\n\treturn new Guide(source)\n}\n\n/**\n * Creates a pure {@link SourceInterface} over a consumer-supplied file\n * inventory — see {@link Source}.\n *\n * @param options - The file inventory and module scope to reflect\n * @returns A `SourceInterface` reflecting the given module scope\n *\n * @example Construct a Source from an inline files record\n * ```ts\n * import { createSource } from '@orkestrel/guide'\n *\n * const source = createSource({\n * \tfiles: {\n * \t\t'src/core/index.ts': \"export * from './Guide.js'\\nexport * from './types.js'\\n\",\n * \t\t'src/core/Guide.ts': 'export class Guide {}\\n',\n * \t\t'src/core/types.ts': 'export interface GuideInterface {\\n\\tsections(): void\\n}\\n',\n * \t},\n * \tmodule: 'src/core',\n * })\n * source.exports() // [{ name: 'Guide', keyword: 'class' }, { name: 'GuideInterface', keyword: 'interface' }]\n * source.surface() // [{ name: 'Guide', keyword: 'class' }, { name: 'GuideInterface', keyword: 'interface' }]\n * source.methods('GuideInterface') // [{ name: 'sections' }]\n * source.exists('src/core/Guide.ts') // true\n * source.exists('src/core') // true — a directory any inventory key sits beneath\n * ```\n */\nexport function createSource(options: SourceOptions): SourceInterface {\n\treturn new Source(options)\n}\n\n/**\n * Creates a {@link SourceManagerInterface} that resolves the consumer's local\n * import specifiers and shares one source view per module.\n *\n * @param options - The shared file inventory and specifier-to-module policy\n * @returns A source manager over the supplied policy\n *\n * @example Resolve a fence's import specifier to the right Source\n * ```ts\n * import { createSourceManager } from '@orkestrel/guide'\n *\n * const sources = createSourceManager({\n * \tfiles: {\n * \t\t'src/core/index.ts': \"export * from './Guide.js'\\n\",\n * \t\t'src/core/Guide.ts': 'export class Guide {}\\n',\n * \t},\n * \tmodules: { '@scope/package': 'src/core', '@scope/package/core': 'src/core' },\n * })\n *\n * sources.source('@scope/package')?.surface() // [{ name: 'Guide', keyword: 'class' }]\n * sources.source('node:fs') // undefined — a foreign import, which a fence check skips\n * sources.source('@scope/package') === sources.source('@scope/package/core') // true\n * sources.sources() // [the one shared view both specifiers name]\n * ```\n */\nexport function createSourceManager(options: SourceManagerOptions): SourceManagerInterface {\n\treturn new SourceManager(options)\n}\n\n/**\n * Compiles the {@link surfaceSymbolShape} into a {@link ContractInterface} for\n * {@link SurfaceSymbol} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `SurfaceSymbol` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createSurfaceSymbolContract } from '@orkestrel/guide'\n *\n * const surfaceSymbol = createSurfaceSymbolContract()\n * surfaceSymbol.is({ name: 'Markdown', keyword: 'class' }) // true\n * ```\n */\nexport function createSurfaceSymbolContract(): ContractInterface<SurfaceSymbol> {\n\treturn createContract(surfaceSymbolShape)\n}\n\n/**\n * Compiles the {@link methodEntryShape} into a {@link ContractInterface} for\n * {@link MethodEntry} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `MethodEntry` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createMethodEntryContract } from '@orkestrel/guide'\n *\n * const methodEntry = createMethodEntryContract()\n * methodEntry.is({ name: 'walk' }) // true\n * ```\n */\nexport function createMethodEntryContract(): ContractInterface<MethodEntry> {\n\treturn createContract(methodEntryShape)\n}\n\n/**\n * Compiles the {@link sourceExampleShape} into a {@link ContractInterface} for\n * {@link SourceExample} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `SourceExample` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createSourceExampleContract } from '@orkestrel/guide'\n *\n * const sourceExample = createSourceExampleContract()\n * sourceExample.is({ name: 'walk', code: 'walk()' }) // true\n * ```\n */\nexport function createSourceExampleContract(): ContractInterface<SourceExample> {\n\treturn createContract(sourceExampleShape)\n}\n\n/**\n * Compiles the {@link driftShape} into a {@link ContractInterface} for\n * {@link Drift} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `Drift` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createDriftContract } from '@orkestrel/guide'\n *\n * const drift = createDriftContract()\n * drift.is({ key: 'class Widget', category: 'summary', guide: 'A widget.' }) // true\n * ```\n */\nexport function createDriftContract(): ContractInterface<Drift> {\n\treturn createContract(driftShape)\n}\n\n/**\n * Compiles the {@link methodGroupShape} into a {@link ContractInterface} for\n * {@link MethodGroup} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `MethodGroup` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createMethodGroupContract } from '@orkestrel/guide'\n *\n * const methodGroup = createMethodGroupContract()\n * methodGroup.is({ interface: 'MarkdownInterface', methods: [{ name: 'walk' }] }) // true\n * ```\n */\nexport function createMethodGroupContract(): ContractInterface<MethodGroup> {\n\treturn createContract(methodGroupShape)\n}\n\n/**\n * Compiles the {@link manifestEntryShape} into a {@link ContractInterface} for\n * {@link ManifestEntry} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `ManifestEntry` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createManifestEntryContract } from '@orkestrel/guide'\n *\n * const manifestEntry = createManifestEntryContract()\n * manifestEntry.is({ concept: 'Markdown', spec: 'guides/src/markdown.md', source: 'src/core', tests: 'tests/src/core' }) // true\n * ```\n */\nexport function createManifestEntryContract(): ContractInterface<ManifestEntry> {\n\treturn createContract(manifestEntryShape)\n}\n"],"mappings":";;;;;;;;;;;;;;AAUA,IAAa,kBAAkB,OAAO,OAAO;CAC5C;CACA;CACA;CACA;CACA;AACD,CAAgF;;;;AAKhF,IAAa,mBAAmB,OAAO,OAAO;CAC7C;CACA;CACA;AACD,CAA8D;;;;AAK9D,IAAa,UAAkB;;;;;;AAO/B,IAAa,cAAc,OAAO,OAAO;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAEC;;AAGD,IAAa,oBAAoB,OAAO,IAAI,6BAA6B;;;;AAKzE,IAAa,UAAkB;;;;AAK/B,IAAa,QAAgB;;;;AAK7B,IAAa,OAAe;;;;AAK5B,IAAa,YAAoB;;;;;AAMjC,IAAa,UAAkB;;;;AAK/B,IAAa,OAAe;;;;AAK5B,IAAa,iBAAoC,OAAO,OAAO;CAAC;CAAM;CAAM;CAAW;AAAO,CAAC;;;;A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oBAAAA,eAAAA,CAAe,kBAAkB;AACzC;;;;;;;;;;;;;;;;AAiBA,SAAgB,sBAAgD;CAC/D,QAAA,GAAOA,oBAAAA,eAAAA,CAAe,UAAU;AACjC;;;;;;;;;;;;;;;;AAiBA,SAAgB,4BAA4D;CAC3E,QAAA,GAAOA,oBAAAA,eAAAA,CAAe,gBAAgB;AACvC;;;;;;;;;;;;;;;;AAiBA,SAAgB,8BAAgE;CAC/E,QAAA,GAAOA,oBAAAA,eAAAA,CAAe,kBAAkB;AACzC"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["holds","INTRINSICS","isBoundedJSONRecord","literalOf","recordOf","isString","arrayOf","unionOf","isString","escapeRegExp","isCodeSpanNode","isEmphasisNode","isLinkNode","isImageNode","walkMarkdownNodes","flattenText","coalesceText","isNonEmptyString","isHeadingNode","isTableNode","isCodeBlockNode","isBlockquoteNode","isParagraphNode","renderMarkdown","createMarkdown","createMarkdown","isTableNode","flattenText","isEmptyString","isNonEmptyArray","objectShape","stringShape","literalShape","optionalShape","arrayShape","unionShape","createMarkdown","isHeadingNode","flattenText","isNonEmptyString","createContract"],"sources":["../../../src/core/constants.ts","../../../src/core/errors.ts","../../../src/core/validators.ts","../../../src/core/helpers.ts","../../../src/core/parsers.ts","../../../src/core/shapers.ts","../../../src/core/Guide.ts","../../../src/core/sources/Source.ts","../../../src/core/sources/SourceManager.ts","../../../src/core/Parity.ts","../../../src/core/factories.ts"],"sourcesContent":["/**\n * Lists the declaration keywords a documented or exported symbol carries, in the order the\n * reflection grammar names them — the frozen population `ExportKeyword`, `isExportKeyword`, and\n * `surfaceSymbolShape` all derive from.\n *\n * @remarks\n * One frozen list feeds the type, the guard, and the shape, so a keyword cannot be admitted by one\n * and refused by another. Comment and template payload is excluded before reflection, and `enum`\n * is outside this population rather than forbidden by general package policy.\n */\nexport const EXPORT_KEYWORDS = Object.freeze([\n\t'type',\n\t'interface',\n\t'const',\n\t'function',\n\t'class',\n] satisfies ReadonlyArray<'type' | 'interface' | 'const' | 'function' | 'class'>)\n\n/**\n * Lists the compared sites a {@link Drift} can describe.\n */\nexport const DRIFT_CATEGORIES = Object.freeze([\n\t'summary',\n\t'signature',\n\t'example',\n] satisfies ReadonlyArray<'summary' | 'signature' | 'example'>)\n\n/**\n * Names the `## Surface` heading text a guide's documented exports section is keyed on.\n */\nexport const SURFACE: string = 'Surface'\n\n/**\n * Lists the codes a {@link GuideError} carries: a refused Surface `header` or empty `signature`\n * cell, a name two modules of one manifest entry declare (`collision`), and the compiler faults —\n * a failed `compile`, an `empty` emit, a `timeout`, and an output `overflow`.\n */\nexport const GUIDE_CODES = Object.freeze([\n\t'header',\n\t'signature',\n\t'collision',\n\t'compile',\n\t'empty',\n\t'timeout',\n\t'overflow',\n] satisfies ReadonlyArray<\n\t'header' | 'signature' | 'collision' | 'compile' | 'empty' | 'timeout' | 'overflow'\n>)\n\n/** Names the cross-copy identity marker of a Guide error. */\nexport const GUIDE_ERROR_BRAND = Symbol.for('@orkestrel/guide.GuideError')\n\n/**\n * Names the `## Methods` heading text a guide's documented interface-methods section is keyed on.\n */\nexport const METHODS: string = 'Methods'\n\n/**\n * Names the `## Tests` heading text a guide's documented test-link section is keyed on.\n */\nexport const TESTS: string = 'Tests'\n\n/**\n * Names the header text of the column a `## Surface` table's declaration keyword is read from.\n */\nexport const KIND: string = 'Kind'\n\n/**\n * Names the header text of the column a `## Surface` table's TypeScript signature is read from.\n */\nexport const SIGNATURE: string = 'Signature'\n\n/**\n * Names the header text of the column a `## Surface` or `## Methods` table's compared\n * description paragraph is read from.\n */\nexport const SUMMARY: string = 'Summary'\n\n/**\n * Names the header text of a `## Surface` or `## Methods` table's first column, the symbol name.\n */\nexport const NAME: string = 'Name'\n\n/**\n * Lists the uniform `## Surface` table header, column by column, that guide construction requires.\n */\nexport const SURFACE_HEADER: readonly string[] = Object.freeze([NAME, KIND, SIGNATURE, SUMMARY])\n\n/**\n * Names the `## By concept` heading text the manifest's run-map table is keyed on.\n */\nexport const MANIFEST: string = 'By concept'\n\n/**\n * Holds the default character budget a rewritten doc block's description paragraph wraps\n * inside — the greatest number of characters a re-wrapped line may carry, counted from the\n * line's first character with a tab counting as one, so a wrapped line reads\n * `${indent} * ${text}` and never passes that count.\n *\n * @remarks\n * The budget counts characters, not rendered columns. A block indented with tabs therefore\n * measures each tab as one character, and a formatter that renders a tab wider reads the same\n * line as longer; a caller whose formatter measures differently passes its own width instead of\n * taking this default. A doc block's own wrapping is not recoverable from its text either — the\n * blocks this package's own source carries are hand-wrapped, and no single greedy width\n * reproduces them — so a rewrite cannot infer a per-block width and falls back to this budget.\n */\nexport const WRAP_WIDTH: number = 100\n\n/**\n * Lists the link `href` schemes a guides-parity link check skips as external — a link\n * with one of these prefixes (or a bare `#` anchor, handled separately in\n * `isExternalLink`) is never resolved against the filesystem.\n */\nexport const EXTERNAL_SCHEMES: readonly string[] = Object.freeze([\n\t'http:',\n\t'https:',\n\t'mailto:',\n\t'tel:',\n])\n","import type { GuideCode, GuideErrorOptions } from './types.js'\nimport type { JSONRecord } from '@orkestrel/contract'\nimport { holds, INTRINSICS, isBoundedJSONRecord } from '@orkestrel/contract'\nimport { GUIDE_CODES, GUIDE_ERROR_BRAND } from './constants.js'\n\n/** Carries a coded refusal of a guide, a manifest entry, or a module compile. */\nexport class GuideError extends Error {\n\toverride readonly name: string = 'GuideError'\n\treadonly code: GuideCode\n\treadonly context: JSONRecord | undefined\n\n\tconstructor(message: string, code: GuideCode, options?: GuideErrorOptions) {\n\t\tsuper(message, options)\n\t\tthis.code = code\n\t\tthis.context = options?.context\n\t\tINTRINSICS.define(this, GUIDE_ERROR_BRAND, { value: this })\n\t}\n}\n\n/**\n * Checks whether a value carries the Guide error brand and declared members across package copies.\n *\n * @example\n * ```ts\n * isGuideError(new GuideError('Invalid Surface header', 'header')) // true\n * ```\n */\nexport function isGuideError(value: unknown): value is GuideError {\n\treturn holds(() => {\n\t\tif (!(value instanceof INTRINSICS.error)) return false\n\t\tif (INTRINSICS.prototype(value) === INTRINSICS.error.prototype) return false\n\t\tif (INTRINSICS.describe(value, GUIDE_ERROR_BRAND)?.value !== value) return false\n\t\tconst code: unknown = INTRINSICS.reflect.read(value, 'code')\n\t\tconst context: unknown = INTRINSICS.reflect.read(value, 'context')\n\t\treturn (\n\t\t\tGUIDE_CODES.some((candidate) => candidate === code) &&\n\t\t\t(context === undefined || isBoundedJSONRecord(context)) &&\n\t\t\ttypeof INTRINSICS.reflect.read(value, 'name') === 'string' &&\n\t\t\ttypeof INTRINSICS.reflect.read(value, 'message') === 'string'\n\t\t)\n\t})\n}\n","import type { Guard } from '@orkestrel/contract'\nimport type {\n\tDrift,\n\tDriftCategory,\n\tExportKeyword,\n\tManifestEntry,\n\tMethodEntry,\n\tMethodGroup,\n\tSourceExample,\n\tSurfaceSymbol,\n} from './types.js'\nimport { arrayOf, isString, literalOf, recordOf, unionOf } from '@orkestrel/contract'\nimport { DRIFT_CATEGORIES, EXPORT_KEYWORDS } from './constants.js'\n\n// AGENTS.md § Design laws: guards are total. Every guard here validates an arbitrary\n// `unknown` value crossing an untrusted boundary (parsed guide/manifest data)\n// against a data type's full shape, composed from @orkestrel/contract\n// combinators and hoisted as module-level values (compiled once, not per call).\n\n/**\n * Checks whether `value` is one of the documented {@link ExportKeyword}\n * literals — the guard behind extracting a Surface table's `Kind` cell into a\n * typed symbol.\n *\n * @param value - The candidate value\n * @returns True if `value` is a valid {@link ExportKeyword}; false otherwise\n *\n * @example\n * ```ts\n * isExportKeyword('class') // true\n * isExportKeyword('enum') // false\n * ```\n */\nexport const isExportKeyword: Guard<ExportKeyword> = literalOf(EXPORT_KEYWORDS)\n\n/** Checks whether `value` names a supported drift category. */\nexport const isDriftCategory: Guard<DriftCategory> = literalOf(DRIFT_CATEGORIES)\n\n/**\n * Checks whether `value` is a well-formed {@link SurfaceSymbol} — a `name`\n * string paired with a valid {@link ExportKeyword}, and optional `signature` and `summary` strings.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link SurfaceSymbol}; false otherwise\n *\n * @example\n * ```ts\n * isSurfaceSymbol({ name: 'Markdown', keyword: 'class' }) // true\n * isSurfaceSymbol({ name: 'Markdown', keyword: 'enum' }) // false\n * ```\n */\nexport const isSurfaceSymbol: Guard<SurfaceSymbol> = recordOf(\n\t{\n\t\tname: isString,\n\t\tkeyword: isExportKeyword,\n\t\tsignature: isString,\n\t\tsummary: isString,\n\t},\n\t['signature', 'summary'],\n)\n\n/**\n * Checks whether `value` is a well-formed {@link MethodEntry} — a `name` string with an\n * optional `summary`.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link MethodEntry}; false otherwise\n *\n * @example\n * ```ts\n * isMethodEntry({ name: 'walk' }) // true\n * isMethodEntry({ name: 1 }) // false\n * ```\n */\nexport const isMethodEntry: Guard<MethodEntry> = recordOf(\n\t{\n\t\tname: isString,\n\t\tsummary: isString,\n\t},\n\t['summary'],\n)\n\n/**\n * Checks whether `value` is a well-formed {@link SourceExample} — a `name` and `code`\n * string with an optional `title` and `language`.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link SourceExample}; false otherwise\n *\n * @example\n * ```ts\n * isSourceExample({ name: 'walk', code: 'walk()' }) // true\n * isSourceExample({ name: 'walk' }) // false\n * ```\n */\nexport const isSourceExample: Guard<SourceExample> = recordOf(\n\t{\n\t\tname: isString,\n\t\ttitle: isString,\n\t\tcode: isString,\n\t\tlanguage: isString,\n\t},\n\t['title', 'language'],\n)\n\n/**\n * Checks whether `value` is a well-formed {@link Drift} — a compared `key` with an optional\n * `guide` and `source` text.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link Drift}; false otherwise\n *\n * @example\n * ```ts\n * isDrift({ key: 'class Widget', category: 'summary', guide: 'A widget.' }) // true\n * isDrift({ guide: 'A widget.' }) // false\n * ```\n */\nexport const isDrift: Guard<Drift> = recordOf(\n\t{\n\t\tkey: isString,\n\t\tcategory: isDriftCategory,\n\t\tguide: isString,\n\t\tsource: isString,\n\t},\n\t['guide', 'source'],\n)\n\n/**\n * Checks whether `value` is a well-formed {@link MethodGroup} — a backticked\n * `interface` name paired with its documented {@link MethodEntry} rows.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link MethodGroup}; false otherwise\n *\n * @example\n * ```ts\n * isMethodGroup({ interface: 'MarkdownInterface', methods: [{ name: 'walk' }] }) // true\n * isMethodGroup({ interface: 'MarkdownInterface', methods: [1] }) // false\n * ```\n */\nexport const isMethodGroup: Guard<MethodGroup> = recordOf({\n\tinterface: isString,\n\tmethods: arrayOf(isMethodEntry),\n})\n\n/**\n * Checks whether `value` is a well-formed {@link ManifestEntry} — a\n * `## By concept` manifest row, its `source` accepting either a single directory\n * or several.\n *\n * @param value - The value to test\n * @returns True if `value` is a well-formed {@link ManifestEntry}; false otherwise\n *\n * @example\n * ```ts\n * isManifestEntry({ concept: 'Markdown', spec: 'guides/src/markdown.md', source: 'src/core', tests: 'tests/src/core' }) // true\n * isManifestEntry({ concept: 1 }) // false\n * ```\n */\nexport const isManifestEntry: Guard<ManifestEntry> = recordOf({\n\tconcept: isString,\n\tspec: isString,\n\tsource: unionOf(isString, arrayOf(isString)),\n\ttests: isString,\n})\n","import type {\n\tBlockNode,\n\tBlockquoteNode,\n\tCodeBlockNode,\n\tInlineNode,\n\tMarkdownDocument,\n\tMarkdownSpan,\n\tTableNode,\n} from '@orkestrel/markdown'\nimport type {\n\tDeclaration,\n\tDeclarationHead,\n\tDeclarationKeyword,\n\tDrift,\n\tFenceImport,\n\tGuideFence,\n\tGuideInterface,\n\tGuideModule,\n\tMethodEntry,\n\tMethodGroup,\n\tParityFinding,\n\tSourceComment,\n\tSourceExample,\n\tSourceInterface,\n\tSourceLine,\n\tSourceProjection,\n\tSurfaceSymbol,\n} from './types.js'\nimport {\n\tcoalesceText,\n\tcreateMarkdown,\n\tflattenText,\n\tisBlockquoteNode,\n\tisCodeBlockNode,\n\tisCodeSpanNode,\n\tisEmphasisNode,\n\tisHeadingNode,\n\tisImageNode,\n\tisLinkNode,\n\tisParagraphNode,\n\tisTableNode,\n\trenderMarkdown,\n\twalkMarkdownNodes,\n} from '@orkestrel/markdown'\nimport { escapeRegExp, isNonEmptyString, isString } from '@orkestrel/contract'\nimport {\n\tEXTERNAL_SCHEMES,\n\tKIND,\n\tMETHODS,\n\tNAME,\n\tSIGNATURE,\n\tSUMMARY,\n\tSURFACE,\n\tSURFACE_HEADER,\n\tTESTS,\n\tWRAP_WIDTH,\n} from './constants.js'\nimport { GuideError } from './errors.js'\nimport { isExportKeyword } from './validators.js'\n\n/**\n * Extracts aligned physical source-line records in one character traversal.\n * Real line and block comments and complete template tokens become spaces in\n * {@link SourceLine.code}, while ordinary code, quoted strings, and recognized\n * regex literals retain their columns. Genuine JSDoc opened from reflection\n * code is retained span by span at its exact physical column in\n * {@link SourceLine.jsdoc}; faux openers in comments and templates are\n * excluded. Membership remains each consumer's separate anchored grammar.\n *\n * @remarks\n * Regex recognition is a bounded lexical goal rather than TypeScript parser\n * grammar. Literal ECMAScript Unicode identifiers participate in slash-state\n * recognition, including private identifiers, without decoding escaped\n * identifier spellings. Slash after bare `}` is division, and a post-brace\n * regex statement requires an explicit `;`. General semicolonless\n * declaration/ASI classification is outside this finite projector, so callers\n * place an explicit `;` before a slash-leading statement after such a\n * declaration.\n *\n * @param source - The TypeScript source text to project\n * @returns One aligned terminator-free record per LF or CRLF physical line, including the final line\n *\n * @example Project source into physical code lines\n * ```ts\n * import { extractSourceLines } from '@orkestrel/guide'\n *\n * extractSourceLines('export const visible = true // note\\n')\n * // [{ source: 'export const visible = true // note', code: 'export const visible = true ', jsdoc: undefined }]\n * // … one record per remaining line\n * ```\n */\nexport function extractSourceLines(source: string): readonly SourceLine[] {\n\tconst lines: SourceLine[] = []\n\tconst tokens: Array<{ readonly code: string; readonly jsdoc?: string }> = []\n\tconst identifier = /#?[$_\\p{ID_Start}][$_\\u200C\\u200D\\p{ID_Continue}]*/uy\n\tconst numeric = /[A-Za-z0-9_$.]+/y\n\tconst final = source.split('').reduce<SourceProjection>(\n\t\t(state, character, offset) => {\n\t\t\tif (offset < state.offset) return state\n\t\t\tconst next = source[offset + 1]\n\t\t\tconst crlf = character === '\\r' && next === '\\n'\n\t\t\tif (character === '\\n' || crlf) {\n\t\t\t\tconst parts = tokens.slice(state.token)\n\t\t\t\tconst code = parts.map((part) => part.code).join('')\n\t\t\t\tlines.push({\n\t\t\t\t\tsource: source.slice(state.start, offset),\n\t\t\t\t\tcode,\n\t\t\t\t\tjsdoc:\n\t\t\t\t\t\tstate.present || state.jsdoc\n\t\t\t\t\t\t\t? parts.map((part) => part.jsdoc ?? ' '.repeat(part.code.length)).join('')\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t})\n\t\t\t\tconst regular = state.mode === 'single' || state.mode === 'double'\n\t\t\t\tconst quoted = state.mode === 'templateSingle' || state.mode === 'templateDouble'\n\t\t\t\tconst reset =\n\t\t\t\t\tstate.mode === 'regex' || state.mode === 'templateLine' || state.mode === 'templateRegex'\n\t\t\t\tconst mode =\n\t\t\t\t\tstate.mode === 'line'\n\t\t\t\t\t\t? state.line\n\t\t\t\t\t\t\t? 'templateCode'\n\t\t\t\t\t\t\t: 'code'\n\t\t\t\t\t\t: state.mode === 'regex'\n\t\t\t\t\t\t\t? 'code'\n\t\t\t\t\t\t\t: state.mode === 'templateLine' || state.mode === 'templateRegex'\n\t\t\t\t\t\t\t\t? 'templateCode'\n\t\t\t\t\t\t\t\t: regular && !state.escaped\n\t\t\t\t\t\t\t\t\t? 'code'\n\t\t\t\t\t\t\t\t\t: quoted && !state.escaped\n\t\t\t\t\t\t\t\t\t\t? 'templateCode'\n\t\t\t\t\t\t\t\t\t\t: state.mode\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + (crlf ? 2 : 1),\n\t\t\t\t\tstart: offset + (crlf ? 2 : 1),\n\t\t\t\t\ttoken: tokens.length,\n\t\t\t\t\tmode,\n\t\t\t\t\tescaped: false,\n\t\t\t\t\tregex: reset ? false : state.regex,\n\t\t\t\t\toperand:\n\t\t\t\t\t\tstate.restricted !== undefined || reset || ((regular || quoted) && !state.escaped)\n\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t: state.operand,\n\t\t\t\t\tmember: state.restricted !== undefined ? false : state.member,\n\t\t\t\t\trole: state.restricted !== undefined ? undefined : state.role,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: state.mode !== 'template' ? true : state.separated,\n\t\t\t\t\tpresent: state.jsdoc,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (state.mode === 'line' || state.mode === 'templateLine') {\n\t\t\t\ttokens.push({ code: ' ' })\n\t\t\t\treturn state\n\t\t\t}\n\t\t\tif (state.mode === 'block' || state.mode === 'templateBlock') {\n\t\t\t\tconst closes = character === '*' && next === '/'\n\t\t\t\ttokens.push({\n\t\t\t\t\tcode: closes ? ' ' : ' ',\n\t\t\t\t\t...(state.jsdoc ? { jsdoc: closes ? '*/' : character } : {}),\n\t\t\t\t})\n\t\t\t\treturn closes\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\t\t\tjsdoc: false,\n\t\t\t\t\t\t\tmode: state.block ? 'templateCode' : 'code',\n\t\t\t\t\t\t}\n\t\t\t\t\t: state\n\t\t\t}\n\t\t\tif (\n\t\t\t\tstate.mode === 'single' ||\n\t\t\t\tstate.mode === 'double' ||\n\t\t\t\tstate.mode === 'templateSingle' ||\n\t\t\t\tstate.mode === 'templateDouble'\n\t\t\t) {\n\t\t\t\tconst template = state.mode === 'templateSingle' || state.mode === 'templateDouble'\n\t\t\t\ttokens.push({ code: template ? ' ' : character })\n\t\t\t\tif (state.escaped) return { ...state, escaped: false }\n\t\t\t\tif (character === '\\\\') return { ...state, escaped: true }\n\t\t\t\tconst closes =\n\t\t\t\t\tstate.mode === 'single' || state.mode === 'templateSingle'\n\t\t\t\t\t\t? character === \"'\"\n\t\t\t\t\t\t: character === '\"'\n\t\t\t\treturn closes\n\t\t\t\t\t? { ...state, mode: template ? 'templateCode' : 'code', operand: false }\n\t\t\t\t\t: state\n\t\t\t}\n\t\t\tif (state.mode === 'regex' || state.mode === 'templateRegex') {\n\t\t\t\ttokens.push({ code: state.mode === 'templateRegex' ? ' ' : character })\n\t\t\t\tif (state.escaped) return { ...state, escaped: false }\n\t\t\t\tif (character === '\\\\') return { ...state, escaped: true }\n\t\t\t\tif (character === '[') return { ...state, regex: true }\n\t\t\t\tif (character === ']') return { ...state, regex: false }\n\t\t\t\tif (character === '/' && !state.regex)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\tmode: state.mode === 'templateRegex' ? 'templateCode' : 'code',\n\t\t\t\t\t\toperand: false,\n\t\t\t\t\t}\n\t\t\t\treturn state\n\t\t\t}\n\t\t\tif (state.mode === 'template') {\n\t\t\t\tconst interpolation = !state.escaped && character === '$' && next === '{'\n\t\t\t\ttokens.push({ code: interpolation ? ' ' : ' ' })\n\t\t\t\tif (state.escaped) return { ...state, escaped: false }\n\t\t\t\tif (character === '\\\\') return { ...state, escaped: true }\n\t\t\t\tif (interpolation)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\t\ttemplates: state.templates === undefined ? undefined : { ...state.templates, depth: 1 },\n\t\t\t\t\t\tmode: 'templateCode',\n\t\t\t\t\t\toperand: true,\n\t\t\t\t\t\tmember: false,\n\t\t\t\t\t\trole: undefined,\n\t\t\t\t\t}\n\t\t\t\tif (character === '\\x60') {\n\t\t\t\t\tconst templates = state.templates?.previous\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\ttemplates,\n\t\t\t\t\t\tmode: templates === undefined ? 'code' : 'templateCode',\n\t\t\t\t\t\toperand: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn state\n\t\t\t}\n\t\t\tconst template = state.mode === 'templateCode'\n\t\t\tif (character === '/' && next === '/') {\n\t\t\t\ttokens.push({ code: ' ' })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\tline: template,\n\t\t\t\t\tmode: template ? 'templateLine' : 'line',\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === '/' && next === '*') {\n\t\t\t\tconst jsdoc = !template && source[offset + 2] === '*'\n\t\t\t\ttokens.push({ code: ' ', ...(jsdoc ? { jsdoc: '/*' } : {}) })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\tblock: template,\n\t\t\t\t\tmode: template ? 'templateBlock' : 'block',\n\t\t\t\t\tjsdoc: jsdoc || state.jsdoc,\n\t\t\t\t\tpresent: jsdoc || state.present,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === \"'\" || character === '\"' || character === '\\x60') {\n\t\t\t\ttokens.push({ code: template || character === '\\x60' ? ' ' : character })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\tmode:\n\t\t\t\t\t\tcharacter === '\\x60'\n\t\t\t\t\t\t\t? 'template'\n\t\t\t\t\t\t\t: character === \"'\"\n\t\t\t\t\t\t\t\t? template\n\t\t\t\t\t\t\t\t\t? 'templateSingle'\n\t\t\t\t\t\t\t\t\t: 'single'\n\t\t\t\t\t\t\t\t: template\n\t\t\t\t\t\t\t\t\t? 'templateDouble'\n\t\t\t\t\t\t\t\t\t: 'double',\n\t\t\t\t\ttemplates:\n\t\t\t\t\t\tcharacter === '\\x60' ? { depth: 0, previous: state.templates } : state.templates,\n\t\t\t\t\tescaped: false,\n\t\t\t\t\tseparated: false,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst visible = template ? ' ' : character\n\t\t\tif (character === '/' && next === '=' && !state.operand) {\n\t\t\t\ttokens.push({ code: template ? ' ' : '/=' })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\toperand: true,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === '/') {\n\t\t\t\ttokens.push({ code: visible })\n\t\t\t\treturn state.operand\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\tmode: template ? 'templateRegex' : 'regex',\n\t\t\t\t\t\t\tescaped: false,\n\t\t\t\t\t\t\tregex: false,\n\t\t\t\t\t\t\tseparated: false,\n\t\t\t\t\t\t\trestricted: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\toperand: true,\n\t\t\t\t\t\t\tmember: false,\n\t\t\t\t\t\t\trole: undefined,\n\t\t\t\t\t\t\tseparated: false,\n\t\t\t\t\t\t\trestricted: undefined,\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tidentifier.lastIndex = offset\n\t\t\tconst matched = identifier.exec(source)\n\t\t\tif (matched !== null) {\n\t\t\t\tconst token = matched[0]\n\t\t\t\ttokens.push({ code: template ? ' '.repeat(token.length) : token })\n\t\t\t\tconst stepped = {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + token.length,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t\tconst frame = state.parentheses\n\t\t\t\tif (token.startsWith('#'))\n\t\t\t\t\treturn { ...stepped, operand: false, member: false, role: undefined }\n\t\t\t\tif (state.member) return { ...stepped, member: false, operand: false, role: undefined }\n\t\t\t\tif (state.restricted === 'label')\n\t\t\t\t\treturn { ...stepped, operand: false, role: undefined, restricted: 'complete' }\n\t\t\t\tif (/^(?:if|while|with)$/.test(token))\n\t\t\t\t\treturn { ...stepped, role: 'statement', operand: true }\n\t\t\t\tif (token === 'for') return { ...stepped, role: 'for', operand: true }\n\t\t\t\tif (token === 'export') return { ...stepped, role: 'export', operand: true }\n\t\t\t\tif (token === 'default' && state.role === 'export')\n\t\t\t\t\treturn { ...stepped, role: undefined, operand: true }\n\t\t\t\tif (/^(?:switch|catch)$/.test(token)) return { ...stepped, role: 'block', operand: true }\n\t\t\t\tif (token === 'await' && state.role === 'for') return { ...stepped, operand: true }\n\t\t\t\tif (\n\t\t\t\t\t/^(?:return|throw|case|delete|void|typeof|new|await|yield|else|do|extends|in|instanceof)$/.test(\n\t\t\t\t\t\ttoken,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\treturn { ...stepped, role: undefined, operand: true }\n\t\t\t\tif (/^(?:break|continue)$/.test(token))\n\t\t\t\t\treturn { ...stepped, role: undefined, operand: false, restricted: 'label' }\n\t\t\t\tif (token === 'debugger')\n\t\t\t\t\treturn { ...stepped, role: undefined, operand: false, restricted: 'complete' }\n\t\t\t\tif (\n\t\t\t\t\ttoken === 'of' &&\n\t\t\t\t\tframe?.role === 'for' &&\n\t\t\t\t\tframe.phase === 'left' &&\n\t\t\t\t\t!frame.binding &&\n\t\t\t\t\t!state.operand\n\t\t\t\t)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...stepped,\n\t\t\t\t\t\tparentheses: { ...frame, phase: 'right' },\n\t\t\t\t\t\toperand: true,\n\t\t\t\t\t\trole: undefined,\n\t\t\t\t\t}\n\t\t\t\tif (/^(?:const|let|var)$/.test(token) && frame?.role === 'for' && frame.phase === 'left')\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...stepped,\n\t\t\t\t\t\tparentheses: { ...frame, binding: true },\n\t\t\t\t\t\toperand: true,\n\t\t\t\t\t\trole: undefined,\n\t\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses: frame?.binding === true ? { ...frame, binding: false } : frame,\n\t\t\t\t\toperand: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (/[0-9]/.test(character)) {\n\t\t\t\tnumeric.lastIndex = offset\n\t\t\t\tconst token = numeric.exec(source)?.[0] ?? character\n\t\t\t\ttokens.push({ code: template ? ' '.repeat(token.length) : token })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + token.length,\n\t\t\t\t\toperand: false,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((character === '!' || character === '=') && next === '=') {\n\t\t\t\tconst width = source[offset + 2] === '=' ? 3 : 2\n\t\t\t\ttokens.push({ code: template ? ' '.repeat(width) : source.slice(offset, offset + width) })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + width,\n\t\t\t\t\toperand: true,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((character === '+' && next === '+') || (character === '-' && next === '-')) {\n\t\t\t\ttokens.push({ code: template ? ' ' : character + next })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\toperand: state.separated ? true : state.operand,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === '.' && next === '.' && source[offset + 2] === '.') {\n\t\t\t\ttokens.push({ code: template ? ' ' : '...' })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 3,\n\t\t\t\t\toperand: true,\n\t\t\t\t\tmember: false,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (character === '?' && next === '.') {\n\t\t\t\ttokens.push({ code: template ? ' ' : '?.' })\n\t\t\t\treturn {\n\t\t\t\t\t...state,\n\t\t\t\t\toffset: offset + 2,\n\t\t\t\t\toperand: false,\n\t\t\t\t\tmember: true,\n\t\t\t\t\trole: undefined,\n\t\t\t\t\trestricted: undefined,\n\t\t\t\t\tseparated: false,\n\t\t\t\t}\n\t\t\t}\n\t\t\ttokens.push({ code: visible })\n\t\t\tif (/\\s/.test(character)) return state\n\t\t\tconst stepped = {\n\t\t\t\t...state,\n\t\t\t\tseparated: false,\n\t\t\t\trestricted: undefined,\n\t\t\t\trole: undefined,\n\t\t\t\tmember: false,\n\t\t\t}\n\t\t\tconst frame = state.parentheses\n\t\t\tif (character === '(')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses: {\n\t\t\t\t\t\trole: state.role ?? 'plain',\n\t\t\t\t\t\tphase: 'left',\n\t\t\t\t\t\tbinding: false,\n\t\t\t\t\t\tprevious: frame,\n\t\t\t\t\t},\n\t\t\t\t\toperand: true,\n\t\t\t\t}\n\t\t\tif (character === ')')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses: frame?.previous,\n\t\t\t\t\toperand: frame?.role === 'statement' || frame?.role === 'for',\n\t\t\t\t}\n\t\t\tif (character === ';')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses:\n\t\t\t\t\t\tframe?.role === 'for' && frame.phase === 'left'\n\t\t\t\t\t\t\t? { ...frame, phase: 'classic' }\n\t\t\t\t\t\t\t: frame,\n\t\t\t\t\toperand: true,\n\t\t\t\t}\n\t\t\tif (character === '.') return { ...stepped, operand: false, member: true }\n\t\t\tconst parentheses =\n\t\t\t\t(character === ']' || character === '}') &&\n\t\t\t\tframe?.role === 'for' &&\n\t\t\t\tframe.phase === 'left' &&\n\t\t\t\tframe.binding\n\t\t\t\t\t? { ...frame, binding: false }\n\t\t\t\t\t: frame\n\t\t\tif (character === ']') return { ...stepped, parentheses, operand: false }\n\t\t\tconst top = state.templates\n\t\t\tif (character === '}')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses,\n\t\t\t\t\toperand: false,\n\t\t\t\t\ttemplates: template && top !== undefined ? { ...top, depth: top.depth - 1 } : top,\n\t\t\t\t\tmode: template && top?.depth === 1 ? 'template' : state.mode,\n\t\t\t\t}\n\t\t\tif (character === '{')\n\t\t\t\treturn {\n\t\t\t\t\t...stepped,\n\t\t\t\t\tparentheses,\n\t\t\t\t\toperand: true,\n\t\t\t\t\ttemplates: template && top !== undefined ? { ...top, depth: top.depth + 1 } : top,\n\t\t\t\t}\n\t\t\treturn { ...stepped, parentheses, operand: character !== '!' ? true : state.operand }\n\t\t},\n\t\t{\n\t\t\toffset: 0,\n\t\t\tstart: 0,\n\t\t\ttoken: 0,\n\t\t\tmode: 'code',\n\t\t\tescaped: false,\n\t\t\tregex: false,\n\t\t\toperand: true,\n\t\t\tmember: false,\n\t\t\trole: undefined,\n\t\t\trestricted: undefined,\n\t\t\tseparated: false,\n\t\t\tblock: false,\n\t\t\tline: false,\n\t\t\tjsdoc: false,\n\t\t\tpresent: false,\n\t\t\tparentheses: undefined,\n\t\t\ttemplates: undefined,\n\t\t},\n\t)\n\tconst parts = tokens.slice(final.token)\n\tconst code = parts.map((part) => part.code).join('')\n\tlines.push({\n\t\tsource: source.slice(final.start),\n\t\tcode,\n\t\tjsdoc:\n\t\t\tfinal.present || final.jsdoc\n\t\t\t\t? parts.map((part) => part.jsdoc ?? ' '.repeat(part.code.length)).join('')\n\t\t\t\t: undefined,\n\t})\n\treturn lines\n}\n\n/**\n * Checks whether an opaque inventory key contains only canonical slash-separated\n * segments. Empty, `.` and `..` segments are rejected without rewriting the\n * key; ordinary dotfile segments remain valid.\n *\n * @param key - The opaque inventory key to inspect\n * @returns True if every segment is canonical; false otherwise\n *\n * @example\n * ```ts\n * hasCanonicalSegments('src/.hidden.ts') // true\n * hasCanonicalSegments('src/../alias.ts') // false\n * ```\n */\nexport function hasCanonicalSegments(key: string): boolean {\n\treturn key.split('/').every((segment) => segment !== '' && segment !== '.' && segment !== '..')\n}\n\n/**\n * Normalizes a module scope to its canonical directory list. `'.'` represents\n * workspace root; empty, trailing, and dot-segment spellings reduce through\n * {@link resolvePath}, and duplicates are removed in first-seen order.\n *\n * @param module - The module scope to normalize\n * @returns The directory list `module` denotes\n *\n * @example\n * ```ts\n * normalizeDirectories('src/core') // ['src/core']\n * normalizeDirectories(['src/core', 'src/browser']) // ['src/core', 'src/browser']\n * ```\n */\nexport function normalizeDirectories(module: GuideModule): readonly string[] {\n\tconst directories: string[] = []\n\tconst seen = new Set<string>()\n\tfor (const value of isString(module) ? [module] : module) {\n\t\tconst directory = resolvePath('.', value)\n\t\tif (seen.has(directory)) continue\n\t\tseen.add(directory)\n\t\tdirectories.push(directory)\n\t}\n\treturn directories\n}\n\n/**\n * Computes the stable cache key for a {@link GuideModule}. Directories normalize before\n * joining, so equivalent module spellings share one key. The NUL separator\n * cannot occur in filesystem-backed canonical-segment inventory keys, so no\n * directory boundary can collide with directory text.\n *\n * @param module - The module scope to key\n * @returns The normalized directories joined by NUL\n *\n * @example\n * ```ts\n * computeModuleKey(['src/core', 'src/browser']) // 'src/core\\0src/browser'\n * ```\n */\nexport function computeModuleKey(module: GuideModule): string {\n\treturn normalizeDirectories(module).join('\\0')\n}\n\n/**\n * Selects the exact opaque file-inventory keys belonging under any canonical\n * {@link GuideModule} directory, sorted. `'.'` selects canonical root-relative\n * keys without accepting `/`, `./`, or `../` aliases. Every selected exact\n * `index.ts` and every `.test.ts` key is excluded independent of scope order.\n *\n * @param files - The workspace file inventory, root-relative path → file text\n * @param module - The module scope to filter to\n * @returns The scope's file keys, root-relative and sorted\n *\n * @example\n * ```ts\n * selectModuleKeys({ 'src/core/Guide.ts': '', 'src/core/index.ts': '' }, 'src/core') // ['src/core/Guide.ts']\n * ```\n */\nexport function selectModuleKeys(\n\tfiles: Readonly<Record<string, string>>,\n\tmodule: GuideModule,\n): readonly string[] {\n\tconst dirs = normalizeDirectories(module)\n\tconst indexes = new Set(dirs.map((directory) => resolvePath(directory, 'index.ts')))\n\tconst keys: string[] = []\n\n\tfor (const key of Object.keys(files)) {\n\t\tif (!hasCanonicalSegments(key)) continue\n\t\tif (!key.endsWith('.ts')) continue\n\t\tif (key.endsWith('.test.ts')) continue\n\t\tif (\n\t\t\t!dirs.some((directory) => directory === '.' || key.startsWith(`${directory}/`)) ||\n\t\t\tindexes.has(key)\n\t\t) {\n\t\t\tcontinue\n\t\t}\n\n\t\tkeys.push(key)\n\t}\n\n\treturn keys.sort()\n}\n\n/**\n * Computes the bijection key for a surface symbol — `${keyword} ${name}` — so a symbol-set\n * comparison diffs (name, keyword) pairs rather than names alone.\n *\n * @param symbol - The symbol to key\n * @returns The `${keyword} ${name}` key\n *\n * @example\n * ```ts\n * computeSymbolKey({ name: 'Markdown', keyword: 'class' }) // 'class Markdown'\n * ```\n */\nexport function computeSymbolKey(symbol: SurfaceSymbol): string {\n\treturn `${symbol.keyword} ${symbol.name}`\n}\n\n/**\n * Finds the names present in `names` but absent from `source` — the set-difference\n * behind a both-directions bijection assertion.\n *\n * @param names - The candidate names\n * @param source - The names to compare against\n * @returns The names in `names` that are not in `source`\n *\n * @example\n * ```ts\n * findMissing(['a', 'b'], ['a']) // ['b']\n * ```\n */\nexport function findMissing(\n\tnames: readonly string[],\n\tsource: readonly string[],\n): readonly string[] {\n\tconst existing = new Set(source)\n\treturn names.filter((name) => !existing.has(name))\n}\n\n/**\n * Finds the fences whose language is absent from the caller's listed languages.\n * Untagged fences are always returned because they have no language to list.\n *\n * @param fences - The guide fences to check\n * @param languages - The listed language tags\n * @returns The unlisted fences in input order\n *\n * @example\n * ```ts\n * findUnlisted([{ language: 'typescript', code: 'walk()' }], ['ts'])\n * // [{ language: 'typescript', code: 'walk()' }]\n * ```\n */\nexport function findUnlisted(\n\tfences: readonly GuideFence[],\n\tlanguages: readonly string[],\n): readonly GuideFence[] {\n\tconst listed = new Set(languages)\n\treturn fences.filter((fence) => fence.language === undefined || !listed.has(fence.language))\n}\n\n/**\n * Finds the symbol-key set-difference between two symbol lists — `symbols` present but\n * absent from `source`, compared by {@link computeSymbolKey} so a symbol can drift in\n * neither name nor keyword.\n *\n * @param symbols - The candidate symbols\n * @param source - The symbols to compare against\n * @returns The symbol keys in `symbols` that are not in `source`\n *\n * @example\n * ```ts\n * findMissingSymbols([{ name: 'X', keyword: 'class', signature: '`new () => X`' }], []) // ['class X']\n * ```\n */\nexport function findMissingSymbols(\n\tsymbols: readonly SurfaceSymbol[],\n\tsource: readonly SurfaceSymbol[],\n): readonly string[] {\n\treturn findMissing(symbols.map(computeSymbolKey), source.map(computeSymbolKey))\n}\n\n/**\n * Checks whether a source declares at least one behavioural member — a `class` or `interface`\n * in its surface that carries a call-signature member — so a guide owes a `## Methods` group only\n * where the source has one to document.\n *\n * @param source - The reflected source under parity\n * @returns True if a surface `class` or `interface` declares a member; false otherwise\n *\n * @example\n * ```ts\n * hasBehaviouralSurface(createSource({ files: { 'src/types.ts': 'export interface Widget { render(): void }' }, module: 'src' })) // true\n * hasBehaviouralSurface(createSource({ files: { 'src/constants.ts': 'export const NAMES = Object.freeze({})' }, module: 'src' })) // false\n * ```\n */\nexport function hasBehaviouralSurface(source: SourceInterface): boolean {\n\treturn source\n\t\t.surface()\n\t\t.some(\n\t\t\t(symbol) =>\n\t\t\t\t(symbol.keyword === 'class' || symbol.keyword === 'interface') &&\n\t\t\t\tsource.methods(symbol.name).length > 0,\n\t\t)\n}\n\n/**\n * Finds the names in `names` that have no example — a fence containing the name at a\n * word boundary in `fences`, or a membership in `examples`, both count as\n * \"has an example\"; presence-only, fence and JSDoc content are never checked.\n *\n * @param names - The candidate symbol/member names to check\n * @param fences - The guide's ```ts Patterns fence bodies to search\n * @param examples - The names already known to carry an `@example` JSDoc block\n * @returns The names in `names` with no fence mention and no `@example`\n *\n * @example\n * ```ts\n * findUnexampled(['walk', 'fold'], ['walk()'], []) // ['fold']\n * findUnexampled(['walk'], [], ['walk']) // []\n * ```\n */\nexport function findUnexampled(\n\tnames: readonly string[],\n\tfences: readonly string[],\n\texamples: readonly string[],\n): readonly string[] {\n\tconst exampled = new Set(examples)\n\treturn names.filter((name) => {\n\t\tif (exampled.has(name)) return false\n\t\tconst boundary = new RegExp(`\\\\b${escapeRegExp(name)}\\\\b`)\n\t\treturn !fences.some((fence) => boundary.test(fence))\n\t})\n}\n\n/**\n * Parses a fence's brace `import` statements into per-specifier imported identifier names —\n * `import type`, mixed multiline braces, and `x as y` aliases all count, each alias resolved to\n * the exported name `x` because that is the name the checked barrel surface must hold. Brace\n * bindings only: a default, namespace, side-effect, or mixed `import Default, { named }`\n * statement is not surfaced.\n *\n * @param fence - A ```ts Patterns fence's verbatim body text\n * @returns One entry per `import ... from 'specifier'` statement, in fence order\n *\n * @example\n * ```ts\n * extractFenceImports(\"import { a, b as c } from 'x'\\n\") // [{ specifier: 'x', names: ['a', 'b'] }]\n * ```\n */\nexport function extractFenceImports(fence: string): readonly FenceImport[] {\n\tconst results: FenceImport[] = []\n\tconst pattern = /import\\s+(?:type\\s+)?\\{([^}]*)\\}\\s*from\\s*['\"]([^'\"]+)['\"]/gs\n\n\tfor (const match of fence.matchAll(pattern)) {\n\t\tconst body = match[1]\n\t\tconst specifier = match[2]\n\t\tif (body === undefined || specifier === undefined) continue\n\n\t\tconst names = body\n\t\t\t.split(',')\n\t\t\t.map((part) => part.trim())\n\t\t\t.filter((part) => part.length > 0)\n\t\t\t.map((part) => part.replace(/^type\\s+/, ''))\n\t\t\t.map((part) => {\n\t\t\t\tconst asMatch = part.match(/^(\\w+)\\s+as\\s+\\w+$/)\n\t\t\t\treturn asMatch?.[1] ?? part\n\t\t\t})\n\t\t\t.filter((part) => /^\\w+$/.test(part))\n\n\t\tresults.push({ specifier, names })\n\t}\n\n\treturn results\n}\n\n/**\n * Checks whether a guides-parity link check skips a link `href` — an external\n * scheme ({@link EXTERNAL_SCHEMES}) or a bare in-document `#` anchor.\n *\n * @param href - The link destination\n * @returns True if a link check leaves the href unresolved against the filesystem; false otherwise\n *\n * @example\n * ```ts\n * isExternalLink('https://example.com') // true\n * isExternalLink('../helpers.ts') // false\n * ```\n */\nexport function isExternalLink(href: string): boolean {\n\tif (href.startsWith('#')) return true\n\treturn EXTERNAL_SCHEMES.some((scheme) => href.startsWith(scheme))\n}\n\n/**\n * Resolves a relative `target` from a root-relative `directory`, normalizing\n * forward-slash dot segments without filesystem or extension inference. A\n * parent pops only a retained real component; every excess leading parent is\n * preserved.\n *\n * @param directory - The root-relative directory to resolve from\n * @param target - The relative target to resolve\n * @returns The normalized path, or `'.'` when no segment remains, retaining every excess parent\n *\n * @example\n * ```ts\n * resolvePath('guides/src', '../../src/core/helpers.ts') // 'src/core/helpers.ts'\n * resolvePath('.', '../../outside.ts') // '../../outside.ts'\n * ```\n */\nexport function resolvePath(directory: string, target: string): string {\n\tconst combined = `${directory}/${target}`\n\tconst segments: string[] = []\n\n\tfor (const segment of combined.split('/')) {\n\t\tif (segment === '' || segment === '.') continue\n\t\tif (segment === '..') {\n\t\t\tconst previous = segments[segments.length - 1]\n\t\t\tif (previous !== undefined && previous !== '..') segments.pop()\n\t\t\telse segments.push(segment)\n\t\t\tcontinue\n\t\t}\n\t\tsegments.push(segment)\n\t}\n\n\treturn segments.length === 0 ? '.' : segments.join('/')\n}\n\n/**\n * Resolves a relative `target` from the directory containing a root-relative\n * declaring `file`. A slashless file belongs to the workspace root; path\n * reduction is delegated to {@link resolvePath}.\n *\n * @param file - The root-relative declaring file\n * @param target - The relative link destination to resolve\n * @returns The normalized path, retaining every excess leading parent\n *\n * @example\n * ```ts\n * resolveLink('guides/src/guide.md', '../../src/core/helpers.ts') // 'src/core/helpers.ts'\n * resolveLink('index.ts', './root.ts') // 'root.ts'\n * ```\n */\nexport function resolveLink(file: string, target: string): string {\n\tconst index = file.lastIndexOf('/')\n\tconst directory = index < 0 ? '.' : file.slice(0, index)\n\treturn resolvePath(directory, target)\n}\n\n/**\n * Finds the first code-span value by descending an inline node list, following\n * into `emphasis` / `link` / `image` children — the extraction rule behind a\n * Surface or Methods table row's first-column identifier.\n *\n * @param nodes - The inline nodes to search\n * @returns The first code span's literal text, or `undefined` when none is found\n *\n * @example\n * ```ts\n * findFirstCode([{ element: 'codeSpan', value: 'Markdown' }]) // 'Markdown'\n * ```\n */\nexport function findFirstCode(nodes: readonly InlineNode[]): string | undefined {\n\tfor (const node of nodes) {\n\t\tif (isCodeSpanNode(node)) return node.value\n\t\tif (isEmphasisNode(node) || isLinkNode(node) || isImageNode(node)) {\n\t\t\tconst value = findFirstCode(node.children)\n\t\t\tif (value !== undefined) return value\n\t\t}\n\t}\n\treturn undefined\n}\n\n/**\n * Extracts the link hrefs within one table cell's inline content, in walk order.\n *\n * @param cell - The cell's inline nodes\n * @returns The cell's link hrefs, in walk order\n *\n * @example\n * ```ts\n * extractCellLinks([{ element: 'link', href: 'x.ts', children: [] }]) // ['x.ts']\n * ```\n */\nexport function extractCellLinks(cell: readonly InlineNode[]): readonly string[] {\n\tconst links: string[] = []\n\tfor (const node of walkMarkdownNodes({ element: 'paragraph', children: cell })) {\n\t\tif (isLinkNode(node)) links.push(node.href)\n\t}\n\treturn links\n}\n\n/**\n * Returns the identifier prefix of a code-span text — everything before its first `<`,\n * trimmed. Guide cells and headings may annotate a generic-parameterized name\n * (`MarkdownHandler<TNode, T>`) for readability, but the bijection key is the\n * bare identifier the source scanner captures, so both sides must normalize\n * the same way.\n *\n * @param code - A code span's literal text\n * @returns The identifier prefix, or an empty string when `code` is empty\n *\n * @example\n * ```ts\n * normalizeIdentifier('MarkdownHandler<TNode, T>') // 'MarkdownHandler'\n * normalizeIdentifier('fold') // 'fold'\n * ```\n */\nexport function normalizeIdentifier(code: string): string {\n\tconst index = code.indexOf('<')\n\treturn (index < 0 ? code : code.slice(0, index)).trim()\n}\n\n/**\n * Extracts compared inline content — the text of a table cell or candidate entity heading\n * flattened with every code span kept as a code span, so `` `Widget` `` reads the same wherever\n * the parity reader compares it. Emphasis drops to its text, a link drops to its text, an image\n * drops to its alternative text, and the markdown parser has already unescaped `\\|`.\n *\n * @param cell - The inline nodes to flatten\n * @returns The compared text, code spans included\n *\n * @example\n * ```ts\n * extractCellText([{ element: 'codeSpan', value: 'Widget' }]) // '`Widget`'\n * ```\n */\nexport function extractCellText(cell: readonly InlineNode[]): string {\n\treturn Iterator.from(cell)\n\t\t.map((node) => {\n\t\t\tif (isCodeSpanNode(node)) return `\\`${node.value}\\``\n\t\t\tif (isEmphasisNode(node) || isLinkNode(node) || isImageNode(node)) {\n\t\t\t\treturn extractCellText(node.children)\n\t\t\t}\n\t\t\treturn flattenText(node)\n\t\t})\n\t\t.toArray()\n\t\t.join('')\n}\n\n/**\n * Builds one table cell's inline content from its compared text — the inverse of\n * {@link extractCellText}. A single-backtick run whose text carries no inner backtick and\n * neither a leading nor a trailing space becomes a code span; every other character, a backtick\n * included, becomes literal text, which `renderMarkdown` escapes so the rendered cell parses back\n * to the text this function was given.\n *\n * @remarks\n * The compared form spells every code span with one backtick per side, because\n * {@link extractCellText} emits `` `${value}` `` whatever delimiter the source used. A run this\n * function refuses is therefore a run no parsed cell produced, and emitting it as text is what\n * keeps the projection total: reading the rendered cell back through {@link extractCellText}\n * returns the text, so a rendered row and a hand-written row compare the same. A code span whose\n * own text carries a backtick or a boundary space is outside the compared form's fidelity in\n * either direction, and this function writes it as text rather than guessing a delimiter.\n *\n * @param text - The cell's compared text, as {@link extractCellText} returns it\n * @returns The cell's inline nodes, in text order\n *\n * @example\n * ```ts\n * buildCell('Holds a `Widget`.')\n * // [{ element: 'text', value: 'Holds a ' }, { element: 'codeSpan', value: 'Widget' }, { element: 'text', value: '.' }]\n * ```\n */\nexport function buildCell(text: string): readonly InlineNode[] {\n\tconst nodes: InlineNode[] = []\n\tconst cursor = Iterator.from(text.matchAll(/`([^`]+)`/g)).reduce((previous, span) => {\n\t\tconst value = span[1]\n\t\tif (value === undefined) return previous\n\t\tif (span.index > previous) {\n\t\t\tnodes.push({ element: 'text', value: text.slice(previous, span.index) })\n\t\t}\n\t\tnodes.push(\n\t\t\tvalue.trim() === value ? { element: 'codeSpan', value } : { element: 'text', value: span[0] },\n\t\t)\n\t\treturn span.index + span[0].length\n\t}, 0)\n\tif (cursor < text.length) nodes.push({ element: 'text', value: text.slice(cursor) })\n\treturn coalesceText(nodes)\n}\n\n/**\n * Finds the index of the column whose header text is `header` so a table's columns survive\n * reordering. The match is exact and case-sensitive — a table without that exact header\n * contributes nothing to the projection reading it, so a `## Surface` table with no\n * {@link SUMMARY} column leaves every row's summary absent and {@link findDrift} reports each\n * of those rows, never agreement.\n *\n * @param table - The table to inspect\n * @param header - The exact header text to locate, for example `Kind`\n * @returns The column's index, or `undefined` when the table has no such header\n *\n * @example\n * ```ts\n * findColumnIndex(table, 'Kind') // 1, or undefined\n * ```\n */\nexport function findColumnIndex(table: TableNode, header: string): number | undefined {\n\tfor (const index of table.header.keys()) {\n\t\tconst cell = table.header[index]\n\t\tif (\n\t\t\tcell !== undefined &&\n\t\t\tflattenText({ element: 'paragraph', children: cell }).trim() === header\n\t\t) {\n\t\t\treturn index\n\t\t}\n\t}\n\treturn undefined\n}\n\n/**\n * Extracts the module-scope exports declared in one file's source text — the declaration keys\n * {@link collectKeys} reports, each split back into the keyword and name that built it, deduped by\n * (keyword, name).\n *\n * @remarks\n * That one grammar matches `export (async)? (function(\\*)?|class|const|interface|type) Name`; a\n * generator export (`export function* walk`) keys as the `function` keyword, its trailing `*`\n * stripped before the {@link ExportKeyword} check. Scanning uses {@link extractSourceLines}, so\n * comment and template payload is excluded while its uninterrupted column-zero head remains\n * required; preserved columns do not grant membership to leading/interrupted comment forms. The\n * population is exactly `type`, `interface`, `const`, `function`, and `class`; `enum` is outside\n * this reflection contract, not forbidden by general package policy.\n *\n * @param source - The file's source text\n * @returns The file's exported symbols, in file order\n *\n * @example\n * ```ts\n * extractExports('export class Markdown {}\\n') // [{ name: 'Markdown', keyword: 'class' }]\n * extractExports('export function* walk() {}\\n') // [{ name: 'walk', keyword: 'function' }]\n * ```\n */\nexport function extractExports(source: string): readonly SurfaceSymbol[] {\n\tconst symbols: SurfaceSymbol[] = []\n\tconst seen = new Set<string>()\n\tconst lines = extractSourceLines(source)\n\tconst summaries = collectSummaries(lines)\n\tconst keys = collectKeys(lines)\n\n\tfor (const line of lines) {\n\t\tconst key = keys.get(line)\n\t\tif (key === undefined || seen.has(key)) continue\n\n\t\t// A declaration key is `${keyword} ${name}`, so its one space splits it back into the pair\n\t\t// that built it. A member key carries no space, so its keyword reads empty and the keyword\n\t\t// guard drops it here — no second head pattern excludes it.\n\t\tconst space = key.indexOf(' ')\n\t\tconst keyword = key.slice(0, Math.max(space, 0))\n\t\tif (!isExportKeyword(keyword)) continue\n\n\t\tseen.add(key)\n\t\tconst name = key.slice(space + 1)\n\t\tconst summary = summaries.get(line)\n\t\tsymbols.push({ name, keyword, ...(summary === undefined ? {} : { summary }) })\n\t}\n\n\treturn symbols\n}\n\n/**\n * Extracts the module-scope declarations lacking the `export` keyword in one file's source text —\n * the mirror image of {@link extractExports}'s grammar, anchored the same way (column 0, so an\n * indented inner declaration never matches).\n *\n * @remarks\n * Scans only the {@link ExportKeyword} keywords (`function` / `class` / `const` / `interface` /\n * `type`) — a module-scope `let` or `var` is outside this scanner's declaration-keyword grammar\n * and out of this check's contract. Scanning uses {@link extractSourceLines}, so comment and\n * template payload is excluded while its uninterrupted column-zero head remains required;\n * preserved columns do not widen membership. `enum` is likewise outside this reflection\n * population, not forbidden by general package policy.\n *\n * @param source - The file's source text\n * @returns The file's hidden (non-exported) symbols, in file order\n *\n * @example\n * ```ts\n * extractHidden('function secretHelper() {}\\n') // [{ name: 'secretHelper', keyword: 'function' }]\n * extractHidden('export class X {}\\n') // []\n * ```\n */\nexport function extractHidden(source: string): readonly SurfaceSymbol[] {\n\tconst symbols: SurfaceSymbol[] = []\n\tconst seen = new Set<string>()\n\tconst lines = extractSourceLines(source)\n\tconst summaries = collectSummaries(lines)\n\n\tfor (const line of lines) {\n\t\tif (line.code.startsWith('export ')) continue\n\t\tconst match = line.code.match(/^(?:async )?(function\\*?|class|const|interface|type) (\\w+)/)\n\t\tconst rawKeyword = match?.[1]\n\t\tconst name = match?.[2]\n\t\tconst keyword = rawKeyword === undefined ? undefined : rawKeyword.replace(/\\*$/, '')\n\t\tif (!isNonEmptyString(keyword) || !isNonEmptyString(name) || !isExportKeyword(keyword)) continue\n\n\t\tconst key = `${keyword} ${name}`\n\t\tif (seen.has(key)) continue\n\t\tseen.add(key)\n\t\tconst summary = summaries.get(line)\n\t\tsymbols.push({ name, keyword, ...(summary === undefined ? {} : { summary }) })\n\t}\n\n\treturn symbols\n}\n\n/**\n * Computes the bracket depth of every character of projected declaration code: an opening `(`,\n * `[`, `{`, or `<` and its closing partner carry the depth outside the pair, the characters\n * between them one more, and every character of a quoted string, its quotes included, `-1`.\n *\n * @remarks\n * The `>` of an `=>` arrow closes nothing. A backslash escapes the next character inside a\n * quoted string. Template literal text is outside the reading, because\n * {@link extractSourceLines} masks it to spaces in the code this function reads.\n *\n * @param code - The projected code of one declaration\n * @returns One depth per UTF-16 code unit of `code`\n *\n * @example\n * ```ts\n * computeDepths(\"f(a, 'b')\") // [0, 0, 1, 1, 1, -1, -1, -1, 0]\n * ```\n */\nexport function computeDepths(code: string): readonly number[] {\n\tconst depths: number[] = []\n\tcode.split('').reduce<{\n\t\treadonly depth: number\n\t\treadonly quote: string | undefined\n\t\treadonly escaped: boolean\n\t}>(\n\t\t(state, character, index) => {\n\t\t\tif (state.quote !== undefined) {\n\t\t\t\tdepths.push(-1)\n\t\t\t\tif (state.escaped) return { ...state, escaped: false }\n\t\t\t\tif (character === '\\\\') return { ...state, escaped: true }\n\t\t\t\treturn character === state.quote ? { ...state, quote: undefined } : state\n\t\t\t}\n\t\t\tif (character === \"'\" || character === '\"') {\n\t\t\t\tdepths.push(-1)\n\t\t\t\treturn { ...state, quote: character }\n\t\t\t}\n\t\t\tif (')]}'.includes(character) || (character === '>' && code[index - 1] !== '=')) {\n\t\t\t\tconst depth = Math.max(0, state.depth - 1)\n\t\t\t\tdepths.push(depth)\n\t\t\t\treturn { ...state, depth }\n\t\t\t}\n\t\t\tdepths.push(state.depth)\n\t\t\treturn '([{<'.includes(character) ? { ...state, depth: state.depth + 1 } : state\n\t\t},\n\t\t{ depth: 0, quote: undefined, escaped: false },\n\t)\n\treturn depths\n}\n\n/**\n * Finds the index of the bracket closing the opener at `start`: the first later character whose\n * {@link computeDepths} depth equals the opener's.\n *\n * @param depths - The depths {@link computeDepths} returned for the code\n * @param start - The index of an opening `(`, `[`, `{`, or `<`\n * @returns The closing bracket's index, or `undefined` when the opener never closes\n *\n * @example\n * ```ts\n * findClosing(computeDepths('<T>(x: T)'), 3) // 8\n * ```\n */\nexport function findClosing(depths: readonly number[], start: number): number | undefined {\n\tconst depth = depths[start]\n\tif (depth === undefined || depth < 0) return undefined\n\tconst index = depths.findIndex((value, position) => position > start && value === depth)\n\treturn index < 0 ? undefined : index\n}\n\n/**\n * Finds every index at which `separator` sits at `depth` outside quoted text, in code order.\n *\n * @param code - The projected code to search\n * @param depths - The depths {@link computeDepths} returned for `code`\n * @param separator - The single character to find\n * @param depth - The bracket depth the separator must sit at\n * @returns The separator indices, in code order\n *\n * @example\n * ```ts\n * findSeparators('a, f(b, c)', computeDepths('a, f(b, c)'), ',', 0) // [1]\n * ```\n */\nexport function findSeparators(\n\tcode: string,\n\tdepths: readonly number[],\n\tseparator: string,\n\tdepth: number,\n): readonly number[] {\n\treturn depths\n\t\t.keys()\n\t\t.filter((index) => depths[index] === depth && code[index] === separator)\n\t\t.toArray()\n}\n\n/**\n * Renders one emitted interface member as its signature entry: a property as its name, an\n * optional one with `?`, a method as `name()` or `name?()`, an accessor as its name, and a call,\n * construct, or index signature as its own text with whitespace collapsed.\n *\n * @remarks\n * `code` is the member's projected code and `source` its text at the same columns, both without\n * the terminating `;`. A leading `readonly` modifier never enters a name. A computed name keeps\n * its brackets, and a quoted name keeps its quotes.\n *\n * @param code - The member's projected code\n * @param source - The member's source text, aligned with `code`\n * @returns The member's entry, or `undefined` when the member is empty\n *\n * @example\n * ```ts\n * renderMember('readonly name?: string', 'readonly name?: string') // 'name?'\n * renderMember('walk(depth: number): void', 'walk(depth: number): void') // 'walk()'\n * renderMember('[key: string]: number', '[key: string]: number') // '[key: string]: number'\n * ```\n */\nexport function renderMember(code: string, source: string): string | undefined {\n\tconst text = source.replace(/\\s+/g, ' ').trim()\n\tif (text.length === 0) return undefined\n\tconst leading = code.length - code.trimStart().length\n\tconst modifier = leading + (/^readonly\\s+/.exec(code.slice(leading))?.[0].length ?? 0)\n\tconst rest = code.slice(modifier)\n\tif (/^(?:new\\s*)?[(<]/.test(rest)) return text\n\tconst depths = computeDepths(rest)\n\tconst bracket = rest.startsWith('[') ? findClosing(depths, 0) : undefined\n\tif (\n\t\tbracket !== undefined &&\n\t\tfindSeparators(rest, depths, ':', 1).some((index) => index < bracket)\n\t) {\n\t\treturn text\n\t}\n\n\tconst accessor = /^(?:get|set)\\s+(?=[^\\s(:?<])/.exec(rest)?.[0].length ?? 0\n\tconst named = rest.slice(accessor)\n\tconst computed = named.startsWith('[') ? findClosing(computeDepths(named), 0) : undefined\n\tconst length =\n\t\tcomputed === undefined\n\t\t\t? (/^(?:\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|[^\\s?(:<]+)/.exec(named)?.[0].length ?? 0)\n\t\t\t: computed + 1\n\tif (length === 0) return text\n\n\tconst offset = modifier + accessor\n\tconst tail = named.slice(length)\n\tconst optional = tail.startsWith('?')\n\tconst method = accessor === 0 && /^\\??\\s*[(<]/.test(tail)\n\treturn `${source.slice(offset, offset + length)}${optional ? '?' : ''}${method ? '()' : ''}`\n}\n\n/**\n * Extracts one emitted declaration's signature: the symbol its column-zero `export` head names,\n * carrying the type text the compiler emitted for it.\n *\n * @remarks\n * `code` is the declaration's projected code and `source` its text at the same columns, each\n * physical line trimmed and the lines joined with single spaces. The forms:\n *\n * - `function`: `<T>(params) => RET` from `NAME<T>(params): RET`.\n * - `class`: `new <T>(params) => YIELD` per `constructor(params)`, several as an intersection of\n * parenthesized signatures, none as `new <T>() => YIELD`. `YIELD` is the first `implements`\n * type, else the class's own name with its type parameter names. Every other member is ignored.\n * - `interface`: `{ entries }` from {@link renderMember} over its own members, in emitted order,\n * each entry once, or `{}` when it declares none. The `extends` clause is not read.\n * - `type`: the text after `=` to the terminating `;`, type parameters omitted.\n * - `const`: the text after `NAME:` to the `;`, or after `NAME =` for a literal the compiler\n * emitted as the constant's type.\n *\n * @param code - The declaration's projected code\n * @param source - The declaration's source text, aligned with `code`\n * @returns The declared symbol with its signature, or `undefined` when no supported head opens it\n *\n * @example\n * ```ts\n * const text = 'export declare function walk<T>(node: T): void;'\n * extractSignature(text, text) // { name: 'walk', keyword: 'function', signature: '<T>(node: T) => void' }\n * ```\n */\nexport function extractSignature(code: string, source: string): SurfaceSymbol | undefined {\n\tconst head =\n\t\t/^export (?:declare )?(?:abstract )?(function|class|interface|type|const(?! enum\\b)) ([^\\s<(:=;{]+)/.exec(\n\t\t\tcode,\n\t\t)\n\tconst keyword = head?.[1]\n\tconst name = head?.[2]\n\tif (head === null || name === undefined || !isExportKeyword(keyword)) return undefined\n\n\tconst depths = computeDepths(code)\n\tconst start = head[0].length\n\tconst generic = code[start] === '<' ? findClosing(depths, start) : undefined\n\tconst typed = generic === undefined ? start : generic + 1\n\tconst generics = source.slice(start, typed)\n\tconst end = findSeparators(code, depths, ';', 0).find((index) => index >= typed) ?? code.length\n\n\tif (keyword === 'function') {\n\t\tconst close = code[typed] === '(' ? findClosing(depths, typed) : undefined\n\t\tif (close === undefined) return undefined\n\t\tconst colon = /^\\s*:/.exec(code.slice(close + 1))?.[0].length\n\t\tif (colon === undefined) return undefined\n\t\tconst returns = source.slice(close + 1 + colon, end).trim()\n\t\treturn {\n\t\t\tname,\n\t\t\tkeyword,\n\t\t\tsignature: `${generics}(${source.slice(typed + 1, close)}) => ${returns}`,\n\t\t}\n\t}\n\n\tif (keyword === 'const' || keyword === 'type') {\n\t\t// The separator alone, because the spaces after it can be masked template text.\n\t\tconst assigned = (keyword === 'const' ? /^\\s*[:=]/ : /^\\s*=/).exec(code.slice(typed))\n\t\tif (assigned === null) return undefined\n\t\treturn { name, keyword, signature: source.slice(typed + assigned[0].length, end).trim() }\n\t}\n\n\tconst open = findSeparators(code, depths, '{', 0).find((index) => index >= typed)\n\tconst close = open === undefined ? undefined : findClosing(depths, open)\n\tif (open === undefined || close === undefined) return undefined\n\tconst boundaries = [\n\t\topen,\n\t\t...findSeparators(code, depths, ';', 1).filter((index) => index > open && index < close),\n\t\tclose,\n\t]\n\tconst members = boundaries.slice(0, -1).map((boundary, position) => {\n\t\tconst next = boundaries[position + 1] ?? close\n\t\treturn { code: code.slice(boundary + 1, next), source: source.slice(boundary + 1, next) }\n\t})\n\n\tif (keyword === 'interface') {\n\t\tconst entries = Array.from(\n\t\t\tnew Set(\n\t\t\t\tmembers\n\t\t\t\t\t.map((member) => renderMember(member.code, member.source))\n\t\t\t\t\t.filter((entry) => entry !== undefined),\n\t\t\t),\n\t\t)\n\t\treturn { name, keyword, signature: entries.length === 0 ? '{}' : `{ ${entries.join(', ')} }` }\n\t}\n\n\tconst heritage = /\\bimplements\\b/.exec(code.slice(typed, open))\n\tconst implemented =\n\t\theritage === null || depths[typed + heritage.index] !== 0\n\t\t\t? undefined\n\t\t\t: typed + heritage.index + heritage[0].length\n\tconst comma =\n\t\timplemented === undefined\n\t\t\t? undefined\n\t\t\t: findSeparators(code, depths, ',', 0).find((index) => index > implemented && index < open)\n\tconst parameters =\n\t\tgeneric === undefined\n\t\t\t? []\n\t\t\t: [start, ...findSeparators(code, depths, ',', 1).filter((index) => index < generic)].map(\n\t\t\t\t\t(boundary, position, list) =>\n\t\t\t\t\t\t/^\\s*(?:(?:const|in|out)\\s+)*([^\\s=,>]+)/.exec(\n\t\t\t\t\t\t\tcode.slice(boundary + 1, list[position + 1] ?? generic),\n\t\t\t\t\t\t)?.[1] ?? '',\n\t\t\t\t)\n\tconst yielded =\n\t\timplemented === undefined\n\t\t\t? `${name}${parameters.length === 0 ? '' : `<${parameters.join(', ')}>`}`\n\t\t\t: source.slice(implemented, comma ?? open).trim()\n\tconst constructors = members\n\t\t.filter((member) =>\n\t\t\t/^\\s*(?:(?:public|private|protected)\\s+)?constructor\\s*\\(/.test(member.code),\n\t\t)\n\t\t.map((member) => {\n\t\t\tconst parenthesis = member.code.indexOf('(')\n\t\t\tconst closed = findClosing(computeDepths(member.code), parenthesis) ?? member.code.length\n\t\t\treturn `new ${generics}(${member.source.slice(parenthesis + 1, closed)}) => ${yielded}`\n\t\t})\n\treturn {\n\t\tname,\n\t\tkeyword,\n\t\tsignature:\n\t\t\tconstructors.length === 0\n\t\t\t\t? `new ${generics}() => ${yielded}`\n\t\t\t\t: constructors.length === 1\n\t\t\t\t\t? (constructors[0] ?? '')\n\t\t\t\t\t: constructors.map((entry) => `(${entry})`).join(' & '),\n\t}\n}\n\n/**\n * Extracts every signature one compiler-emitted declaration file declares: each column-zero\n * `export` head read through {@link extractSignature}, an overload set's emitted heads joined in\n * order as an intersection of parenthesized signatures.\n *\n * @remarks\n * The text is read through {@link extractSourceLines}, so comment and template payload never\n * opens or closes a bracket. Each physical line is trimmed and a declaration's lines are joined\n * with single spaces, so a multi-line emitted type reads as one line. A head the projector does\n * not support, such as an `enum` or a re-export, contributes nothing. Every other repeated head\n * keeps its first signature.\n *\n * @param declaration - The emitted `.d.ts` text\n * @returns The declared symbols with their signatures, in first-seen order\n *\n * @example\n * ```ts\n * extractSignatures('export declare function open(id: string): boolean;\\nexport declare function open(ids: readonly string[]): boolean;\\n')\n * // [{ name: 'open', keyword: 'function', signature: '((id: string) => boolean) & ((ids: readonly string[]) => boolean)' }]\n * ```\n */\nexport function extractSignatures(declaration: string): readonly SurfaceSymbol[] {\n\tconst records = extractSourceLines(declaration)\n\t\t.map((line) => {\n\t\t\tconst start = line.code.length - line.code.trimStart().length\n\t\t\tconst end = line.code.trimEnd().length\n\t\t\treturn {\n\t\t\t\tcode: line.code.slice(start, end),\n\t\t\t\tsource: line.source.slice(start, end),\n\t\t\t\thead: start === 0 && line.code.startsWith('export '),\n\t\t\t}\n\t\t})\n\t\t.filter((record) => record.code.length > 0)\n\tconst heads = records\n\t\t.keys()\n\t\t.filter((index) => records[index]?.head === true)\n\t\t.toArray()\n\tconst symbols = heads\n\t\t.map((head, position) => {\n\t\t\tconst segment = records.slice(head, heads[position + 1] ?? records.length)\n\t\t\treturn extractSignature(\n\t\t\t\tsegment.map((record) => record.code).join(' '),\n\t\t\t\tsegment.map((record) => record.source).join(' '),\n\t\t\t)\n\t\t})\n\t\t.filter((symbol) => symbol !== undefined)\n\n\treturn Array.from(new Set(symbols.map(computeSymbolKey))).flatMap((key) => {\n\t\tconst declared = symbols.filter((symbol) => computeSymbolKey(symbol) === key)\n\t\tconst [first] = declared\n\t\tif (first === undefined) return []\n\t\tif (first.keyword !== 'function' || declared.length === 1) return [first]\n\t\treturn [\n\t\t\t{\n\t\t\t\t...first,\n\t\t\t\tsignature: declared.map((symbol) => `(${symbol.signature ?? ''})`).join(' & '),\n\t\t\t},\n\t\t]\n\t})\n}\n\n/**\n * Joins the declaration head starting at `start` into one space-separated\n * line, consuming lines until the first that opens a body: one that ends with\n * `{`, or one that closes an empty body with `{}` or `{ }`.\n *\n * @remarks\n * A line ending with `{}` closes an empty body only when every angle, round,\n * and square bracket the head opened outside quoted text has closed; inside\n * one, `{}` is a type or an argument, and an arrow's `=>` closes nothing. A\n * head that reaches the next column-zero `export` line opens no body.\n *\n * @param lines - The file's source lines\n * @param start - The index of the head's first line\n * @returns The joined head, or `undefined` when no line opens a body\n *\n * @example\n * ```ts\n * joinHead(['export class X {'], 0) // { text: 'export class X {', end: 0 }\n * joinHead(['export interface Y extends X {}'], 0) // { text: 'export interface Y extends X {}', end: 0 }\n * ```\n */\nexport function joinHead(lines: readonly string[], start: number): DeclarationHead | undefined {\n\tconst parts: string[] = []\n\tfor (const distance of Array.prototype.keys.call({\n\t\tget length() {\n\t\t\treturn Math.max(0, Math.ceil(lines.length - start))\n\t\t},\n\t})) {\n\t\tconst index = start + distance\n\t\tconst line = lines[index]\n\t\tif (line === undefined) break\n\t\tconst text = line.trimEnd()\n\t\tif (index > start && text.startsWith('export ')) return undefined\n\t\tparts.push(index === start ? text : text.trimStart())\n\t\tif (text.endsWith('{')) return { text: parts.join(' '), end: index }\n\t\tconst bare = parts.join(' ').replace(/'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"/g, '')\n\t\tconst closed =\n\t\t\t(bare.match(/</g)?.length ?? 0) <= (bare.match(/(?<!=)>/g)?.length ?? 0) &&\n\t\t\t(bare.match(/\\(/g)?.length ?? 0) <= (bare.match(/\\)/g)?.length ?? 0) &&\n\t\t\t(bare.match(/\\[/g)?.length ?? 0) <= (bare.match(/\\]/g)?.length ?? 0)\n\t\tif (closed && /\\{\\s*\\}$/.test(text)) return { text: parts.join(' '), end: index }\n\t}\n\treturn undefined\n}\n\n/**\n * Collects every `export class` / `export interface` declaration one file's source text declares,\n * each keyed `${keyword} ${name}` and carrying the body lines and the base identifiers read from\n * its own head, so a body and a heritage clause always come from the same declaration.\n *\n * @remarks\n * The whole file is projected once through {@link extractSourceLines} and every head is read from\n * that one projection, so a scope resolving many names reads each file once rather than once per\n * name. A head is a column-zero `export class` / `export interface` line, an oxfmt-wrapped\n * signature joined through {@link joinHead}, with an optional generic parameter list and an\n * optional heritage clause between the identifier and the opening `{`; the identifier is the head's\n * own run up to that list or clause, so it enters the key as literal text and no name reaches a\n * `RegExp`. Body lines are the raw source between the head and the first projected column-zero `}`,\n * keeping JSDoc evidence intact; a head whose last line closes its own body with `{}` or `{ }`\n * records an empty body. Every balanced `<...>` span is removed from the head before its\n * `extends` clause is read, so a `T extends Base` type parameter is never a base and `Base<T>`\n * reads as `Base`; a class's `implements` clause and everything after it is excluded, and a\n * qualified base such as `namespace.Base` is returned verbatim. The first head of a key that opens\n * a column-zero close answers for that key: a head that opens none records nothing, and a later\n * head of a key already collected adds nothing unless the earlier head recorded neither a body\n * nor bases, which declares nothing as {@link Source} reads it, so the later head replaces it.\n *\n * @param source - The file's source text to read\n * @returns One entry per collected declaration, keyed `${keyword} ${name}`\n *\n * @example\n * ```ts\n * collectDeclarations('export interface X extends Y {\\n\\twalk(): void\\n}\\n').get('interface X')\n * // { body: ['\\twalk(): void'], bases: ['Y'] }\n * ```\n */\nexport function collectDeclarations(source: string): ReadonlyMap<string, Declaration> {\n\tconst declarations = new Map<string, Declaration>()\n\tconst opener = /^export (?:class|interface) /\n\tconst grammar = /^export (class|interface) ([^\\s<]+)(?:<.*>)?(?: .*)? \\{(?:\\s*\\})?$/\n\tconst lines = extractSourceLines(source)\n\tconst projected = lines.map((line) => line.code)\n\n\tfor (const index of projected.keys()) {\n\t\tconst line = projected[index]\n\t\tif (line === undefined || !opener.test(line)) continue\n\n\t\tconst head = joinHead(projected, index)\n\t\tif (head === undefined) continue\n\t\tconst declared = grammar.exec(head.text)\n\t\tconst keyword = declared?.[1]\n\t\tconst name = declared?.[2]\n\t\tif (keyword === undefined || name === undefined) continue\n\n\t\tconst key = `${keyword} ${name}`\n\t\tconst known = declarations.get(key)\n\t\t// A head with neither a body nor bases declares nothing, as Source reads it, so a later head answers.\n\t\tif (known !== undefined && (known.body.length > 0 || known.bases.length > 0)) continue\n\n\t\tconst visible: string[] = []\n\t\tIterator.from(head.text.slice(`export ${key}`.length, head.text.lastIndexOf('{'))).reduce(\n\t\t\t(depth, character) => {\n\t\t\t\tif (character === '<') return depth + 1\n\t\t\t\tif (character === '>') return Math.max(0, depth - 1)\n\t\t\t\tif (depth === 0) visible.push(character)\n\t\t\t\treturn depth\n\t\t\t},\n\t\t\t0,\n\t\t)\n\t\tconst flat = visible.join('')\n\t\tconst clause = flat.replace(/\\bimplements\\b[\\s\\S]*$/, '').match(/\\bextends\\b([\\s\\S]*)$/)?.[1]\n\t\tconst bases =\n\t\t\tclause === undefined\n\t\t\t\t? []\n\t\t\t\t: clause\n\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t.map((base) => base.trim())\n\t\t\t\t\t\t.filter(isNonEmptyString)\n\n\t\t// joinHead ends a head on `}` only where its line closes an empty body, so no close follows it.\n\t\tif (head.text.endsWith('}')) {\n\t\t\tdeclarations.set(key, { body: [], bases })\n\t\t\tcontinue\n\t\t}\n\n\t\tconst close = Array.prototype.keys\n\t\t\t.call({ length: projected.length - head.end - 1 })\n\t\t\t.map((distance) => head.end + 1 + distance)\n\t\t\t.find((candidate) => projected[candidate] === '}')\n\t\tif (close !== undefined)\n\t\t\tdeclarations.set(key, {\n\t\t\t\tbody: lines.slice(head.end + 1, close).map((record) => record.source),\n\t\t\t\tbases,\n\t\t\t})\n\n\t\t// An unterminated body records nothing — keep scanning in case a later head closes.\n\t}\n\n\treturn declarations\n}\n\n/**\n * Locates the named `export class` / `export interface` declaration in one file's source text\n * and returns its body lines and its base identifiers read from that one head, so a body and a\n * heritage clause always come from the same declaration, or `undefined` when the file declares\n * no such head.\n *\n * @remarks\n * The one named lookup over {@link collectDeclarations}, which owns the head grammar, the body\n * window, and the base reading. This lookup spells the map's `${keyword} ${name}` key for its\n * caller, so a consumer reading one name never writes that convention itself. `name` is compared\n * as literal text against the identifier the head itself carries, so a metacharacter in `name`\n * names that character rather than matching text it does not name. Every call collects the whole\n * file afresh: a consumer reading many names from one file calls {@link collectDeclarations} once\n * and reads the map, and {@link Source} holds one such map per module scope.\n *\n * @param source - The file's source text to search\n * @param keyword - Whether to look for a `class` or an `interface`\n * @param name - The declaration's identifier\n * @returns Its body and bases, or `undefined` when `source` declares no such head\n *\n * @example\n * ```ts\n * extractDeclaration('export interface X extends Y {\\n\\twalk(): void\\n}\\n', 'interface', 'X')\n * // { body: ['\\twalk(): void'], bases: ['Y'] }\n * ```\n */\nexport function extractDeclaration(\n\tsource: string,\n\tkeyword: DeclarationKeyword,\n\tname: string,\n): Declaration | undefined {\n\treturn collectDeclarations(source).get(`${keyword} ${name}`)\n}\n\n/**\n * Selects the member lines declaring a callable member: plain, `async`, generator\n * (`*`), and optional (`records?(`) methods all count; getters, setters,\n * `static` members, and `#` privates never do (their keyword or `#` breaks\n * the `name(` shape). The grammar is {@link collectKeys}'s, read once over\n * {@link extractBodyLines}'s projection of the body, so commented method-like payload never\n * becomes eligible and each member keys to the owner head that projection supplies. Each member\n * carries its own doc block's description paragraph, read through {@link collectSummaries}; the\n * first declaration of a name answers for it.\n *\n * @param lines - A declaration's body lines\n * @returns The declared members, deduplicated by name and sorted by name\n *\n * @example\n * ```ts\n * extractMemberMethods(['\\tmap(): void', '\\tfilter(): void']) // [{ name: 'filter' }, { name: 'map' }]\n * ```\n */\nexport function extractMemberMethods(lines: readonly string[]): readonly MethodEntry[] {\n\tconst methods = new Map<string, MethodEntry>()\n\tconst projected = extractBodyLines(lines)\n\tconst summaries = collectSummaries(projected)\n\tconst keys = collectKeys(projected)\n\n\tfor (const line of projected) {\n\t\t// A member key is `${owner}.${member}`, so its dot splits the member name back out and a\n\t\t// declaration key, which carries none, drops out here.\n\t\tconst key = keys.get(line) ?? ''\n\t\tconst dot = key.indexOf('.')\n\t\tif (dot < 0) continue\n\n\t\tconst name = key.slice(dot + 1)\n\t\tif (methods.has(name)) continue\n\t\tconst summary = summaries.get(line)\n\t\tmethods.set(name, { name, ...(summary === undefined ? {} : { summary }) })\n\t}\n\n\treturn Array.from(methods.values()).sort((a, b) =>\n\t\ta.name === b.name ? 0 : a.name < b.name ? -1 : 1,\n\t)\n}\n\n/**\n * Selects the block nodes under the named `##` heading, up to the next `##`-or-higher\n * heading (or the document's end) — the section-scoping window `extractSurface` /\n * `extractMethods` walk over.\n *\n * @param document - The parsed guide document\n * @param heading - The `##` heading text to scope to, for example `Surface`\n * @returns The blocks belonging to that section, in document order\n *\n * @example\n * ```ts\n * selectSectionBlocks(document, 'Surface') // the blocks between `## Surface` and the next `##`\n * ```\n */\nexport function selectSectionBlocks(\n\tdocument: MarkdownDocument,\n\theading: string,\n): readonly BlockNode[] {\n\tconst scanned: Array<{\n\t\treadonly block: BlockNode\n\t\treadonly active: boolean\n\t\treadonly heading: boolean\n\t}> = []\n\tfor (const block of document.children) {\n\t\tconst active = scanned.at(-1)?.active ?? false\n\t\tif (isHeadingNode(block) && block.level <= 2) {\n\t\t\tif (block.level === 2 && flattenText(block).trim() === heading) {\n\t\t\t\tscanned.push({ block, active: true, heading: true })\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (active) break\n\t\t}\n\t\tscanned.push({ block, active, heading: false })\n\t}\n\treturn scanned.filter((entry) => entry.active && !entry.heading).map((entry) => entry.block)\n}\n\n/**\n * Validates every `## Surface` table a guide carries: each header must be exactly\n * {@link SURFACE_HEADER}, and each row that keys a symbol must carry a non-empty `Signature` cell.\n *\n * @remarks\n * Reads each `## Surface` section through {@link selectSectionBlocks}, a repeated section\n * included, and refuses at the first offending table in document order, through {@link GuideError} with code\n * `header` for a nonuniform header and `signature` for a keyed empty cell. Header and row text in\n * the message is JSON-encoded and capped at 200 characters.\n *\n * @param document - The parsed guide document\n * @throws {@link GuideError} at the first nonuniform header or keyed empty Signature cell\n *\n * @example\n * ```ts\n * validateSurface(createMarkdown('## Surface\\n\\n| Name | Kind |\\n| --- | --- |').document)\n * // throws GuideError: ## Surface table 1 has header \"Name | Kind\"; expected \"Name | Kind | Signature | Summary\".\n * ```\n */\nexport function validateSurface(document: MarkdownDocument): void {\n\tconst expected = SURFACE_HEADER.join(' | ')\n\tconst signed = SURFACE_HEADER.indexOf(SIGNATURE)\n\tconst tables = new Set(\n\t\tdocument.children\n\t\t\t.flatMap((block, start) =>\n\t\t\t\tisHeadingNode(block) && block.level === 2 && flattenText(block).trim() === SURFACE\n\t\t\t\t\t? selectSectionBlocks({ ...document, children: document.children.slice(start) }, SURFACE)\n\t\t\t\t\t: [],\n\t\t\t)\n\t\t\t.filter(isTableNode),\n\t)\n\tfor (const [index, table] of Array.from(tables).entries()) {\n\t\tconst header = table.header.map((children) =>\n\t\t\tflattenText({ element: 'paragraph', children }).trim(),\n\t\t)\n\t\tif (\n\t\t\theader.length !== SURFACE_HEADER.length ||\n\t\t\t!SURFACE_HEADER.every((name, column) => header[column] === name)\n\t\t) {\n\t\t\tthrow new GuideError(\n\t\t\t\t`## Surface table ${index + 1} has header ${JSON.stringify(header.join(' | ').slice(0, 200))}; expected ${JSON.stringify(expected)}.`,\n\t\t\t\t'header',\n\t\t\t)\n\t\t}\n\t\tfor (const position of table.rows.keys()) {\n\t\t\tconst symbol = extractRowSymbol(table, position)\n\t\t\tif (symbol === undefined) continue\n\t\t\tconst cell = table.rows[position]?.[signed]\n\t\t\tif (\n\t\t\t\tcell !== undefined &&\n\t\t\t\tflattenText({ element: 'paragraph', children: cell }).trim().length > 0\n\t\t\t)\n\t\t\t\tcontinue\n\t\t\tthrow new GuideError(\n\t\t\t\t`## Surface table ${index + 1} row ${position + 1} (${JSON.stringify(`${symbol.keyword} ${symbol.name}`.slice(0, 200))}) has an empty Signature cell; expected a non-empty TypeScript signature code span under ${JSON.stringify(expected)}.`,\n\t\t\t\t'signature',\n\t\t\t)\n\t\t}\n\t}\n}\n\n/**\n * Validates that the modules one manifest entry spans declare disjoint exports: one name exported\n * from two modules, whatever its keyword, is one capability split across environments.\n *\n * @remarks\n * Each source file answers for the most specific listed module directory that contains it, so a\n * nested module listed beside its parent never collides with itself. Logic that serves several\n * environments lives once in its layer's `core` directory, such as `src/core` or `app/core`;\n * environments whose internals differ each export a distinct name. Every colliding name is\n * reported in one refusal, in key order, each with every module that declares it; name and module\n * text is JSON-encoded and capped at 200 characters.\n *\n * @param files - The workspace-relative inventory the modules are read from\n * @param module - The manifest entry's source scope\n * @throws {@link GuideError} with code `collision` naming each name and the modules that declare it\n *\n * @example\n * ```ts\n * validateModules(\n * \t{ 'src/core/a.ts': 'export function open() {}', 'src/server/a.ts': 'export function open() {}' },\n * \t['src/core', 'src/server'],\n * )\n * // throws GuideError: \"open\" is declared in \"src/core\" and \"src/server\"; …\n * ```\n */\nexport function validateModules(\n\tfiles: Readonly<Record<string, string>>,\n\tmodule: GuideModule,\n): void {\n\tconst directories = normalizeDirectories(module)\n\tconst declared = selectModuleKeys(files, directories).flatMap((key) => {\n\t\tconst owner = directories\n\t\t\t.filter((directory) => directory === '.' || key.startsWith(`${directory}/`))\n\t\t\t.reduce((current, directory) => (directory.length > current.length ? directory : current), '')\n\t\treturn extractExports(files[key] ?? '').map((symbol) => ({\n\t\t\tkey: symbol.name,\n\t\t\towner,\n\t\t}))\n\t})\n\tconst collisions = Array.from(new Set(declared.map((entry) => entry.key)))\n\t\t.sort()\n\t\t.map((key) => ({\n\t\t\tkey,\n\t\t\towners: directories.filter((directory) =>\n\t\t\t\tdeclared.some((entry) => entry.key === key && entry.owner === directory),\n\t\t\t),\n\t\t}))\n\t\t.filter((collision) => collision.owners.length > 1)\n\tif (collisions.length === 0) return\n\tconst named = collisions.map(\n\t\t(collision) =>\n\t\t\t`${JSON.stringify(collision.key.slice(0, 200))} is declared in ${collision.owners.map((owner) => JSON.stringify(owner.slice(0, 200))).join(' and ')}`,\n\t)\n\tconst cores = Array.from(\n\t\tnew Set(\n\t\t\tcollisions.flatMap((collision) =>\n\t\t\t\tcollision.owners\n\t\t\t\t\t.filter((owner) => owner !== '.')\n\t\t\t\t\t.map((owner) => `${owner.replace(/\\/.*$/u, '').slice(0, 200)}/core`),\n\t\t\t),\n\t\t),\n\t).sort()\n\tthrow new GuideError(\n\t\t`${named.join('; ')}; one name exported from two environments is a conflict. Declare logic both environments share once in ${cores.join(' or ')}, and give each environment's own logic a distinct name.`,\n\t\t'collision',\n\t\t{\n\t\t\tcontext: {\n\t\t\t\tcollisions: collisions.map((collision) => ({\n\t\t\t\t\tname: collision.key,\n\t\t\t\t\tmodules: collision.owners,\n\t\t\t\t})),\n\t\t\t},\n\t\t},\n\t)\n}\n\n/**\n * Extracts one `## Surface` table row's symbol — its column 0 code span as the name, its\n * {@link KIND} column as the keyword, and its exact `Signature` and {@link SUMMARY} columns as\n * normalized text when those columns exist. Empty cells remain absent. A row with no code-span\n * name and a row whose `Kind` text is\n * no {@link ExportKeyword} have no symbol to key, so each returns `undefined`.\n *\n * @param table - The table to read\n * @param row - The index of the row within {@link TableNode.rows}\n * @returns The row's symbol, or `undefined` when the row keys none\n *\n * @example\n * ```ts\n * extractRowSymbol(table, 0) // { name: 'walk', keyword: 'function', summary: 'Walks the tree.' }\n * ```\n */\nexport function extractRowSymbol(table: TableNode, row: number): SurfaceSymbol | undefined {\n\tconst cells = table.rows[row]\n\tif (cells === undefined) return undefined\n\n\tconst nameCell = cells[0]\n\tconst rawName = nameCell === undefined ? undefined : findFirstCode(nameCell)\n\tconst name = rawName === undefined ? undefined : normalizeIdentifier(rawName)\n\tif (name === undefined) return undefined\n\n\tconst column = findColumnIndex(table, KIND)\n\tconst kindCell = column === undefined ? undefined : cells[column]\n\tconst keyword =\n\t\tkindCell === undefined ? '' : flattenText({ element: 'paragraph', children: kindCell }).trim()\n\tif (!isExportKeyword(keyword)) return undefined\n\n\tconst summary = extractRowSummary(table, row)\n\tconst signed = findColumnIndex(table, SIGNATURE)\n\tconst signatureCell = signed === undefined ? undefined : cells[signed]\n\tconst signature =\n\t\tsignatureCell === undefined ? '' : normalizeSummary(extractCellText(signatureCell))\n\treturn {\n\t\tname,\n\t\tkeyword,\n\t\t...(signature.length === 0 ? {} : { signature }),\n\t\t...(summary === undefined ? {} : { summary }),\n\t}\n}\n\n/**\n * Extracts one `## Methods` table row's entry — its column 0 code span as the name and its\n * {@link SUMMARY} column as the compared summary when the table has that column. A row with no\n * code-span name has no member to key, so it returns `undefined`.\n *\n * @param table - The table to read\n * @param row - The index of the row within {@link TableNode.rows}\n * @returns The row's entry, or `undefined` when the row keys none\n *\n * @example\n * ```ts\n * extractRowEntry(table, 0) // { name: 'walk', summary: 'Walks the tree.' }\n * ```\n */\nexport function extractRowEntry(table: TableNode, row: number): MethodEntry | undefined {\n\tconst cells = table.rows[row]\n\tif (cells === undefined) return undefined\n\n\tconst cell = cells[0]\n\tconst rawName = cell === undefined ? undefined : findFirstCode(cell)\n\tconst name = rawName === undefined ? undefined : normalizeIdentifier(rawName)\n\tif (name === undefined) return undefined\n\n\tconst summary = extractRowSummary(table, row)\n\treturn { name, ...(summary === undefined ? {} : { summary }) }\n}\n\n/**\n * Extracts one row's compared summary — its {@link SUMMARY} column read through\n * {@link extractCellText} and {@link normalizeSummary}. A table with no such column and a row\n * whose cell is empty each carry no summary and return `undefined` rather than an empty string,\n * so {@link findDrift} reports the absence.\n *\n * @param table - The table to read\n * @param row - The index of the row within {@link TableNode.rows}\n * @returns The row's compared summary, or `undefined` when it carries none\n *\n * @example\n * ```ts\n * extractRowSummary(table, 0) // 'Walks the tree.'\n * ```\n */\nexport function extractRowSummary(table: TableNode, row: number): string | undefined {\n\tconst described = findColumnIndex(table, SUMMARY)\n\tconst cells = table.rows[row]\n\tconst cell = described === undefined || cells === undefined ? undefined : cells[described]\n\tconst summary = cell === undefined ? '' : normalizeSummary(extractCellText(cell))\n\treturn summary.length === 0 ? undefined : summary\n}\n\n/**\n * Extracts every `## Surface` identifier the guide documents — each table row's column 0\n * code span (the name) paired with its `Kind` column (located by header text), unioned with every\n * H3 entity heading whose trimmed compared inline content is exactly its backticked code-span\n * name, deduped by {@link computeSymbolKey}. A row with no code-span name has no name to key a\n * symbol on, so this reader skips it and {@link extractUnnamed} reports it; a row with an\n * unrecognized `Kind` text is skipped. A row also carries its {@link SUMMARY} column's compared\n * text when the table has that column; a table without it leaves every row's summary absent,\n * which {@link findDrift} reports. The exact `Signature` column contributes normalized signature\n * text, including code spans, when present and non-empty; no other header supplies it.\n *\n * @remarks\n * The heading boundary compares {@link extractCellText} with the raw value from\n * {@link findFirstCode} before {@link normalizeIdentifier} strips a generic annotation.\n * Surrounding spaces, emphasis, and links preserve that identity. This reader refuses a heading\n * carrying any other visible text or an additional code span. Entries retain encounter order, and\n * the first-seen name + keyword wins: a genuine heading before its table row keeps the heading's\n * class entry without signature or summary, while a preceding table row keeps both cells.\n *\n * @param document - The parsed guide document\n * @returns The documented surface, in encounter order\n *\n * @example\n * ```ts\n * extractSurface(document) // [{ name: 'Markdown', keyword: 'class' }, ...]\n * ```\n */\nexport function extractSurface(document: MarkdownDocument): readonly SurfaceSymbol[] {\n\tconst symbols: SurfaceSymbol[] = []\n\tconst seen = new Set<string>()\n\n\tfor (const block of selectSectionBlocks(document, SURFACE)) {\n\t\tif (isTableNode(block)) {\n\t\t\tfor (const row of block.rows.keys()) {\n\t\t\t\tconst symbol = extractRowSymbol(block, row)\n\t\t\t\tif (symbol === undefined) continue\n\t\t\t\tconst key = computeSymbolKey(symbol)\n\t\t\t\tif (seen.has(key)) continue\n\t\t\t\tseen.add(key)\n\t\t\t\tsymbols.push(symbol)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif (isHeadingNode(block) && block.level === 3) {\n\t\t\tconst rawName = findFirstCode(block.children)\n\t\t\tif (rawName === undefined || extractCellText(block.children).trim() !== `\\`${rawName}\\``) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst name = normalizeIdentifier(rawName)\n\t\t\tconst symbol: SurfaceSymbol = { name, keyword: 'class' }\n\t\t\tconst key = computeSymbolKey(symbol)\n\t\t\tif (seen.has(key)) continue\n\t\t\tseen.add(key)\n\t\t\tsymbols.push(symbol)\n\t\t}\n\t}\n\n\treturn symbols\n}\n\n/**\n * Extracts one {@link MethodGroup} per documented behavioral interface in `## Methods` —\n * an H4 with a code span sets the current interface, and the table immediately\n * following becomes its documented methods. A row with no code-span name has no name to key a\n * member on, so this reader skips it and {@link extractUnnamed} reports it. Each row carries its\n * {@link SUMMARY} column's compared text when the table has that column.\n *\n * @param document - The parsed guide document\n * @returns The documented method groups, in document order\n *\n * @example\n * ```ts\n * extractMethods(document) // [{ interface: 'MarkdownInterface', methods: [{ name: 'walk' }] }]\n * ```\n */\nexport function extractMethods(document: MarkdownDocument): readonly MethodGroup[] {\n\tconst groups: MethodGroup[] = []\n\n\tfor (const [table, name] of collectGroups(document)) {\n\t\tconst methods: MethodEntry[] = []\n\t\tfor (const row of table.rows.keys()) {\n\t\t\tconst entry = extractRowEntry(table, row)\n\t\t\tif (entry !== undefined) methods.push(entry)\n\t\t}\n\t\tgroups.push({ interface: name, methods })\n\t}\n\n\treturn groups\n}\n\n/**\n * Collects each `## Methods` table keyed to the interface its `####` heading names — an H4\n * carrying a code span sets the current interface and the table immediately following claims it,\n * so a heading with no table and a table with no heading before it contribute nothing. The map\n * iterates in document order and a node keys itself, so a repeated identical table keeps its own\n * entry.\n *\n * @param document - The parsed guide document\n * @returns One entry per documented `## Methods` table, in document order\n *\n * @example\n * ```ts\n * collectGroups(document).values().next().value // 'GuideInterface'\n * ```\n */\nexport function collectGroups(document: MarkdownDocument): ReadonlyMap<TableNode, string> {\n\tconst groups: Array<readonly [TableNode, string]> = []\n\tselectSectionBlocks(document, METHODS).reduce<string | undefined>((current, block) => {\n\t\tif (isHeadingNode(block) && block.level === 4) {\n\t\t\tconst name = findFirstCode(block.children)\n\t\t\treturn name === undefined ? undefined : normalizeIdentifier(name)\n\t\t}\n\t\tif (isTableNode(block) && current !== undefined) {\n\t\t\tgroups.push([block, current])\n\t\t\treturn undefined\n\t\t}\n\t\treturn current\n\t}, undefined)\n\treturn new Map(groups)\n}\n\n/**\n * Extracts every `## Surface` or `## Methods` table row whose first cell carries no code span.\n * {@link extractSurface} and {@link extractMethods} skip such a row, because a row with no\n * name gives them nothing to key a symbol or a member on, and this projection is what reports\n * the skip. Each entry is the row's cells read through {@link extractCellText} and joined\n * by ` | `, so a reader can locate the row in the guide; the `## Surface` rows come first,\n * then the `## Methods` rows, each in document order. {@link GuideInterface.unnamed} caches it.\n *\n * @param document - The parsed guide document\n * @returns One entry per row carrying no code-span name\n *\n * @example\n * ```ts\n * extractUnnamed(document) // ['Widget | class | Represents a widget.']\n * ```\n */\nexport function extractUnnamed(document: MarkdownDocument): readonly string[] {\n\tconst unnamed: string[] = []\n\n\tfor (const heading of [SURFACE, METHODS]) {\n\t\tfor (const block of selectSectionBlocks(document, heading)) {\n\t\t\tif (!isTableNode(block)) continue\n\t\t\tfor (const row of block.rows) {\n\t\t\t\tconst cell = row[0]\n\t\t\t\tif (cell !== undefined && findFirstCode(cell) !== undefined) continue\n\t\t\t\tunnamed.push(row.map((content) => extractCellText(content)).join(' | '))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn unnamed\n}\n\n/**\n * Extracts every link href in the guide document, including table cells — a full,\n * depth-first walk of the whole AST.\n *\n * @param document - The parsed guide document\n * @returns Every link's href, in walk order\n *\n * @example\n * ```ts\n * extractLinks(document) // ['../../src/core/helpers.ts', 'https://example.com']\n * ```\n */\nexport function extractLinks(document: MarkdownDocument): readonly string[] {\n\tconst links: string[] = []\n\tfor (const node of walkMarkdownNodes(document)) {\n\t\tif (isLinkNode(node)) links.push(node.href)\n\t}\n\treturn links\n}\n\n/**\n * Extracts the relative test links declared under `## Tests` — every link href found\n * within that section only.\n *\n * @param document - The parsed guide document\n * @returns The `## Tests` section's link hrefs, in walk order\n *\n * @example\n * ```ts\n * extractTests(document) // ['../../tests/src/core/Markdown.test.ts', ...]\n * ```\n */\nexport function extractTests(document: MarkdownDocument): readonly string[] {\n\tconst links: string[] = []\n\tfor (const block of selectSectionBlocks(document, TESTS)) {\n\t\tfor (const node of walkMarkdownNodes(block)) {\n\t\t\tif (isLinkNode(node)) links.push(node.href)\n\t\t}\n\t}\n\treturn links\n}\n\n/**\n * Returns the canonical body of one genuine JSDoc span — the `/**` opener, the closing\n * marker, each line's continuation marker, and the block's leading indentation removed,\n * with per-line trailing whitespace trimmed and the surrounding blank lines dropped. A\n * line's own indentation beyond the marker is kept, so an `@example` fence body keeps the\n * shape it was written in.\n *\n * @param comment - One complete genuine JSDoc span's raw text\n * @returns The span's unwrapped body\n *\n * @example\n * ```ts\n * normalizeComment('/**' + ' Creates a widget. *' + '/') // 'Creates a widget.'\n * ```\n */\nexport function normalizeComment(comment: string): string {\n\treturn unwrapComment(comment).join('\\n').replace(/^\\n+/, '').replace(/\\n+$/, '')\n}\n\n/**\n * Unwraps one genuine JSDoc span into one content line per physical line — the `/**` opener,\n * the closing marker, each line's continuation marker, and per-line trailing whitespace removed,\n * with a line's own indentation past the marker kept. The result is aligned with\n * `comment.split('\\n')`, so an index found in it addresses the same physical line of the span it\n * was built from, which is what lets a rewrite keep every line it does not replace.\n * {@link normalizeComment} is this projection joined and trimmed at its ends.\n *\n * @param comment - One complete genuine JSDoc span's raw text\n * @returns One content line per physical line of the span\n *\n * @example\n * ```ts\n * unwrapComment('/**' + '\\n * Walks.\\n *' + '/') // ['', 'Walks.', '']\n * ```\n */\nexport function unwrapComment(comment: string): readonly string[] {\n\tconst body = /^[ \\t]*\\/\\*([\\s\\S]*?)\\*\\/[ \\t]*$/.exec(comment)?.[1] ?? comment\n\treturn body.split('\\n').map((line) => line.replace(/^[ \\t]*\\*[ \\t]?/, '').replace(/[ \\t]+$/, ''))\n}\n\n/**\n * Returns the canonical compared form of a description paragraph. `{@link Target}` and\n * `{@link Target | label}` become the code token of the target text, or of the label where one is\n * written; a target's module part — the inline import form `import('./module.js').` and TSDoc's\n * package-qualified form `@scope/pkg#` — is dropped first. Every run of whitespace, including a\n * collapsed continuation marker and a line break, becomes one space, the ends trim, and a code\n * span keeps its delimiters while its own boundary whitespace goes. The guide's side and the\n * source's side read through this one form.\n *\n * @remarks\n * The clauses land in a fixed order, because each one decides what the next one sees. Every\n * single-backtick code span — one backtick per side, no inner backtick, no adjacent backtick —\n * is located first, so a delimiter the `{@link}` expansion inserts afterwards is never mistaken\n * for an authored one. The expansion then runs outside those spans\n * only, so a `{@link}` written inside a code span stays literal on both sides. Whitespace\n * collapses next, which is what makes a span wrapped across two physical lines comparable at\n * all. The boundary trim runs last, inside each located span: the markdown parser strips one\n * space from each end of a code span it reads, and this trim is the symmetric rule that meets\n * it, so `` ` | ` ``, `` ` |` ``, and `` `|` `` all reach `` `|` `` from either side. A span\n * whose content is all whitespace keeps one space, because a parser strips nothing from that\n * one.\n *\n * A target's module part is the inline import form `import('./module.js').` or TSDoc's\n * package-qualified form `@scope/pkg#`, and the expansion drops it, so a cross-file link and the\n * code token a guide cell documents it with reach the same text. A package qualifier carries `@`\n * or `/`; text before a `#` carrying neither is JSDoc's member reference, so `{@link Owner#member}`\n * and `{@link #member}` travel whole and a guide cell documents each as written. An unscoped\n * package name is spelled like an owner, so `{@link pkg#Name}` travels whole too — write the\n * scoped or the path form where a cell must drop the package. Everything after a module part\n * travels: `Owner.member` keeps its owner, and a dotted target no module part precedes is\n * untouched. A label is text rather than a target, so `{@link Target | label}` renders its label\n * whole.\n *\n * A code span delimited by more than one backtick is outside the compared form's representable\n * set and travels untouched, as does a code span whose own text carries a backtick: the form\n * spells every span with one backtick per side, so neither can be written back. A summary that\n * needs one of those constructs takes another shape: name the construct in prose rather than\n * expecting the comparison to converge it.\n *\n * @param text - A doc block's description paragraph, or a guide cell's flattened text\n * @returns The compared form of that text\n *\n * @example\n * ```ts\n * normalizeSummary('Creates a\\n{@link Widget}.') // 'Creates a `Widget`.'\n * normalizeSummary(\"Reads {@link import('./widgets.js').Widget}.\") // 'Reads `Widget`.'\n * normalizeSummary('Reads {@link @scope/widgets#Widget}.') // 'Reads `Widget`.'\n * normalizeSummary('Reads {@link Widget#render}.') // 'Reads `Widget#render`.'\n * normalizeSummary('cells joined by ` | `.') // 'cells joined by `|`.'\n * ```\n */\nexport function normalizeSummary(text: string): string {\n\tconst normalized = text\n\t\t.split(/((?<!`)`[^`]+`(?!`))/)\n\t\t.map((part, index) => {\n\t\t\tif (index % 2 === 0) {\n\t\t\t\treturn part\n\t\t\t\t\t.replace(/\\{@link\\s+[^}|]*\\|\\s*([^}]*?)\\s*\\}/g, '`$1`')\n\t\t\t\t\t.replace(\n\t\t\t\t\t\t/\\{@link\\s+(?:import\\([^)]*\\)\\.|[^}|#\\s]*[@/][^}|#\\s]*#)?([^}|]*?)\\s*\\}/g,\n\t\t\t\t\t\t'`$1`',\n\t\t\t\t\t)\n\t\t\t}\n\t\t\tconst value = part.slice(1, -1).replace(/\\s+/g, ' ').trim()\n\t\t\treturn `\\`${value.length === 0 ? ' ' : value}\\``\n\t\t})\n\t\t.join('')\n\treturn normalized.replace(/\\s+/g, ' ').trim()\n}\n\n/**\n * Wraps one paragraph into greedy lines no longer than `width` characters. Every run of\n * whitespace separates words, and a word longer than `width` takes its own line rather than\n * being split, so a long code token or URL survives the wrap intact.\n *\n * @param text - The paragraph to wrap\n * @param width - The greatest length a returned line may reach\n * @returns The wrapped lines, in order, or an empty list when `text` carries no word\n *\n * @example\n * ```ts\n * wrapText('one two three', 8) // ['one two', 'three']\n * ```\n */\nexport function wrapText(text: string, width: number): readonly string[] {\n\tconst words = text.split(/\\s+/).filter((word) => word.length > 0)\n\tconst lines: string[] = []\n\tconst final = words.reduce(\n\t\t(previous, word, index) => {\n\t\t\tif (index === previous.start) return { start: index, length: word.length }\n\t\t\tif (previous.length + 1 + word.length <= width) {\n\t\t\t\treturn { start: previous.start, length: previous.length + 1 + word.length }\n\t\t\t}\n\t\t\tlines.push(words.slice(previous.start, index).join(' '))\n\t\t\treturn { start: index, length: word.length }\n\t\t},\n\t\t{ start: 0, length: 0 },\n\t)\n\tif (words.length > 0) lines.push(words.slice(final.start).join(' '))\n\treturn lines\n}\n\n/**\n * Builds one genuine JSDoc span from its content lines — the inverse of {@link unwrapComment}.\n * Each line is emitted at `indent` behind a continuation marker, an empty line as the bare\n * marker so no line carries trailing whitespace, and the leading and trailing empty lines are\n * dropped because the opener and the closer take those physical lines.\n *\n * @param lines - The span's content lines, as {@link unwrapComment} returns them\n * @param indent - The whitespace the span opens at\n * @returns The span's raw text, opener and closer included\n *\n * @example\n * ```ts\n * buildComment(['Walks.'], '') // '/**\\n * Walks.\\n *' + '/'\n * ```\n */\nexport function buildComment(lines: readonly string[], indent: string): string {\n\tconst content = [...lines]\n\twhile (content[0] === '') content.shift()\n\twhile (content[content.length - 1] === '') content.pop()\n\n\tconst raw = [`${indent}/**`]\n\tfor (const line of content) raw.push(line.length === 0 ? `${indent} *` : `${indent} * ${line}`)\n\traw.push(`${indent} */`)\n\n\treturn raw.join('\\n')\n}\n\n/**\n * Returns one doc block's unwrapped text with every fenced body replaced by aligned spaces,\n * so a tag search reads the block's structure and never its example code. A line opening with\n * three or more backticks or tildes opens a body, the first line opening with a run of the same\n * character at least as long closes it, an unclosed body runs to the end, and the marker lines\n * themselves stay. The projection preserves every line and every column, so an index found in\n * it addresses the same character of the text it was built from.\n *\n * @param text - One doc block's unwrapped text, as {@link normalizeComment} returns it\n * @returns The same text with each fenced body's characters replaced by spaces\n *\n * @example\n * ```ts\n * maskFences('@example\\n~~~\\n@decorator()\\n~~~').split('\\n')[2] // ' '\n * ```\n */\nexport function maskFences(text: string): string {\n\tconst masked: string[] = []\n\ttext.split('\\n').reduce<string | undefined>((marker, line) => {\n\t\tconst fence = /^[ \\t]*(`{3,}|~{3,})/.exec(line)?.[1]\n\t\tif (marker === undefined) {\n\t\t\tmasked.push(line)\n\t\t\treturn fence\n\t\t}\n\t\tconst closed = fence !== undefined && fence.startsWith(marker)\n\t\tmasked.push(closed ? line : ' '.repeat(line.length))\n\t\treturn closed ? undefined : marker\n\t}, undefined)\n\treturn masked.join('\\n')\n}\n\n/**\n * Extracts every eligible genuine JSDoc block paired with the physical record it documents.\n *\n * @remarks\n * An opener is eligible only when it is the first non-whitespace source material of its record; a\n * leading whitespace-separated span chain is last-span authoritative; intervening source material\n * severs association, while a leading JSDoc on the next record replaces pending state. Any other\n * next physical record is returned once and consumes it. This parser walks aligned records without\n * rescanning source syntax or applying declaration/member grammar, and every reader of a doc\n * block's text — the description paragraph, the `@example` blocks, the member summaries — reads it\n * through this one walk.\n *\n * @param lines - Aligned physical source-line records\n * @returns One record per documented physical line, in source order\n *\n * @example\n * ```ts\n * extractSourceComments(extractSourceLines('/**' + ' Walks. *' + '/\\nexport function walk() {}'))\n * // [{ text: 'Walks.', line: the `export function walk() {}` SourceLine }]\n * ```\n */\nexport function extractSourceComments(lines: readonly SourceLine[]): readonly SourceComment[] {\n\tconst comments: SourceComment[] = []\n\tIterator.from(lines).reduce<{\n\t\treadonly block: boolean\n\t\treadonly eligible: boolean\n\t\treadonly span: string[]\n\t\treadonly pending: string | undefined\n\t}>(\n\t\t(previous, line) => {\n\t\t\tconst projection = line.jsdoc\n\t\t\tconst first = projection?.indexOf('/**') ?? -1\n\t\t\tif (\n\t\t\t\tprevious.pending !== undefined &&\n\t\t\t\t!(!previous.block && first >= 0 && line.source.slice(0, first).trim() === '')\n\t\t\t) {\n\t\t\t\tcomments.push({ text: previous.pending, line })\n\t\t\t}\n\t\t\tconst state = { ...previous, pending: undefined }\n\t\t\tif (projection === undefined) return state\n\t\t\tconst close = state.block ? projection.indexOf('*/') : -1\n\t\t\tconst end = close < 0 ? projection.length : close + 2\n\t\t\tif (state.block) state.span.push(projection.slice(0, end))\n\t\t\tif (state.block && close < 0) return state\n\t\t\tconst opener = state.block ? projection.indexOf('/**', close + 2) : first\n\t\t\tconst whitespace = state.block\n\t\t\t\t? line.source.slice(close + 2, opener < 0 ? line.source.length : opener).trim() === ''\n\t\t\t\t: line.source.slice(0, first).trim() === ''\n\t\t\tconst eligible = state.block ? state.eligible && whitespace : whitespace\n\t\t\tif (opener < 0)\n\t\t\t\treturn state.block\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\tblock: false,\n\t\t\t\t\t\t\tpending: eligible ? normalizeComment(state.span.join('\\n')) : undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: state\n\t\t\tconst spans = /\\/\\*(?=\\*)[\\s\\S]*?(?:\\*\\/|$)/g\n\t\t\tspans.lastIndex = opener\n\t\t\treturn Iterator.from(projection.matchAll(spans)).reduce<typeof previous>(\n\t\t\t\t(current, match) => {\n\t\t\t\t\tconst cursor = match.index\n\t\t\t\t\tconst closing = projection.indexOf('*/', cursor + 2)\n\t\t\t\t\tconst finish = closing < 0 ? projection.length : closing + 2\n\t\t\t\t\tconst span = [projection.slice(cursor, finish)]\n\t\t\t\t\tif (closing < 0) return { ...current, span, block: true }\n\t\t\t\t\tconst next = projection.indexOf('/**', closing + 2)\n\t\t\t\t\tconst gap =\n\t\t\t\t\t\tline.source.slice(closing + 2, next < 0 ? line.source.length : next).trim() === ''\n\t\t\t\t\tif (next < 0)\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...current,\n\t\t\t\t\t\t\tspan,\n\t\t\t\t\t\t\tblock: false,\n\t\t\t\t\t\t\tpending: current.eligible && gap ? normalizeComment(span.join('\\n')) : undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\treturn { ...current, span, block: false, eligible: current.eligible && gap }\n\t\t\t\t},\n\t\t\t\t{ ...state, block: false, eligible },\n\t\t\t)\n\t\t},\n\t\t{ block: false, eligible: false, span: [], pending: undefined },\n\t)\n\treturn comments\n}\n\n/**\n * Selects the next physical record after an eligible genuine JSDoc whose final\n * authoritative span carries an `@example` tag opening a line at its first non-blank column —\n * the {@link extractSourceComments} walk filtered to the blocks that carry one. Title\n * text is allowed, and {@link maskFences} keeps a fenced body's own lines out of the search.\n *\n * @param lines - Aligned physical source-line records\n * @returns The immediately following candidate lines, in source order\n *\n * @example\n * ```ts\n * extractExampleLines(extractSourceLines('/**' + ' @example *' + '/\\nexport function walk() {}'))\n * // the `export function walk() {}` SourceLine\n * ```\n */\nexport function extractExampleLines(lines: readonly SourceLine[]): readonly SourceLine[] {\n\treturn extractSourceComments(lines)\n\t\t.filter((comment) => /^[ \\t]*@example(?=[ \\t]|$)/m.test(maskFences(comment.text)))\n\t\t.map((comment) => comment.line)\n}\n\n/**\n * Collects the description paragraph of every documented physical record — a doc block's\n * text before its first block tag, in {@link normalizeSummary}'s compared form — keyed by the\n * record it documents. A record whose block carries no description contributes no entry, so\n * an absent summary stays absent rather than becoming an empty string.\n *\n * @param lines - Aligned physical source-line records\n * @returns One entry per documented record carrying a description paragraph\n *\n * @example\n * ```ts\n * collectSummaries(extractSourceLines('/**' + ' Walks. *' + '/\\nexport function walk() {}')).size // 1\n * ```\n */\nexport function collectSummaries(lines: readonly SourceLine[]): ReadonlyMap<SourceLine, string> {\n\tconst summaries = new Map<SourceLine, string>()\n\n\tfor (const comment of extractSourceComments(lines)) {\n\t\tconst tag = maskFences(comment.text).search(/^[ \\t]*@\\w/m)\n\t\tconst summary = normalizeSummary(tag < 0 ? comment.text : comment.text.slice(0, tag))\n\t\tif (summary.length > 0) summaries.set(comment.line, summary)\n\t}\n\n\treturn summaries\n}\n\n/**\n * Extracts the aligned physical records of a declaration's body, read inside an owner head this\n * function supplies, so a callable member in the body carries the `Owner.member` key\n * {@link collectKeys} reports for it, and that head's own record opens the projection. A body\n * read on its own carries no head, and the member grammar attaches a member to the head\n * enclosing it.\n *\n * @remarks\n * The supplied head is an `export interface` line, so the projection opens with that head's own\n * record and every body line follows it in order. A column-zero `}` among the body lines closes\n * the supplied head and leaves every later member unkeyed; a body {@link extractDeclaration}\n * returns carries none, because that reader ends a body at the first one.\n *\n * @param lines - A declaration's body lines\n * @returns The supplied head's record, then one record per body line\n *\n * @example\n * ```ts\n * extractBodyLines(['\\twalk(): void'])[1]?.code // '\\twalk(): void'\n * ```\n */\nexport function extractBodyLines(lines: readonly string[]): readonly SourceLine[] {\n\treturn extractSourceLines(['export interface Owner {', ...lines].join('\\n'))\n}\n\n/**\n * Collects the compared key of every physical record a key names — a {@link computeSymbolKey}\n * symbol key for a column-zero `export` declaration head, an `Owner.member` key for a one-tab\n * callable member inside one — keyed by the record itself. The owner closes at the first\n * column-zero `}` or at a column-zero `export` declaration carrying another keyword, and a\n * record no key names contributes no entry.\n *\n * @remarks\n * This is the package's one key grammar, and each keyed reader projects its own part back out of\n * it: {@link extractExports} splits a declaration key at its one space,\n * {@link extractMemberMethods} and {@link extractExampleMethods} split a member key at its dot,\n * and {@link locateComment} matches a caller's key against the whole map. A change to the head\n * shape or to the member shape reaches every one of them at once.\n *\n * An owner opens at a column-zero `export class`, `export abstract class`, or `export interface`\n * head and closes at the\n * first column-zero `}`, so a member declared past that brace keys nothing. A column-zero `export` declaration carrying any other keyword closes the owner it follows,\n * because a member belongs to the head enclosing it. Reading runs over {@link extractSourceLines}'s\n * projection, so a head or\n * a member written inside a comment or a template literal keys nothing.\n *\n * @param lines - Aligned physical source-line records\n * @returns One entry per record a key names, in file order\n *\n * @example\n * ```ts\n * const keys = collectKeys(extractSourceLines('export class Widget {\\n\\twalk(): void\\n}'))\n * Array.from(keys.values()) // ['class Widget', 'Widget.walk']\n * ```\n */\nexport function collectKeys(lines: readonly SourceLine[]): ReadonlyMap<SourceLine, string> {\n\tconst keys: Array<readonly [SourceLine, string]> = []\n\tIterator.from(lines).reduce<string | undefined>((owner, line) => {\n\t\tconst head =\n\t\t\t/^export (?:async )?(?:abstract )?(function\\*?|class|const|interface|type) (\\w+)/.exec(\n\t\t\t\tline.code,\n\t\t\t)\n\t\tconst keyword = head?.[1]?.replace(/\\*$/, '')\n\t\tconst name = head?.[2]\n\t\tif (isNonEmptyString(keyword) && isNonEmptyString(name) && isExportKeyword(keyword)) {\n\t\t\tkeys.push([line, computeSymbolKey({ name, keyword })])\n\t\t\treturn keyword === 'class' || keyword === 'interface' ? name : undefined\n\t\t}\n\t\tif (line.code === '}') return undefined\n\t\tconst member = /^\\t(?:async )?\\*?(\\w+)\\??(?:<.*>)?\\(/.exec(line.code)?.[1]\n\t\tif (owner !== undefined && isNonEmptyString(member)) keys.push([line, `${owner}.${member}`])\n\t\treturn owner\n\t}, undefined)\n\treturn new Map(keys)\n}\n\n/**\n * Collects the `@example` blocks one doc block's unwrapped text carries, each named for the\n * declaration or member the block documents. The text after the tag becomes the block's\n * `title`; a body opening with a fence contributes that fence's language and its verbatim\n * body, and a body with no fence contributes its own trimmed text as the code.\n *\n * @param comment - One doc block's unwrapped text, as {@link normalizeComment} returns it\n * @param name - The declaration or member the block documents\n * @returns The block's `@example` entries, in block order\n *\n * @example\n * ```ts\n * collectExamples('@example Walking\\n```ts\\nwalk()\\n```', 'walk')\n * // [{ name: 'walk', title: 'Walking', code: 'walk()', language: 'ts' }]\n * ```\n */\nexport function collectExamples(comment: string, name: string): readonly SourceExample[] {\n\tconst examples: SourceExample[] = []\n\tconst masked = maskFences(comment)\n\tconst tags = /^[ \\t]*@example(?=[ \\t]|$)[ \\t]*(.*)$/gm\n\n\tfor (const tag of masked.matchAll(tags)) {\n\t\tconst title = (tag[1] ?? '').trim()\n\t\tconst start = tag.index + tag[0].length\n\t\tconst rest = comment.slice(start).replace(/^\\n/, '')\n\t\tconst next = masked\n\t\t\t.slice(start)\n\t\t\t.replace(/^\\n/, '')\n\t\t\t.search(/^[ \\t]*@\\w+/m)\n\t\tconst body = (next < 0 ? rest : rest.slice(0, next)).replace(/^\\n+/, '').replace(/\\n+$/, '')\n\t\tconst fence = /^```(\\S*)\\n([\\s\\S]*?)\\n?```/.exec(body)\n\t\tconst language = fence?.[1] ?? ''\n\t\tconst code = fence?.[2] ?? body\n\n\t\texamples.push({\n\t\t\tname,\n\t\t\t...(title.length === 0 ? {} : { title }),\n\t\t\tcode,\n\t\t\t...(language.length === 0 ? {} : { language }),\n\t\t})\n\t}\n\n\treturn examples\n}\n\n/**\n * Extracts the `@example` blocks carried by the exported declaration heads in one file's source\n * text, each named for the declaration its block documents. Shared adjacency comes from\n * {@link extractSourceComments} and each block is read by {@link collectExamples}; head\n * membership is the {@link collectKeys} key of the documented record under every keyword that\n * grammar admits at column zero, so comment and template payload cannot qualify and the head\n * grammar stays the one every reader here shares. A member key carries a dot and a head key\n * does not, so a member's block belongs to {@link extractExampleMethods} instead. A head\n * carrying several blocks contributes each.\n *\n * @param source - The file's source text\n * @returns The exported declaration heads' `@example` blocks, in file order, deduplicated by name and title\n *\n * @example\n * ```ts\n * const block = ['/**', ' * @example', ' * new Widget()', ' *' + '/', 'export class Widget {}', ''].join('\\n')\n * extractExamples(block) // [{ name: 'Widget', code: 'new Widget()' }]\n * extractExamples('export class Widget {}\\n') // []\n * ```\n */\nexport function extractExamples(source: string): readonly SourceExample[] {\n\tconst examples: SourceExample[] = []\n\tconst seen = new Set<string>()\n\tconst lines = extractSourceLines(source)\n\tconst keys = collectKeys(lines)\n\n\tfor (const comment of extractSourceComments(lines)) {\n\t\t// A head key is `${keyword} ${name}` and a member key is `Owner.member`, so the dot is\n\t\t// what separates them and the block's name is the text past the head's one space.\n\t\tconst key = keys.get(comment.line)\n\t\tif (key === undefined || key.includes('.')) continue\n\n\t\tconst name = key.slice(key.indexOf(' ') + 1)\n\t\tfor (const example of collectExamples(comment.text, name)) {\n\t\t\tconst entry = `${name}\\n${example.title ?? ''}`\n\t\t\tif (seen.has(entry)) continue\n\t\t\tseen.add(entry)\n\t\t\texamples.push(example)\n\t\t}\n\t}\n\n\treturn examples\n}\n\n/**\n * Extracts the `@example` blocks carried by the callable members of a declaration body (per\n * {@link collectKeys}' grammar, the same one {@link extractMemberMethods} reads), each named for\n * the member its block documents. Shared adjacency comes from {@link extractSourceComments} and\n * each block is read by {@link collectExamples}; member membership is the key\n * {@link extractBodyLines}'s projection gives the documented record.\n *\n * @param lines - A declaration's body lines\n * @returns The members' `@example` blocks, deduplicated by name and title and sorted by name\n *\n * @example\n * ```ts\n * extractExampleMethods(['\\t/**', '\\t * @example', '\\t * walk()', '\\t *' + '/', '\\twalk(): void'])\n * // [{ name: 'walk', code: 'walk()' }]\n * ```\n */\nexport function extractExampleMethods(lines: readonly string[]): readonly SourceExample[] {\n\tconst examples: SourceExample[] = []\n\tconst seen = new Set<string>()\n\tconst projected = extractBodyLines(lines)\n\tconst keys = collectKeys(projected)\n\n\tfor (const comment of extractSourceComments(projected)) {\n\t\tconst key = keys.get(comment.line) ?? ''\n\t\tconst dot = key.indexOf('.')\n\t\tif (dot < 0) continue\n\n\t\tconst name = key.slice(dot + 1)\n\t\tfor (const example of collectExamples(comment.text, name)) {\n\t\t\tconst entry = `${name}\\n${example.title ?? ''}`\n\t\t\tif (seen.has(entry)) continue\n\t\t\tseen.add(entry)\n\t\t\texamples.push(example)\n\t\t}\n\t}\n\n\treturn examples.sort((a, b) => (a.name === b.name ? 0 : a.name < b.name ? -1 : 1))\n}\n\n/**\n * Extracts every fenced code block anywhere in the guide document. A full AST walk\n * includes fences nested inside blockquotes and lists, and the same walk carries each\n * fence's nearest preceding heading as its `title` — the key an `@example` block pairs on.\n * A heading's text is flattened, so a title written with a code span pairs with a plain\n * `@example` title.\n *\n * @param document - The parsed guide document\n * @returns Every fence's language, verbatim code, and title, in document order\n *\n * @example\n * ```ts\n * extractFences(document) // [{ language: 'ts', code: \"import { X } from './x.js'\\nX()\" }]\n * ```\n */\nexport function extractFences(document: MarkdownDocument): readonly GuideFence[] {\n\treturn Array.from(collectFences(document).values())\n}\n\n/**\n * Collects each fenced code block keyed by its own node, paired with the {@link GuideFence}\n * {@link extractFences} reports for it — the node-addressed form a rewrite needs, so a caller\n * that located a fence by title can read that node's source region back from the parser. The map\n * iterates in document order and a node keys itself, so a repeated identical fence keeps its own\n * entry.\n *\n * @param document - The parsed guide document\n * @returns One entry per fenced code block, in document order\n *\n * @example\n * ```ts\n * Array.from(collectFences(document).values()) // [{ language: 'ts', code: 'walk()' }]\n * ```\n */\nexport function collectFences(document: MarkdownDocument): ReadonlyMap<CodeBlockNode, GuideFence> {\n\tconst fences: Array<readonly [CodeBlockNode, GuideFence]> = []\n\tIterator.from(walkMarkdownNodes(document)).reduce((title, node) => {\n\t\tif (isHeadingNode(node)) return flattenText(node).trim()\n\t\tif (isCodeBlockNode(node)) {\n\t\t\tfences.push([\n\t\t\t\tnode,\n\t\t\t\t{\n\t\t\t\t\tlanguage: node.lang,\n\t\t\t\t\tcode: node.code,\n\t\t\t\t\t...(title.length === 0 ? {} : { title }),\n\t\t\t\t},\n\t\t\t])\n\t\t}\n\t\treturn title\n\t}, '')\n\treturn new Map(fences)\n}\n\n/**\n * Extracts the guide's tagline — the text of the blockquote following the document's H1,\n * with every code span kept as a code span and whitespace collapsed. A heading before the\n * blockquote ends the window, so a blockquote elsewhere in the document is not the tagline.\n *\n * @param document - The parsed guide document\n * @returns The tagline, or `undefined` when no blockquote follows an H1 before the next heading\n *\n * @example\n * ```ts\n * extractTagline(document) // 'A pure, I/O-free guides-parity toolkit'\n * ```\n */\nexport function extractTagline(document: MarkdownDocument): string | undefined {\n\tconst scanned: Array<{\n\t\treadonly block: BlockNode\n\t\treadonly opened: boolean\n\t\treadonly selected: BlockquoteNode | undefined\n\t}> = []\n\tfor (const block of document.children) {\n\t\tconst opened = scanned.at(-1)?.opened ?? false\n\t\tif (isHeadingNode(block)) {\n\t\t\tif (opened) break\n\t\t\tscanned.push({ block, opened: block.level === 1, selected: undefined })\n\t\t\tcontinue\n\t\t}\n\t\tconst selected = opened && isBlockquoteNode(block) ? block : undefined\n\t\tscanned.push({ block, opened, selected })\n\t\tif (selected !== undefined) break\n\t}\n\tconst selected = scanned.find((entry) => entry.selected !== undefined)?.selected\n\tif (selected === undefined) return undefined\n\tconst text = normalizeSummary(\n\t\tselected.children\n\t\t\t.filter(isParagraphNode)\n\t\t\t.map((paragraph) => extractCellText(paragraph.children))\n\t\t\t.join(' '),\n\t)\n\treturn text.length === 0 ? undefined : text\n}\n\n/**\n * Computes the drift between one compared key's guide text and source text. A pair agrees\n * only when both sides carry the same text, and every other state is a drift: guide text\n * alone reports the guide's side, source text alone reports the source's, and neither side\n * carrying text reports the key by itself. A side carrying no text is absent from the result,\n * so a documented symbol with no doc block reports as a drift naming the guide's text alone,\n * and a row a table has no `Summary` column for against a declaration with no doc block\n * reports as `{ key }`.\n *\n * @param key - The compared pair's key\n * @param category - The compared site the drift came from\n * @param guide - The guide's text there, or `undefined` when it carries none\n * @param source - The source's text there, or `undefined` when it carries none\n * @returns The drift, or `undefined` when both sides carry the same text\n *\n * @example\n * ```ts\n * computeDrift('function walk', 'summary', 'Walks the tree.', 'Walks a tree.')\n * // { key: 'function walk', category: 'summary', guide: 'Walks the tree.', source: 'Walks a tree.' }\n * ```\n */\nexport function computeDrift(\n\tkey: string,\n\tcategory: Drift['category'],\n\tguide: string | undefined,\n\tsource: string | undefined,\n): Drift | undefined {\n\tif (guide !== undefined && guide === source) return undefined\n\treturn {\n\t\tkey,\n\t\tcategory,\n\t\t...(guide === undefined ? {} : { guide }),\n\t\t...(source === undefined ? {} : { source }),\n\t}\n}\n\n/**\n * Compares documented and declared membership exactly after sorting copies, preserving duplicates.\n *\n * @param spec - The guide inventory key the finding belongs to\n * @param name - The declaration whose membership is compared\n * @param documented - The documented member names\n * @param declared - The declared member names\n * @returns The membership finding, or `undefined` when the sorted populations match\n *\n * @example Compare declaration membership\n * ```ts\n * import { compareMembership } from '@orkestrel/guide'\n *\n * compareMembership('guides/widget.md', 'WidgetInterface', ['open'], ['open']) // undefined\n * ```\n */\nexport function compareMembership(\n\tspec: string,\n\tname: string,\n\tdocumented: readonly string[],\n\tdeclared: readonly string[],\n): ParityFinding | undefined {\n\tconst left = [...documented].sort()\n\tconst right = [...declared].sort()\n\tif (JSON.stringify(left) === JSON.stringify(right)) return undefined\n\treturn {\n\t\tspec,\n\t\ttext: `${spec} ${name} documents ${JSON.stringify(left)} and declares ${JSON.stringify(right)}.`,\n\t}\n}\n\n/**\n * Computes a category-separated identity for a guide finding.\n *\n * @param spec - The guide inventory key the drift belongs to\n * @param drift - The categorized disagreement\n * @returns The inventory key, category, and compared key separated by line feeds\n *\n * @example Identify categorized drift\n * ```ts\n * import { identifyDrift } from '@orkestrel/guide'\n *\n * identifyDrift('guides/widget.md', { category: 'summary', key: 'function open' })\n * // 'guides/widget.md\\nsummary\\nfunction open'\n * ```\n */\nexport function identifyDrift(spec: string, drift: Drift): string {\n\treturn `${spec}\\n${drift.category}\\n${drift.key}`\n}\n\n/**\n * Formats present parity text as a JSON string and absent text as `absent`.\n *\n * @param value - The compared side's text, or `undefined` when absent\n * @returns The developer-facing side text\n *\n * @example Format a parity side\n * ```ts\n * import { formatSide } from '@orkestrel/guide'\n *\n * formatSide('Walks.') // '\"Walks.\"'\n * formatSide(undefined) // 'absent'\n * ```\n */\nexport function formatSide(value: string | undefined): string {\n\treturn value === undefined ? 'absent' : JSON.stringify(value)\n}\n\n/**\n * Formats a categorized drift with its guide and source sides.\n *\n * @param drift - The categorized disagreement to format\n * @returns The complete developer-facing drift text\n *\n * @example Format categorized drift\n * ```ts\n * import { formatDrift } from '@orkestrel/guide'\n *\n * formatDrift({ category: 'summary', key: 'function walk', guide: 'Walks.', source: 'Walks a tree.' })\n * // 'summary function walk: guide \"Walks.\" source \"Walks a tree.\"'\n * ```\n */\nexport function formatDrift(drift: Drift): string {\n\treturn `${drift.category} ${drift.key}: guide ${formatSide(drift.guide)} source ${formatSide(drift.source)}`\n}\n\n/**\n * Finds every disagreement between a guide and the source it documents, naming both sites:\n * each `## Surface` row against its declaration's description paragraph, each present\n * `Signature` cell against the declaration's computed signature written as a code span, each\n * `## Methods` row against its member's, and the first titled guide fence of a heading against the\n * `@example` block of the same title. An example's compared text is its language on the first\n * line and its body beneath, so a fence that names another language drifts on its own.\n *\n * @remarks\n * Only a pair present on both sides is compared, so a symbol, a member, or a title one side\n * lacks entirely is left to the bijection checks that own it and is never reported twice.\n * {@link computeDrift} rules each compared pair, so a pair whose sides carry different text, a\n * pair where one side carries none, and a pair where neither side carries text are all drift.\n * The pairing is per title across the whole document, not per heading: the first fence a title\n * reaches is the compared one, and every later fence of that title is outside the comparison,\n * whether it sits under the same heading or under a second heading of the same text. A signature\n * is compared only when both sides carry one, so an H3 entity heading, which carries no cell, and\n * a source reflected without emitted declarations stay outside that comparison.\n *\n * @param guide - The parsed guide\n * @param source - The reflected source the guide documents\n * @returns One entry per disagreement: each Surface row's summary then signature, then Methods\n * rows, then examples\n *\n * @example\n * ```ts\n * findDrift(guide, source) // [{ key: 'function walk', category: 'summary', guide: 'Walks.', source: 'Walks a tree.' }]\n * ```\n */\nexport function findDrift(guide: GuideInterface, source: SourceInterface): readonly Drift[] {\n\tconst drifts: Drift[] = []\n\tconst declared = new Map(source.surface().map((symbol) => [computeSymbolKey(symbol), symbol]))\n\n\tfor (const symbol of guide.surface()) {\n\t\tconst key = computeSymbolKey(symbol)\n\t\tconst match = declared.get(key)\n\t\tif (match === undefined) continue\n\t\tconst drift = computeDrift(key, 'summary', symbol.summary, match.summary)\n\t\tif (drift !== undefined) drifts.push(drift)\n\t\tif (symbol.signature === undefined || match.signature === undefined) continue\n\t\tconst computed = normalizeSummary(\n\t\t\textractCellText([{ element: 'codeSpan', value: match.signature }]),\n\t\t)\n\t\tconst signed = computeDrift(key, 'signature', symbol.signature, computed)\n\t\tif (signed !== undefined) drifts.push(signed)\n\t}\n\n\tfor (const group of guide.methods()) {\n\t\tconst members = new Map(source.methods(group.interface).map((entry) => [entry.name, entry]))\n\t\tfor (const entry of group.methods) {\n\t\t\tconst member = members.get(entry.name)\n\t\t\tif (member === undefined) continue\n\t\t\tconst drift = computeDrift(\n\t\t\t\t`${group.interface}.${entry.name}`,\n\t\t\t\t'summary',\n\t\t\t\tentry.summary,\n\t\t\t\tmember.summary,\n\t\t\t)\n\t\t\tif (drift !== undefined) drifts.push(drift)\n\t\t}\n\t}\n\n\tconst examples = collectTitles(guide, source)\n\tconst compared = new Set<string>()\n\tfor (const fence of guide.fences()) {\n\t\tif (fence.title === undefined || compared.has(fence.title)) continue\n\t\tcompared.add(fence.title)\n\t\tconst example = examples.get(fence.title)\n\t\tif (example === undefined) continue\n\t\tconst drift = computeDrift(\n\t\t\tfence.title,\n\t\t\t'example',\n\t\t\t`${fence.language ?? ''}\\n${fence.code}`,\n\t\t\t`${example.language ?? ''}\\n${example.code}`,\n\t\t)\n\t\tif (drift !== undefined) drifts.push(drift)\n\t}\n\n\treturn drifts\n}\n\n/**\n * Collects the titled `@example` blocks a guide's documented surface reaches — the module's\n * exported declaration heads, plus the own members of every documented `class` and `interface` —\n * keyed by title, the first block of a title answering for it.\n *\n * @param guide - The parsed guide naming the documented declarations\n * @param source - The reflected source to read the blocks from\n * @returns One entry per distinct `@example` title\n *\n * @example\n * ```ts\n * collectTitles(guide, source).get('Walk a tree') // { name: 'walk', title: 'Walk a tree', code: 'walk()' }\n * ```\n */\nexport function collectTitles(\n\tguide: GuideInterface,\n\tsource: SourceInterface,\n): ReadonlyMap<string, SourceExample> {\n\tconst titled = new Map<string, SourceExample>()\n\tconst owners = guide\n\t\t.surface()\n\t\t.filter((symbol) => symbol.keyword === 'class' || symbol.keyword === 'interface')\n\tconst examples = [\n\t\t...source.examples(),\n\t\t...owners.flatMap((symbol) => source.examples(symbol.name)),\n\t]\n\n\tfor (const example of examples) {\n\t\tif (example.title === undefined || titled.has(example.title)) continue\n\t\ttitled.set(example.title, example)\n\t}\n\n\treturn titled\n}\n\n/**\n * Builds a copy of `table` with one cell's inline content replaced by `cell`. Every other cell\n * keeps its own nodes, so a rewrite touches the one cell it names and the header and the\n * alignment row travel unchanged.\n *\n * @param table - The table to copy\n * @param row - The index of the row to rewrite within {@link TableNode.rows}\n * @param column - The index of the cell to rewrite within that row\n * @param cell - The cell's new inline content, such as {@link buildCell} returns\n * @returns The rewritten table\n *\n * @example\n * ```ts\n * buildTable(table, 0, 3, buildCell('Walks the tree.')).rows[0]?.[3] // [{ element: 'text', value: 'Walks the tree.' }]\n * ```\n */\nexport function buildTable(\n\ttable: TableNode,\n\trow: number,\n\tcolumn: number,\n\tcell: readonly InlineNode[],\n): TableNode {\n\treturn {\n\t\telement: 'table',\n\t\theader: table.header,\n\t\trows: table.rows.map((cells, index) =>\n\t\t\tindex === row\n\t\t\t\t? cells.map((current, position) => (position === column ? cell : current))\n\t\t\t\t: cells,\n\t\t),\n\t\talign: table.align,\n\t}\n}\n\n/**\n * Builds the fenced code block one `@example` block renders as — its code inside a fence\n * carrying its language, and an untagged fence when the block names none.\n *\n * @param example - The block to render\n * @returns The fence node\n *\n * @example\n * ```ts\n * buildFence({ name: 'walk', code: 'walk()', language: 'ts' }) // { element: 'codeBlock', code: 'walk()', lang: 'ts' }\n * ```\n */\nexport function buildFence(example: SourceExample): CodeBlockNode {\n\treturn {\n\t\telement: 'codeBlock',\n\t\tcode: example.code,\n\t\t...(example.language === undefined ? {} : { lang: example.language }),\n\t}\n}\n\n/**\n * Splices `replacement` into `source` over the region `span` addresses, and returns the result.\n * The text before the region and the text after it travel byte for byte, so a rewrite that\n * addresses one node's region changes nothing else in the document.\n *\n * @param source - The text to rewrite\n * @param span - The half-open region to replace: the region `MarkdownInterface.span` reports\n * for a markdown node, or the one {@link locateComment} reports for a doc block\n * @param replacement - The text to write over that region\n * @returns The rewritten text\n *\n * @example\n * ```ts\n * spliceSpan('one two three', { start: 4, end: 7 }, 'TWO') // 'one TWO three'\n * ```\n */\nexport function spliceSpan(source: string, span: MarkdownSpan, replacement: string): string {\n\treturn source.slice(0, span.start) + replacement + source.slice(span.end)\n}\n\n/**\n * Renders a uniform `Name | Kind | Signature | Summary` table with one row per symbol, the name\n * as a code span, the keyword as text, and the signature and summary through {@link buildCell}.\n * An absent signature or summary renders an empty cell, which {@link extractSurface} reads back\n * as absent. Guide construction refuses an empty signature cell.\n *\n * @remarks\n * The render carries no `## Surface` heading, because a guide documents its surface in several\n * tables under their own sub-headings and one of them is what this function produces. Reading the\n * render back therefore parses it under that heading. `renderMarkdown` pads every cell to one\n * space, so the render is not the committed column-aligned bytes; the checkout's formatter\n * re-aligns the table and the reader compares parsed entries rather than bytes.\n *\n * @param symbols - The symbols to document, in row order\n * @returns The table's markdown source, with no trailing newline\n *\n * @example\n * ```ts\n * renderSurface([{ name: 'walk', keyword: 'function', summary: 'Walks the tree.' }])\n * // '| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `walk` | function | | Walks the tree. |'\n * ```\n */\nexport function renderSurface(symbols: readonly SurfaceSymbol[]): string {\n\treturn renderMarkdown({\n\t\telement: 'table',\n\t\theader: [\n\t\t\t[{ element: 'text', value: NAME }],\n\t\t\t[{ element: 'text', value: KIND }],\n\t\t\t[{ element: 'text', value: SIGNATURE }],\n\t\t\t[{ element: 'text', value: SUMMARY }],\n\t\t],\n\t\trows: symbols.map((symbol) => [\n\t\t\t[{ element: 'codeSpan', value: symbol.name }],\n\t\t\t[{ element: 'text', value: symbol.keyword }],\n\t\t\tbuildCell(symbol.signature ?? ''),\n\t\t\tbuildCell(symbol.summary ?? ''),\n\t\t]),\n\t\talign: [null, null, null, null],\n\t})\n}\n\n/**\n * Renders one `## Methods` group — the `####` heading naming the interface as a code span, then\n * a `Name` and {@link SUMMARY} table with one row per documented member. A member carrying no\n * summary renders an empty cell, which {@link extractMethods} reads back as an absent summary.\n *\n * @remarks\n * The render carries no `## Methods` heading, for the reason {@link renderSurface} states:\n * a guide documents one group per interface under that one section heading.\n *\n * @param group - The interface and its members\n * @returns The heading and table's markdown source, with no trailing newline\n *\n * @example\n * ```ts\n * renderMethods({ interface: 'WidgetInterface', methods: [{ name: 'walk', summary: 'Walks.' }] })\n * // '#### `WidgetInterface`\\n\\n| Name | Summary |\\n| --- | --- |\\n| `walk` | Walks. |'\n * ```\n */\nexport function renderMethods(group: MethodGroup): string {\n\treturn renderMarkdown({\n\t\telement: 'document',\n\t\tchildren: [\n\t\t\t{ element: 'heading', level: 4, children: [{ element: 'codeSpan', value: group.interface }] },\n\t\t\t{\n\t\t\t\telement: 'table',\n\t\t\t\theader: [[{ element: 'text', value: NAME }], [{ element: 'text', value: SUMMARY }]],\n\t\t\t\trows: group.methods.map((entry) => [\n\t\t\t\t\t[{ element: 'codeSpan', value: entry.name }],\n\t\t\t\t\tbuildCell(entry.summary ?? ''),\n\t\t\t\t]),\n\t\t\t\talign: [null, null],\n\t\t\t},\n\t\t],\n\t})\n}\n\n/**\n * Renders one `@example` block as the guide fence it pairs with — an H3 heading carrying the\n * block's title, then a fence carrying its language and its code. An untitled block renders the\n * fence alone, because a fence pairs on its nearest preceding heading and an untitled block\n * claims none.\n *\n * @remarks\n * The title renders as literal text rather than markdown, so a title carrying backticks or\n * emphasis reads back through {@link extractFences} as the text the `@example` tag carried.\n * The heading level is 3 because a guide documents its examples one level under a `##` section;\n * {@link extractFences} pairs on the nearest preceding heading of any level, so the level is\n * presentation rather than pairing.\n *\n * @param example - The block to render\n * @returns The heading and fence's markdown source, with no trailing newline\n *\n * @example\n * ```ts\n * renderExample({ name: 'walk', title: 'Walk a tree', code: 'walk()', language: 'ts' })\n * // an H3 heading of 'Walk a tree', then a fence tagged `ts` carrying `walk()`\n * ```\n */\nexport function renderExample(example: SourceExample): string {\n\tconst fence = buildFence(example)\n\treturn renderMarkdown({\n\t\telement: 'document',\n\t\tchildren:\n\t\t\texample.title === undefined\n\t\t\t\t? [fence]\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telement: 'heading',\n\t\t\t\t\t\t\tlevel: 3,\n\t\t\t\t\t\t\tchildren: [{ element: 'text', value: example.title }],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfence,\n\t\t\t\t\t],\n\t})\n}\n\n/**\n * Replaces one compared cell in a guide's text and returns the whole guide back. `key` names the\n * row the way {@link findDrift} names it — a {@link computeSymbolKey} key for a `## Surface` row,\n * an `Owner.member` key for a `## Methods` row — and the row's cell under the `column` header\n * becomes `cell`. Only the table's own source region is rewritten, so every byte outside it\n * travels unchanged; a key reaching no cell returns `undefined`, and a row already carrying that\n * cell returns the guide byte for byte.\n *\n * @remarks\n * A row the key does not reach, a table carrying no `column` header, and a document whose parse\n * recorded no region for the table are each a miss, and a miss returns `undefined` rather than\n * throwing, so a caller reports the key it could not place — the one meaning `undefined` carries\n * in every replacer here. A row already carrying `cell` returns the guide byte for byte, because\n * a rewrite would re-pad the whole table for no change; that identity reads both cells through\n * {@link extractCellText} and {@link normalizeSummary}, so a caller passing text the compared form\n * still moves is a fixed point on the second run rather than a row rewritten forever. The\n * rewritten table renders one-space padded whatever padding it carried, so the checkout's\n * formatter re-aligns it, and a code span renders with every `|` written `\\|` and a longer\n * backtick fence when its text holds a backtick.\n *\n * @param guide - The guide's markdown source\n * @param key - The compared key naming the row\n * @param column - The header text of the column to write, {@link SUMMARY} or {@link SIGNATURE}\n * @param cell - The cell's new inline content, such as {@link buildCell} returns\n * @returns The guide's text with that cell replaced, or `undefined` when the key reaches no cell\n *\n * @example\n * ```ts\n * replaceCell('## Surface\\n\\n| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `walk` | function | `() => void` | Walks. |', 'function walk', SUMMARY, buildCell('Walks a tree.'))\n * // '## Surface\\n\\n| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `walk` | function | `() => void` | Walks a tree. |'\n * ```\n */\nexport function replaceCell(\n\tguide: string,\n\tkey: string,\n\tcolumn: string,\n\tcell: readonly InlineNode[],\n): string | undefined {\n\tconst markdown = createMarkdown(guide)\n\tconst document = markdown.document\n\tconst surface = Iterator.from(selectSectionBlocks(document, SURFACE))\n\t\t.filter(isTableNode)\n\t\t.flatMap((table) =>\n\t\t\ttable.rows.keys().map((index) => ({ table, index, symbol: extractRowSymbol(table, index) })),\n\t\t)\n\t\t.find((row) => row.symbol !== undefined && computeSymbolKey(row.symbol) === key)\n\tconst groups = collectGroups(document)\n\tconst selected =\n\t\tsurface ??\n\t\tIterator.from(groups)\n\t\t\t.flatMap(([table, owner]) =>\n\t\t\t\ttable.rows.keys().map((index) => ({\n\t\t\t\t\ttable,\n\t\t\t\t\tindex,\n\t\t\t\t\towner,\n\t\t\t\t\tentry: extractRowEntry(table, index),\n\t\t\t\t})),\n\t\t\t)\n\t\t\t.find((row) => row.entry !== undefined && `${row.owner}.${row.entry.name}` === key)\n\tif (selected === undefined) return undefined\n\tconst { table, index } = selected\n\tconst position = findColumnIndex(table, column)\n\tif (position === undefined) return undefined\n\tconst current = normalizeSummary(extractCellText(table.rows[index]?.[position] ?? []))\n\tif (current === normalizeSummary(extractCellText(cell))) return guide\n\tconst span = markdown.span(table)\n\tif (span === undefined) return undefined\n\treturn spliceSpan(guide, span, renderMarkdown(buildTable(table, index, position, cell)))\n}\n\n/**\n * Replaces one titled fence in a guide's text and returns the whole guide back. The first fence\n * carrying `title` — the pairing {@link findDrift} compares on — takes `example`'s language and\n * code. Only the fence's own source region is rewritten, so every byte outside it travels\n * unchanged; a title no fence carries returns `undefined`, and a fence already carrying that\n * body returns the guide byte for byte.\n *\n * @remarks\n * A title no fence carries and a document whose parse recorded no region for the fence are each a\n * miss, and a miss returns `undefined` rather than throwing — the one meaning `undefined` carries\n * in every replacer here. A fence already carrying that language and code returns the guide\n * byte for byte. A later fence of the same title is outside the pairing and is never rewritten,\n * which is the rule {@link findDrift} compares under.\n *\n * @param guide - The guide's markdown source\n * @param title - The heading text the fence pairs on\n * @param example - The block whose language and code the fence takes\n * @returns The guide's text with that fence replaced, or `undefined` when no fence carries the title\n *\n * @example\n * ```ts\n * replaceFence(guide, 'Walk', { name: 'walk', title: 'Walk', code: 'walk()', language: 'ts' })\n * // the guide's text with the fence under its `### Walk` heading carrying `walk()`\n * ```\n */\nexport function replaceFence(\n\tguide: string,\n\ttitle: string,\n\texample: SourceExample,\n): string | undefined {\n\tconst markdown = createMarkdown(guide)\n\tconst selected = Iterator.from(collectFences(markdown.document)).find(\n\t\t([, fence]) => fence.title === title,\n\t)\n\tif (selected === undefined) return undefined\n\tconst [located, current] = selected\n\tif (current.code === example.code && current.language === example.language) return guide\n\n\tconst span = markdown.span(located)\n\tif (span === undefined) return undefined\n\treturn spliceSpan(guide, span, renderMarkdown(buildFence(example)))\n}\n\n/**\n * Replaces one doc block's description paragraph with `summary` and returns the whole block back.\n * The paragraph is the block's text before its first block tag, and it re-wraps inside `width`;\n * the blank line before the first tag, every tag line, the block's indentation, and its\n * continuation markers all survive. A block already carrying the summary returns byte for byte,\n * and a text that is no doc block and a summary carrying no word each return `undefined`.\n *\n * @remarks\n * A miss returns `undefined`, the one meaning `undefined` carries in every replacer here, so a\n * caller reports the block it could not rewrite. Text that opens with no\n * `/**` is no doc block: a single-star `/*` comment reaches this function only by a caller's\n * mistake, and reshaping it into a doc block would be a silent edit. A `summary` carrying no word\n * names no paragraph to write, and deleting the block's description on that argument would erase\n * documentation on the strength of an absent value — a caller with nothing to write writes\n * nothing.\n *\n * A block already carrying `summary` returns byte for byte, which is what keeps a propagation\n * that finds no drift from rewriting the file: a doc block's own wrapping is not recoverable from\n * its text, so re-wrapping an unchanged paragraph would move most blocks this package's source\n * carries. That identity reads both sides through {@link normalizeSummary}, and it holds for a\n * block carrying no tag as much as for a block carrying several. A block written on one physical\n * line stays on one line while `summary` still fits inside `width`, and expands otherwise.\n *\n * `width` counts characters from the line's first, a tab counting as one, so a wrapped line reads\n * `${indent} * ${text}` and never passes that count. A caller whose formatter measures a tab as\n * more than one column passes a smaller width rather than taking the default.\n *\n * @param comment - One complete genuine JSDoc span's raw text, as it sits in the file\n * @param summary - The block's new description paragraph\n * @param width - The character budget a re-wrapped line stays inside. Default: {@link WRAP_WIDTH}\n * @returns The block's raw text with that paragraph replaced, or `undefined` for a text that is\n * no doc block and for a `summary` carrying no word\n *\n * @example\n * ```ts\n * replaceSummary('/**' + ' Walks. *' + '/', 'Walks a tree.') // '/**' + ' Walks a tree. *' + '/'\n * ```\n */\nexport function replaceSummary(\n\tcomment: string,\n\tsummary: string,\n\twidth: number = WRAP_WIDTH,\n): string | undefined {\n\tif (!/^[ \\t]*\\/\\*\\*/.test(comment)) return undefined\n\tconst content = unwrapComment(comment)\n\tconst indent = /^[ \\t]*/.exec(comment)?.[0] ?? ''\n\tconst wrapped = wrapText(summary, width - indent.length - 3)\n\tif (wrapped.length === 0) return undefined\n\n\tconst masked = maskFences(content.join('\\n')).split('\\n')\n\tconst tag = masked.findIndex((line) => /^[ \\t]*@\\w/.test(line))\n\n\tconst described = content.slice(0, tag < 0 ? content.length : tag).join('\\n')\n\tif (normalizeSummary(described) === normalizeSummary(summary)) return comment\n\n\tconst tail = tag < 0 ? [] : content.slice(tag)\n\tif (tail.length === 0 && wrapped.length === 1 && content.length === 1) {\n\t\tconst single = `${indent}/** ${wrapped[0] ?? ''} */`\n\t\tif (single.length <= width) return single\n\t}\n\n\tconst lines = [...wrapped]\n\tif (tail.length > 0) lines.push('')\n\treturn buildComment([...lines, ...tail], indent)\n}\n\n/**\n * Replaces the body of one titled `@example` tag in a doc block's raw text and returns the whole\n * block back. The tag carrying `example`'s title takes a fence of its language and its code;\n * every other tag, the description paragraph, the block's indentation, and its continuation\n * markers all survive. A text that is no doc block, a title no tag carries, and a language or\n * code the emitted three-backtick fence cannot enclose or the doc block cannot hold each return\n * `undefined`.\n *\n * @remarks\n * A miss returns `undefined`, the one meaning `undefined` carries in every replacer here, so a\n * caller reports the block it could not rewrite. Text that opens with no\n * `/**` is no doc block, for the reason {@link replaceSummary} states. A block carrying no\n * `@example` tag of that title has nowhere to write, so an untitled tag and a tag carrying\n * another title are each left alone, and an `example` naming no title misses a block whose tags\n * all carry one. Code carrying a run of three or more backticks is a body the emitted fence\n * cannot enclose: the fence is three backticks, {@link maskFences} ends a body at the first line\n * opening a run at least as long, and {@link collectExamples} reads to the first such run\n * whatever column it sits at, so writing that body would truncate it and turn a following\n * `@`-line into a tag. A language or code carrying the doc-comment terminator is a body the\n * block itself cannot hold: the terminator closes the block where it lands and the file stops\n * parsing there. Refusing keeps the rewrite total over the bodies it can spell.\n *\n * A tag already carrying that language and code returns byte for byte. {@link maskFences} keeps\n * the current body's own lines out of the tag search, so a fenced body carrying a tag-shaped line\n * does not end the body early. The body ends at its last line carrying text, so the blank line\n * separating it from the next tag survives.\n *\n * @param comment - One complete genuine JSDoc span's raw text, as it sits in the file\n * @param example - The block whose language and code the tag's body takes\n * @returns The block's raw text with that body replaced, or `undefined` for a text that is no\n * doc block, for a title no `@example` tag carries, and for a language or code the emitted\n * fence cannot enclose or the doc block cannot hold — a body carrying the doc-comment terminator\n *\n * @example\n * ```ts\n * replaceExample('/**' + '\\n * @example Walk\\n * old()\\n *' + '/', { name: 'walk', title: 'Walk', code: 'walk()', language: 'ts' })\n * // the same block, its `@example Walk` body now a fence tagged `ts` carrying `walk()`\n * ```\n */\nexport function replaceExample(comment: string, example: SourceExample): string | undefined {\n\tif (!/^[ \\t]*\\/\\*\\*/.test(comment)) return undefined\n\tconst spelled = [example.language ?? '', ...example.code.split('\\n')]\n\tif (spelled.some((line) => line.includes('```') || line.includes('*/'))) return undefined\n\tconst content = unwrapComment(comment)\n\tconst masked = maskFences(content.join('\\n')).split('\\n')\n\tconst title = example.title ?? ''\n\tconst start = masked.findIndex((line) => {\n\t\tconst tag = /^[ \\t]*@example(?=[ \\t]|$)[ \\t]*(.*)$/.exec(line)\n\t\treturn tag !== null && (tag[1] ?? '').trim() === title\n\t})\n\tif (start < 0) return undefined\n\n\tconst current = collectExamples(content.join('\\n'), example.name).find(\n\t\t(entry) => (entry.title ?? '') === title,\n\t)\n\tif (\n\t\tcurrent !== undefined &&\n\t\tcurrent.code === example.code &&\n\t\tcurrent.language === example.language\n\t) {\n\t\treturn comment\n\t}\n\n\tconst next = masked.findIndex((line, index) => index > start && /^[ \\t]*@\\w/.test(line))\n\tconst boundary = next < 0 ? content.length : next\n\tconst last = content.findLastIndex(\n\t\t(line, index) => index > start && index < boundary && line.length > 0,\n\t)\n\tconst end = last < 0 ? start + 1 : last + 1\n\n\tconst indent = /^[ \\t]*/.exec(comment)?.[0] ?? ''\n\tconst body = [`\\`\\`\\`${example.language ?? ''}`, ...example.code.split('\\n'), '```']\n\treturn buildComment([...content.slice(0, start + 1), ...body, ...content.slice(end)], indent)\n}\n\n/**\n * Locates the doc block a compared key attaches to inside one file's text and returns the block's\n * own character region, so a caller can `slice` the block, rewrite it through\n * {@link replaceSummary} or {@link replaceExample}, and write the result back through\n * {@link spliceSpan}. `key` names the pair the way {@link findDrift} names it — a\n * {@link computeSymbolKey} key for a declaration, an `Owner.member` key for an interface or class\n * member; the region covers the block's own indentation, and no block carrying the key returns\n * `undefined`.\n *\n * @remarks\n * Attachment is {@link extractSourceComments}'s, not a second reading of the file: that walk\n * pairs each eligible block with the physical record it documents, and this function keeps the\n * record {@link collectKeys} gives `key`. The keys are that one grammar's — the map\n * {@link extractExports} and {@link extractMemberMethods} each read their own part out of — so\n * this function runs no head pattern, no member pattern, and no owner-close rule of its own, and\n * a change to any of them reaches the locator too. Every block {@link collectSummaries} reports\n * a summary for is reachable by its key, and a block carrying only block tags is reachable too although it carries no summary.\n * A block it misses is one the comparison never had: a block a blank line separates from its\n * declaration attaches to the blank line, and a block written inside a template literal or a\n * string is no genuine span at all. The first block whose record carries the key answers for it,\n * as the first declaration of a name does everywhere else.\n *\n * The region runs from the start of the opener's line, the block's indentation included, to the\n * character past its closing marker — the raw text {@link replaceSummary} and\n * {@link replaceExample} each document as the span \"as it sits in the file\", so a caller slices,\n * rewrites, and splices with no adjustment and the rewrite keeps the indentation it found. A\n * block that source material precedes on its own line starts at the opener instead. The region\n * is read off the aligned JSDoc projection rather than searched for in the text, so an opener\n * written inside a string never yields one, and line offsets come from\n * {@link extractSourceLines}'s own records under its stated LF-or-CRLF terminator rule, so a\n * CRLF file reports the offsets its own bytes carry.\n *\n * @param text - One file's whole source text\n * @param key - The compared key naming the declaration or the member\n * @returns The block's half-open character region, or `undefined` when no block carries the key\n *\n * @example\n * ```ts\n * const text = '/**' + ' Walks. *' + '/\\nexport function walk(): void {}\\n'\n * locateComment(text, 'function walk') // { start: 0, end: 13 }\n * ```\n */\nexport function locateComment(text: string, key: string): MarkdownSpan | undefined {\n\tconst lines = extractSourceLines(text)\n\tconst keys = collectKeys(lines)\n\tconst records: Array<{\n\t\treadonly line: SourceLine\n\t\treadonly index: number\n\t\treadonly offset: number\n\t\treadonly next: number\n\t}> = []\n\tfor (const [index, line] of lines.entries()) {\n\t\tconst offset = records.at(-1)?.next ?? 0\n\t\tconst after = offset + line.source.length\n\t\trecords.push({ line, index, offset, next: after + (text.startsWith('\\r\\n', after) ? 2 : 1) })\n\t}\n\tconst offsets = records.map((record) => record.offset)\n\tconst positions = new Map(records.map((record) => [record.line, record.index]))\n\tfor (const comment of extractSourceComments(lines)) {\n\t\tif (keys.get(comment.line) !== key) continue\n\t\tconst close = (positions.get(comment.line) ?? 0) - 1\n\t\tconst closing = lines[close]?.jsdoc\n\t\tconst end = closing === undefined ? -1 : closing.lastIndexOf('*/')\n\t\tif (end < 0) continue\n\t\tconst first =\n\t\t\tlines\n\t\t\t\t.keys()\n\t\t\t\t.take(close)\n\t\t\t\t.map((index) => close - index)\n\t\t\t\t.find((index) => lines[index - 1]?.jsdoc === undefined) ?? 0\n\t\tconst found = Array.prototype.keys\n\t\t\t.call({ length: close - first + 1 })\n\t\t\t.map((distance) => first + distance)\n\t\t\t.reduce(\n\t\t\t\t(state, index) => {\n\t\t\t\t\tconst projection = lines[index]?.jsdoc ?? ''\n\t\t\t\t\treturn Iterator.from(projection.matchAll(/(?=\\/\\*\\*|\\*\\/)/g)).reduce(\n\t\t\t\t\t\t(current, match) => {\n\t\t\t\t\t\t\tconst at = match.index\n\t\t\t\t\t\t\tif (at < current.cursor || !projection.startsWith(current.inside ? '*/' : '/**', at))\n\t\t\t\t\t\t\t\treturn current\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinside: !current.inside,\n\t\t\t\t\t\t\t\tline: current.inside ? current.line : index,\n\t\t\t\t\t\t\t\tcolumn: current.inside ? current.column : at,\n\t\t\t\t\t\t\t\tcursor: at + (current.inside ? 2 : 3),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ ...state, cursor: 0 },\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\t{ inside: false, line: -1, column: -1, cursor: 0 },\n\t\t\t)\n\t\tif (found.line < 0) continue\n\t\tconst source = lines[found.line]?.source ?? ''\n\t\tconst start = source.slice(0, found.column).trim() === '' ? 0 : found.column\n\t\treturn { start: (offsets[found.line] ?? 0) + start, end: (offsets[close] ?? 0) + end + 2 }\n\t}\n\treturn undefined\n}\n","import type { ManifestEntry } from './types.js'\nimport { createMarkdown, flattenText, isTableNode } from '@orkestrel/markdown'\nimport { isEmptyString, isNonEmptyArray } from '@orkestrel/contract'\nimport { MANIFEST } from './constants.js'\nimport {\n\textractCellLinks,\n\tnormalizeDirectories,\n\tresolvePath,\n\tselectSectionBlocks,\n} from './helpers.js'\n\n/**\n * Parses a `## By concept` manifest table into its {@link ManifestEntry} rows —\n * each row's Concept cell (flattened text), Spec / Tests cells (a single link\n * href, resolved against `directory`), and Source cell (every link href,\n * resolved against `directory`; Source links canonicalize through\n * {@link normalizeDirectories}, one directory collapses to a `string`, and several become\n * a `readonly string[]`). A row missing a concept, spec link, tests link, or\n * source link is skipped as malformed.\n *\n * @param markdown - The manifest markdown source, for example the content of `guides/README.md`\n * @param directory - The root-relative directory containing the manifest\n * @returns The manifest's entries, in row order\n *\n * @example\n * ```ts\n * parseManifest(readme, 'guides') // [{ concept: 'Markdown', spec: 'guides/src/markdown.md', ... }]\n * ```\n */\nexport function parseManifest(markdown: string, directory: string): readonly ManifestEntry[] {\n\tconst document = createMarkdown(markdown).document\n\tconst entries: ManifestEntry[] = []\n\n\tfor (const block of selectSectionBlocks(document, MANIFEST)) {\n\t\tif (!isTableNode(block)) continue\n\n\t\tfor (const row of block.rows) {\n\t\t\tconst conceptCell = row[0]\n\t\t\tconst specCell = row[1]\n\t\t\tconst sourceCell = row[2]\n\t\t\tconst testsCell = row[3]\n\t\t\tif (\n\t\t\t\tconceptCell === undefined ||\n\t\t\t\tspecCell === undefined ||\n\t\t\t\tsourceCell === undefined ||\n\t\t\t\ttestsCell === undefined\n\t\t\t) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst concept = flattenText({ element: 'paragraph', children: conceptCell }).trim()\n\t\t\tif (isEmptyString(concept)) continue\n\n\t\t\tconst specHref = extractCellLinks(specCell)[0]\n\t\t\tconst testsHref = extractCellLinks(testsCell)[0]\n\t\t\tif (specHref === undefined || testsHref === undefined) continue\n\n\t\t\tconst sourceHrefs = normalizeDirectories(\n\t\t\t\textractCellLinks(sourceCell).map((href) => resolvePath(directory, href)),\n\t\t\t)\n\t\t\tif (!isNonEmptyArray<string>(sourceHrefs)) continue\n\t\t\tconst [firstSource] = sourceHrefs\n\t\t\tconst source = sourceHrefs.length === 1 ? firstSource : sourceHrefs\n\n\t\t\tentries.push({\n\t\t\t\tconcept,\n\t\t\t\tspec: resolvePath(directory, specHref),\n\t\t\t\tsource,\n\t\t\t\ttests: resolvePath(directory, testsHref),\n\t\t\t})\n\t\t}\n\t}\n\n\treturn entries\n}\n","import {\n\tarrayShape,\n\tliteralShape,\n\tobjectShape,\n\toptionalShape,\n\tstringShape,\n\tunionShape,\n} from '@orkestrel/contract'\nimport { DRIFT_CATEGORIES, EXPORT_KEYWORDS } from './constants.js'\n\n// AGENTS.md § Design laws: shapers are `ContractShape` values, not functions\n// or types - a JSON-Schema blueprint the compilers (factories.ts) turn into a\n// guard / parser / schema / generator in lockstep. Every documented data type\n// here is non-recursive, so each shapes directly (no `lazyOf` gate needed).\n\n/**\n * Shapes a {@link SurfaceSymbol} — a documented / exported symbol's `name`\n * paired with its {@link ExportKeyword}, optional `signature`, and optional compared `summary`.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { surfaceSymbolShape } from '@orkestrel/guide'\n *\n * const surfaceSymbol = createContract(surfaceSymbolShape)\n * surfaceSymbol.is({ name: 'Markdown', keyword: 'class' }) // true\n * ```\n */\nexport const surfaceSymbolShape = objectShape({\n\tname: stringShape(),\n\tkeyword: literalShape(EXPORT_KEYWORDS),\n\tsignature: optionalShape(stringShape()),\n\tsummary: optionalShape(stringShape()),\n})\n\n/**\n * Shapes a {@link MethodEntry} — one documented method's `name` paired with its optional\n * compared `summary`.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { methodEntryShape } from '@orkestrel/guide'\n *\n * const methodEntry = createContract(methodEntryShape)\n * methodEntry.is({ name: 'walk' }) // true\n * ```\n */\nexport const methodEntryShape = objectShape({\n\tname: stringShape(),\n\tsummary: optionalShape(stringShape()),\n})\n\n/**\n * Shapes a {@link SourceExample} — one `@example` block's `name`, its optional pairing\n * `title`, its `code`, and its optional fence `language`.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { sourceExampleShape } from '@orkestrel/guide'\n *\n * const sourceExample = createContract(sourceExampleShape)\n * sourceExample.is({ name: 'walk', code: 'walk()' }) // true\n * ```\n */\nexport const sourceExampleShape = objectShape({\n\tname: stringShape(),\n\ttitle: optionalShape(stringShape()),\n\tcode: stringShape(),\n\tlanguage: optionalShape(stringShape()),\n})\n\n/**\n * Shapes a {@link Drift} — one disagreement's compared `key` with the optional text each\n * side carries there.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { driftShape } from '@orkestrel/guide'\n *\n * const drift = createContract(driftShape)\n * drift.is({ key: 'class Widget', category: 'summary', guide: 'A widget.' }) // true\n * ```\n */\nexport const driftShape = objectShape({\n\tkey: stringShape(),\n\tcategory: literalShape(DRIFT_CATEGORIES),\n\tguide: optionalShape(stringShape()),\n\tsource: optionalShape(stringShape()),\n})\n\n/**\n * Shapes a {@link MethodGroup} — a backticked `interface` name paired with\n * its documented `methods`.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { methodGroupShape } from '@orkestrel/guide'\n *\n * const methodGroup = createContract(methodGroupShape)\n * methodGroup.is({ interface: 'MarkdownInterface', methods: ['walk'] }) // true\n * ```\n */\nexport const methodGroupShape = objectShape({\n\tinterface: stringShape(),\n\tmethods: arrayShape(methodEntryShape),\n})\n\n/**\n * Shapes a {@link ManifestEntry} — one `## By concept` manifest row, `source`\n * accepting either a single directory or several.\n *\n * @example\n * ```ts\n * import { createContract } from '@orkestrel/contract'\n * import { manifestEntryShape } from '@orkestrel/guide'\n *\n * const manifestEntry = createContract(manifestEntryShape)\n * manifestEntry.is({ concept: 'Markdown', spec: 'guides/src/markdown.md', source: 'src/core', tests: 'tests/src/core' }) // true\n * ```\n */\nexport const manifestEntryShape = objectShape({\n\tconcept: stringShape(),\n\tspec: stringShape(),\n\tsource: unionShape(stringShape(), arrayShape(stringShape())),\n\ttests: stringShape(),\n})\n","import type { GuideFence, GuideInterface, MethodGroup, SurfaceSymbol } from './types.js'\nimport { createMarkdown, flattenText, isHeadingNode } from '@orkestrel/markdown'\nimport {\n\textractFences,\n\textractLinks,\n\textractMethods,\n\textractSurface,\n\textractTagline,\n\textractTests,\n\textractUnnamed,\n\tvalidateSurface,\n} from './helpers.js'\n\n/**\n * Presents a pure, structured view over one parsed guide — the documented\n * projections (`sections` / `tagline` / `surface` / `methods` / `unnamed` / `links` /\n * `tests` / `fences`) are extracted once at construction and cached.\n *\n * @remarks\n * Parses `source` once through `@orkestrel/markdown` and never touches the\n * filesystem — `Guide` reads only the markdown text it is given and records\n * nothing about where the guide came from. Every accessor returns the same\n * cached, readonly array on every call. Before caching, refuses the first Surface table with\n * a header other than `Name | Kind | Signature | Summary` or a keyed empty Signature cell,\n * through {@link validateSurface}.\n *\n * @example\n * ```ts\n * import { Guide } from '@orkestrel/guide'\n *\n * const guide = new Guide('## Surface\\n\\n| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `X` | class | `new () => X` | |')\n * guide.surface() // [{ name: 'X', keyword: 'class', signature: '`new () => X`' }]\n * ```\n */\nexport class Guide implements GuideInterface {\n\treadonly #sections: readonly string[]\n\treadonly #tagline: string | undefined\n\treadonly #surface: readonly SurfaceSymbol[]\n\treadonly #methods: readonly MethodGroup[]\n\treadonly #unnamed: readonly string[]\n\treadonly #links: readonly string[]\n\treadonly #tests: readonly string[]\n\treadonly #fences: readonly GuideFence[]\n\n\tconstructor(source: string) {\n\t\tconst document = createMarkdown(source).document\n\t\tvalidateSurface(document)\n\n\t\tthis.#sections = document.children\n\t\t\t.filter(isHeadingNode)\n\t\t\t.filter((heading) => heading.level === 2)\n\t\t\t.map((heading) => flattenText(heading).trim())\n\t\tthis.#tagline = extractTagline(document)\n\t\tthis.#surface = extractSurface(document)\n\t\tthis.#methods = extractMethods(document)\n\t\tthis.#unnamed = extractUnnamed(document)\n\t\tthis.#links = extractLinks(document)\n\t\tthis.#tests = extractTests(document)\n\t\tthis.#fences = extractFences(document)\n\t}\n\n\tsections(): readonly string[] {\n\t\treturn this.#sections\n\t}\n\n\ttagline(): string | undefined {\n\t\treturn this.#tagline\n\t}\n\n\tsurface(): readonly SurfaceSymbol[] {\n\t\treturn this.#surface\n\t}\n\n\tmethods(): readonly MethodGroup[] {\n\t\treturn this.#methods\n\t}\n\n\tunnamed(): readonly string[] {\n\t\treturn this.#unnamed\n\t}\n\n\tlinks(): readonly string[] {\n\t\treturn this.#links\n\t}\n\n\ttests(): readonly string[] {\n\t\treturn this.#tests\n\t}\n\n\tfences(): readonly GuideFence[] {\n\t\treturn this.#fences\n\t}\n}\n","import type {\n\tDeclaration,\n\tDeclarationKeyword,\n\tMethodEntry,\n\tSourceExample,\n\tSourceInterface,\n\tSourceOptions,\n\tSurfaceSymbol,\n} from '../types.js'\nimport {\n\tcollectDeclarations,\n\tcomputeSymbolKey,\n\textractExampleMethods,\n\textractExamples,\n\textractExports,\n\textractHidden,\n\textractMemberMethods,\n\textractSignatures,\n\textractSourceLines,\n\thasCanonicalSegments,\n\tnormalizeDirectories,\n\tresolveLink,\n\tresolvePath,\n\tselectModuleKeys,\n} from '../helpers.js'\n\n/**\n * Reflects, as a pure `SourceInterface`, a module scope's intentional direct declarations,\n * conventional barrel-reachable surface, and member methods over a consumer-supplied file\n * inventory, using text-only line scanners rather than the TypeScript compiler API or the\n * filesystem. `Source` never touches disk:\n * the consumer gathers the inventory however their environment allows\n * (`node:fs` in a Node script, `import.meta.glob` in a browser/vitest run) and\n * passes it in as `files`.\n *\n * @remarks\n * Conventional barrel traversal recurses through both\n * exact workspace-root `index.ts` and nested `/index.ts` targets. `'.'` is the\n * canonical workspace-root module, module spellings normalize once at\n * construction, and exact opaque inventory keys are never rewritten; keys with\n * empty, `.` or `..` segments stay outside both initial and resolved barrel\n * inventory entrances after relative-row reduction; canonical parent hops\n * remain valid. `methods` resolves a declaration's members through its\n * `extends` chain within the same module scope, keeping the keyword it started\n * from; a base the scope does not declare contributes nothing. One declaration\n * answers under each keyword: the first file in sorted key order that declares\n * the head supplies its members and its bases, and a second file declaring the\n * same name under that keyword adds nothing. The interface answers for a name,\n * and the class when no interface declares it; one file declaring the name as\n * both shapes, a TypeScript declaration merge, answers with both, own members\n * ahead of inherited ones and the interface's own first. Every reading derives once per instance from the immutable\n * inventory and is reused — the scope's declaration map on the first `methods`\n * or `examples` lookup, then each name's members and each example collection\n * under the name asked for — so a reader asking twice reads the files once and\n * receives the same records, and a second instance over the same inventory\n * derives the same readings of its own. Source projection preserves columns\n * without widening direct/hidden column-zero heads. Literal ECMAScript Unicode\n * identifiers participate in bounded slash-state recognition without escape\n * decoding. Regex recognition is bounded: slash after bare `}` is division, so\n * a post-brace regex statement requires an explicit `;`. General semicolonless\n * declaration/ASI classification is also outside the finite projector, so a\n * slash-leading statement after such a declaration requires an explicit `;`.\n *\n * @example\n * ```ts\n * import { Source } from '@orkestrel/guide'\n *\n * const source = new Source({\n * \tfiles: {\n * \t\t'src/core/index.ts': \"export * from './Guide.js'\\nexport * from './types.js'\\n\",\n * \t\t'src/core/Guide.ts': 'export class Guide {}\\n',\n * \t\t'src/core/types.ts': 'export interface GuideInterface {\\n\\tsections(): void\\n}\\n',\n * \t},\n * \tmodule: 'src/core',\n * })\n * source.exports() // [{ name: 'Guide', keyword: 'class' }, { name: 'GuideInterface', keyword: 'interface' }]\n * source.surface() // [{ name: 'Guide', keyword: 'class' }, { name: 'GuideInterface', keyword: 'interface' }]\n * source.methods('GuideInterface') // [{ name: 'sections' }]\n * source.exists('src/core/Guide.ts') // true\n * ```\n */\nexport class Source implements SourceInterface {\n\treadonly #files: Readonly<Record<string, string>>\n\treadonly #directories: readonly string[]\n\treadonly #methods = new Map<string, readonly MethodEntry[]>()\n\treadonly #examples = new Map<string | undefined, readonly SourceExample[]>()\n\t#exports: readonly SurfaceSymbol[] | undefined\n\t#surface: readonly SurfaceSymbol[] | undefined\n\t#hidden: readonly SurfaceSymbol[] | undefined\n\t#declarations: ReadonlyMap<string, Declaration> | undefined\n\treadonly #origins = new Map<string, string>()\n\treadonly #emitted: Readonly<Record<string, string>> | undefined\n\treadonly #signed = new Map<string, readonly SurfaceSymbol[]>()\n\n\tconstructor(options: SourceOptions) {\n\t\tthis.#files = options.files\n\t\tthis.#directories = normalizeDirectories(options.module)\n\t\tthis.#emitted = options.declarations\n\t}\n\n\t// The module's exports are computed once on first access and cached —\n\t// every subsequent call reuses the same scan of an immutable inventory.\n\texports(): readonly SurfaceSymbol[] {\n\t\tif (this.#exports === undefined)\n\t\t\tthis.#exports = this.#scanSymbols((key, text) => this.#scanExports(key, text))\n\t\treturn this.#exports\n\t}\n\n\t// The conventional barrel surface is computed once on first access and\n\t// cached independently from the intentional direct-declaration inventory.\n\tsurface(): readonly SurfaceSymbol[] {\n\t\tif (this.#surface === undefined) this.#surface = this.#scanSurface()\n\t\treturn this.#surface\n\t}\n\n\t// A name's members are computed once per instance and cached under that name, so a\n\t// reader asking twice resolves one `extends` chain rather than two.\n\tmethods(name: string): readonly MethodEntry[] {\n\t\tconst cached = this.#methods.get(name)\n\t\tif (cached !== undefined) return cached\n\n\t\tconst members = this.#scanMethods(name)\n\t\tthis.#methods.set(name, members)\n\t\treturn members\n\t}\n\n\texists(relative: string): boolean {\n\t\tconst keys = Object.keys(this.#files)\n\t\treturn keys.some((key) => key === relative || key.startsWith(`${relative}/`))\n\t}\n\n\t// The module's hidden declarations are computed once on first access and\n\t// cached — mirrors `exports()`'s caching.\n\thidden(): readonly SurfaceSymbol[] {\n\t\tif (this.#hidden === undefined)\n\t\t\tthis.#hidden = this.#scanSymbols((_key, text) => extractHidden(text))\n\t\treturn this.#hidden\n\t}\n\n\t// Each reading is computed once per instance and cached under the name it was asked\n\t// for, the module-wide collection under the absent name.\n\texamples(): readonly SourceExample[]\n\texamples(name: string): readonly SourceExample[]\n\texamples(name?: string): readonly SourceExample[] {\n\t\tconst cached = this.#examples.get(name)\n\t\tif (cached !== undefined) return cached\n\n\t\tconst examples = name === undefined ? this.#scanExamples() : this.#exampleMembers(name)\n\t\tthis.#examples.set(name, examples)\n\t\treturn examples\n\t}\n\n\t// TypeScript merges a class and an interface only inside one module, so one file declaring a\n\t// name as both shapes answers with both member sets: each shape's own members ahead of\n\t// inherited ones, the interface's own first, as in `#exampleMembers`. Shapes from two files are\n\t// separate declarations, so the interface answers and the class answers only when no interface\n\t// declares the name. A class's members arrive without the `constructor` no guide documents.\n\t#scanMethods(name: string): readonly MethodEntry[] {\n\t\tconst fromInterface = this.#members('interface', name, new Set<string>())\n\t\tconst fromClass = this.#members('class', name, new Set<string>())?.filter(\n\t\t\t(entry) => entry.name !== 'constructor',\n\t\t)\n\t\tconst origin = this.#origin('interface', name)\n\t\tif (origin === undefined || origin !== this.#origin('class', name))\n\t\t\treturn fromInterface ?? fromClass ?? []\n\n\t\tconst methods = new Map<string, MethodEntry>()\n\t\tfor (const entry of [\n\t\t\t...extractMemberMethods(this.#locate('interface', name)?.body ?? []),\n\t\t\t...extractMemberMethods(this.#locate('class', name)?.body ?? []),\n\t\t\t...(fromInterface ?? []),\n\t\t\t...(fromClass ?? []),\n\t\t])\n\t\t\tif (entry.name !== 'constructor' && !methods.has(entry.name)) methods.set(entry.name, entry)\n\n\t\treturn Array.from(methods.values()).sort((a, b) =>\n\t\t\ta.name === b.name ? 0 : a.name < b.name ? -1 : 1,\n\t\t)\n\t}\n\n\t// The union of exported declaration heads' `@example` blocks across the module's\n\t// files, deduped by name and title in first-seen order — mirrors `#scanSymbols`,\n\t// but over the `@example` scanner rather than a `SurfaceSymbol` one.\n\t#scanExamples(): readonly SourceExample[] {\n\t\tconst examples: SourceExample[] = []\n\t\tconst seen = new Set<string>()\n\n\t\tfor (const key of selectModuleKeys(this.#files, this.#directories)) {\n\t\t\tconst text = this.#files[key]\n\t\t\tif (text === undefined) continue\n\n\t\t\tfor (const example of extractExamples(text)) {\n\t\t\t\tconst identity = `${example.name}\\n${example.title ?? ''}`\n\t\t\t\tif (seen.has(identity)) continue\n\t\t\t\tseen.add(identity)\n\t\t\t\texamples.push(example)\n\t\t\t}\n\t\t}\n\n\t\treturn examples\n\t}\n\n\t// The graph closure of each selected directory's conventional root barrel,\n\t// deduped with the same identity and ordering as the direct export scan.\n\t#scanSurface(): readonly SurfaceSymbol[] {\n\t\tconst symbols: SurfaceSymbol[] = []\n\t\tconst seen = new Set<string>()\n\t\tconst visited = new Set<string>()\n\n\t\tfor (const directory of this.#directories) {\n\t\t\tthis.#collectSurface(resolvePath(directory, 'index.ts'), visited, symbols, seen)\n\t\t}\n\n\t\treturn symbols.sort((a, b) => (a.name === b.name ? 0 : a.name < b.name ? -1 : 1))\n\t}\n\n\t// Traverse one exact canonical index inventory key. Only complete\n\t// conventional relative `.js` star rows whose reduced targets are canonical\n\t// enter the graph; every other line is outside the reflected population and\n\t// remains validation-owned by policy and builds.\n\t#collectSurface(\n\t\tindex: string,\n\t\tvisited: Set<string>,\n\t\tsymbols: SurfaceSymbol[],\n\t\tseen: Set<string>,\n\t): void {\n\t\tif (!hasCanonicalSegments(index)) return\n\t\tif (visited.has(index)) return\n\t\tvisited.add(index)\n\n\t\tconst source = this.#files[index]\n\t\tif (source === undefined) return\n\n\t\tfor (const line of extractSourceLines(source)) {\n\t\t\tconst row = line.code.match(\n\t\t\t\t/^\\s*export\\s+\\*\\s+from\\s+(?:'(\\.\\.?\\/[^']+\\.js)'|\"(\\.\\.?\\/[^\"]+\\.js)\")\\s*;?\\s*(?:\\/\\/.*)?$/,\n\t\t\t)\n\t\t\tconst target = row?.[1] ?? row?.[2]\n\t\t\tif (target === undefined) continue\n\n\t\t\tconst path = resolveLink(index, `${target.slice(0, -3)}.ts`)\n\t\t\tif (!hasCanonicalSegments(path)) continue\n\t\t\tif (path === 'index.ts' || path.endsWith('/index.ts')) {\n\t\t\t\tthis.#collectSurface(path, visited, symbols, seen)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (visited.has(path)) continue\n\t\t\tvisited.add(path)\n\n\t\t\tconst text = this.#files[path]\n\t\t\tif (text === undefined) continue\n\t\t\tfor (const symbol of this.#scanExports(path, text)) {\n\t\t\t\tconst identity = computeSymbolKey(symbol)\n\t\t\t\tif (seen.has(identity)) continue\n\t\t\t\tseen.add(identity)\n\t\t\t\tsymbols.push(symbol)\n\t\t\t}\n\t\t}\n\t}\n\n\t// The `@example` blocks of the interface-or-class declaration body named\n\t// `name`, unioning both shapes (an implementer may carry its own `@example` a\n\t// documented interface member does not, or vice versa). The interface's own\n\t// block answers first for a member both shapes document.\n\t#exampleMembers(name: string): readonly SourceExample[] {\n\t\tconst members = new Map<string, SourceExample>()\n\n\t\tfor (const example of [\n\t\t\t...extractExampleMethods(this.#locate('interface', name)?.body ?? []),\n\t\t\t...extractExampleMethods(this.#locate('class', name)?.body ?? []),\n\t\t]) {\n\t\t\tconst identity = `${example.name}\\n${example.title ?? ''}`\n\t\t\tif (members.has(identity)) continue\n\t\t\tmembers.set(identity, example)\n\t\t}\n\n\t\treturn Array.from(members.values()).sort((a, b) =>\n\t\t\ta.name === b.name ? 0 : a.name < b.name ? -1 : 1,\n\t\t)\n\t}\n\n\t// The pure union-and-dedupe-and-sort composition behind `exports()` and\n\t// `hidden()` — kept as a private method because it orchestrates a scanner\n\t// across every file of the module scope rather than being a self-contained\n\t// leaf.\n\t#scanSymbols(\n\t\tscan: (key: string, source: string) => readonly SurfaceSymbol[],\n\t): readonly SurfaceSymbol[] {\n\t\tconst symbols: SurfaceSymbol[] = []\n\t\tconst seen = new Set<string>()\n\n\t\tfor (const key of selectModuleKeys(this.#files, this.#directories)) {\n\t\t\tconst text = this.#files[key]\n\t\t\tif (text === undefined) continue\n\n\t\t\tfor (const symbol of scan(key, text)) {\n\t\t\t\tconst identity = computeSymbolKey(symbol)\n\t\t\t\tif (seen.has(identity)) continue\n\t\t\t\tseen.add(identity)\n\t\t\t\tsymbols.push(symbol)\n\t\t\t}\n\t\t}\n\n\t\treturn symbols.sort((a, b) => (a.name === b.name ? 0 : a.name < b.name ? -1 : 1))\n\t}\n\n\t// One file's exports, each carrying the signature its emitted declaration projects when the\n\t// options supply one, read once per inventory key and reused by `exports()` and `surface()`.\n\t#scanExports(key: string, text: string): readonly SurfaceSymbol[] {\n\t\tconst cached = this.#signed.get(key)\n\t\tif (cached !== undefined) return cached\n\n\t\tconst declaration = this.#emitted?.[`${key.slice(0, -3)}.d.ts`]\n\t\tconst signatures = new Map(\n\t\t\t(declaration === undefined ? [] : extractSignatures(declaration)).map((symbol) => [\n\t\t\t\tcomputeSymbolKey(symbol),\n\t\t\t\tsymbol.signature,\n\t\t\t]),\n\t\t)\n\t\tconst symbols = extractExports(text).map((symbol) => {\n\t\t\tconst signature = signatures.get(computeSymbolKey(symbol))\n\t\t\treturn signature === undefined\n\t\t\t\t? symbol\n\t\t\t\t: {\n\t\t\t\t\t\tname: symbol.name,\n\t\t\t\t\t\tkeyword: symbol.keyword,\n\t\t\t\t\t\tsignature,\n\t\t\t\t\t\t...(symbol.summary === undefined ? {} : { summary: symbol.summary }),\n\t\t\t\t\t}\n\t\t})\n\t\tthis.#signed.set(key, symbols)\n\t\treturn symbols\n\t}\n\n\t// The declared members of the `keyword` declaration named `name` unioned with\n\t// those of every declaration it extends, each carrying its own doc block's\n\t// description paragraph. `undefined` states one fact only — the module scope\n\t// declares no such head — which is what sends `methods()` on to the class\n\t// shape; a name already on the visit path is declared and returns an empty\n\t// union, so a cycle and a diamond each collapse to one visit. A base the scope\n\t// does not declare contributes nothing, and a member the declaration itself\n\t// documents answers ahead of the base it overrides.\n\t#members(\n\t\tkeyword: DeclarationKeyword,\n\t\tname: string,\n\t\tvisited: Set<string>,\n\t): readonly MethodEntry[] | undefined {\n\t\tif (visited.has(name)) return []\n\t\tvisited.add(name)\n\n\t\tconst declaration = this.#locate(keyword, name)\n\t\tif (declaration === undefined) return undefined\n\n\t\tconst methods = new Map<string, MethodEntry>()\n\t\tfor (const entry of extractMemberMethods(declaration.body)) methods.set(entry.name, entry)\n\t\tfor (const base of declaration.bases) {\n\t\t\tfor (const member of this.#members(keyword, base, visited) ?? []) {\n\t\t\t\tif (!methods.has(member.name)) methods.set(member.name, member)\n\t\t\t}\n\t\t}\n\n\t\treturn Array.from(methods.values()).sort((a, b) =>\n\t\t\ta.name === b.name ? 0 : a.name < b.name ? -1 : 1,\n\t\t)\n\t}\n\n\t// The one declaration that answers for `name`, read from the scope's declaration map,\n\t// which is collected once on first lookup and reused by every later one.\n\t#locate(keyword: DeclarationKeyword, name: string): Declaration | undefined {\n\t\tif (this.#declarations === undefined) this.#declarations = this.#scanDeclarations()\n\t\treturn this.#declarations.get(`${keyword} ${name}`)\n\t}\n\n\t// The inventory key of the file whose head answers for `name` under `keyword`, recorded by\n\t// the same scan as the declaration map.\n\t#origin(keyword: DeclarationKeyword, name: string): string | undefined {\n\t\treturn this.#locate(keyword, name) === undefined\n\t\t\t? undefined\n\t\t\t: this.#origins.get(`${keyword} ${name}`)\n\t}\n\n\t// The scope's declarations, keyed `${keyword} ${name}` — one `collectDeclarations`\n\t// pass per file in sorted key order, so a scope reads each file once however many\n\t// names it resolves. The first file whose located head has a body or bases answers\n\t// for a key, its body and bases read together, so a later file declaring the same\n\t// name contributes nothing. A located head with neither a body nor bases does not\n\t// declare; the scan continues past it to a later file or leaves the key unanswered.\n\t#scanDeclarations(): ReadonlyMap<string, Declaration> {\n\t\tconst declarations = new Map<string, Declaration>()\n\n\t\tfor (const key of selectModuleKeys(this.#files, this.#directories)) {\n\t\t\tconst text = this.#files[key]\n\t\t\tif (text === undefined) continue\n\n\t\t\tfor (const [identity, declaration] of collectDeclarations(text)) {\n\t\t\t\tif (declarations.has(identity)) continue\n\t\t\t\tif (declaration.body.length === 0 && declaration.bases.length === 0) continue\n\t\t\t\tdeclarations.set(identity, declaration)\n\t\t\t\tthis.#origins.set(identity, key)\n\t\t\t}\n\t\t}\n\n\t\treturn declarations\n\t}\n}\n","import type { SourceInterface, SourceManagerInterface, SourceManagerOptions } from '../types.js'\nimport { computeModuleKey } from '../helpers.js'\nimport { Source } from './Source.js'\n\n/**\n * Resolves a consumer-owned import-specifier policy into pure source views and\n * caches those views by module, so aliases for one module share one entity.\n * Unmapped specifiers remain foreign to the consumer and return `undefined`.\n * `sources()` enumerates the same shared views, one per distinct module the\n * policy maps.\n *\n * @example\n * ```ts\n * import { SourceManager } from '@orkestrel/guide'\n *\n * const sources = new SourceManager({\n * \tfiles: { 'src/core/index.ts': \"export * from './types.js'\" },\n * \tmodules: { '@scope/package': 'src/core' },\n * })\n * sources.source('@scope/package')?.surface()\n * sources.sources() // [the same shared view]\n * ```\n */\nexport class SourceManager implements SourceManagerInterface {\n\treadonly #files: Readonly<Record<string, string>>\n\treadonly #modules: SourceManagerOptions['modules']\n\treadonly #sources = new Map<string, SourceInterface>()\n\n\tconstructor(options: SourceManagerOptions) {\n\t\tthis.#files = options.files\n\t\tthis.#modules = options.modules\n\t}\n\n\tsource(specifier: string): SourceInterface | undefined {\n\t\tif (!Object.hasOwn(this.#modules, specifier)) return undefined\n\t\tconst module = this.#modules[specifier]\n\t\tif (module === undefined) return undefined\n\n\t\tconst key = computeModuleKey(module)\n\t\tconst existing = this.#sources.get(key)\n\t\tif (existing !== undefined) return existing\n\n\t\tconst source = new Source({ files: this.#files, module })\n\t\tthis.#sources.set(key, source)\n\t\treturn source\n\t}\n\n\tsources(): readonly SourceInterface[] {\n\t\tconst views: SourceInterface[] = []\n\t\tconst seen = new Set<SourceInterface>()\n\n\t\tfor (const specifier of Object.keys(this.#modules)) {\n\t\t\tconst view = this.source(specifier)\n\t\t\tif (view === undefined || seen.has(view)) continue\n\t\t\tseen.add(view)\n\t\t\tviews.push(view)\n\t\t}\n\n\t\treturn views\n\t}\n}\n","import type { MarkdownSpan } from '@orkestrel/markdown'\nimport type {\n\tDrift,\n\tManifestEntry,\n\tParityExampleResult,\n\tParityFinding,\n\tParityInterface,\n\tParityOptions,\n\tParityResult,\n\tParityRewriteResult,\n\tParityRow,\n\tSourceExample,\n} from './types.js'\nimport { isNonEmptyString } from '@orkestrel/contract'\nimport {\n\tbuildCell,\n\tcollectExamples,\n\tcollectTitles,\n\tcompareMembership,\n\tcomputeSymbolKey,\n\textractFenceImports,\n\tfindDrift,\n\tfindMissing,\n\tfindMissingSymbols,\n\tfindUnexampled,\n\tfindUnlisted,\n\tformatDrift,\n\tformatSide,\n\thasBehaviouralSurface,\n\tidentifyDrift,\n\tisExternalLink,\n\tlocateComment,\n\tnormalizeDirectories,\n\tnormalizeComment,\n\treplaceCell,\n\treplaceExample,\n\treplaceFence,\n\treplaceSummary,\n\tresolveLink,\n\tselectModuleKeys,\n\tspliceSpan,\n\tvalidateModules,\n} from './helpers.js'\nimport { METHODS, SIGNATURE, SUMMARY, SURFACE, TESTS } from './constants.js'\nimport { Guide } from './Guide.js'\nimport { GuideError, isGuideError } from './errors.js'\nimport { Source } from './sources/Source.js'\nimport { SourceManager } from './sources/SourceManager.js'\n\n/**\n * Composes generic guide-parity inspection and explicit in-memory rewrites over a caller inventory.\n */\nexport class Parity implements ParityInterface {\n\treadonly #options: ParityOptions\n\treadonly #rows: readonly ParityRow[]\n\n\tconstructor(options: ParityOptions) {\n\t\tthis.#options = {\n\t\t\tfiles: { ...options.files },\n\t\t\tentries: options.entries.map((entry) => ({ ...entry })),\n\t\t\tmodules: { ...options.modules },\n\t\t\tlanguages: [...options.languages],\n\t\t\tlanguage: options.language,\n\t\t\t...(options.pitch === undefined ? {} : { pitch: { ...options.pitch } }),\n\t\t\t...(options.declarations === undefined ? {} : { declarations: { ...options.declarations } }),\n\t\t}\n\t\tthis.#rows = this.#createRows(this.#options.files)\n\t}\n\n\trows(): readonly ParityRow[] {\n\t\treturn this.#rows\n\t}\n\n\tinspect(): ParityResult {\n\t\tconst input: ParityFinding[] = []\n\t\tconst sections: ParityFinding[] = []\n\t\tconst surface: ParityFinding[] = []\n\t\tconst methods: ParityFinding[] = []\n\t\tconst declarations: ParityFinding[] = []\n\t\tconst links: ParityFinding[] = []\n\t\tconst tests: ParityFinding[] = []\n\t\tconst fences: ParityFinding[] = []\n\t\tconst exampleFences: ParityFinding[] = []\n\t\tconst exampleFunctions: ParityFinding[] = []\n\t\tconst exampleMethods: ParityFinding[] = []\n\t\tconst exampleTitles: ParityFinding[] = []\n\t\tconst examples: ParityExampleResult = {\n\t\t\tfences: exampleFences,\n\t\t\tfunctions: exampleFunctions,\n\t\t\tmethods: exampleMethods,\n\t\t\ttitles: exampleTitles,\n\t\t}\n\t\tconst imports: ParityFinding[] = []\n\t\tconst drift: ParityFinding[] = []\n\t\tconst pitch: ParityFinding[] = []\n\n\t\tthis.#inspectInput(input)\n\t\tfor (const row of this.#rows) {\n\t\t\tthis.#inspectSections(row, sections)\n\t\t\tthis.#inspectSurface(row, surface)\n\t\t\tthis.#inspectMethods(row, methods)\n\t\t\tthis.#inspectDeclarations(row, declarations)\n\t\t\tthis.#inspectLinks(row, links, tests)\n\t\t\tthis.#inspectFences(row, fences)\n\t\t\tthis.#inspectExamples(row, exampleFences, exampleFunctions, exampleMethods, exampleTitles)\n\t\t\tthis.#inspectImports(row, imports)\n\t\t\tthis.#inspectDrift(row, drift)\n\t\t}\n\t\tthis.#inspectPitch(pitch)\n\n\t\treturn {\n\t\t\tinput,\n\t\t\tsections,\n\t\t\tsurface,\n\t\t\tmethods,\n\t\t\tdeclarations,\n\t\t\tlinks,\n\t\t\ttests,\n\t\t\tfences,\n\t\t\texamples,\n\t\t\timports,\n\t\t\tdrift,\n\t\t\tpitch,\n\t\t}\n\t}\n\n\tdocument(): ParityRewriteResult {\n\t\treturn this.#rewrite((row, drift, files) => this.#rewriteGuide(row, drift, files))\n\t}\n\n\tannotate(): ParityRewriteResult {\n\t\treturn this.#rewrite((row, drift, files) => this.#rewriteSource(row, drift, files))\n\t}\n\n\t#rewrite(\n\t\tapply: (row: ParityRow, drift: Drift, files: Map<string, string>) => string | undefined,\n\t): ParityRewriteResult {\n\t\tconst files = new Map(Object.entries(this.#options.files))\n\t\tconst reasons = new Map<string, string>()\n\t\tconst requested = new Set<string>()\n\n\t\tfor (const row of this.#rows) {\n\t\t\tfor (const drift of findDrift(row.guide, row.source)) {\n\t\t\t\tconst identity = identifyDrift(row.entry.spec, drift)\n\t\t\t\trequested.add(identity)\n\t\t\t\tconst reason = apply(row, drift, files)\n\t\t\t\tif (reason !== undefined) reasons.set(identity, reason)\n\t\t\t}\n\t\t}\n\n\t\tconst inventory = Object.fromEntries(files)\n\t\tconst remaining: ParityFinding[] = []\n\t\tconst result = new Parity({ ...this.#options, files: inventory })\n\t\tremaining.push(...result.inspect().input)\n\t\tfor (const row of result.rows()) {\n\t\t\tfor (const drift of findDrift(row.guide, row.source)) {\n\t\t\t\tconst identity = identifyDrift(row.entry.spec, drift)\n\t\t\t\tif (!requested.has(identity)) continue\n\t\t\t\tremaining.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${formatDrift(drift)}; ${reasons.get(identity) ?? 'the requested destination still disagrees'}`,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tconst changes = Array.from(files.entries())\n\t\t\t.filter(([path, content]) => this.#options.files[path] !== content)\n\t\t\t.sort(([left], [right]) => left.localeCompare(right))\n\t\t\t.map(([path, content]) => ({ path, content }))\n\t\treturn { changes, findings: remaining }\n\t}\n\n\t#createRows(files: Readonly<Record<string, string>>): readonly ParityRow[] {\n\t\tconst rows: ParityRow[] = []\n\t\tfor (const entry of this.#options.entries) {\n\t\t\tconst text = files[entry.spec]\n\t\t\tif (text === undefined) continue\n\t\t\tconst guide = this.#attribute(entry.spec, () => new Guide(text))\n\t\t\tthis.#attribute(entry.spec, () => validateModules(files, entry.source))\n\t\t\trows.push({\n\t\t\t\tentry,\n\t\t\t\tguide,\n\t\t\t\tsource: new Source({\n\t\t\t\t\tfiles,\n\t\t\t\t\tmodule: entry.source,\n\t\t\t\t\t...(this.#options.declarations === undefined\n\t\t\t\t\t\t? {}\n\t\t\t\t\t\t: { declarations: this.#options.declarations }),\n\t\t\t\t}),\n\t\t\t})\n\t\t}\n\t\treturn rows\n\t}\n\n\t// Runs one step over the guide at `spec` and names that guide in a coded refusal the step\n\t// raises, keeping the refusal's code and context and carrying it as the cause.\n\t#attribute<T>(spec: string, step: () => T): T {\n\t\ttry {\n\t\t\treturn step()\n\t\t} catch (error) {\n\t\t\tif (!isGuideError(error)) throw error\n\t\t\tthrow new GuideError(`${JSON.stringify(spec.slice(0, 200))}: ${error.message}`, error.code, {\n\t\t\t\tcause: error,\n\t\t\t\t...(error.context === undefined ? {} : { context: error.context }),\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectInput(findings: ParityFinding[]): void {\n\t\tif (this.#options.entries.length === 0) {\n\t\t\tfindings.push({ text: 'The manifest has no guide entries.' })\n\t\t}\n\t\tfor (const entry of this.#options.entries) {\n\t\t\tif (this.#options.files[entry.spec] !== undefined) continue\n\t\t\tfindings.push({ spec: entry.spec, text: `${entry.spec} is absent from the inventory.` })\n\t\t}\n\t}\n\n\t#inspectSections(row: ParityRow, findings: ParityFinding[]): void {\n\t\tconst sections = row.guide.sections()\n\t\tfor (const heading of [SURFACE, METHODS, TESTS]) {\n\t\t\tif (sections.includes(heading)) continue\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no ## ${heading} section.`,\n\t\t\t})\n\t\t}\n\t\tif (row.guide.methods().length === 0 && hasBehaviouralSurface(row.source)) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no documented method groups.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectSurface(row: ParityRow, findings: ParityFinding[]): void {\n\t\tif (row.guide.surface().length === 0) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} has no documented surface.` })\n\t\t}\n\t\tfor (const unnamed of row.guide.unnamed()) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has an unnamed row: ${unnamed}`,\n\t\t\t})\n\t\t}\n\t\tfor (const key of findMissingSymbols(row.source.exports(), row.source.surface())) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} does not re-export ${key}.` })\n\t\t}\n\t\tfor (const key of findMissingSymbols(row.source.surface(), row.source.exports())) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} barrel exposes no direct ${key}.`,\n\t\t\t})\n\t\t}\n\t\tfor (const key of findMissingSymbols(row.source.surface(), row.guide.surface())) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} does not document ${key}.` })\n\t\t}\n\t\tfor (const key of findMissingSymbols(row.guide.surface(), row.source.surface())) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} documents no barrel ${key}.` })\n\t\t}\n\t\tfor (const symbol of row.source.hidden()) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} source hides ${computeSymbolKey(symbol)}.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectMethods(row: ParityRow, findings: ParityFinding[]): void {\n\t\tfor (const group of row.guide.methods()) {\n\t\t\tconst documented = group.methods.map((entry) => entry.name)\n\t\t\tconst declared = row.source.methods(group.interface).map((entry) => entry.name)\n\t\t\tif (documented.length === 0) {\n\t\t\t\tfindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} ${group.interface} has no documented methods.`,\n\t\t\t\t})\n\t\t\t}\n\t\t\tfor (const name of findMissing(declared, documented)) {\n\t\t\t\tfindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} does not document ${group.interface}.${name}.`,\n\t\t\t\t})\n\t\t\t}\n\t\t\tfor (const name of findMissing(documented, declared)) {\n\t\t\t\tfindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} documents no source ${group.interface}.${name}.`,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst entity = group.interface.replace(/Interface$/, '')\n\t\t\tif (entity === group.interface) continue\n\t\t\tfor (const name of findMissing(\n\t\t\t\trow.source.methods(entity).map((entry) => entry.name),\n\t\t\t\tdocumented,\n\t\t\t)) {\n\t\t\t\tfindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} ${entity}.${name} is outside the ${group.interface} contract.`,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\t#inspectDeclarations(row: ParityRow, findings: ParityFinding[]): void {\n\t\tconst groups = row.guide.methods()\n\t\tconst documented = groups.map((group) => group.interface)\n\t\tconst declared = new Set(row.source.surface().map((symbol) => symbol.name))\n\t\tconst classes = new Set(\n\t\t\trow.source\n\t\t\t\t.surface()\n\t\t\t\t.filter((symbol) => symbol.keyword === 'class')\n\t\t\t\t.map((symbol) => symbol.name),\n\t\t)\n\n\t\tfor (const group of groups) {\n\t\t\tconst finding = compareMembership(\n\t\t\t\trow.entry.spec,\n\t\t\t\tgroup.interface,\n\t\t\t\tgroup.methods.map((entry) => entry.name),\n\t\t\t\trow.source.methods(group.interface).map((entry) => entry.name),\n\t\t\t)\n\t\t\tif (finding !== undefined) findings.push(finding)\n\t\t}\n\n\t\tfor (const symbol of row.source.surface()) {\n\t\t\tif (symbol.keyword !== 'interface' && symbol.keyword !== 'class') continue\n\t\t\t// A barrel exports a class and an interface of one name only as a declaration merge,\n\t\t\t// because two modules exporting the name would conflict, so the class answers for it.\n\t\t\tif (symbol.keyword === 'interface' && classes.has(symbol.name)) continue\n\t\t\tconst members = row.source.methods(symbol.name).map((entry) => entry.name)\n\t\t\tif (members.length === 0) continue\n\t\t\tconst contract = `${symbol.name}Interface`\n\t\t\tconst implementing = symbol.keyword === 'class' && declared.has(contract)\n\t\t\tif (implementing) {\n\t\t\t\tconst finding = compareMembership(\n\t\t\t\t\trow.entry.spec,\n\t\t\t\t\tsymbol.name,\n\t\t\t\t\trow.source.methods(contract).map((entry) => entry.name),\n\t\t\t\t\tmembers,\n\t\t\t\t)\n\t\t\t\tif (finding !== undefined) findings.push(finding)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (documented.includes(symbol.name)) continue\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} ${symbol.name} declares members and carries no method table.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectLinks(row: ParityRow, links: ParityFinding[], tests: ParityFinding[]): void {\n\t\tif (row.guide.links().length === 0) {\n\t\t\tlinks.push({ spec: row.entry.spec, text: `${row.entry.spec} has no links.` })\n\t\t}\n\t\tfor (const href of row.guide.links()) {\n\t\t\tif (isExternalLink(href)) continue\n\t\t\tconst path = resolveLink(row.entry.spec, href)\n\t\t\tif (row.source.exists(path)) continue\n\t\t\tlinks.push({ spec: row.entry.spec, text: `${row.entry.spec} has a broken link: ${href}.` })\n\t\t}\n\t\tif (row.guide.tests().length === 0) {\n\t\t\ttests.push({ spec: row.entry.spec, text: `${row.entry.spec} has no test links.` })\n\t\t}\n\t\tfor (const href of row.guide.tests()) {\n\t\t\tconst path = resolveLink(row.entry.spec, href)\n\t\t\tif (row.source.exists(path)) continue\n\t\t\ttests.push({ spec: row.entry.spec, text: `${row.entry.spec} has a missing test: ${href}.` })\n\t\t}\n\t}\n\n\t#inspectFences(row: ParityRow, findings: ParityFinding[]): void {\n\t\tfor (const fence of findUnlisted(row.guide.fences(), this.#options.languages)) {\n\t\t\tfindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has an unlisted fence language under ${fence.title ?? 'no heading'}: ${fence.language ?? 'absent'}.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectExamples(\n\t\trow: ParityRow,\n\t\tfencesFindings: ParityFinding[],\n\t\tfunctionFindings: ParityFinding[],\n\t\tmethodFindings: ParityFinding[],\n\t\ttitleFindings: ParityFinding[],\n\t): void {\n\t\tconst fences = row.guide\n\t\t\t.fences()\n\t\t\t.filter((fence) => fence.language === this.#options.language)\n\t\t\t.map((fence) => fence.code)\n\t\tif (fences.length === 0) {\n\t\t\tfencesFindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no ${this.#options.language} example fence.`,\n\t\t\t})\n\t\t}\n\t\tconst functions = row.guide\n\t\t\t.surface()\n\t\t\t.filter((symbol) => symbol.keyword === 'function')\n\t\t\t.map((symbol) => symbol.name)\n\t\tfor (const name of findUnexampled(\n\t\t\tfunctions,\n\t\t\tfences,\n\t\t\trow.source.examples().map((example) => example.name),\n\t\t)) {\n\t\t\tfunctionFindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no example for ${name}.`,\n\t\t\t})\n\t\t}\n\n\t\tfor (const group of row.guide.methods()) {\n\t\t\tconst entity = group.interface.replace(/Interface$/, '')\n\t\t\tconst examples = row.source.examples(group.interface).map((example) => example.name)\n\t\t\tif (entity !== group.interface) {\n\t\t\t\texamples.push(...row.source.examples(entity).map((example) => example.name))\n\t\t\t}\n\t\t\tfor (const name of findUnexampled(\n\t\t\t\tgroup.methods.map((entry) => entry.name),\n\t\t\t\tfences,\n\t\t\t\texamples,\n\t\t\t)) {\n\t\t\t\tmethodFindings.push({\n\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\ttext: `${row.entry.spec} has no example for ${group.interface}.${name}.`,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tconst guide = row.guide\n\t\t\t.fences()\n\t\t\t.map((fence) => fence.title)\n\t\t\t.filter(isNonEmptyString)\n\t\tconst source = row.source\n\t\t\t.examples()\n\t\t\t.map((example) => example.title)\n\t\t\t.filter(isNonEmptyString)\n\t\tif (!guide.some((title) => source.includes(title))) {\n\t\t\ttitleFindings.push({\n\t\t\t\tspec: row.entry.spec,\n\t\t\t\ttext: `${row.entry.spec} has no top-level example-title pair: guide ${JSON.stringify(guide)} source ${JSON.stringify(source)}.`,\n\t\t\t})\n\t\t}\n\t}\n\n\t#inspectImports(row: ParityRow, findings: ParityFinding[]): void {\n\t\tconst sources = new SourceManager({\n\t\t\tfiles: this.#options.files,\n\t\t\tmodules: this.#options.modules,\n\t\t})\n\t\tconst compared = Iterator.from(row.guide.fences()).reduce((previous, fence) => {\n\t\t\tif (fence.language !== this.#options.language) return previous\n\t\t\treturn Iterator.from(extractFenceImports(fence.code)).reduce((matched, imported) => {\n\t\t\t\tconst source = sources.source(imported.specifier)\n\t\t\t\tif (source === undefined) return matched\n\t\t\t\tconst surface = source.surface().map((symbol) => symbol.name)\n\t\t\t\tfor (const name of findMissing(imported.names, surface)) {\n\t\t\t\t\tfindings.push({\n\t\t\t\t\t\tspec: row.entry.spec,\n\t\t\t\t\t\ttext: `${row.entry.spec} imports missing ${name} from ${imported.specifier}.`,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t}, previous)\n\t\t}, false)\n\t\tif (!compared) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: `${row.entry.spec} has no mapped self import.` })\n\t\t}\n\t}\n\n\t#inspectDrift(row: ParityRow, findings: ParityFinding[]): void {\n\t\tfor (const drift of findDrift(row.guide, row.source)) {\n\t\t\tfindings.push({ spec: row.entry.spec, text: formatDrift(drift) })\n\t\t}\n\t}\n\n\t#inspectPitch(findings: ParityFinding[]): void {\n\t\tconst pitch = this.#options.pitch\n\t\tif (pitch === undefined) return\n\t\tconst readme = this.#options.files[pitch.readme]\n\t\tconst spec = this.#options.files[pitch.spec]\n\t\tif (readme === undefined) {\n\t\t\tfindings.push({ spec: pitch.readme, text: `${pitch.readme} is absent from the inventory.` })\n\t\t\treturn\n\t\t}\n\t\tif (spec === undefined) {\n\t\t\tfindings.push({ spec: pitch.spec, text: `${pitch.spec} is absent from the inventory.` })\n\t\t\treturn\n\t\t}\n\t\tconst left = this.#attribute(pitch.readme, () => new Guide(readme)).tagline()\n\t\tconst right = this.#attribute(pitch.spec, () => new Guide(spec)).tagline()\n\t\tif (left !== undefined && left === right) return\n\t\tfindings.push({\n\t\t\tspec: pitch.spec,\n\t\t\ttext: `${pitch.spec} pitch: README ${formatSide(left)} guide ${formatSide(right)}.`,\n\t\t})\n\t}\n\n\t#rewriteGuide(row: ParityRow, drift: Drift, files: Map<string, string>): string | undefined {\n\t\tif (drift.source === undefined) return 'source authority is absent'\n\t\tconst current = files.get(row.entry.spec)\n\t\tif (current === undefined) return 'the guide inventory text is absent'\n\n\t\tif (drift.category === 'summary') {\n\t\t\tconst replacement = replaceCell(current, drift.key, SUMMARY, buildCell(drift.source))\n\t\t\tif (replacement === undefined)\n\t\t\t\treturn 'the guide summary cell or its provenance is unavailable'\n\t\t\tfiles.set(row.entry.spec, replacement)\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (drift.category === 'signature') {\n\t\t\tconst signature = row.source\n\t\t\t\t.surface()\n\t\t\t\t.find((symbol) => computeSymbolKey(symbol) === drift.key)?.signature\n\t\t\tif (signature === undefined) return 'the computed signature is unavailable'\n\t\t\tconst replacement = replaceCell(current, drift.key, SIGNATURE, [\n\t\t\t\t{ element: 'codeSpan', value: signature },\n\t\t\t])\n\t\t\tif (replacement === undefined)\n\t\t\t\treturn 'the guide signature cell or its provenance is unavailable'\n\t\t\tfiles.set(row.entry.spec, replacement)\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst example = collectTitles(row.guide, row.source).get(drift.key)\n\t\tif (example === undefined) return 'the paired source example is unavailable'\n\t\tconst replacement = replaceFence(current, drift.key, example)\n\t\tif (replacement === undefined) return 'the titled guide fence or its provenance is unavailable'\n\t\tfiles.set(row.entry.spec, replacement)\n\t\treturn undefined\n\t}\n\n\t#rewriteSource(row: ParityRow, drift: Drift, files: Map<string, string>): string | undefined {\n\t\tif (drift.category === 'signature') return 'a signature is computed from the source declaration'\n\t\tif (drift.guide === undefined) return 'guide authority is absent'\n\t\tif (drift.category === 'summary') {\n\t\t\tconst located = this.#locateSource(row.entry, drift.key, files)\n\t\t\tif (located === undefined) return 'the source doc block or its provenance is unavailable'\n\t\t\tconst comment = located.text.slice(located.span.start, located.span.end)\n\t\t\tconst replacement = replaceSummary(comment, drift.guide)\n\t\t\tif (replacement === undefined) return 'the source summary cannot be represented safely'\n\t\t\tfiles.set(located.path, spliceSpan(located.text, located.span, replacement))\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst fence = row.guide.fences().find((entry) => entry.title === drift.key)\n\t\tconst located = this.#locateExample(row, drift.key, files)\n\t\tif (fence === undefined || located === undefined) {\n\t\t\treturn 'the paired source example or its provenance is unavailable'\n\t\t}\n\t\tconst comment = located.text.slice(located.span.start, located.span.end)\n\t\tconst example: SourceExample = {\n\t\t\tname: located.example.name,\n\t\t\ttitle: drift.key,\n\t\t\tcode: fence.code,\n\t\t\t...(fence.language === undefined ? {} : { language: fence.language }),\n\t\t}\n\t\tconst replacement = replaceExample(comment, example)\n\t\tif (replacement === undefined) return 'the guide example cannot be represented safely'\n\t\tfiles.set(located.path, spliceSpan(located.text, located.span, replacement))\n\t\treturn undefined\n\t}\n\n\t#locateSource(\n\t\tentry: ManifestEntry,\n\t\tkey: string,\n\t\tfiles: ReadonlyMap<string, string>,\n\t): { readonly path: string; readonly text: string; readonly span: MarkdownSpan } | undefined {\n\t\tconst inventory = Object.fromEntries(files)\n\t\tfor (const path of selectModuleKeys(inventory, normalizeDirectories(entry.source))) {\n\t\t\tconst text = files.get(path)\n\t\t\tif (text === undefined) continue\n\t\t\tconst span = locateComment(text, key)\n\t\t\tif (span !== undefined) return { path, text, span }\n\t\t}\n\t\treturn undefined\n\t}\n\n\t#locateExample(\n\t\trow: ParityRow,\n\t\ttitle: string,\n\t\tfiles: ReadonlyMap<string, string>,\n\t):\n\t\t| {\n\t\t\t\treadonly path: string\n\t\t\t\treadonly text: string\n\t\t\t\treadonly span: MarkdownSpan\n\t\t\t\treadonly example: SourceExample\n\t\t }\n\t\t| undefined {\n\t\tconst target = collectTitles(row.guide, row.source).get(title)\n\t\tif (target === undefined) return undefined\n\t\tconst keys: string[] = []\n\t\tfor (const symbol of row.source.exports()) {\n\t\t\tif (symbol.name === target.name) keys.push(computeSymbolKey(symbol))\n\t\t}\n\t\tfor (const owner of row.guide.surface()) {\n\t\t\tif (owner.keyword !== 'class' && owner.keyword !== 'interface') continue\n\t\t\tconst matched = row.source\n\t\t\t\t.examples(owner.name)\n\t\t\t\t.some((example) => example.name === target.name && example.title === title)\n\t\t\tif (matched) keys.push(`${owner.name}.${target.name}`)\n\t\t}\n\n\t\tconst inventory = Object.fromEntries(files)\n\t\tfor (const path of selectModuleKeys(inventory, normalizeDirectories(row.entry.source))) {\n\t\t\tconst text = files.get(path)\n\t\t\tif (text === undefined) continue\n\t\t\tconst selected = keys.reduce<\n\t\t\t\t{ readonly span: MarkdownSpan; readonly example: SourceExample } | undefined\n\t\t\t>((previous, key) => {\n\t\t\t\tconst span = locateComment(text, key)\n\t\t\t\tif (span === undefined) return previous\n\t\t\t\tconst comment = normalizeComment(text.slice(span.start, span.end))\n\t\t\t\tconst example = collectExamples(comment, target.name).find((entry) => entry.title === title)\n\t\t\t\tif (example === undefined) return previous\n\t\t\t\treturn previous === undefined || span.start < previous.span.start\n\t\t\t\t\t? { span, example }\n\t\t\t\t\t: previous\n\t\t\t}, undefined)\n\t\t\tif (selected !== undefined) return { path, text, ...selected }\n\t\t}\n\t\treturn undefined\n\t}\n}\n","import type { ContractInterface } from '@orkestrel/contract'\nimport type {\n\tDrift,\n\tGuideInterface,\n\tManifestEntry,\n\tMethodEntry,\n\tMethodGroup,\n\tSourceExample,\n\tSourceInterface,\n\tSourceManagerInterface,\n\tSourceManagerOptions,\n\tSourceOptions,\n\tSurfaceSymbol,\n} from './types.js'\nimport { createContract } from '@orkestrel/contract'\nimport { Guide } from './Guide.js'\nimport {\n\tdriftShape,\n\tmanifestEntryShape,\n\tmethodEntryShape,\n\tmethodGroupShape,\n\tsourceExampleShape,\n\tsurfaceSymbolShape,\n} from './shapers.js'\nimport { Source } from './sources/Source.js'\nimport { SourceManager } from './sources/SourceManager.js'\n\n/**\n * Creates a structured {@link GuideInterface} view over one guide's markdown\n * source — parses once and caches its `sections` / `surface` / `methods` /\n * `links` / `tests` / `fences` projections.\n *\n * @param source - The guide's markdown source text\n * @returns A working {@link GuideInterface}\n * @throws {@link GuideError} when a Surface header is nonuniform or a keyed Signature cell is empty.\n *\n * @example Construct a Guide from markdown text\n * ```ts\n * import { createGuide } from '@orkestrel/guide'\n *\n * const guide = createGuide(\n * \t'## Surface\\n\\n| Name | Kind | Signature | Summary |\\n| --- | --- | --- | --- |\\n| `X` | class | `new () => X` | |',\n * )\n * guide.surface() // [{ name: 'X', keyword: 'class', signature: '`new () => X`' }]\n * guide.sections() // ['Surface']\n * ```\n */\nexport function createGuide(source: string): GuideInterface {\n\treturn new Guide(source)\n}\n\n/**\n * Creates a pure {@link SourceInterface} over a consumer-supplied file\n * inventory — see {@link Source}.\n *\n * @param options - The file inventory and module scope to reflect\n * @returns A `SourceInterface` reflecting the given module scope\n *\n * @example Construct a Source from an inline files record\n * ```ts\n * import { createSource } from '@orkestrel/guide'\n *\n * const source = createSource({\n * \tfiles: {\n * \t\t'src/core/index.ts': \"export * from './Guide.js'\\nexport * from './types.js'\\n\",\n * \t\t'src/core/Guide.ts': 'export class Guide {}\\n',\n * \t\t'src/core/types.ts': 'export interface GuideInterface {\\n\\tsections(): void\\n}\\n',\n * \t},\n * \tmodule: 'src/core',\n * })\n * source.exports() // [{ name: 'Guide', keyword: 'class' }, { name: 'GuideInterface', keyword: 'interface' }]\n * source.surface() // [{ name: 'Guide', keyword: 'class' }, { name: 'GuideInterface', keyword: 'interface' }]\n * source.methods('GuideInterface') // [{ name: 'sections' }]\n * source.exists('src/core/Guide.ts') // true\n * source.exists('src/core') // true — a directory any inventory key sits beneath\n * ```\n */\nexport function createSource(options: SourceOptions): SourceInterface {\n\treturn new Source(options)\n}\n\n/**\n * Creates a {@link SourceManagerInterface} that resolves the consumer's local\n * import specifiers and shares one source view per module.\n *\n * @param options - The shared file inventory and specifier-to-module policy\n * @returns A source manager over the supplied policy\n *\n * @example Resolve a fence's import specifier to the right Source\n * ```ts\n * import { createSourceManager } from '@orkestrel/guide'\n *\n * const sources = createSourceManager({\n * \tfiles: {\n * \t\t'src/core/index.ts': \"export * from './Guide.js'\\n\",\n * \t\t'src/core/Guide.ts': 'export class Guide {}\\n',\n * \t},\n * \tmodules: { '@scope/package': 'src/core', '@scope/package/core': 'src/core' },\n * })\n *\n * sources.source('@scope/package')?.surface() // [{ name: 'Guide', keyword: 'class' }]\n * sources.source('node:fs') // undefined — a foreign import, which a fence check skips\n * sources.source('@scope/package') === sources.source('@scope/package/core') // true\n * sources.sources() // [the one shared view both specifiers name]\n * ```\n */\nexport function createSourceManager(options: SourceManagerOptions): SourceManagerInterface {\n\treturn new SourceManager(options)\n}\n\n/**\n * Compiles the {@link surfaceSymbolShape} into a {@link ContractInterface} for\n * {@link SurfaceSymbol} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `SurfaceSymbol` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createSurfaceSymbolContract } from '@orkestrel/guide'\n *\n * const surfaceSymbol = createSurfaceSymbolContract()\n * surfaceSymbol.is({ name: 'Markdown', keyword: 'class' }) // true\n * ```\n */\nexport function createSurfaceSymbolContract(): ContractInterface<SurfaceSymbol> {\n\treturn createContract(surfaceSymbolShape)\n}\n\n/**\n * Compiles the {@link methodEntryShape} into a {@link ContractInterface} for\n * {@link MethodEntry} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `MethodEntry` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createMethodEntryContract } from '@orkestrel/guide'\n *\n * const methodEntry = createMethodEntryContract()\n * methodEntry.is({ name: 'walk' }) // true\n * ```\n */\nexport function createMethodEntryContract(): ContractInterface<MethodEntry> {\n\treturn createContract(methodEntryShape)\n}\n\n/**\n * Compiles the {@link sourceExampleShape} into a {@link ContractInterface} for\n * {@link SourceExample} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `SourceExample` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createSourceExampleContract } from '@orkestrel/guide'\n *\n * const sourceExample = createSourceExampleContract()\n * sourceExample.is({ name: 'walk', code: 'walk()' }) // true\n * ```\n */\nexport function createSourceExampleContract(): ContractInterface<SourceExample> {\n\treturn createContract(sourceExampleShape)\n}\n\n/**\n * Compiles the {@link driftShape} into a {@link ContractInterface} for\n * {@link Drift} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `Drift` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createDriftContract } from '@orkestrel/guide'\n *\n * const drift = createDriftContract()\n * drift.is({ key: 'class Widget', category: 'summary', guide: 'A widget.' }) // true\n * ```\n */\nexport function createDriftContract(): ContractInterface<Drift> {\n\treturn createContract(driftShape)\n}\n\n/**\n * Compiles the {@link methodGroupShape} into a {@link ContractInterface} for\n * {@link MethodGroup} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `MethodGroup` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createMethodGroupContract } from '@orkestrel/guide'\n *\n * const methodGroup = createMethodGroupContract()\n * methodGroup.is({ interface: 'MarkdownInterface', methods: [{ name: 'walk' }] }) // true\n * ```\n */\nexport function createMethodGroupContract(): ContractInterface<MethodGroup> {\n\treturn createContract(methodGroupShape)\n}\n\n/**\n * Compiles the {@link manifestEntryShape} into a {@link ContractInterface} for\n * {@link ManifestEntry} — a guard, coercing parser, JSON Schema, and seeded\n * generator from one shape declaration (AGENTS.md § Design laws).\n *\n * @returns A `ManifestEntry` contract bundling `schema` / `is` / `parse` / `generate`\n *\n * @example\n * ```ts\n * import { createManifestEntryContract } from '@orkestrel/guide'\n *\n * const manifestEntry = createManifestEntryContract()\n * manifestEntry.is({ concept: 'Markdown', spec: 'guides/src/markdown.md', source: 'src/core', tests: 'tests/src/core' }) // true\n * ```\n */\nexport function createManifestEntryContract(): ContractInterface<ManifestEntry> {\n\treturn createContract(manifestEntryShape)\n}\n"],"mappings":";;;;;;;;;;;;;;AAUA,IAAa,kBAAkB,OAAO,OAAO;CAC5C;CACA;CACA;CACA;CACA;AACD,CAAgF;;;;AAKhF,IAAa,mBAAmB,OAAO,OAAO;CAC7C;CACA;CACA;AACD,CAA8D;;;;AAK9D,IAAa,UAAkB;;;;;;AAO/B,IAAa,cAAc,OAAO,OAAO;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAEC;;AAGD,IAAa,oBAAoB,OAAO,IAAI,6BAA6B;;;;AAKzE,IAAa,UAAkB;;;;AAK/B,IAAa,QAAgB;;;;AAK7B,IAAa,OAAe;;;;AAK5B,IAAa,YAAoB;;;;;AAMjC,IAAa,UAAkB;;;;AAK/B,IAAa,OAAe;;;;AAK5B,IAAa,iBAAoC,OAAO,OAAO;CAAC;CAAM;CAAM;CAAW;AAAO,CAAC;;;;AAK/F,IAAa,WAAmB;;;;;;;;;;;;;;;AAgBhC,IAAa,aAAqB;;;;;;AAOlC,IAAa,mBAAsC,OAAO,OAAO;CAChE;CACA;CACA;CACA;AACD,CAAC;;;ACjHD,IAAa,aAAb,cAAgC,MAAM;CACrC,OAAiC;CACjC;CACA;CAEA,YAAY,SAAiB,MAAiB,SAA6B;EAC1E,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO;EACZ,KAAK,UAAU,SAAS;EACxB,oBAAA,WAAW,OAAO,MAAM,mBAAmB,EAAE,OAAO,KAAK,CAAC;CA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