Skip to main content

Module propose

Module propose 

Source
Expand description

Task proposals through the outbox (tasks channel): an agent task the agent asks for, or a contradiction between two facts (lean-ctx-ae queues those). A proposal is screened when it is queued; ctx_tasks propose sends it at once off the tool call (send_now), and the scheduler and lean-ctx cloud sync send what is still queued. Cloud answers with the task’s state: a member agent’s task is open at once (owners and maintainers may close it afterwards); a Cloud that still asks for approval answers proposed, and that is what is reported.

A person’s proposal from LeanCTX Code (rc4-67) goes the same way with origin person; only the app-only local routes queue one, never ctx_tasks or lean-ctx cloud tasks propose. Origin person is sent only signed by the app’s task-propose key (prepare_person_task makes the exact bytes, the app signs them, enqueue_signed_person queues the request with that signature; this process never signs) and only to a Cloud that announces FEATURE_TASK_PERSON_ORIGIN. Any other person’s proposal (propose_person_task, an older Cloud) goes as an agent’s, as before.

Structs§

DrainReport
What one drain pass did.
Fields
A proposal’s words.
PreparedPerson
A person’s proposal ready for the app to sign (rc4-67): the proposal as it will be queued, the exact body sent (without task_signature) and the bytes the app signs. Nothing is queued or signed here.
QueuedProposal
One queued proposal (the outbox payload).
SignedPerson
What the app’s signature on a person’s proposal covers besides the body, and the signature itself (public: it proves nothing without the bound key the Cloud holds).

Enums§

Delivery
What became of one queued proposal.
ProposalKind
What a proposal is.

Constants§

FEATURE_TASK_PERSON_ORIGIN
The GET /v1/capabilities feature of a Cloud that records an engine’s proposal with origin person as the linked person’s.

Functions§

created_line
What lean-ctx cloud sync prints for a task Cloud created from a proposal: its real state, so an agent knows whether it can claim it.
delivery_line
The caller’s line for what send_now did.
drain
Send the due proposals (scheduler, lean-ctx cloud sync; never inside a tool call).
enqueue
Screen, validate and queue proposal; returns the outbox item id.
enqueue_signed_person
Queue a prepared person’s proposal with the app’s task_signature (checked against the bound key by the caller); returns the outbox id.
person_origin_offered
Whether the Cloud takes a person’s origin: asked now (a failure keeps the last answer).
prepare_person_task
Prepare the person’s proposal for project_root in vault_id through instance_id, signed at signed_at (see PreparedPerson). Screened and validated as one that is sent.
propose_agent_task
An agent task for the project at project_root: ctx_tasks propose, lean-ctx cloud tasks propose and imports. Always origin agent.
propose_now
Screen, validate and send proposal to vault_id now, without the outbox: for a caller that needs the task number at once (bringing local tasks into a vault on link). The idempotency key is the queued one, so a repeat after an interrupted run gets the same task back.
propose_person_task
A task the person this machine is linked to proposed in LeanCTX Code (rc4-67): origin person. Only the app-only local route calls it; the Cloud names the person from the machine’s link, never from the request.
send_now
Send the queued proposal id now instead of with the next scheduler pass (ctx_tasks propose runs this off the tool call, as claims and results go out). A proposal that cannot go out now stays queued and the scheduler sends it later. None: the scheduler sent it meanwhile (Cloud’s idempotency key keeps a resend of one proposal one task).
send_person_now
send_now for a person’s proposal (rc4-67): asks the Cloud first what it accepts (a failure keeps the last answer), so the answer says whether the Cloud records the task as the person’s (true) or, an older Cloud, as an agent’s.