/** * BASIS_CODES — vocabulary-controlled decision basis codes. * * Every DecisionBasis emitted by adjudicate() must have its `code` drawn from * the per-category constant here. This prevents semantic drift ("scope_ok" vs * "scope_sufficient" vs "scope-valid") in audit records. Adopters extend via * module augmentation, not free-form strings. * * See docs/basis-codes.md for extension guidelines. */ export type BasisCategory = "state" | "auth" | "taint" | "ledger" | "schema" | "business" | "validation" | "kill" | "deadline" | "confirmation" | "budget" | "kernel"; export declare const BASIS_CODES: { readonly state: { readonly TRANSITION_VALID: "transition_valid"; readonly TRANSITION_ILLEGAL: "transition_illegal"; readonly TERMINAL_STATE: "terminal_state"; readonly GRANT_EXPIRED: "grant_expired"; }; readonly auth: { readonly SCOPE_SUFFICIENT: "scope_sufficient"; readonly SCOPE_INSUFFICIENT: "scope_insufficient"; readonly IDENTITY_MISSING: "identity_missing"; readonly IDENTITY_EXPIRED: "identity_expired"; }; readonly taint: { readonly LEVEL_PERMITTED: "level_permitted"; readonly LEVEL_INSUFFICIENT: "level_insufficient"; readonly PROPAGATION_VIOLATION: "propagation_violation"; }; readonly ledger: { readonly FRESH: "fresh"; readonly REPLAY_SUPPRESSED: "replay_suppressed"; readonly RESOURCE_VERSION_STALE: "resource_version_stale"; }; readonly schema: { readonly VERSION_SUPPORTED: "version_supported"; readonly VERSION_UNSUPPORTED: "version_unsupported"; readonly PAYLOAD_INVALID: "payload_invalid"; readonly INTENT_HASH_MISMATCH: "intent_hash_mismatch"; }; readonly business: { readonly RULE_SATISFIED: "rule_satisfied"; readonly RULE_VIOLATED: "rule_violated"; readonly QUANTITY_CAPPED: "quantity_capped"; readonly BREAKGLASS_GRANTED: "breakglass_granted"; readonly BREAKGLASS_TTL_INVALID: "breakglass_ttl_invalid"; }; readonly validation: { readonly FORBIDDEN_PHRASE_ABSENT: "forbidden_phrase_absent"; readonly HOMOGLYPH_NORMALIZED: "homoglyph_normalized"; readonly UNICODE_NORMALIZED: "unicode_normalized"; readonly PII_DETECTED: "pii_detected"; readonly PII_REDACTED: "pii_redacted"; readonly PII_BLOCKED: "pii_blocked"; readonly COMMAND_FLAG_STRIPPED: "command_flag_stripped"; readonly COMMAND_SANITIZED: "command_sanitized"; readonly COMMAND_BLOCKED: "command_blocked"; readonly GROUNDEDNESS_LOW: "groundedness_low"; readonly GROUNDEDNESS_DEGRADED: "groundedness_degraded"; readonly SESSION_RISK_ELEVATED: "session_risk_elevated"; }; /** * Kill-switch — emitted when `setKillSwitch(true, ...)` is active. Blocks * every intent regardless of taint or policy default. Toggling the switch * is itself an audit-emitting operator action. */ readonly kill: { readonly ACTIVE: "active"; readonly SEAL_MISMATCH: "seal_mismatch"; }; /** * Deadline — emitted by `adjudicateWithDeadline` when wall-clock time * exceeded the supplied budget before adjudication completed. */ readonly deadline: { readonly EXCEEDED: "exceeded"; }; /** * Confirmation lifecycle — emitted by `adjudicateAndAudit` when an * `AdjudicateAndAuditDeps.confirmationReceipt` is supplied for an * envelope that would otherwise have produced REQUEST_CONFIRMATION. * The kernel substitutes EXECUTE with this basis appended so audit * records preserve the "kernel asked → user confirmed → now allowed" * causality in a single record. */ readonly confirmation: { readonly RECEIVED: "received"; }; /** * Capabilities-as-budgets (025) — emitted by `adjudicateAndAudit` when an * `AdjudicateAndAuditDeps.budgetGrant` is asserted by the impure shell for an * envelope that would otherwise have produced REQUEST_CONFIRMATION. The shell * asserts the grant ONLY after a successful atomic burn-down (a * single-use-counted decrement against the grant's limit), so this basis * records "a standing, human-granted budget satisfied the ask-first threshold * for THIS bounded substitution". Mirrors `confirmation.RECEIVED`: a * deterministic §C carve-out (a bounded pre-authorization, not a risk model * lowering a ceiling) — it ONLY ever substitutes EXECUTE for the * threshold-style outcome and NEVER weakens any state/taint/auth/business * guard. The grant's `budgetId` rides in `DecisionBasis.detail`. */ readonly budget: { readonly SATISFIED: "satisfied"; }; /** * Kernel-internal — emitted when the kernel itself produces a decision * because a guard threw (`GUARD_PANIC`) or when execution exceeded the * configured kernel deadline (`DEADLINE_EXCEEDED`, redundant with the * `deadline.EXCEEDED` code maintained for back-compat — prefer * `deadline.EXCEEDED` outside the kernel-internal path). * * `guard_panic` is the result of T-002 — the kernel wraps every guard * invocation in `try/catch` and converts a thrown error into a SECURITY * REFUSE rather than propagating to the adopter. The basis carries the * phase + matched-guard identity in `detail`. */ readonly kernel: { readonly GUARD_PANIC: "guard_panic"; readonly KERNEL_INTENT_DISPATCHED: "intent_dispatched"; }; }; export type BasisCodesMap = typeof BASIS_CODES; export type BasisCode = C extends BasisCategory ? BasisCodesMap[C][keyof BasisCodesMap[C]] : never; export type DecisionBasis = C extends BasisCategory ? { readonly category: C; readonly code: BasisCode; readonly detail?: Record; } : never; /** * Runtime guard — confirms a DecisionBasis carries a known code for its category. * Used by the "basis vocabulary purity" invariant test to catch drift before it * reaches an audit sink. */ export declare function isKnownBasisCode(basis: DecisionBasis): boolean; /** * Typed helper to construct a basis with compile-time vocabulary enforcement. * Prefer this over raw object literals at call sites. */ export declare function basis(category: C, code: BasisCode, detail?: Record): DecisionBasis; //# sourceMappingURL=basis-codes.d.ts.map