Liking cljdoc? Tell your friends :D

hive-datascript.swarm.coordination.session-registry

Session-scoped registry of what a run produced, for wrap to harvest.

SCOPING: every row carries the session that wrote it. A reader passes a :session-ref (plus :parent-of) and gets back only the rows that session owns. Ownership is the host's rule, applied through the :scope-rows hook (hive-datascript.swarm.hooks). Reads WITHOUT a :session-ref keep the unscoped behaviour, but clearing is never unscoped by accident: clear-* takes the explicit ids the caller actually harvested.

Session-scoped registry of what a run produced, for wrap to harvest.

SCOPING: every row carries the session that wrote it. A reader passes a
`:session-ref` (plus `:parent-of`) and gets back only the rows that session
owns. Ownership is the host's rule, applied through the :scope-rows hook
(hive-datascript.swarm.hooks). Reads WITHOUT a :session-ref keep the
unscoped behaviour, but clearing is never unscoped by accident: clear-*
takes the explicit ids the caller actually harvested.
raw docstring

clear-completed-tasks!clj

(clear-completed-tasks!)
(clear-completed-tasks! task-ids)

Clear completed tasks from the registry after wrap has harvested them.

PREFER the 1-arity: pass the ids this wrap actually harvested, so a concurrent session's unharvested rows survive. The 0-arity clears EVERY row in the store regardless of who wrote it: it is the reset button, not the end of a wrap.

Returns: Number of tasks cleared

Clear completed tasks from the registry after wrap has harvested them.

PREFER the 1-arity: pass the ids this wrap actually harvested, so a
concurrent session's unharvested rows survive. The 0-arity clears EVERY row
in the store regardless of who wrote it: it is the reset button, not the
end of a wrap.

Returns:
  Number of tasks cleared
sourceraw docstring

clear-kanban-movements!clj

(clear-kanban-movements!)
(clear-kanban-movements! movement-ids)

Clear kanban movements after wrap has harvested them.

PREFER the 1-arity with the ids this wrap harvested; the 0-arity clears the whole store regardless of owner (see clear-completed-tasks!).

Returns: Number of movements cleared

Clear kanban movements after wrap has harvested them.

PREFER the 1-arity with the ids this wrap harvested; the 0-arity clears the
whole store regardless of owner (see clear-completed-tasks!).

Returns:
  Number of movements cleared
sourceraw docstring

get-completed-taskclj

(get-completed-task task-id)

Get a completed task by ID.

Returns: Map with completed-task attributes or nil if not found

Get a completed task by ID.

Returns:
  Map with completed-task attributes or nil if not found
sourceraw docstring

get-completed-tasks-this-sessionclj

(get-completed-tasks-this-session &
                                  {:keys [agent-id project-id session-ref
                                          parent-of]})

Get all completed tasks registered this session.

Used by wrap to harvest task completions.

Options:

  • :agent-id - Filter by specific agent
  • :project-id - Filter by project scope
  • :session-ref - SessionRef of the caller; when given, only rows this session OWNS come back (its own subtree plus adopted ad-hoc sessions). Without it the read is unscoped.
  • :parent-of - session-id -> parent session-id, for the ownership walk

Returns: Seq of completed-task maps sorted by completion time (most recent first)

Get all completed tasks registered this session.

Used by wrap to harvest task completions.

Options:
- :agent-id    - Filter by specific agent
- :project-id  - Filter by project scope
- :session-ref - SessionRef of the caller; when given, only rows this
                 session OWNS come back (its own subtree plus adopted
                 ad-hoc sessions). Without it the read is unscoped.
- :parent-of   - session-id -> parent session-id, for the ownership walk

Returns:
  Seq of completed-task maps sorted by completion time (most recent first)
sourceraw docstring

get-kanban-movements-this-sessionclj

(get-kanban-movements-this-session &
                                   {:keys [agent-id project-id session-ref
                                           parent-of]})

Get all kanban movements registered this session.

Used by wrap to harvest status transitions.

Options:

  • :agent-id - Filter by specific agent
  • :project-id - Filter by project scope
  • :session-ref - SessionRef of the caller; scopes the read to what this session owns (see get-completed-tasks-this-session)
  • :parent-of - session-id -> parent session-id, for the ownership walk

Returns: Seq of kanban-movement maps sorted by timestamp (chronological)

Get all kanban movements registered this session.

Used by wrap to harvest status transitions.

Options:
- :agent-id    - Filter by specific agent
- :project-id  - Filter by project scope
- :session-ref - SessionRef of the caller; scopes the read to what this
                 session owns (see get-completed-tasks-this-session)
- :parent-of   - session-id -> parent session-id, for the ownership walk

Returns:
  Seq of kanban-movement maps sorted by timestamp (chronological)
sourceraw docstring

register-completed-task!clj

(register-completed-task! task-id
                          {:keys [title agent-id project-id session-id]})

Register a completed task for wrap to harvest.

Called by on-kanban-done hook when tasks move to DONE. Tasks are session-scoped and cleared after wrap.

Arguments: task-id - Unique identifier (e.g., kanban task ID) opts - Map with optional keys: :title - Task title/description :agent-id - ID of completing agent (auto-detected if not provided) :project-id - Project scope :session-id - Session that recorded it; without it the row is unowned and no wrap will clear it

Returns: Transaction report

Register a completed task for wrap to harvest.

Called by on-kanban-done hook when tasks move to DONE.
Tasks are session-scoped and cleared after wrap.

Arguments:
  task-id - Unique identifier (e.g., kanban task ID)
  opts    - Map with optional keys:
            :title      - Task title/description
            :agent-id   - ID of completing agent (auto-detected if not provided)
            :project-id - Project scope
            :session-id - Session that recorded it; without it the row is
                          unowned and no wrap will clear it

Returns:
  Transaction report
sourceraw docstring

register-kanban-movement!clj

(register-kanban-movement! {:keys [task-id title from to agent-id project-id
                                   session-id]})

Register a kanban status transition for wrap to harvest.

Called by kanban create/move handlers to track all status changes, not just completions. Session-scoped and cleared after wrap.

Arguments: opts - Map with keys: :task-id - Kanban task ID :title - Task title :from - Previous status (nil for creation) :to - New status :agent-id - Agent that triggered the move (auto-detected) :project-id - Project scope :session-id - Session that recorded it (see register-completed-task!)

Returns: Transaction report

Register a kanban status transition for wrap to harvest.

Called by kanban create/move handlers to track all status changes,
not just completions. Session-scoped and cleared after wrap.

Arguments:
  opts - Map with keys:
         :task-id    - Kanban task ID
         :title      - Task title
         :from       - Previous status (nil for creation)
         :to         - New status
         :agent-id   - Agent that triggered the move (auto-detected)
         :project-id - Project scope
         :session-id - Session that recorded it (see register-completed-task!)

Returns:
  Transaction report
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close