/** * @fileoverview Rule-ID mapping — engine slug → OpenSIP-convention rule ID. * * The engine's `Rule.slug` follows the pattern `graph:` (e.g. * `graph:orphan-subtree`) per `engine/src/types.ts`. OpenSIP's rule-ID * convention is `..` — a three-segment * dot-separated form that lets the reconciler classify findings by family * (dead-code vs duplication vs safety, etc.) without parsing message text. * * For graph-emitted findings, the first segment is always `graph` (the * source package). The second segment is the rule family the engine rule * belongs to (`dead-code`, `duplication`, `safety`). The third segment * is the specific rule. * * The mapping is a frozen constant — adding a new rule to the engine * requires updating this table explicitly. An unknown slug throws a typed * error so a missing mapping fails loudly at SARIF emission rather than * silently producing a wrong rule ID downstream. * * Co-located with the SARIF emitter (Task 2.2) so the conversion is * testable in isolation. Phase 2 Task 2.1 per DEC-498. */ /** * Mapping from engine `Rule.slug` to OpenSIP-convention rule ID. * * Every entry in `engine/src/rules/registry.ts`'s `BUILT_IN_RULES` MUST * have an entry here. Tests in `__tests__/render/rule-id-mapping.test.ts` * enforce coverage by iterating `currentRules()`. */ export declare const RULE_ID_MAPPING: Readonly>; /** * OpenSIP-convention rule ID regex. Three dot-separated segments, lowercase * kebab-case allowed in each segment. The SARIF emitter asserts every * `result.ruleId` matches this; tests verify the regex against every * mapping entry. */ export declare const OPENSIP_RULE_ID_REGEX: RegExp; /** * Translate an engine slug to its OpenSIP-convention rule ID. * * @throws {ValidationError} when `slug` is not in `RULE_ID_MAPPING`. This * is a programmer error (a rule was added to the engine registry * without updating this table), not a runtime input issue — fail loudly * at SARIF emission rather than emit an invalid wire format. */ export declare function mapEngineSlugToOpenSipRuleId(slug: string): string; /** * Inverse of {@link RULE_ID_MAPPING}: OpenSIP rule ID → engine slug. The * mapping is 1:1, so the inverse is unambiguous. Used by the `--workspace` * parent to recover engine slugs from child envelopes (whose signals carry * the Option-A-mapped OpenSIP rule ID) before building the dashboard session * payload, whose per-rule metric columns are keyed on engine slugs. */ export declare const OPENSIP_RULE_ID_TO_ENGINE_SLUG: Readonly>; /** * Translate an OpenSIP-convention rule ID back to its engine slug. Returns * the input unchanged when it is already an engine slug (or otherwise * unmapped) so callers can pass through signals that were never remapped. */ export declare function mapOpenSipRuleIdToEngineSlug(ruleId: string): string; //# sourceMappingURL=rule-id-mapping.d.ts.map