Skip to main content

SqliteReceiptStore

Struct SqliteReceiptStore 

Source
pub struct SqliteReceiptStore { /* private fields */ }

Implementations§

Source§

impl SqliteReceiptStore

Source

pub fn record_capability_snapshot( &self, token: &CapabilityToken, parent_capability_id: Option<&str>, ) -> Result<(), CapabilityLineageError>

Record a capability snapshot at issuance time.

Identical duplicate inserts are idempotent. Conflicting projections are rejected before the first-writer-wins insert.

The parent_capability_id argument must refer to a capability already present in the lineage table. If it is Some but the parent is missing, the depth defaults to 1 (the minimum delegation depth).

Source

pub fn record_capability_snapshot_with_timeout( &self, token: &CapabilityToken, parent_capability_id: Option<&str>, budget: Duration, ) -> Result<(), CapabilityLineageError>

Bounded variant of [record_capability_snapshot]: the writer round trip is capped at budget. The evaluation hot path uses this so a wedged or dying commit writer that passed the pre-dispatch liveness check but stalls on this snapshot cannot hang the request inside an unbounded write.

Source

pub fn upsert_capability_snapshot( &mut self, snapshot: &CapabilitySnapshot, ) -> Result<(), CapabilityLineageError>

Upsert an already-materialized capability snapshot.

This is used by cluster replication so followers can converge on the leader’s lineage table without reconstructing full signed tokens.

Source

pub fn get_lineage( &self, capability_id: &str, ) -> Result<Option<CapabilitySnapshot>, CapabilityLineageError>

Retrieve a single capability snapshot by its ID.

Returns None if no snapshot exists for the given capability_id.

Source

pub fn get_delegation_chain( &self, capability_id: &str, ) -> Result<Vec<CapabilitySnapshot>, CapabilityLineageError>

Walk the delegation chain for a capability, returning root-first ordering.

Uses a WITH RECURSIVE CTE that walks from the given capability up through its parent chain, tracking depth level. The ORDER BY level DESC produces root-first ordering because the root has the highest level value.

A max-depth guard (level < 20) prevents infinite recursion caused by accidental cycles in the parent chain.

Source

pub fn list_capabilities_for_subject( &self, subject_key: &str, ) -> Result<Vec<CapabilitySnapshot>, CapabilityLineageError>

List all capability snapshots for a given subject key.

Returns snapshots ordered newest-first by issued_at.

Source

pub fn list_capability_snapshots( &self, subject_key: Option<&str>, issuer_key: Option<&str>, ) -> Result<Vec<CapabilitySnapshot>, CapabilityLineageError>

List capability snapshots filtered by subject and/or issuer.

If both filters are present they are combined with AND semantics. Results are ordered deterministically oldest-first to keep reputation corpus construction stable across runs.

Source

pub fn list_capability_snapshots_after_seq( &self, after_seq: u64, limit: usize, ) -> Result<Vec<StoredCapabilitySnapshot>, CapabilityLineageError>

Return capability lineage snapshots added after a given local sequence.

The sequence is the SQLite rowid, which is monotonic for this append-only table and therefore suitable as a replication cursor.

Source

pub fn max_lineage_seq(&self) -> Result<u64, ReceiptStoreError>

Highest lineage snapshot seq (capability_lineage rowid), or 0 when empty. list_capability_snapshots_after_seq paginates on rowid, so the head is MAX(rowid). Returns ReceiptStoreError so the cluster status path converts it through the same CliError variant as the receipt heads.

Source§

impl SqliteReceiptStore

Source

pub fn build_evidence_export_bundle( &self, query: &EvidenceExportQuery, ) -> Result<EvidenceExportBundle, EvidenceExportError>

Build a local-only evidence export bundle from the current SQLite store.

This method never fabricates joins that the runtime does not persist. Tool receipts can be scoped by capability or agent subject. Child receipts do not currently have the same attribution fields, so they are either included by query window or omitted with an explicit scope flag.

Source

pub fn build_evidence_export_bundle_with_transparency( &self, query: &EvidenceExportQuery, ) -> Result<(EvidenceExportBundle, CheckpointTransparencySummary), EvidenceExportError>

Build a bundle and its transparency summary with one checkpoint validation pass.

Source

pub fn build_evidence_export_transparency_summary( &self, checkpoints: &[KernelCheckpoint], ) -> Result<CheckpointTransparencySummary, EvidenceExportError>

Source§

