Skip to main content

Crate lean_ctx_tasks

Crate lean_ctx_tasks 

Source
Expand description

Local project tasks: the Hive task model (TaskV1, TaskState) kept per project on this machine, so tasks work without Hive (owner decision 2026-11-04: everything a project has works locally in the Instance; Hive only adds sharing).

proposed --accept--> open --claim--> claimed --submit--> submitted --verify accept--> done
   |                  ^ ^               |  |                  |
   +--decline--> rejected +--release----+  +--submit failed--> failed
                          +--------------------- verify reject ---+
proposed/open/claimed --stop--> cancelled

The rules (board):

  • anyone (an agent or a person) may accept or decline a proposal, the proposer included;
  • only an agent claims, the proposer included; a claim lasts its minutes and is renewed by the holder’s claim again or update; an expired claim opens the task again;
  • the holder updates, submits or releases; a person may release too;
  • a result is verified by a person or by another agent, never by the agent that submitted it; reject opens the task again;
  • a person (never an agent) stops a proposed, open or claimed task, with a reason;
  • every transition is recorded with who and when, on the task and in the store’s journal (store).

Text rules (lengths, one-line summaries, evidence kinds) are Hive’s: each write is checked with the matching Hive request type’s validate.

This crate never posts on the bus or decides whether a project is linked to a vault: every write returns its Changes, and the caller announces them (lean-ctx-hive tasks::local).

Re-exports§

pub use board::Amendment;
pub use board::Board;
pub use board::LocalTask;
pub use board::Proposal;
pub use board::SharedRef;
pub use board::Submission;
pub use board::Transition;
pub use store::Store;

Modules§

board
The project’s tasks in memory and every transition on them. Pure: the time comes in, nothing is read or written here (crate::store does).
store
One project’s tasks on disk: tasks.json (the board, written crash-atomically, 0600) and journal.jsonl (every transition, appended before the board is written, bounded). A write holds an in-process lock and an exclusive file lock (tasks.lock, bounded wait) across load → change → journal → write, so concurrent writers of any process queue instead of losing each other’s transitions. notices.json keeps the journal sequence the bus has taken every notice through.

Structs§

Change
One recorded transition, as a write returns it for its notices.

Enums§

Actor
Who acts on a task.
TaskError
Why a write was refused. reason codes follow Hive’s (task_claimed, task_not_open, task_closed, not_submitted, self_verify, …).
TaskEvent
What happened to a task; the bus key names it (task:<n>:<event>).

Constants§

DEFAULT_CLAIM_MINUTES
Claim length when the caller names none.
LOCAL_VAULT
The vault_id every local task carries (it lives in no vault).
MAX_CLAIM_MINUTES
No keeper renews a local claim: the holder renews it by working on it.
MIN_CLAIM_MINUTES

Functions§

timestamp
Whole-second UTC, as Hive writes task times.