Skip to main content

WorkGraphService

Struct WorkGraphService 

Source
pub struct WorkGraphService { /* private fields */ }

Implementations§

Source§

impl WorkGraphService

Source

pub fn new(store: Arc<dyn WorkGraphStore>) -> Self

Source

pub fn with_scope( store: Arc<dyn WorkGraphStore>, default_realm_id: impl Into<String>, default_namespace: WorkNamespace, ) -> Self

Source

pub fn store(&self) -> &Arc<dyn WorkGraphStore>

Source

pub fn execution_bridge(&self) -> WorkExecutionBridge

Explicitly enter the trusted execution-coordinator boundary.

Holding an in-process WorkGraphService is already realm-backend authority. Embedders that distribute untrusted code must retain the service behind an admitted surface rather than handing it out.

Source

pub fn default_realm_id(&self) -> &str

Source

pub fn default_namespace(&self) -> &WorkNamespace

Source

pub async fn create( &self, request: CreateWorkItemRequest, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn create_goal( &self, request: GoalCreateRequest, ) -> Result<GoalCreateResult, WorkGraphError>

Source

pub async fn goal_status( &self, request: GoalStatusRequest, ) -> Result<GoalStatusResult, WorkGraphError>

Source

pub async fn attention_binding( &self, request: AttentionBindingRequest, ) -> Result<AttentionBindingResult, WorkGraphError>

Source

pub async fn list_attention( &self, request: AttentionListRequest, ) -> Result<AttentionListResult, WorkGraphError>

Source

pub async fn prune_terminal_attention( &self, request: AttentionPruneRequest, ) -> Result<AttentionPruneResult, WorkGraphError>

Prune TERMINAL (superseded/stopped) attention binding rows in scope. The workgraph event stream keeps the audit history; binding rows otherwise grow monotonically with reassignment churn. Host-plane lifecycle API — not exposed on the agent tool surface.

Source

pub async fn pause_attention( &self, request: AttentionPauseRequest, ) -> Result<AttentionBindingResult, WorkGraphError>

Source

pub async fn resume_attention( &self, request: AttentionResumeRequest, ) -> Result<AttentionBindingResult, WorkGraphError>

Source

pub async fn reassign_attention( &self, request: AttentionReassignRequest, ) -> Result<AttentionReassignResult, WorkGraphError>

Source

pub async fn break_glass_reassign_attention( &self, request: BreakGlassAttentionReassignRequest, ) -> Result<AttentionReassignResult, WorkGraphError>

Break-glass host-plane reassignment. WorkGraphs are agent-operated: the agent-native transfer is a coordinate-mode agent executing the move, and the agent tool surface’s mode-derived authority stays untouched. This entry exists for the one state the graph cannot heal agent-natively — a binding stuck on a wedged/retired agent with no coordinator holding authority over it. It bypasses the projection witness (hosts must not forge projections) but keeps every other invariant: binding currency (expected_revision CAS), item non-terminality, and the active-binding-per-target occupancy guard. Mandatory attribution is recorded in the workgraph event stream and a WARN log. Never exposed on the agent tool surface or wire catalogs.

Source

pub async fn attention_projection( &self, request: AttentionProjectionRequest, ) -> Result<AttentionProjectionResult, WorkGraphError>

Source

pub async fn goal_confirm( &self, request: GoalConfirmRequest, ) -> Result<GoalConfirmResult, WorkGraphError>

Source

pub async fn goal_confirm_public( &self, request: GoalConfirmRequest, ) -> Result<GoalConfirmResult, WorkGraphError>

Source

pub async fn goal_request_close( &self, request: GoalRequestCloseRequest, ) -> Result<GoalRequestCloseResult, WorkGraphError>

Source

pub async fn get( &self, realm_id: Option<String>, namespace: Option<WorkNamespace>, id: WorkItemId, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn list( &self, filter: WorkItemFilter, ) -> Result<Vec<WorkItem>, WorkGraphError>

Source

pub async fn ready( &self, filter: ReadyWorkFilter, ) -> Result<Vec<WorkItem>, WorkGraphError>

Source

pub async fn snapshot( &self, filter: WorkGraphSnapshotFilter, ) -> Result<WorkGraphSnapshot, WorkGraphError>

Source

pub async fn claim( &self, request: ClaimWorkItemRequest, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn release( &self, request: ReleaseWorkItemRequest, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn update( &self, request: UpdateWorkItemRequest, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn escalate_policy( &self, request: PolicyEscalateRequest, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn block( &self, realm_id: Option<String>, namespace: Option<WorkNamespace>, id: WorkItemId, expected_revision: u64, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn close( &self, request: CloseWorkItemRequest, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn add_evidence( &self, request: AddEvidenceRequest, ) -> Result<WorkItem, WorkGraphError>

Source

pub async fn add_evidence_idempotent( &self, request: AddEvidenceRequest, ) -> Result<WorkItem, WorkGraphError>

Add evidence exactly once by evidence id.

An exact replay returns the current item without another revision. A same-id/different-content replay fails closed. This is the recovery seam used by execution bridges after an ambiguous projection boundary.

Source

pub async fn find_execution_binding( &self, realm_id: Option<String>, namespace: Option<WorkNamespace>, binding_id: WorkExecutionBindingId, ) -> Result<Option<WorkExecutionBinding>, WorkGraphError>

Source

pub async fn execution_binding( &self, realm_id: Option<String>, namespace: Option<WorkNamespace>, binding_id: WorkExecutionBindingId, ) -> Result<WorkExecutionBinding, WorkGraphError>

Source

pub async fn execution_binding_for_target_run( &self, run_id: &str, ) -> Result<Option<WorkExecutionBinding>, WorkGraphError>

Resolve the current realm’s unique execution binding for a target run. Flow status surfaces use this for first-class reverse linkage.

Source

pub async fn execution_bindings( &self, filter: WorkExecutionBindingFilter, ) -> Result<Vec<WorkExecutionBinding>, WorkGraphError>

Source

pub async fn events( &self, filter: WorkGraphEventFilter, ) -> Result<Vec<WorkGraphEvent>, WorkGraphError>

Trait Implementations§

Source§

impl Clone for WorkGraphService

Source§

fn clone(&self) -> WorkGraphService

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CoreExecutorTurnFinalizationGuard for T
where T: Send,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more