ADR 0014: Adoption record — GET /runtime-signals and detect_stranded_reservation (E2)
Status
Accepted (adoption record — both surfaces were already implemented and shipped before this record existed; see the 2026-10 fleet ADR-conformance audit, which found them undocumented).
Context
Two read-only surfaces exist in this codebase with no ADR of their own:
GET /runtime-signals(internal/application/usecases/runtime_signals.go,internal/adapters/inbound/http/router.go'sgetRuntimeSignals) — a Phase 5 "runtime-feedback" report synthesizing Prometheus (error rate/p99 latency per service, viaports.TelemetryReader) and Loki (recent ERROR/FATAL log lines, viaports.LogReader) into one per-service severity classification (internal/domain/policy). It is the only use case in this repo that talks to the observability stack rather than a bounded context's own MCP/REST surface.detect_stranded_reservation(the E2 MCP tool,internal/application/usecases/stranded_reservation.go) — correlates fulfillment-execution'sdiagnose_stuck_tasks(expired/expiring task leases) against inventory-storage'scheck_availability/get_bin_occupancy(usable-stock shortfall) for one SKU into a rankedStrandedReservationExceptionrecommendation. It only ever recommendsrevoke_reservation; it never calls inventory-storage's write tool itself.
Both predate this repo's ADR series catching up with its own build-out pace — normal for a repo whose feature work outran its adoption-record discipline, not evidence either surface deviates from an established decision. This record closes that gap per the fleet convention: every live surface gets a record, even retroactively.
Decision
Document both as accepted, as-built, with no behavior change from this record.
1. GET /runtime-signals
- Inputs:
cfg.RuntimeSignalsServices(default: the fleet's 8 backend bounded contexts) andcfg.RuntimeSignalsNamespace(defaultwarehouse-systems) scope the Prometheus/Loki queries; a 10-minute rolling window. - Degradation, not failure: an unreachable Prometheus or Loki is
recorded in
UnavailableSourcesand that source's contribution to eachServiceSignalis simply omitted (zero-valued) — the same "partial availability degrades to a partial/typed result" guardrailDailyBriefalready follows, never a 5xx for a down observability backend.newTelemetryReader/newLogReader(cmd/agent/main.go) return a no-op stub/nil whenPROMETHEUS_URL/LOKI_URLare unset, so a deployment with no observability stack configured still serves/runtime-signals— it just reports everything unavailable. - Never mutates anything. Pure read-side, same as every other route in this agent (ADR 0001).
2. detect_stranded_reservation (E2)
- Ports consumed:
ports.FulfillmentExecutionClient.DiagnoseStuckTasksandports.InventoryStorageClient(check_availability,get_bin_occupancy) — both already wired for other use cases (E1'sFlowBalanceAdvisory, the MCP read surface), reused here rather than duplicated. - Degradation: each upstream call failure folds into
policy.Evaluate's inputs as an unavailable/nil field, degrading the recommendation rather than failing the call — same discipline as E1'sDecide(). - Mandatory blast radius: a
revoke_reservationrecommendation is only ever emitted alongside the bin/quantity that would return to usable stock — never on partial evidence (ReservationId/BinIdmay be empty, in which case the policy still reportsDetectedfor visibility but withholds the revoke recommendation). - Zero write capability. Like
explain_travel_factor(ADR 0009), this tool is annotatedReadOnlyHint: trueand calls no write tool — the operator (or a future automation layer, out of scope here) decides whether to act on the recommendation.
Consequences
Positive — the ADR index now accounts for every inbound surface this
repo exposes; a reader auditing "what does this agent actually do" no
longer has to fall back to reading router.go/tools.go source to find
two of its routes/tools.
Negative / accepted — none; this is a documentation-only record. No code changed as a result of writing it.