/** * Citation-sidecar structural lint + orphan detection (#1503). * * TS-native port of section9 `scripts/corpus/lint_sidecars.py` (structural * lint) and `scripts/corpus/find_orphans.py` (zero-edge sidecars). These are * *sidecar-structural* checks — distinct from the generic `aiwg lint * --ruleset research` (note-level frontmatter/orphans) that the `research-lint` * skill runs. The `research-lint` skill references these for sidecar depth * rather than duplicating them (reconcile, don't duplicate). * * @source historical: corpus/lint_sidecars.py, corpus/find_orphans.py * @tests @test/unit/artifacts/sidecar-lint.test.ts */ /** * Structural lint for one sidecar's text. Mirrors `lint_sidecars.lint`: * - frontmatter present + has `ref:`/`title:`/`type:` * - has an Outgoing section + an Incoming section (merge-redirects exempt) * - no duplicate `| # | Title` table headers under the same sub-header * (the doubled-append bug pattern) */ export declare function lintSidecarText(text: string): string[]; export interface SidecarLintResult { totalFiles: number; filesWithIssues: number; totalIssues: number; /** issue label → ref ids exhibiting it */ byIssue: Record; } export declare function lintSidecars(root: string): SidecarLintResult; export declare function renderLint(r: SidecarLintResult): string; export interface Orphan { ref: string; title: string; } /** * Read the title from a reference analysis doc (`REF-NNN-*.md` or `REF-NNN.md`). * Prefers frontmatter `title:`, then the first `# ` heading in the body — so * docs that open with a `---` frontmatter block still yield a real title (the * section9 original read the literal first line and rendered `---`). */ export declare function refTitle(root: string, ref: string): string; /** Sidecars with zero incoming AND zero outgoing edges (lenient section scan). */ export declare function findOrphans(root: string): Orphan[]; export declare function renderOrphans(orphans: Orphan[]): string; //# sourceMappingURL=sidecar-lint.d.ts.map