impl SqliteReceiptStore

Source

pub fn query_receipts( &self, query: &ReceiptQuery, ) -> Result<ReceiptQueryResult, ReceiptStoreError>

Query tool receipts with multi-filter support and cursor-based pagination.

Filters are applied with AND semantics. The cursor parameter enables forward-only pagination using the seq column as a stable cursor.

The limit is capped at MAX_QUERY_LIMIT. total_count reflects the full filtered set (no cursor applied), regardless of the page limit.

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source

pub fn tool_receipt_count(&self) -> Result<u64, ReceiptStoreError>

Source

pub fn child_receipt_count(&self) -> Result<u64, ReceiptStoreError>

Source

pub fn list_tool_receipts( &self, limit: usize, capability_id: Option<&str>, tool_server: Option<&str>, tool_name: Option<&str>, decision_kind: Option<&str>, ) -> Result<Vec<ChioReceipt>, ReceiptStoreError>

Source

pub fn list_tool_receipts_with_context( &self, read_context: &ReceiptReadContext, limit: usize, capability_id: Option<&str>, tool_server: Option<&str>, tool_name: Option<&str>, decision_kind: Option<&str>, ) -> Result<Vec<ChioReceipt>, ReceiptStoreError>

Source

pub fn list_tool_receipts_for_subject( &self, subject_key: &str, ) -> Result<Vec<ChioReceipt>, ReceiptStoreError>

List all tool receipts attributed to a given subject public key.

Uses the persisted subject_key column when present and falls back to the capability lineage join for older rows.

Source

pub fn list_tool_receipts_for_subject_with_context( &self, read_context: &ReceiptReadContext, subject_key: &str, ) -> Result<Vec<ChioReceipt>, ReceiptStoreError>

Source

pub fn list_tool_receipts_after_seq( &self, after_seq: u64, limit: usize, ) -> Result<Vec<StoredToolReceipt>, ReceiptStoreError>

Source

pub fn list_tool_receipts_after_seq_with_context( &self, read_context: &ReceiptReadContext, after_seq: u64, limit: usize, ) -> Result<Vec<StoredToolReceipt>, ReceiptStoreError>

Source

pub fn list_child_receipts( &self, limit: usize, session_id: Option<&str>, parent_request_id: Option<&str>, request_id: Option<&str>, operation_kind: Option<&str>, terminal_state: Option<&str>, ) -> Result<Vec<ChildRequestReceipt>, ReceiptStoreError>

Source

pub fn list_child_receipts_with_context( &self, read_context: &ReceiptReadContext, limit: usize, session_id: Option<&str>, parent_request_id: Option<&str>, request_id: Option<&str>, operation_kind: Option<&str>, terminal_state: Option<&str>, ) -> Result<Vec<ChildRequestReceipt>, ReceiptStoreError>

Source

pub fn list_child_receipts_after_seq( &self, after_seq: u64, limit: usize, ) -> Result<Vec<StoredChildReceipt>, ReceiptStoreError>

Source

pub fn list_child_receipts_after_seq_with_context( &self, read_context: &ReceiptReadContext, after_seq: u64, limit: usize, ) -> Result<Vec<StoredChildReceipt>, ReceiptStoreError>

Source§

impl SqliteReceiptStore

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self, ReceiptStoreError>

Source

pub fn wait_for_writer_ready( &self, timeout: Duration, ) -> Result<(), ReceiptStoreError>

Wait until the commit actor has seeded its durable head before a host advertises readiness. The flush barrier is processed only after actor initialization, and the serving check preserves a poisoned-head failure.

Source

pub fn open_existing(path: impl AsRef<Path>) -> Result<Self, ReceiptStoreError>

Source

pub fn open_with_pool_config( path: impl AsRef<Path>, pool_config: SqlitePoolConfig, ) -> Result<Self, ReceiptStoreError>

Source

pub fn open_with_options( path: impl AsRef<Path>, options: SqliteStoreOptions, ) -> Result<Self, ReceiptStoreError>

Source

pub fn open_existing_with_options( path: impl AsRef<Path>, options: SqliteStoreOptions, ) -> Result<Self, ReceiptStoreError>

Source

pub fn open_with_pool_sizes( path: impl AsRef<Path>, reader_pool_max_size: u32, writer_pool_max_size: u32, ) -> Result<Self, ReceiptStoreError>

Source§

impl SqliteReceiptStore

Source

