import { type AuthoredFixture, type AuthoredRuleInput, type AuthoredRuleRecord, type FrozenSplitArtifact, type ParsedRuleRecord } from '@mmnto/totem'; /** `.totem`-relative path to the authoring input. */ export declare const AUTHORED_RULES_REL: string; /** One ingested record: the resolved path, its LF-admitted content hash, and slice 1's parse. */ export interface IngestedRecord { /** The reference exactly as the envelope wrote it — informational, never identity. */ path: string; /** sha256 of the LF-admitted bytes — what every §8 attestation binds to. */ contentHash: string; parsed: ParsedRuleRecord; } /** * The closed set of § Design 1 shape rules an envelope `record:` reference can * violate. A runtime value, not a bare union, so the test table can assert every * rule has a negative fixture — the same discipline `GLOB_DIALECT_RULES` applies * on the record-grammar side. */ export declare const RECORD_REFERENCE_RULES: readonly ["separator", "absolute-path", "drive-letter", "unc-path", "empty-segment", "current-segment", "parent-segment", "records-dir-prefix", "suffix", "is-the-records-dir"]; export type RecordReferenceRule = (typeof RECORD_REFERENCE_RULES)[number]; /** * LEXICAL validation of a `record:` reference — pure string rules over the value * as written, run BEFORE any path resolution. * * Why lexical and why first (falsification leg MIN-2): `path.resolve` + * `path.relative` reach the same verdict for a POSIX-clean reference on every * platform, but they DIVERGE on the malformed ones. On win32 a backslash is a * separator and on linux it is a filename character; a drive-letter absolute that * happens to land inside the root passes containment; `//` collapses; and the * default filesystem case-insensitivity lets `.totem/Rules/x.rule.yaml` resolve * into the real directory on Windows and fail on linux. The reference is also * recorded VERBATIM in the tracked `authoring-ledger.ndjson`, so an accepted * absolute or backslashed form would commit a machine-specific path into a shared * attestation. These rules give one verdict on both platforms, on the text. * * Returns the violated rule, or `null` when the reference is well-formed. The * resolved-containment check in `resolveRecordPath` stays as the second line of * defence. */ export declare function checkRecordReference(totemDirName: string, reference: string): RecordReferenceRule | null; /** * Prop 310 § Design 10 / Amendment 1 — DERIVE each positive fixture's * `preimageSource` from the record's `examples[ordinal]`, keyed `(ruleId, ordinal)` * with the CR-blind pair hash as drift sensor. * * Called AFTER the identity is resolved, because the derived key carries the real * minted `ruleId` — deriving before the mint would anchor the pair to a placeholder. * A dangling ordinal and a duplicate ordinal both fail LOUD naming the rule and the * ordinal ("a dangling, duplicate, or hash-mismatched reference fails loud at * intake — never a silent re-pair"); the hash-mismatch leg is the ledger's own * `contentHash` comparison, which needs no second mechanism. */ export declare function deriveRecordFixtures(rule: AuthoredRuleInput, ingested: IngestedRecord, ruleId: string): AuthoredFixture[]; /** A rule the whitelist could not decide — recorded, not minted, not ledgered (no record reaches compile). */ export interface RejectedAuthoredRule { author: string; targetDefect: string; structuralClass: string; declaredEngine: string; reason: string; } export interface RuleAuthorResult { /** The eligible, materialized records (slice-B output; fed to the compiler in B2). */ records: AuthoredRuleRecord[]; /** Newly minted identities this run. */ minted: number; /** Existing identities with a material change → a new ledger revision (same ruleId). */ revised: number; /** Existing identities unchanged → no ledger append (idempotent re-read). */ unchanged: number; /** Non-decidable rules — excluded from the producer output, surfaced for the author. */ rejected: RejectedAuthoredRule[]; } /** * ADR-112 §8 — ingest `.totem/spine/authored-rules.yaml` into authored records + * the authoring-ledger. `judgedBy` names the independent check (NEVER the author) * recorded on every eligibility verdict. Pure + deterministic except the ledger IO. */ export declare function runRuleAuthor(totemDir: string, opts: { judgedBy: string; verifyOnly?: boolean; /** * ADR-112 §5.1/§8 R1 — the VERIFIED frozen split this authoring run binds to. * The caller (the command layer) resolves the artifact by the file's * content-addressed splitRef AND proves it on the shared ref * (spine-freeze-proof.ts) BEFORE handing it here — this git-free library * only enforces the binding facts. REQUIRED whenever the file's splitRef is * content-addressed (`split:`); forbidden otherwise. */ freezeBinding?: { artifact: FrozenSplitArtifact; }; /** * ADR-112 §5.2 leakage semantics (#2294 couple, operator option (a)): fixture * PRs the caller PROVED strictly pre-window by ancestry against the artifact's * `cutBoundarySha` (`verifyPreWindowFixturePrs`, spine-fixture-ancestry.ts — * the command layer owns the git; this library stays git-free and consumes * the verified result, the same seam as `freezeBinding`). Absent/empty ⇒ the * strict train-only behavior, byte-unchanged. */ verifiedPreWindowFixturePrs?: ReadonlySet; }): RuleAuthorResult; //# sourceMappingURL=authored-rule-intake.d.ts.map