proposit-core
    Preparing search index...

    Interface TArgumentLifecycle<TArg, TPremise, TExpr, TVar>

    Snapshot, rollback, and reactive subscription lifecycle. Static factory methods (fromSnapshot, fromData) are class-level only.

    interface TArgumentLifecycle<
        TArg extends TCoreArgument = TCoreArgument,
        TPremise extends TCorePremise = TCorePremise,
        TExpr extends TCorePropositionalExpression = TCorePropositionalExpression,
        TVar extends TCorePropositionalVariable = TCorePropositionalVariable,
    > {
        getSnapshot(): TReactiveSnapshot<TArg, TPremise, TExpr, TVar>;
        normalize(
            tier?: "structural" | "evaluable" | "derivable" | "presentable",
        ): void;
        rollback(
            snapshot: TArgumentEngineSnapshot<TArg, TPremise, TExpr, TVar>,
        ): void;
        snapshot(): TArgumentEngineSnapshot<TArg, TPremise, TExpr, TVar>;
        subscribe(listener: () => void): () => void;
        validate(
            tier: "structural" | "evaluable" | "derivable" | "presentable",
        ): readonly {
            argumentId?: string;
            claimId?: string;
            code:
                | "S-1"
                | "S-2"
                | "S-3"
                | "S-4"
                | "S-5"
                | "S-6"
                | "S-7"
                | "S-8"
                | "S-9"
                | "S-10"
                | "S-11"
                | "S-12"
                | "S-13"
                | "S-14"
                | "E-1"
                | "E-3"
                | "E-4"
                | "E-5"
                | "E-6"
                | "E-7"
                | "D-1"
                | "D-2"
                | "D-3"
                | "D-4"
                | "D-5"
                | "D-6"
                | "P-1"
                | "P-2"
                | "P-3"
                | "P-4"
                | "P-5";
            expressionId?: string;
            message: string;
            premiseId?: string;
            tier: "structural"
            | "evaluable"
            | "derivable"
            | "presentable";
            variableId?: string;
        }[];
        validateInvariants(): TInvariantValidationResult;
    }

    Type Parameters

    Implemented by

    Index

    Methods

    • Global normalize pass per spec §6. Runs the AN rule set (AN-1..AN-4) everywhere it can fire, converging the argument toward tier (defaults to 'presentable').

      normalize is non-destructive in the logical-meaning sense — it does not delete variables, change claim references, or modify operator semantics. Recovery from Evaluable or Derivable violations requires user intent and is exposed via the repair primitives.

      In v1.0 every AN rule targets a Presentable invariant, so calls with tier ∈ {'structural', 'evaluable', 'derivable'} are effectively no-ops. The parameter exists as forward-compatible API surface.

      Bypasses behavior: cleanup runs regardless of whether the engine is in 'assistive' or 'permissive' mode.

      Parameters

      • Optionaltier: "structural" | "evaluable" | "derivable" | "presentable"

      Returns void

      1.0.0

    • Registers a listener that is called after every mutation.

      Parameters

      • listener: () => void

        The callback to invoke on mutation.

      Returns () => void

      An unsubscribe function that removes the listener.

    • Four-tier grammar validation per spec §4. Returns the union of violations from Structural up through tier'structural' returns S-rule violations only, 'evaluable' returns S + E, 'derivable' returns S + E + D, 'presentable' returns the full union. Empty array means the argument is at the requested tier or stricter. Never throws on grammar issues.

      For the invariant sweep (schema/reference/checksums) see TArgumentLifecycle.validateInvariants.

      Parameters

      • tier: "structural" | "evaluable" | "derivable" | "presentable"

      Returns readonly {
          argumentId?: string;
          claimId?: string;
          code:
              | "S-1"
              | "S-2"
              | "S-3"
              | "S-4"
              | "S-5"
              | "S-6"
              | "S-7"
              | "S-8"
              | "S-9"
              | "S-10"
              | "S-11"
              | "S-12"
              | "S-13"
              | "S-14"
              | "E-1"
              | "E-3"
              | "E-4"
              | "E-5"
              | "E-6"
              | "E-7"
              | "D-1"
              | "D-2"
              | "D-3"
              | "D-4"
              | "D-5"
              | "D-6"
              | "P-1"
              | "P-2"
              | "P-3"
              | "P-4"
              | "P-5";
          expressionId?: string;
          message: string;
          premiseId?: string;
          tier: "structural"
          | "evaluable"
          | "derivable"
          | "presentable";
          variableId?: string;
      }[]

    • Run a comprehensive invariant validation sweep on the entire argument. Checks schema conformance, reference integrity, ownership, conclusion-ref + circularity, and per-premise validation.

      Distinct from TArgumentLifecycle.validate, which runs the four-tier grammar validator (Structural ⊇ Evaluable ⊇ Derivable ⊇ Presentable). The two are complementary — grammar tiers cover AST-shape rules; this method covers schema/reference/structural-bookkeeping invariants that sit outside the tier hierarchy.

      Returns TInvariantValidationResult

      1.0.0 — replaces the pre-1.0 validate() no-arg overload, which has been removed.