pub fn append_chio_receipt_returning_seq( &self, receipt: &ChioReceipt, ) -> Result<u64, ReceiptStoreError>

Source

pub fn store_checkpoint( &self, checkpoint: &KernelCheckpoint, ) -> Result<(), ReceiptStoreError>

Store a signed KernelCheckpoint in the kernel_checkpoints table.

Source

pub fn load_checkpoint_by_seq( &self, checkpoint_seq: u64, ) -> Result<Option<KernelCheckpoint>, ReceiptStoreError>

Load a KernelCheckpoint by its checkpoint_seq.

Source

pub fn receipts_canonical_bytes_range( &self, start_seq: u64, end_seq: u64, ) -> Result<Vec<(u64, Vec<u8>)>, ReceiptStoreError>

Return canonical JSON bytes for receipts with seq in [start_seq, end_seq], ordered by seq.

Uses RFC 8785 canonical JSON for deterministic Merkle leaf hashing.

Source

pub fn db_size_bytes(&self) -> Result<u64, ReceiptStoreError>

Return the current on-disk size of the database in bytes.

Uses PRAGMA page_count and PRAGMA page_size to compute the size without requiring a filesystem stat, which is consistent in WAL mode.

Source

pub fn live_db_size_bytes(&self) -> Result<u64, ReceiptStoreError>

Live logical size in bytes: (page_count - freelist_count) * page_size. Unlike db_size_bytes (on-disk, freelist included), this drops after an archival delete plus incremental_vacuum, so a size-driven rotation trigger converges instead of re-firing on freed-but-not-reclaimed pages.

Source

pub fn oldest_receipt_timestamp(&self) -> Result<Option<u64>, ReceiptStoreError>

Return the Unix timestamp (seconds) of the oldest receipt in the live database, or None if there are no receipts.

Source

pub fn oldest_receipt_timestamp_for_tenant( &self, tenant_id: &str, ) -> Result<Option<u64>, ReceiptStoreError>

Return the oldest live receipt timestamp for a tenant.

Source

pub fn archive_receipts_before( &self, cutoff_unix_secs: u64, archive_path: &str, ) -> Result<u64, ReceiptStoreError>

Archive all receipts whose entire checkpointed prefix has aged past cutoff_unix_secs, co-archiving the claim-log projection and reconciliation evidence, then deleting the archived range from the live store, all on the single writer connection. Returns the number of tool-receipt rows archived.

Source

pub fn rotate_if_needed( &self, config: &RetentionConfig, ) -> Result<u64, ReceiptStoreError>

Check the time and size thresholds and, if either is exceeded, run a checkpoint-aligned rotation on the writer connection.

  • Time threshold: receipts older than config.retention_days days age out of the checkpointed prefix.
  • Size threshold: if the live database size exceeds max_size_bytes, the median-timestamp cutoff archives roughly the checkpointed half.

Returns the number of tool-receipt rows archived (0 when no whole checkpointed batch has fully aged, i.e. a no-op rotation).

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source

pub fn record_session_anchor_record( &self, session_id: &str, anchor_id: &str, auth_context_fingerprint: &str, issued_at: u64, supersedes_anchor_id: Option<&str>, anchor_json: &Value, ) -> Result<(), ReceiptStoreError>

Source

pub fn record_request_lineage_record( &self, session_id: &str, request_id: &str, parent_request_id: Option<&str>, session_anchor_id: Option<&str>, recorded_at: u64, request_fingerprint: Option<&str>, lineage_json: &Value, ) -> Result<(), ReceiptStoreError>

Source

pub fn record_receipt_lineage_statement_record( &self, child_receipt_id: &str, request_id: Option<&str>, session_id: Option<&str>, session_anchor_id: Option<&str>, parent_request_id: Option<&str>, parent_receipt_id: Option<&str>, chain_id: Option<&str>, recorded_at: u64, statement_json: &Value, ) -> Result<(), ReceiptStoreError>

Source

pub fn receipt_lineage_verification( &self, receipt_id: &str, ) -> Result<Option<ReceiptLineageVerification>, ReceiptStoreError>

Source

pub fn append_child_receipt_record( &self, receipt: &ChildRequestReceipt, ) -> Result<u64, ReceiptStoreError>

Source

pub fn append_child_receipt_record_with_timeout( &self, receipt: &ChildRequestReceipt, budget: Duration, ) -> Result<u64, ReceiptStoreError>

