import type { CompiledDefinition } from './types.js'; export interface QueriedBlocks { /** block name → where the dashboard asks for it (sorted locations) */ blocks: Map; /** templated from: spellings ({field}) — unresolvable without evaluating */ unresolvable: string[]; } export interface CensusEntry { block: string; bucket: 'healthy' | 'dead-weight' | 'orphaned' | 'empty'; declared: boolean; /** the types that attach this block */ types: string[]; /** live records (outside _archive/) */ rows: number; /** records parked under _archive/ */ archivedRows: number; /** sidecar paths carrying the block, archive included */ sources: string[]; /** dashboard locations that read this block */ queried: string[]; notes: string[]; } export interface Census { entries: CensusEntry[]; /** queried, but neither declared nor populated — the dashboard asks for a * block that exists nowhere */ phantoms: { block: string; locations: string[]; }[]; unresolvable: string[]; /** live sidecars whose .md twin is absent — their records are unreachable * (the engine's sidecar-not-a-concept, restated as inventory) */ twinless: string[]; /** false when no dashboard was given: the queried axis is unknown, so * nothing can be proven healthy */ queriedKnown: boolean; } export interface CensusInput { def: CompiledDefinition; /** vault documents — only paths are read, for the twin check */ files: ReadonlyMap; sidecars: ReadonlyMap; dashboardYaml?: string | null; /** include: fragment path → text, resolved by the host (loadFragments / * the pushed tree) — the census never touches a filesystem */ fragments?: ReadonlyMap; /** E32 t1 — the named-view library, path → text. The queried axis walks * EVERY library file, referenced or not: which views a dashboard actually * places is an evaluation question, and QUERIED never evaluates. The * over-approximation is deliberate and cheap — a block read only by an * unreferenced library view reports healthy rather than dead-weight, * which errs on the side that never tells anyone to delete live records. */ views?: ReadonlyMap; } /** the archive shelf — t8's deletion gate offers moves into it */ export declare function isArchivePath(p: string): boolean; /** the blocks a dashboard reads, WITHOUT evaluating it — a broken dashboard * answers with whatever parses, never with a throw */ export declare function collectQueriedBlocks(dashboardYaml: string | null | undefined, fragments?: ReadonlyMap, views?: ReadonlyMap): QueriedBlocks; export declare function recordsCensus(input: CensusInput): Census;