import { loadTrackerConfig } from './config.js'; import { type CheckResult, type CoreRoot, type Finding, type IssueRecord } from './core/engine.js'; import type { RuleCategory } from './checkRules.js'; export type TrackerCheckOptions = { projectRoot?: string; config?: ReturnType; issues?: string[]; /** ZTB-33: `ztrack check --source ` — scope validation to the named declared source(s). * Absent = the whole union. Threaded to the loader/backend; when scoped to one source, * `crossSourceConflicts` cannot fire (there is nothing else to conflict with). */ sources?: string[]; failOnWarning?: boolean; categories?: Partial>; verifyCommits?: boolean; now?: string; phase?: 'all' | 'gate'; /** `ztrack check --preset `: an operator-supplied validation preset module, loaded in * place of the repo's configured `validation.entrypoint` — unconfined to the project (see * presetRegistry.ts's `loadOperatorPreset`). `check` only; threaded through to the single * resolution point (`resolveTrackerValidation`) shared by all three functions below. */ presetPath?: string; }; export type TrackerCheckResult = CheckResult & { loadedIssueIds?: string[]; /** Set only by `checkFile` when the target file parsed as DOCUMENT grammar (many issues, one * file — the same grammar a registered `format: "document"` source uses) and was validated as * such, instead of as one loose issue. `registeredName` is the declared source's `--source` * selector when the file IS one of the tracker's registered sources, else null — the CLI uses * null to OFFER `ztrack import --register` (never to run it: mutating * tracker-config.json is the user's call). `dialect` is set when the file matched a DIALECT * (docs/DIALECTS.md) rather than the native grammar — declared on a registered source, or * detected (`detectDialect`) on an unregistered file — and names the dialect the offer should * carry (`--register --dialect `). */ documentFile?: { dialect?: string; path: string; issueIds: string[]; registeredName: string | null; }; }; /** Validate the live tracker store. */ export declare function checkTracker(options?: TrackerCheckOptions): Promise; export declare function fileToRecord(absPath: string, content: string, diagnostics?: Finding[]): IssueRecord; /** Validate a single markdown file against the installed preset. A file in DOCUMENT grammar * (id-bearing section headings) is checked as the multi-issue document it is — see * `checkDocumentFile` above. A file that instead matches a DIALECT — declared on a registered * source, else detected (`detectDialect`'s ≥2-explicit-status floor) — is checked through that * lens (`checkDialectFile`). Anything else is treated as ONE loose issue. The file need not be * in the tracker — `ztrack check ./some-issue.md`. */ export declare function checkFile(filePath: string, options?: TrackerCheckOptions): Promise; /** Validate an already-exported, validated root (committed CI artifact / `--input`). * The root is the export shape `{ issues: [...] }` — never a legacy snapshot. */ export declare function checkTrackerRoot(root: unknown, options?: TrackerCheckOptions): Promise;