Deadline-bounded variant of [append_child_receipt_record]. Fails closed with ReceiptStoreError::Timeout if the commit round trip exceeds budget, so a wedged writer cannot pin the kernel-wide receipt write lock while nested-flow child receipts drain.

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source§

impl SqliteReceiptStore

Source

pub fn max_tool_receipt_seq(&self) -> Result<u64, ReceiptStoreError>

Highest tool-receipt replication seq, or 0 on an empty store. Single indexed MAX read; does not materialize the store.

Source

pub fn max_child_receipt_seq(&self) -> Result<u64, ReceiptStoreError>

Highest child-receipt replication seq, or 0 on an empty store.

Source

pub fn with_strict_tenant_isolation(&self, strict: bool)

Multi-tenant receipt isolation: toggle strict-isolation mode on tenant-scoped queries.

When strict = true, a tenant_filter = Some(id) query returns ONLY rows whose tenant_id = id. Pre-multitenant receipts with tenant_id IS NULL are excluded.

When strict = false, the same query also includes rows where tenant_id IS NULL – the pre-multitenant “public” fallback set – so pre-multitenant (NULL-tagged) receipts remain visible during an explicit compatibility window.

A tenant_filter = None admin / compat query always returns every row regardless of this setting.

Source

pub fn strict_tenant_isolation_enabled(&self) -> bool

Read the current strict-tenant-isolation setting.

Source

pub fn incremental_verification_enabled(&self) -> bool

Read-only after open (staged-rollout flag).

Source

pub fn append_chio_receipt_canonical( &self, canonical: Arc<CanonicalBytes>, ) -> Result<(), ReceiptStoreError>

Source

pub fn append_chio_receipt_canonical_bytes( &self, canonical: Arc<CanonicalBytes>, ) -> Result<(), ReceiptStoreError>

Source

pub fn append_chio_receipt_canonical_returning_seq( &self, canonical: Arc<CanonicalBytes>, ) -> Result<u64, ReceiptStoreError>

Source

pub fn append_chio_receipt_canonical_bytes_returning_seq( &self, canonical: Arc<CanonicalBytes>, ) -> Result<u64, ReceiptStoreError>

Source

pub fn writer_liveness( &self, stall_threshold: Duration, ) -> ReceiptWriterLiveness

Best-effort writer liveness derived from the commit-actor counters, assessed against the operator-configured stall_threshold. See [classify_writer_liveness] for the transition rules.

Source

pub fn append_chio_receipt_consuming_authorization( &self, receipt: &ChioReceipt, consumption: &AuthorizationReceiptConsumption, ) -> Result<(), ReceiptStoreError>

Source

pub fn flush_receipt_writes( &self, ) -> Result<ReceiptFlushReport, ReceiptStoreError>

Source

pub fn retention_repair( &self, archive_path: &str, ) -> Result<u64, ReceiptStoreError>

Recover a store whose claim-log projection rows survived a source-row delete. Fail-closed: only removes claim-log extra rows (absent from both source tables) that are (a) present in the named archive and (b) at or below the smallest checkpoint batch_end_seq that covers them, so the uncheckpointed suffix is never touched. Returns the number of rows removed.

Dispatched as its own writer-actor command (RetentionRepair), not writer_handle().run_write: a Write job is rejected outright while the head is Poisoned (see handle_non_append_command’s Write arm), which is exactly the state a bricked store’s writer actor is in on open, so run_write can never reach the store this method exists to repair. RetentionRepair runs unconditionally on the single writer connection (still fully serialized with every other writer command, same single-writer discipline as run_write), like ReseedHead and Rotate, and reseeds the head on success so the same store instance is appendable again without requiring a fresh open.

Source

pub fn audit_receipt_cost_projection(&self) -> Result<(), ReceiptStoreError>

Source

pub fn reseed_verified_head(&self) -> Result<(), ReceiptStoreError>

Rerun the one-time full verification on the writer connection and adopt the resulting head. This is the chio receipt audit --repair entry point; it is also safe to call on a healthy store.

Source

pub fn enable_background_checkpoints( &self, signer: BackgroundCheckpointSigner, ) -> Result<(), ReceiptStoreError>

Install the background checkpoint signer. Idempotent per store (a second call replaces the signer). Until called, the store appends without producing checkpoints.

Source

pub fn flush_receipt_writes_with_timeout( &self, timeout: Duration, ) -> Result<ReceiptFlushReport, ReceiptStoreError>

Source

