WorkGraph Attention Goals
Status: Implemented architecture record. Initial WorkGraph goals, attention, host controls, turn overlays, tool scoping, and mob lowering shipped starting in v0.6.24. The durable WorkGraph-to-Mob Flow execution bridge shipped starting in v0.8.16. Automatic idle polling and hidden continuation production remain future work; the runtime has typed continuation admission, while ordinary turns resolve and revalidate attention before injecting their overlay.Summary
Codex-style goals should not become a new durable goal graph in Meerkat. The durable “what must be true” part is already WorkGraph-shaped: objective, status, blockers, claims, evidence, readiness, and terminal state. The missing primitive is attention:meerkat-workgraph
capability:
WorkGraphLifecycleMachinecontinues to own durable work item truth.- A WorkGraph-owned attention binding owns which execution owner should keep attending to which work item, in which stance.
MeerkatMachinecontinues to own actual runtime admission, wake, turn execution, and context delivery.meerkat-moblowers durableAgentIdentitybindings into WorkGraph owner keys. Core Meerkat never needs to nameMobId.
Motivation
Codex/goal persists a high-level objective and keeps the agent moving by
injecting hidden continuation context whenever the thread becomes idle. That is
useful, but a direct port is wrong for Meerkat.
Meerkat has two important differences:
- session-only operation is first-class;
- most substantial work can be identity-first, mob-shaped, and role-specialized.
- durable commitment truth;
- the actor currently expected to attend to it;
- the role or stance used when projecting that commitment into a turn.
Existing Authorities
WorkGraph already owns durable commitment semantics. Its public docs say it answers what work exists, what is blocked, what is ready, who claimed it, what evidence supports completion, and what is terminally done, failed, or cancelled. It owns item lifecycle, dependency legality, readiness, claims, terminal state, evidence references, event history, and projections. Runtime already owns session admission and turn execution.Input::Continuation
and WakeIfIdle already exist as runtime primitives, and
StartTurnRuntimeSemantics is the runtime/session carrier for handling mode,
tool overlays, context appends, and turn metadata.
Mob already owns multi-agent topology: roster, stable member identity,
runtime-binding rotation, wiring, flows, and member lifecycle. Public mob APIs
use AgentIdentity; per-runtime details may rotate.
Dogma requires a single semantic owner. A side map called “goal bindings” that
decides pause, resume, completion, wake, projection mode, or authority would be
a hidden lifecycle machine. If the binding has semantic state, that state needs
a named authority.
Decision
Do not introduceMobGoal, ThreadGoal, or a generic core GoalLifecycleMachine.
Instead, add WorkGraph attention as an optional WorkGraph-owned capability:
WorkOwnerKey, but public callers
must use domain handles:
Session { session_id } is valid in session/runtime surfaces. Lowered owner keys
are stored only after the owning feature has validated the source identity.
AgentIdentity bindings are created through meerkat-mob, which validates the
identity and lowers it to a WorkGraph owner key. Core Meerkat does not need an
AgentIdentity type and never names MobId.
Attention Modes
Attention mode controls projection and tool authority. It is not WorkGraph item status.
The parent work item can be the same for several agents, but their attention
modes must differ. A reviewer receives the parent objective as a claim to test,
not as a motivational target.
Attention Status
Attention status answers whether the runtime should continue projecting this binding. It does not close or block the WorkGraph item.Paused { until } becomes
eligible again when the clock passes, or meerkat-schedule resumes the binding.
A WorkGraph item may use its own snoozed_until for item-level readiness, but
that fact must not substitute for one actor’s attention pause.
Machine Ownership
The implemented architecture uses a generated authority path and does not add a generic core goal machine. Current ownership shape:Runtime Handoff
Runtime must treat attention as an observed input, not as its own commitment truth. The shipped trusted-host path performs the revalidation and admission steps below for explicit continuation requests and ordinary turn overlays. The automatic idle trigger in step 1 remains future work. Idle continuation flow:- Runtime becomes idle, or a host explicitly requests continuation for an attention binding.
- Runtime or the host-facing runtime surface asks the optional WorkGraph
attention service for an eligible active binding for this
SessionId. - For each candidate, the service re-reads the WorkGraph item and verifies:
- item still exists;
- item is not terminal;
- attention binding is active;
- target still resolves to the current session or identity binding;
- projection policy permits continuation.
- Runtime enqueues
Input::Continuationthrough the normal runtime admission path. - Runtime starts the turn with typed attention context in
StartTurnRuntimeSemantics. - Session service applies the typed context at the turn boundary.
Projection Contract
Runtime should not inject raw WorkGraph fields as hidden instructions. Descriptions, labels, and evidence summaries are user-authored or agent-authored data, not policy. The attention service should emit a typed projection:- source truth is named;
- rebuild trigger is item/binding revision;
- staleness policy is explicit;
- role stance is typed;
- max rendered shape is bounded;
- parent objective text is framed as data, not instruction priority.
Completion Authority
Completion is WorkGraph terminal state plus policy. It is not “the model said complete” unless policy grants that model authority to close the item. This proposal requires explicit completion policy on the WorkGraph item:Session-Only Shape
Session-only Meerkat remains first-class. Creating a session goal:- Host creates a WorkGraph item in a realm namespace such as
session/{session_id}. - Host creates an active attention binding targeting
SessionId. - Runtime observes the binding and continues the session while eligible.
- The session agent can add evidence, block the item, or close it only if the authority policy permits.
Mob Shape
There is no mob-bound goal lifecycle. A mob objective is a WorkGraph root item, often scoped by namespace or linked through a typed external reference. Mobs route attention; they do not own work terminality. Example:meerkat-mob support lowers AgentIdentity targets into durable
owner-key attention targets. For ordinary turns, meerkat/src/surface.rs
resolves those keys against the session’s mob_id and agent_identity labels,
selects the newest matching session generation deterministically, and
revalidates the current attention projection before composing the turn overlay.
Automatic idle continuation for a lowered owner remains future work.
Mob docs should avoid saying the persisted mob owns “work” in the WorkGraph
sense. Mob owns roster, wiring, member lifecycle, flows, and routing. WorkGraph
owns shared durable work.
Flow Execution Seam
Flow execution uses an explicit durable association rather than a prompt-level WorkGraph id. The controlling host commitsWorkExecutionBinding before
launching the Flow. The binding fixes the Mob and Flow identities, effective run-config
digest, deterministic run id, activation parameters, idempotency key, and
retry predecessor.
WorkExecutionLifecycleMachine emits the next cross-system obligation. The
composition shell realizes that obligation and feeds the typed outcome back:
begun proves target absence;
after it, the exact run is the durable target fact. A realizing record with no
run fails closed as quarantine. The public bridge cannot resolve that state
from caller testimony. Recovery requires the deterministic run to become
observable or a future sealed host authority to prove a safe resolution.
Tool Authority
Current WorkGraph exposure is coarse: enabling WorkGraph gives a member create, claim, update, block, close, link, and evidence tools. That is too broad for adversarial roles. Attention projection should narrow tool authority by mode and work item:
Attention-aware filtering should be the final capability-narrowing layer:
ToolCategoryOverride remains coarse-grained capability exposure. Mob profiles
remain role defaults. The final authorization check must know the attention
binding id, mode, work item scope, and requested operation before a WorkGraph
mutation reaches WorkGraphService.
Public Surfaces
Suggested user-facing vocabulary:/goal <objective>: create WorkGraph item plus session attention binding./goal pause: pause attention binding, not WorkGraph item./goal resume: reactivate attention binding if item is still non-terminal./goal clear: stop the attention binding; item remains unless user explicitly cancels it. Supersession is reserved for future binding replacement flows./goal status: show attention status plus referenced WorkGraph item status.
workgraph/goal/create: transactionally create a WorkGraph item and its initial attention binding.workgraph/goal/status: return referenced item status plus attention status.workgraph/goal/confirm: attach host/principal confirmation evidence.workgraph/goal/request_close: request policy-gated item closure.workgraph/attention/list: list active attention bindings.workgraph/attention/pause: pause a binding without mutating the item.workgraph/attention/resume: resume a paused binding if the item remains non-terminal.- trusted runtime-host attention continuation: enqueue a hidden continuation for a session-bound binding.
rkat workgraph:
goal-create, goal-status, goal-confirm, goal-close, attention-list,
attention-pause, and attention-resume. The runtime has a typed trusted-host
continuation seam, but no automatic idle-polling producer or REST-backed CLI
command ships today. CLI confirmation does not accept raw principal authority.
The CLI intentionally
does not expose the broad WorkGraph mutation surface as the goal UX.
Core host goal creation targets a session handle. Mob/agent targets are not
accepted through this core host contract; meerkat-mob must validate
AgentIdentity and lower it to a WorkGraph owner binding through its own
feature surface. This keeps core Meerkat from freezing a public
WorkOwnerKey::Agent or WorkOwnerKey::Mob bypass.
Failure Modes
The design must fail closed when:- WorkGraph is disabled;
- WorkGraph item is missing;
- item revision changed in a way that invalidates the projection;
- item is terminal;
- attention binding is paused/stopped/superseded;
- target identity no longer resolves;
- runtime is not idle;
- queued user or peer work has priority;
- projection cannot be built safely;
- authority policy would allow self-review of a parent item.
Non-Goals
- Do not add
MobGoal. - Do not add a core
GoalLifecycleMachineduplicating WorkGraph. - Do not make WorkGraph readiness equivalent to runtime wakeup.
- Do not use namespace strings as semantic proof of session, mob, or agent ownership.
- Do not inject a parent objective as every member’s own goal.
- Do not let reviewer/adversarial profiles depend only on prompt text for their stance.
- Do not provide a local fallback goal table when WorkGraph is disabled.
Resolved Recommendations
- Model attention as WorkGraph-owned state with
WorkAttentionLifecycleMachineand a trusted runtime-host continuation seam. Do not add a generic core goal machine. - Model pause/resume on the attention binding. Timed pauses may use
Paused { until }or schedule-driven resume, but should not mutate item readiness. - Expose a narrow host/principal mutation surface for goal creation, pause/resume/stop/reassign, status, confirmation evidence, and policy-gated closure. Do not expose a broad WorkGraph editor as the first goal surface.
- Put completion policy on the WorkGraph item. Let attention bindings carry delegated authority only.
- Apply attention-aware tool filtering after session config, category overrides, and mob profile tooling, with a final per-call WorkGraph authorization check.
Acceptance Bar
The implementation remains conformant only if:- WorkGraph remains the only owner of durable work truth.
- Runtime remains the only owner of turn admission and continuation.
- Attention binding lifecycle is WorkGraph-owned and generated, currently via
WorkAttentionLifecycleMachine. - The WorkGraph/runtime handoff has one named seam that revalidates attention eligibility and enters runtime through normal continuation admission.
- Mob remains optional and feature-owned.
- Session-only operation remains first-class.
- Adversarial roles receive typed falsification/review projections, not the parent objective as their own motivational goal.
