/**
 * consolidation-operator.ts — Standalone operator vocabulary + validators
 * for the consolidation subsystem (issue #561, All-Mem paper
 * arxiv:2603.19595).
 *
 * This module is intentionally dependency-free so storage, the `remnic
 * doctor` check (PR 4), and the undo CLI (PR 5) can import the validators
 * without dragging in the full consolidation engine — which in turn pulls
 * in the Codex materialize runner and creates a `storage → consolidation
 * → codex-materialize-runner → storage` import cycle.
 *
 * The `semantic-consolidation.ts` module re-exports these symbols so
 * existing import paths continue to work.
 */
/**
 * Operator algebra for non-destructive consolidation.
 *
 * - `split`  — one source memory is rewritten as multiple smaller memories.
 * - `merge`  — multiple source memories are collapsed into one canonical
 *   memory.
 * - `update` — a newer value supersedes an older value within the same
 *   logical fact.
 * - `pattern-reinforcement` (issue #687 PR 2/4) — emitted by the
 *   pattern-reinforcement maintenance job when it clusters duplicate
 *   non-procedural memories and promotes the most recent member to
 *   canonical.  Unlike the other operators, the job does not produce
 *   page-versioning snapshots — it just stamps reinforcement metadata
 *   on the canonical and points superseded duplicates at it.  See
 *   `maintenance/pattern-reinforcement.ts`.
 */
type ConsolidationOperator = "split" | "merge" | "update" | "pattern-reinforcement";
/**
 * Allowed values for the `derived_via` frontmatter field.  Used by storage
 * validation to reject unknown operator values on write.
 */
declare const CONSOLIDATION_OPERATORS: readonly ConsolidationOperator[];
/**
 * Regular expression for validating a memory-id `derived_from` entry
 * (issue #687 PR 2/4).  Pattern reinforcement records source memory IDs
 * directly rather than page-versioning snapshots, so we also need to
 * accept that shape.
 *
 * Memory IDs are alphanumeric with hyphens, underscores, or COLONS —
 * the namespace-prefixed form (e.g. `global:fact-abc-123`,
 * `entity:person-alice`) is a legitimate ID format already used
 * throughout the graph-retrieval code path (`stripDerivedFromVersion`).
 * The disambiguation against `<path>:<version>` is *not* "no colons
 * allowed" — it's "the segment after the last colon must NOT be a
 * non-negative integer" (PR #730 review feedback, Codex P1).
 *
 * Slashes and dots remain forbidden so paths cannot accidentally pass
 * as memory IDs.
 *
 * Exported so the consolidation-provenance integrity scanner (PR
 * #730 review feedback) can recognize bare memory IDs instead of
 * flagging them as malformed snapshot references.
 */
declare const DERIVED_FROM_MEMORY_ID_RE: RegExp;
/**
 * Validate a `derived_from` entry string.  Returns `true` for either
 * - the snapshot format `<non-empty path>:<integer >= 0>` (issue #561), or
 * - a memory-id of the form `[A-Za-z0-9][A-Za-z0-9_:-]*` (issue #687
 *   PR 2/4 — used by pattern-reinforcement provenance).  Memory IDs
 *   may include `:` for namespace-prefixed forms like
 *   `global:fact-abc-123` (PR #730 review feedback, Codex P1).
 *
 * Disambiguation rule: only treat the entry as `<path>:<version>` when
 * the trailing segment after the last `:` is a non-negative integer
 * AND the left side looks like a path (contains `/` or `.`).
 * Otherwise treat the entire string as a memory ID.  This is the same
 * heuristic the graph retrieval path uses when splitting derived_from
 * references back into a memory id.
 *
 * Kept pure so storage and future CLI/doctor paths can share the same
 * validator.
 */
declare function isValidDerivedFromEntry(entry: unknown): entry is string;
/**
 * Type guard for `ConsolidationOperator`.
 */
declare function isConsolidationOperator(value: unknown): value is ConsolidationOperator;
/**
 * Narrow operator vocabulary for the LLM-driven semantic-consolidation
 * pass (issue #561 PR 3).  This explicitly excludes
 * `"pattern-reinforcement"` (issue #687 PR 2/4), which is reserved for
 * the maintenance job and must NEVER be emitted by the consolidation
 * LLM.  Without this narrow gate, a hallucinated
 * `{"operator":"pattern-reinforcement"}` response from the LLM would
 * write misleading provenance on a semantic-consolidation memory
 * (Cursor Bugbot review, PR #730 head `aa1c2a8`).
 */
type SemanticConsolidationLlmOperator = "split" | "merge" | "update";
/**
 * Type guard restricted to the operator subset the
 * semantic-consolidation LLM is allowed to emit.  Use this in any
 * code path that validates LLM output — `isConsolidationOperator` is
 * for validating values that came from disk / internal callers.
 */
declare function isSemanticConsolidationLlmOperator(value: unknown): value is SemanticConsolidationLlmOperator;

export { CONSOLIDATION_OPERATORS, type ConsolidationOperator, DERIVED_FROM_MEMORY_ID_RE, type SemanticConsolidationLlmOperator, isConsolidationOperator, isSemanticConsolidationLlmOperator, isValidDerivedFromEntry };