pub fn record_retention_rotation_outcome(&self, failure: Option<&str>)

Record the outcome of a background retention rotation into health. None clears a prior failure after a successful rotation; Some(message) records a rotation error or panic so a persistently failing background maintenance task surfaces as unhealthy in receipt_store_health instead of the failure living only in the worker’s logs. Called by the kernel maintenance worker on the store handle it holds; the health snapshot is shared across all handles of this store, so the failure is visible to any other handle sampling health.

Source

pub fn receipt_store_health( &self, ) -> Result<ReceiptStoreHealthReport, ReceiptStoreError>

Source

pub fn writer_serving_closed(&self) -> bool

Whether the commit writer can no longer be trusted to persist receipts, so the kernel pre-dispatch gate must deny before a tool executes. True when the supervised writer thread has left the healthy state, and also when the writer’s verified head is poisoned: the thread is alive but every append is rejected until an operator reseeds.

Source

pub fn receipt_store_health_read_only( path: &Path, ) -> Result<ReceiptStoreHealthReport, ReceiptStoreError>

Sample receipt-store health from a READ-ONLY connection.

The SIEM serve-mode watchdog observes a receipt DB the kernel owns; it must not create it, switch it to WAL, or spin a writer pool on it, matching the read-only receipt-polling contract. open does all three, so it cannot be used on a read-only mount and would create an empty DB on a mistyped path. This opens a single READ_ONLY connection instead: a missing file reports NotFound rather than being created, and a read-only mount is sampled without any write attempt.

A read-only observer cannot see the owning writer’s in-memory counters, so writer is defaulted; the checkpoint-progress fields the watchdog gauges consume (committed/checkpointed seqs and the uncheckpointed range) are computed from the read connection with the same helpers as receipt_store_health.

Source

pub fn latest_committed_entry_seq(&self) -> Result<u64, ReceiptStoreError>

Source

pub fn latest_checkpointed_entry_seq(&self) -> Result<u64, ReceiptStoreError>

Source

pub fn next_checkpoint_range( &self, max_batch: u64, ) -> Result<Option<ReceiptCheckpointRange>, ReceiptStoreError>

Source

pub fn receipt_checkpoint_status( &self, max_batch: Option<u64>, ) -> Result<ReceiptCheckpointStatusReport, ReceiptStoreError>

Source

pub fn create_next_receipt_checkpoint( &self, max_batch: u64, keypair: &Keypair, ) -> Result<ReceiptCheckpointCreateReport, ReceiptStoreError>

Trait Implementations§

Source§

impl ReceiptStore for SqliteReceiptStore

Source§

fn append_chio_receipt( &self, receipt: &ChioReceipt, ) -> Result<(), ReceiptStoreError>

Source§

fn settlement_store_binding(&self) -> Option<SettlementStoreBinding>

Identify the durable writer shared with a settlement outcome store.
Source§

fn atomic_receipt_projection(&self) -> AtomicReceiptProjection

Report the atomic receipt-sidecar projection implemented by this store.
Source§

fn supports_atomic_receipt_projection_with_timeout(&self) -> bool

Whether the atomic receipt projection also honors the supplied append deadline. Settlement runtime installation requires this capability so a legacy atomic-only store cannot reintroduce an unbounded writer wait.
Source§

fn append_chio_receipt_with_pending_observation( &self, receipt: &ChioReceipt, pending: &PendingSettlementObservation, ) -> Result<(), ReceiptStoreError>

Atomically append a receipt and its initial settlement observation. Read more
Source§

fn append_chio_receipt_with_pending_observation_and_timeout( &self, receipt: &ChioReceipt, pending: &PendingSettlementObservation, budget: Duration, ) -> Result<Option<u64>, ReceiptStoreError>

Atomically append a receipt and its initial settlement observation while honoring the receipt-append deadline on stores with an async writer. Read more
Source§

fn load_chio_receipt( &self, receipt_id: &str, ) -> Result<Option<ChioReceipt>, ReceiptStoreError>

Load a chio receipt by id. The provided default returns None; a store backing a store-authoritative deployment MUST override this (and load_child_receipt) with a real point lookup. Read more
Source§

fn load_child_receipt( &self, receipt_id: &str, ) -> Result<Option<ChildRequestReceipt>, ReceiptStoreError>

