Skip to main content

Module facade

Module facade 

Source
Expand description

TasksFacade - the seam between the task MCP tools and workspace state. The production impl (ProdTasksFacade) resolves the caller’s project and drives the direct Workspace task methods; the mock records calls for tool tests.

Task-list mutations are direct Workspace methods (lock the tasks mutex + persist), NOT Command-bus dispatches - a task is workspace state, like the cron list beside it, not a session action.

Re-exportsΒ§

use std::sync::Arc; πŸ”’
use std::sync::Weak; πŸ”’
use std::time::SystemTime; πŸ”’
use forge_primitives::tasks::By; πŸ”’
use forge_primitives::tasks::Estimate; πŸ”’
use forge_primitives::tasks::LinkKind; πŸ”’
use forge_primitives::tasks::Task; πŸ”’
use forge_primitives::tasks::TaskId; πŸ”’
use forge_primitives::tasks::TaskStatus; πŸ”’
use forge_primitives::tasks::WaitingKind; πŸ”’
use crate::SessionSlot; πŸ”’
use crate::mcp::caller_context::caller_context; πŸ”’
use crate::tasks::ClaimError; πŸ”’
use crate::tasks::IdError; πŸ”’
use crate::tasks::MoveError; πŸ”’
use crate::workspace::Workspace; πŸ”’

StructsΒ§

ProdTasksFacade πŸ”’
Production facade over Weak<Workspace> (weak to avoid a cycle with the MCP server the workspace owns).
RemovedTaskTree πŸ”’
The tree a tasks__delete removed: the named task as it stood, and how many descendants went with it.
TaskDraft πŸ”’
A task as tasks__create states it: the fields the caller supplies, before the project, the id and the timestamps are stamped on.
TaskLinkDraft πŸ”’
One link as a caller states it: the kind is derived from the target’s shape when it is not given.
TaskPatch πŸ”’
The fields tasks__update may change. An absent field is left alone.

EnumsΒ§

TasksError πŸ”’
Why a tasks__* call failed.

TraitsΒ§

TasksFacade πŸ”’
The task tools’ view of the workspace. Sync - task-list mutations are direct state writes with no async handler to await.

FunctionsΒ§

missing_task_error πŸ”’
The refusal for a stated id that names nothing in the caller’s project: an id another project owns is named as such, so a caller cannot read β€œno such task” as proof the row was never there.
narrow_rows πŸ”’
The list’s narrowing, one definition for the real path and the mock: owner by label, parent by id, status by state, ready by the board’s own mark.
resolve_parent πŸ”’
The parent a write stores: the row a stated id names when it lands on one, the words as stated when it names nothing (a child may point at a row that is gone), and a refusal naming the rows when it names several.