@sema-agent/core
Version:
Stateless, task-oriented AI agent core
33 lines (32 loc) • 2.89 kB
TypeScript
/**
* The checkpoint screen's chain comparison, the part that is not the digest: the one spelling difference it reads as no difference,
* and the causes its refusal (`resume.parent_constraint_mismatch`) names in `detail.reason` — `constraint_changed` (the chain the
* resume runs under is not the row's), `constraint_unjudgeable` (the chain could not be judged); the row judge names the third,
* `constraint_chain_damaged`, and `chainInstallationRefusal` (child-tree.ts) the three `installation_record_*` words.
*/
import { CheckpointError } from "../checkpoint-features.js";
import type { ConstraintChainEntry } from "../tool-policy.js";
/** `resume.parent_constraint_mismatch` for a re-supplied chain that is not the one the row recorded: another layer count, or a
* layer whose facts or frozen deny data differ. */
export declare const chainChanged: (message: string) => CheckpointError;
/** `resume.parent_constraint_mismatch` for a chain that could not be judged: an entry that is neither one caller policy nor one
* installation, or a judgment that threw. */
export declare const chainUnjudgeable: (message: string) => CheckpointError;
/**
* The chain rung's refusal with its cause — every `resume.parent_constraint_mismatch` the rung answers carries a `detail.reason`.
* One that reaches it without one (an engine refusal thrown from inside a layer while the chain was rebuilt or judged, which the
* rung passes through as it was thrown) is a chain that could not be judged: answered as the one copy (`copyOfCheckpointError`: its
* message and cause where they can be read) with `constraint_unjudgeable`; the thrown object itself is not edited. Any other refusal
* is returned as it is.
*/
export declare function withMismatchCause(refusal: CheckpointError | undefined): CheckpointError | undefined;
/**
* One value, two spellings: an entry with no frozen component and a live remainder (`{ components: [], requiresLiveRemainder: true }`,
* what `combinePolicies(p, createAllowDenyPolicy({}))` projects for an opaque `p`) and an opaque entry (`{ opaque: true }`) both
* freeze nothing and leave the whole decision to the live policy — the frozen deny layers execute no component of either, and the
* edit re-adjudication refuses an edit under either. A re-supplied entry spelled one way, against a row that recorded the other at
* its position, is read in the row's spelling, its layer facts its own; any other difference stays a difference (the remainder bit
* of an entry that freezes nothing, a component, the order or repeats of components or names). The row's digest then decides, as it
* does for every chain — a row whose chain was edited to the other spelling authenticates nothing it did not before.
*/
export declare function inRecordedSpelling(supplied: ConstraintChainEntry, recorded: ConstraintChainEntry | undefined): ConstraintChainEntry;