Load a child-request receipt by id. Provided default returns None; a store used for a store-authoritative deployment must override both this and load_chio_receipt. A miss is a fail-closed deny of the dependent call-chain claim, never a false allow. The same bounded-mirror eviction caveat documented on load_chio_receipt applies.
Source§

fn append_chio_receipt_canonical( &self, _receipt: &ChioReceipt, canonical: &CanonicalBytes, ) -> Result<(), ReceiptStoreError>

Source§

fn append_chio_receipt_returning_seq( &self, receipt: &ChioReceipt, ) -> Result<Option<u64>, ReceiptStoreError>

Source§

fn append_chio_receipt_with_timeout( &self, receipt: &ChioReceipt, budget: Duration, ) -> Result<Option<u64>, ReceiptStoreError>

Append a receipt, failing closed with ReceiptStoreError::Timeout if the commit round trip exceeds budget. The default ignores the budget and keeps the unbounded behavior for stores without an async writer; a store with a commit actor overrides this so a wedged writer cannot pin the kernel-wide receipt write lock indefinitely.
Source§

fn writer_liveness(&self, stall_threshold: Duration) -> ReceiptWriterLiveness

Point-in-time writer liveness, assessed against the operator-configured stall threshold. Default Unknown keeps stores with no async writer, or no watchdog wired, permissive at the pre-dispatch gate; such stores ignore the threshold.
Source§

fn append_chio_receipt_consuming_authorization( &self, receipt: &ChioReceipt, consumption: &AuthorizationReceiptConsumption, ) -> Result<(), ReceiptStoreError>

Source§

fn receipts_canonical_bytes_range( &self, start_seq: u64, end_seq: u64, ) -> Result<Vec<(u64, Vec<u8>)>, ReceiptStoreError>

Source§

fn flush_receipt_writes(&self) -> Result<ReceiptFlushReport, ReceiptStoreError>

Source§

fn flush_receipt_writes_with_timeout( &self, timeout: Duration, ) -> Result<ReceiptFlushReport, ReceiptStoreError>

Source§

fn receipt_store_health( &self, ) -> Result<ReceiptStoreHealthReport, ReceiptStoreError>

Source§

fn writer_serving_closed(&self) -> bool

Whether the store’s commit writer has degraded to the point that durable persistence can no longer be trusted, so evaluations must fail closed before dispatch rather than after executing a tool with no receipt path. Read more
Source§

fn latest_committed_entry_seq(&self) -> Result<u64, ReceiptStoreError>

Source§

fn latest_checkpointed_entry_seq(&self) -> Result<u64, ReceiptStoreError>

Source§

fn next_checkpoint_range( &self, max_batch: u64, ) -> Result<Option<ReceiptCheckpointRange>, ReceiptStoreError>

Source§

fn receipt_checkpoint_status( &self, max_batch: Option<u64>, ) -> Result<ReceiptCheckpointStatusReport, ReceiptStoreError>

Source§

fn store_checkpoint( &self, checkpoint: &KernelCheckpoint, ) -> Result<(), ReceiptStoreError>

Source§

fn create_next_receipt_checkpoint( &self, max_batch: u64, keypair: &Keypair, ) -> Result<ReceiptCheckpointCreateReport, ReceiptStoreError>

Source§

fn load_checkpoint_by_seq( &self, checkpoint_seq: u64, ) -> Result<Option<KernelCheckpoint>, ReceiptStoreError>

Source§

fn load_latest_checkpoint( &self, ) -> Result<Option<KernelCheckpoint>, ReceiptStoreError>

Source§

fn supports_kernel_signed_checkpoints(&self) -> bool

Source§

fn enable_background_checkpoints( &self, keypair: Keypair, max_batch: u64, ) -> Result<bool, ReceiptStoreError>

Install a background checkpoint signer on stores that build their own checkpoints on the writer thread. Returns Ok(false) when the store does not support background checkpointing (default).
Source§

fn supports_retention(&self) -> bool

Whether this store actually implements retention rotation (rotate_receipts). Default false: the default rotate_receipts is a fail-closed default, so a kernel configured with retention_config uses this to refuse attaching a store that cannot rotate, rather than serving traffic under a retention policy whose background worker would only log “not supported” on every interval and never archive.
Source§

fn rotate_receipts( &self, config: &RetentionConfig, ) -> Result<u64, ReceiptStoreError>

Archive receipts that have aged out under config (day/size threshold, or an explicit cutoff). Returns the number of archived tool-receipt rows. Default: unsupported (fail-closed) for stores that do not implement retention.
Source§

