pub enum AttestationKind {
Show 18 variants
Examples {
file_hash: ContentHash,
count: usize,
},
Spec {
spec_id: SpecId,
method: SpecMethod,
trials: Option<usize>,
},
DiffBody {
other_body_hash: ContentHash,
input_count: usize,
},
TypeCheck,
EffectAudit,
SandboxRun {
effects: BTreeSet<String>,
},
Override {
actor: String,
reason: String,
target_attestation_id: Option<AttestationId>,
},
Defer {
actor: String,
reason: String,
},
Block {
actor: String,
reason: String,
},
Unblock {
actor: String,
reason: String,
},
Trace {
run_id: TraceRunId,
root_target: SigId,
},
ProducerBlock {
tool_id: String,
reason: String,
blocked_at: u64,
},
ProducerUnblock {
tool_id: String,
reason: String,
unblocked_at: u64,
},
RepairHint {
failed_op_id: OpId,
errors: Value,
suggested_transform: Option<Value>,
},
RepairAttempt {
hint_id: OpId,
outcome: String,
applied_op_id: Option<OpId>,
},
ProducerTrust {
tool_id: String,
score_thousandths: u32,
evidence: String,
granted_by: String,
},
TrustWaived {
producer: String,
score_thousandths: u32,
threshold_thousandths: u32,
kind_tag: String,
},
CapsuleInstall {
artifact: String,
content_hash: ContentHash,
signer: String,
effective_grant: String,
},
}Expand description
What was verified. The variants mirror the verdict surfaces
lex agent-tool and the store-write gate already produce.
Variants§
Examples
lex agent-tool --examples FILE — body was run against
{input, expected} pairs.
Spec
lex spec check or lex agent-tool --spec FILE — a
behavioral contract was checked against the body.
DiffBody
lex agent-tool --diff-body 'src' — a second body was run on
the same inputs and the outputs compared.
TypeCheck
Emitted by the store-write gate (#130) on every accepted op. The store can answer “the HEAD typechecks” as a queryable fact rather than an implicit invariant.
EffectAudit
Emitted by lex audit --effect K when no violations are
found. Useful as a trust signal that a stage was checked
against a specific effect-policy revision.
SandboxRun
Emitted by lex agent-tool on a successful sandboxed run.
effects is the set the sandbox actually allowed; useful for
answering “did this code run under fs_write?” after the fact.
Override
Human-issued override (lex-tea v3, #172). Records that a
human took an action that bypassed an automatic verdict
— e.g. activating a stage despite a Spec::Failed or
TypeCheck::Failed attestation. Subject to the same
trust trail as agent attestations: the audit fact lives
in the log alongside what it overrode.
actor is the human’s identifier (today: LEX_TEA_USER
env var or --actor flag; v3b adds session auth).
target_attestation_id points at the attestation being
overridden, when one exists; for unconditional pins
(e.g. activate-by-default) it can be None.
Defer
lex stage defer (lex-tea v3b, #172). Records that a human
looked at the stage and chose to revisit it later. No state
change — purely an audit/triage signal so dashboards and AI
reviewers can see “this isn’t abandoned, it’s snoozed.”
Block
lex stage block (lex-tea v3b, #172). Records that a human
has decided this stage should not activate. lex stage pin
and any other activation path consults the attestation log
and refuses while a Block is the latest decision for the
stage. Reversed by AttestationKind::Unblock.
Unblock
lex stage unblock (lex-tea v3b, #172). Counterpart to
AttestationKind::Block. The attestation log is append-
only, so we encode “block lifted” as a separate, later fact
rather than mutating the original block.
Trace
lex run --trace finalized a [lex_trace::TraceTree] (#246).
Links the trace blob to the stage that was the run’s entry
point. The trace itself stays at
<store>/traces/<run_id>/trace.json (per
docs/design/trace-vs-vcs.md); this attestation is the
audit-side hook so lex attest filter --kind trace and
cross-store sync can reason about runs without copying the
trace bytes.
root_target is the entry function’s SigId — the call site
the user (or agent) typed on the command line. Distinct from
Attestation::stage_id, which records the content-addressed
stage the entry function resolved to; the same root_target
across multiple body edits surfaces as multiple
(stage_id, root_target) rows in the attestation log.
ProducerBlock
Retroactive producer quarantine (#248). Declares “as of
blocked_at, attestations produced by tool_id are no
longer trusted; the branch advance gate must refuse to move
past any op whose attestations were produced by this tool
at or after blocked_at.”
Distinct from policy.json’s blocked_producers (#181):
that is a forward-going read-time tag for the activity
feed; this is a write-time gate on branch advance, retro-
active to a specific timestamp. The two compose cleanly —
blocked_producers filters what reviewers see; ProducerBlock
stops a compromised tool’s history from being promoted past
a known-bad point.
Stored at the attestation log under stage_id == tool_id
so the by-stage index doubles as a by-tool lookup for these
records — no schema break, no separate index needed.
Attestation::stage_id carries the tool_id for these
records; the variant payload duplicates it for clarity in
the JSON.
ProducerUnblock
Counterpart to AttestationKind::ProducerBlock (#248). The
attestation log is append-only, so revoking a producer block
is a separate, later fact rather than a delete. The branch
advance gate honors the most recent verdict for each
tool_id by timestamp.
RepairHint
Auto-emitted by Store::apply_operation_checked when an op
is rejected for TypeError (#281). Records the failed op’s
id, the structured type-error envelope, and an optional
suggested-transform payload (left empty by the gate; the
lex repair --apply flow populates it via LLM call). The
hint is attached to the candidate stage that didn’t
typecheck, so lex_vcs::AttestationLog::list_for_stage
surfaces it on the next read.
Schema: errors and suggested_transform are
serde_json::Value to keep this crate independent of
lex-types::TypeError (which lives downstream) and to let
the slice-2 LLM integration ship without a schema bump.
RepairAttempt
Records one iteration of lex repair --apply (#281). The
repair loop emits a chain of RepairAttempts — one per
applied transform — so the audit trail walks the agent’s
fix progression.
Fields
ProducerTrust
Positive trust signal for a producer (#293). Complement to
Self::ProducerBlock. Computed from a producer’s recent
history of (passed, failed, inconclusive) attestations;
not manually set. score_thousandths is in [0, 1000]
(representing 0.0 .. 1.0); fixed-point because
AttestationKind is Eq for content-addressed hashing,
which f64 doesn’t implement. Consumers (the
required_attestations gate) may waive a requirement
when the latest score for a tool exceeds a configured
threshold in policy.required_attestations[].skip_if_producer_trust_thousandths_above.
Refuses to grant trust to a tool with an active
ProducerBlock (the hard veto wins).
Stored under stage_id == tool_id so the by-stage index
doubles as a per-tool lookup — same trick ProducerBlock
uses.
Fields
score_thousandths: u32Score × 1000, clamped to [0, 1000]. Derived from
passed / (passed + failed + inconclusive) over the
last window attestations from this tool.
TrustWaived
Records that the required_attestations gate waived a
requirement because the producer’s ProducerTrust score
exceeded the configured threshold (#293). Audit signal —
not load-bearing for gate decisions, but ensures every
skip is recoverable from the attestation log.
Fields
CapsuleInstall
A capsule installed cleanly under lex-os (lex-os#36 / #38).
Promotes the tamper-evident CapsuleInstalled record from a
lex-os capsule install --audit-out log into a durable,
content-addressed attestation, via lex attest import-install.
In the capsule distribution model the publisher’s signing key
is the producer identity, so these records are stored under
stage_id == signer and carry produced_by.tool == signer
— the same convention ProducerBlock / ProducerTrust use.
That makes a publisher’s install track record feed
recompute_producer_trust (which scores produced_by.tool)
and, through it, the trusted-keys keyring that capsule install --trusted-keys consumes. The loop closes: install → attestation
→ earned trust → keyring → next install.
Fields
content_hash: ContentHashHex SHA-256 of the published archive bytes — the publish-time identity of exactly which bytes installed. Empty when imported from a pre-content-hash audit log.
Trait Implementations§
Source§impl Clone for AttestationKind
impl Clone for AttestationKind
Source§fn clone(&self) -> AttestationKind
fn clone(&self) -> AttestationKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AttestationKind
impl Debug for AttestationKind
Source§impl<'de> Deserialize<'de> for AttestationKind
impl<'de> Deserialize<'de> for AttestationKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AttestationKind
Source§impl PartialEq for AttestationKind
impl PartialEq for AttestationKind
Source§fn eq(&self, other: &AttestationKind) -> bool
fn eq(&self, other: &AttestationKind) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AttestationKind
impl Serialize for AttestationKind
impl StructuralPartialEq for AttestationKind
Auto Trait Implementations§
impl Freeze for AttestationKind
impl RefUnwindSafe for AttestationKind
impl Send for AttestationKind
impl Sync for AttestationKind
impl Unpin for AttestationKind
impl UnsafeUnpin for AttestationKind
impl UnwindSafe for AttestationKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.