Skip to main content

Domain vision

A read-side, decision-support mechanism that correlates signals from the fleet's bounded contexts into a single diagnosis and a ranked, human-gated recommendation. It owns no aggregate, enforces no new invariant, and persists no domain state — its "domain" is decision policy.

What it owns, and what it refuses to own​

ConcernOwner
Correlating a rebalance recommendation, a staffing gap, and a stuck-task diagnostic into one ranked FlowBalanceExceptionwarehouse-ops-agent
Correlating expired task leases with a usable-stock shortfall into a StrandedReservation recommendationwarehouse-ops-agent
Synthesizing a cross-path, cross-site daily operational briefwarehouse-ops-agent
Correlating queue depth with measured labor utilization (ADR 0008) and a travel-distance reading with a slow path (ADR 0009)warehouse-ops-agent
Classifying services' runtime error rate / p99 latency against fleet-wide thresholds (GET /runtime-signals)warehouse-ops-agent
Whether a rebalance is actually needed on a path right nowwes-work-planning
Whether a shift is actually understaffedworkforce-management
Whether a task is actually stuck, and whyfulfillment-execution
Whether stock is actually usable, reserved, or in a bininventory-storage
Whether a location physically exists and what site it belongs tofacility-layout
How long associates actually spent on tasks versus idlelabor-performance
Executing any recommendation this agent makesa human, today; a later, separately-gated write slice, eventually

The line is correlation versus ground truth. This agent never re-derives or duplicates a fact an upstream context already owns — it reads that fact through the context's published MCP tool and correlates it against readings from the others. It has zero independent authority over any fact it reasons about.

The guardrails that make this safe by construction​

  1. Reads everywhere, writes nowhere directly. Every domain fact this agent reasons over crosses an MCP tool-call boundary to an upstream context's existing read tools. It has never called, and in v1 cannot call, any of their write tools (assign_labor, release_next_work, revoke_reservation, complete_task) — see the Governance note. This is CI-enforced by internal/architecture/zerowrite/zerowrite_test.go.
  2. Correlate, don't alert on one metric. The E3 daily-brief rule flags a path as an open exception only when two or more independent signals fire together (see internal/domain/policy.deriveExceptions). A single understaffed reading, alone, is ordinary operating noise, not an exception.
  3. Untrusted input is validated, never defaulted. Every enum value this agent reads back from an upstream tool response (a wes RebalanceAction, a fulfillment-execution TaskType) is checked against a closed set. An unrecognized value is rejected with an error — never silently coerced to a default.
  4. Partial upstream availability degrades to a typed partial result, never a hard failure. If an upstream context is unreachable, the affected path's brief (or exception decision) is marked Partial with its MissingSignals listed, and the recommendation conservatively degrades toward hold rather than guessing.
  5. Every decision shows its work. A Decision, StrandedReservationException, or OpenException this agent returns always carries a full evidence trail: which upstream tool call produced each fact, and what it showed. No recommendation is ever returned bare.
  6. A write recommendation is never returned without its blast radius. E2's revoke_reservation recommendation is impossible to reach without inventory-storage.get_bin_occupancy's reading already in hand — the blast-radius readout is a precondition of the recommendation existing at all, not an optional enrichment.

Why a separate repo, not a sixth bounded context​

See ADR 0001 for the full rationale. In one sentence: there is no aggregate or invariant for this capability to own, so a new bounded context would be a domain in name only — a new, independently-deployable repo that is purely a Customer of the existing contexts' Open Host Services keeps the dependency map acyclic and every context's boundary honest.