fn record_retention_rotation_outcome(&self, failure: Option<&str>)

Record the outcome of a background retention rotation so a persistent failure is observable in receipt_store_health (and any health/flush report) rather than living only in logs. None clears a prior failure after a successful rotation; Some(message) records a rotation error or panic so a silently-failing background retention task marks the store unhealthy and surfaces the cause to operators and automation. Default no-op for stores without a health surface.
Source§

fn record_capability_snapshot( &self, token: &CapabilityToken, parent_capability_id: Option<&str>, ) -> Result<(), ReceiptStoreError>

Source§

fn record_capability_snapshot_with_timeout( &self, token: &CapabilityToken, parent_capability_id: Option<&str>, budget: Duration, ) -> Result<(), ReceiptStoreError>

Record a capability snapshot, failing closed with ReceiptStoreError::Timeout if the writer round trip exceeds budget. The default ignores the budget and keeps the unbounded behavior for stores without an async writer; a store with a commit actor overrides this so a writer that stalls after the pre-dispatch liveness check cannot hang the evaluation hot path inside the snapshot write.
Source§

fn get_capability_snapshot( &self, capability_id: &str, ) -> Result<Option<CapabilitySnapshot>, ReceiptStoreError>

Source§

fn get_capability_delegation_chain( &self, capability_id: &str, ) -> Result<Vec<CapabilitySnapshot>, ReceiptStoreError>

Source§

fn record_session_anchor( &self, session_id: &str, anchor_id: &str, auth_context_fingerprint: &str, issued_at: u64, supersedes_anchor_id: Option<&str>, anchor_json: &Value, ) -> Result<(), ReceiptStoreError>

Persist a serialized SessionAnchor (JSON form).
Source§

fn record_request_lineage( &self, session_id: &str, request_id: &str, parent_request_id: Option<&str>, session_anchor_id: Option<&str>, recorded_at: u64, request_fingerprint: Option<&str>, lineage_json: &Value, ) -> Result<(), ReceiptStoreError>

Persist a serialized RequestLineageRecord (JSON form).
Source§

fn record_receipt_lineage_statement( &self, child_receipt_id: &str, request_id: Option<&str>, session_id: Option<&str>, session_anchor_id: Option<&str>, parent_request_id: Option<&str>, parent_receipt_id: Option<&str>, chain_id: Option<&str>, recorded_at: u64, statement_json: &Value, ) -> Result<(), ReceiptStoreError>

Persist a serialized ReceiptLineageStatement (JSON form).
Source§

fn get_receipt_lineage_verification( &self, receipt_id: &str, ) -> Result<Option<ReceiptLineageVerification>, ReceiptStoreError>

Source§

fn as_any_mut(&self) -> Option<&dyn Any>

Source§

fn resolve_credit_bond( &self, bond_id: &str, ) -> Result<Option<CreditBondRow>, ReceiptStoreError>

Source§

fn append_child_receipt( &self, receipt: &ChildRequestReceipt, ) -> Result<(), ReceiptStoreError>

Source§

fn append_child_receipt_returning_seq( &self, receipt: &ChildRequestReceipt, ) -> Result<Option<u64>, ReceiptStoreError>

Source§

fn append_child_receipt_with_timeout( &self, receipt: &ChildRequestReceipt, budget: Duration, ) -> Result<Option<u64>, ReceiptStoreError>

Append a child receipt, failing closed with ReceiptStoreError::Timeout if the commit round trip exceeds budget. The default ignores the budget and keeps the unbounded behavior for stores without an async writer; a store with a commit actor overrides this so a wedged writer cannot pin the kernel-wide receipt write lock while nested-flow child receipts drain.
Source§

fn admission_projection_capabilities(&self) -> AdmissionProjectionCapabilities

Source§

fn commit_admission_projection( &self, _projection: &AdmissionTerminalProjection, ) -> Result<AdmissionTerminal, ReceiptStoreError>

Source§

fn supports_tenant_scoped_retention(&self) -> bool

Whether this store can honor a TENANT-SCOPED retention config (RetentionConfig.tenant_id set). Default false: prefix-watermark retention archives a contiguous checkpointed prefix of the WHOLE log and cannot carve out a single tenant, so a tenant-scoped rotate_receipts fails closed. A kernel configured with a tenant-scoped retention policy uses this to refuse attaching a store that could never archive under it, rather than spawning a worker that only logs “unsupported” every interval.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more