Expand description
Task evidence (trace per change, contract §36): when this engine’s agent submits or verifies a Cloud task, the engine pins what it can prove about the work, so LeanCTX Cloud can join a landed change to its goal, the context its agent saw, and the rule that allowed it.
The task receipt (docs/contracts/task-receipt-v1.md) of the task’s
sessions is built here, on this machine, and stays here. Cloud receives
leanctx.cloud.task-evidence/v1: the receipt’s sha256 digest, its
chain_broken flag, per session a keyed session_ref with chain heads
and counts, and the distinct policy digests of its deliveries. The digest
is over the exact bytes lean-ctx task receipt <n> --json --session …
prints, so a person recomputes it with lean-ctx task trace <n> --json.
The sessions of a task are those the local work trace names (the session
that claimed it and the one that submitted it, as the app’s
LEAN_CTX_SESSION_ID), and the session of the calling process. The
brief the app started a session with is known only as its digest
(lean-ctx tasks update <n> --brief-digest sha256:…, kept locally).
The receipts switches gate it: [cloud] receipts_upload, the lease’s
receipts.upload right, the workspace rule “Share instance metrics” and
the release switch (crate::receipts). Queued only while receipts are
queued and the enrolled Cloud announces change_trace; sent in the
receipts run. When any of that is off nothing is queued or sent, and
Cloud shows the gap no_receipt. Nothing here ever fails a task call.
Structs§
- Evidence
Run - What one send pass did.
- Local
Trace - What this machine knows of task
numberof the checkout atroot, forlean-ctx task trace(local only, nothing is sent).
Constants§
- FEATURE_
CHANGE_ TRACE - The
featuresentry of a Cloud that takes task evidence.
Functions§
- brief_
of - The brief digest recorded for task
numberofvault_id. - local_
trace LocalTraceof tasknumberin the checkout atroot.- note_
task_ closed - Note that task
numberofvault_idwas submitted or verified by this engine’s agent: queue its evidence when receipts are queued and the enrolled Cloud takes it. Silent and best effort. - receipt_
digest sha256:and the hex digest of the receipt as printed: its text and the final newline (lean-ctx task receipt … --json | sha256sum).- receipt_
text - The receipt text of
taskoversessions, from the installed builder. - record_
brief - Record the digest of the brief the app started task
number’s session with. Local only: it leaves with the task’s evidence. - record_
brief_ at record_brieffor tasknumberof the vault of the checkout atroot(lean-ctx tasks update <n> --brief-digest sha256:…).- sessions_
of - The session ids of a task in order, once: the claiming session, the
submitting session, then
current(the calling process’s), each as the app names it. At mostMAX_EVIDENCE_SESSIONS. - set_
receipt_ source - Install the receipt builder (the CLI crate owns it). Without one, no evidence is queued.
Type Aliases§
- Receipt
Source - Builds the
task.receiptdocument text of a task over its sessions, aslean-ctx task receipt <task> --json --session …prints it (without the final newline);Nonewhen no receipt can be built now.