import { z } from 'zod';
export declare const CompileManifestSchema: z.ZodObject<{
    compiled_at: z.ZodString;
    model: z.ZodString;
    input_hash: z.ZodString;
    output_hash: z.ZodString;
    rule_count: z.ZodNumber;
    compile_worker_fingerprint: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    model: string;
    compiled_at: string;
    input_hash: string;
    output_hash: string;
    rule_count: number;
    compile_worker_fingerprint?: string | undefined;
}, {
    model: string;
    compiled_at: string;
    input_hash: string;
    output_hash: string;
    rule_count: number;
    compile_worker_fingerprint?: string | undefined;
}>;
export type CompileManifest = z.infer<typeof CompileManifestSchema>;
/**
 * Generate a deterministic SHA-256 hash of `.md` lesson files in a directory.
 *
 * Files are discovered recursively, sorted alphabetically by relative path,
 * and line endings are normalized to `\n` before hashing.
 *
 * When `repoCwd` is supplied and resolves inside a git repository, only
 * **git-tracked** lessons are hashed — untracked working-tree lessons (e.g. an
 * MCP `add_lesson`/`extract` scratch file) are excluded so they cannot diverge
 * the hash and block an unrelated push (mmnto-ai/totem#2051 / #2055
 * working-tree-scope class). The producer (`totem compile`) runs on a clean
 * tree, so the hash it records already equals the tracked-only hash; checkers
 * (`verify-manifest`, `lint`, `status`) pass `repoCwd` to stay symmetric
 * without forcing a recompile. Outside a git repo, or when git is unavailable,
 * the function falls back to hashing every `.md` (the legacy/pure behavior) —
 * so the default no-arg form is byte-for-byte unchanged.
 */
export declare function generateInputHash(lessonsDir: string, repoCwd?: string): string;
/**
 * Recursively shape an object tree so every nested record's keys are sorted
 * lexicographically and `undefined` properties are dropped. Pure data
 * transform — caller chooses how to serialize the result (minified for hash
 * payloads, pretty-printed for committable files).
 */
export declare function canonicalizeKeys(value: unknown): unknown;
/**
 * Stringify a value with deterministic key order. The 1-arg form returns
 * minified JSON (the manifest-hash payload form per mmnto/totem#1407). Pass
 * `indent` to produce pretty-printed canonical JSON (used for committable
 * artefacts like `.totem/verification-outcomes.json` per mmnto-ai/totem#1684).
 */
export declare function canonicalStringify(value: unknown, indent?: number): string;
/**
 * Generate a deterministic SHA-256 hash of the compiled rules file.
 *
 * Line endings are normalized to `\n` before hashing. For files that
 * contain at least one compound `astGrepYamlRule`, the payload is
 * re-serialised through `canonicalStringify` so key-order variation
 * inside the yaml object cannot shift the hash (mmnto/totem#1407).
 * Files without any compound rule keep the byte-stream path for
 * backward compatibility with manifests written by pre-#1407 CLIs:
 * the old and new computation match byte-for-byte in that case, so
 * every user's existing compile-manifest.json stays valid after
 * upgrading without a forced recompile.
 *
 * A parse failure falls back to the raw content so verify-manifest
 * can still catch tampering on partial writes; it does not mask the
 * error.
 */
export declare function generateOutputHash(rulesPath: string): string;
/**
 * Write a compile manifest to disk as pretty-printed JSON.
 */
export declare function writeCompileManifest(manifestPath: string, manifest: CompileManifest): void;
/**
 * Read and validate a compile manifest from disk.
 *
 * @throws {TotemParseError} if the file is missing or contains invalid JSON/schema.
 */
export declare function readCompileManifest(manifestPath: string): CompileManifest;
//# sourceMappingURL=compile-manifest.d.ts.map