/** * The lint runner's catalog table — one entry per rule namespace, total by * construction over `ExtensionType`. * * `axm lint` used to name its catalogs seven times over (an import list, a * group union, an evaluation tuple, a rendering list, a drift-detection call * sequence), and a catalog could be — and was — added to the barrel while * being silently skipped by the runner: `hookRules` shipped evaluated by the * publish gate but never by `axm lint`. * * Now every catalog is a key of {@link CatalogRuleContexts} and a row of * {@link LINT_CATALOGS}. Because the table is checked against * `Record`, adding an extension type to * `EXTENSION_TYPE_TABLE` fails compile here until its catalog is decided, and * deleting a key from `CatalogRuleContexts` fails compile at the row that * indexes it. * * @experimental This API is unstable and may change without notice. * @packageDocumentation */ import type { ExtensionType } from "../extensions/common.js"; import type { HookRuleContext, KnowledgeRuleContext, McpServerRuleContext, PackRuleContext, RuleRuleContext, SkillRuleContext, SubagentRuleContext, WorkspaceRuleContext } from "./context.js"; import type { LintRule } from "./rule.js"; /** * The contexts a full lint run evaluates, one array per catalog. * * `workspace` is the one pseudo-group: it is not an extension type, and it * always carries exactly the single workspace context. * * @experimental This API is unstable and may change without notice. */ export interface CatalogRuleContexts { readonly skill: ReadonlyArray; readonly pack: ReadonlyArray; readonly subagent: ReadonlyArray; readonly "mcp-server": ReadonlyArray; readonly rule: ReadonlyArray; readonly hook: ReadonlyArray; readonly knowledge: ReadonlyArray; readonly workspace: ReadonlyArray; } /** * A catalog key: every extension type, plus the `workspace` pseudo-group. * * Declared from `ExtensionType` rather than `keyof CatalogRuleContexts`, so * the two must agree: a new extension type leaves `CatalogRuleContexts` * missing a key, and a deleted `CatalogRuleContexts` key leaves * {@link CatalogContext} indexing a key that no longer exists. Either way the * build fails until the catalog is decided. * * @experimental This API is unstable and may change without notice. */ export type CatalogGroup = ExtensionType | "workspace"; /** Filesystem identity evaluated by a lint run. */ export type LintView = "workspace" | "git-index"; /** The context type a given catalog's rules consume. */ export type CatalogContext = CatalogRuleContexts[K][number]; /** * Every rule catalog, keyed by group. * * The annotation is the totality gate: the key set is `ExtensionType | * "workspace"`, and each value is checked against the context type * `CatalogRuleContexts` declares for that key. * * @experimental This API is unstable and may change without notice. */ export declare const REPOSITORY_LINT_CATALOGS: { readonly [K in CatalogGroup]: ReadonlyArray>>; }; /** Positive catalog of rules that require live operational state. */ export declare const LIVE_ONLY_LINT_CATALOGS: { workspace: readonly LintRule[]; }; /** Select positive rule catalogs for a view without an exclusion list. */ export declare const lintCatalogsForView: (view: LintView) => { readonly [K in CatalogGroup]: ReadonlyArray>>; }; /** Complete workspace catalog retained for callers that do not select a view. */ export declare const LINT_CATALOGS: { readonly skill: readonly LintRule>[]; readonly workspace: readonly LintRule[]; readonly "mcp-server": readonly LintRule>[]; readonly subagent: readonly LintRule>[]; readonly rule: readonly LintRule>[]; readonly hook: readonly LintRule>[]; readonly knowledge: readonly LintRule>[]; readonly pack: readonly LintRule>[]; }; /** * Catalog evaluation and rendering order. * * Findings render group-by-group in this order and the order is * test-observable, so it is declared explicitly rather than derived from * object key order. It matches `allCatalogRuleIds` in the catalog barrel; * `workspace` stays last. * * @experimental This API is unstable and may change without notice. */ export declare const CATALOG_GROUP_ORDER: readonly ["skill", "pack", "subagent", "mcp-server", "hook", "rule", "knowledge", "workspace"]; /** * An empty context record. Callers that evaluate only some catalogs spread * this so adding a catalog does not silently skip them. * * @experimental This API is unstable and may change without notice. */ export declare const emptyCatalogRuleContexts: CatalogRuleContexts; //# sourceMappingURL=catalog-contexts.d.ts.map