Entity relationship
This page is a copy of docs/docs/ddd/entity-relationship.md on develop, derived from that repository's code. Edit it there, then re-sync.
There is no database
warehouse-ops-agent has no Postgres and no schema:
- no
migrations/directory in the repo; - no database driver in
go.mod(nopgx,database/sqldriver or similar); - no repository port in
internal/ports; getting-started.mdandCLAUDE.mdboth state it holds no database and no persisted state.
So there is no ER diagram of tables, no outbox_events, no
processed_events, no idempotency_keys, no schema_migrations and no
analytics projection here. Every fact the service reasons about is
re-read from an upstream context at request time and forgotten when the
response is written. Restarting the process loses nothing.
What state it does hold
The only state is configuration (read once at startup) and a few process-local, in-memory structures. None of it is durable.
Source: internal/config/config.go (Config, PathTarget, LLMConfig,
defaults), internal/adapters/outbound/mcpclient/tool_invoker.go
(ToolInvoker.specs), internal/resilience/breaker.go and
internal/adapters/outbound/llm/anthropic/reasoner.go (the one
gobreaker instance).
Omits: OTel metric instruments and the per-call MCP client session, which
Session.callTool opens and closes on every call.
No relationship lines are drawn: there are no foreign keys anywhere. The logical links are prose-only:
CONFIGholds a list ofPATH_TARGETentries (DAILY_BRIEF_PATH_TARGETS, a JSON array; one default targetWH1/pick-zone-a/PICK/wh1/shift-1when unset; a set but unparseable value, or an empty array[], is a startup error, not a silent fallback — ADR 0017) and oneLLM_CONFIG.TOOL_SPEC_CACHEis filled once per process byToolInvoker.Specs, and only whenLLM_MODEis notoff.CIRCUIT_BREAKERexists only when the Anthropic reasoner is wired.
The circuit breaker is the only state machine
Source: internal/resilience/breaker.go (ReadyToTrip,
DefaultMaxRequests = 1, DefaultInterval = 30s, DefaultCooldown = 30s).
Omits: the retry with jittered backoff around each call (ADR 0011) and the
circuit_breaker_state{dependency="anthropic-llm"} gauge it publishes.
Table ≠ aggregate mapping
| Table | Aggregate | Notes |
|---|---|---|
| none | none | No table and no aggregate exist. Upstream contexts own every persisted fact this service reads; see the context map for whose. |