Skip to main content

Module draft

Module draft 

Source
Expand description

Captured session knowledge → one draft proposal in the outbox.

Every fact passes the capture gate first (crate::capture); what fails stays local and is only counted. Runs at session end, on ctx_session save (debounced 10 min per project) and at server shutdown. It never touches the network: the draft is planned against the last pulled base, screened, and queued; super::pull / the scheduler send it later.

Structs§

QueuedDraft
The payload of a knowledge outbox item.
Recapture
What recapture did.
Watermark
Where the next draft of a project starts.

Enums§

Trigger
Why a draft is being made.

Functions§

enqueue_session_draft
Plan, screen and queue the learnings of the project at root made since its last draft. Returns the outbox id, or None when there is nothing to propose (or Cloud is not set up for this machine).
on_session_event
Hook for session end, save and shutdown: enqueue only, never network, never an error for the caller (a failure is recorded for cloud status).
queued
The draft inside a queued item, for status listings.
recapture
lean-ctx cloud capture --recapture (SPEC-ENGINE §3.1.6): remove the project’s unsent session drafts (they never reached members), reset its capture watermark and run the gate over the whole local knowledge.
session_ref
An opaque per-session reference: no host, user or path data. It is an unsalted digest, so a guessable session id can be tested against it: it names sessions locally (file names, done markers) and, uploaded, only constant labels that name no session (cloud-link, cloud-task-proposals). What is uploaded for a session, or for a label passed in its place (cli-import, emspace-import), is crate::session_ref::uploaded_ses_ref.
syncs_through_replica
Whether the project stable at root syncs through its vault’s C0 2.0 replica, as cloud sync decides: the enrolled Cloud speaks 2.0 and the project is bound (or linked, and bound on its next sync). A 1.x Cloud keeps the draft path.