MessageWeave/docs
anonsaber 88f0923e6c feat(status): report per-instance backend label so probes can identify the origin
`/api/status` now echoes a `backend` field alongside `version`. The baked
`BUILD_VERSION` is identical across every instance built from the same image bath,
so it answers "did this deploy land?" but not "which origin answered?" when a
probe goes through the Cloudflare Worker load balancer (`ARCH-LB-WORKER`) — and the
Worker's `x-lb-backend` header is unreliable (it is silently dropped when the
response headers are immutable, e.g. cross-origin without CORS). Having the backend
self-report in the body removes that dependency entirely.

The value is a per-instance observability label read once at startup from
`BACKEND_ID` (falling back to `HOSTNAME`, which container runtimes set their
selves). It is not a connection secret and is never persisted (`C-REDIS-ONLY-STATE`).
`null` means neither env var was set — two such instances are indistinguishable by
this field by design.

Wiring keeps handlers off the environment (matching the `debug_surface_requested`
rationale: env is process-global and reading it inside a handler races tests):
`main` reads it once and threads `backend_id` through the router builders into
`AppState::backend_id`.

Also replaces the drift-prone `src/main.rs:<line>` anchors in design.md /
design.zh-CN.md with symbol references (`std::env::var` key names,
`LlmClient::with_runtime`), per the symbol-not-line rule; the insert had already
shifted them.

Tests: `setup_status_reports_backend_label` asserts the label round-trips into the
body. GATE-P0 105 passed / 0 failed / 4 ignored; GATE-DOCS 6/6 clean.
2026-10-14 02:28:06 +08:00
..
charter.md fix(push): rate-limiter no longer blocks verification; sync stale docs 2026-10-13 22:43:29 +08:00
charter.zh-CN.md fix(push): rate-limiter no longer blocks verification; sync stale docs 2026-10-13 22:43:29 +08:00
design.md feat(status): report per-instance backend label so probes can identify the origin 2026-10-14 02:28:06 +08:00
design.zh-CN.md feat(status): report per-instance backend label so probes can identify the origin 2026-10-14 02:28:06 +08:00
opengaps.md fix(push): rate-limiter no longer blocks verification; sync stale docs 2026-10-13 22:43:29 +08:00
opengaps.zh-CN.md fix(push): rate-limiter no longer blocks verification; sync stale docs 2026-10-13 22:43:29 +08:00
reference.md feat(status): report per-instance backend label so probes can identify the origin 2026-10-14 02:28:06 +08:00
reference.zh-CN.md feat(status): report per-instance backend label so probes can identify the origin 2026-10-14 02:28:06 +08:00
retired.md feat: immediate push trigger + inline /help + RFC 8620 push verification fix 2026-10-12 22:18:29 +08:00
retired.zh-CN.md feat: immediate push trigger + inline /help + RFC 8620 push verification fix 2026-10-12 22:18:29 +08:00