Verification prompt — observatory audit trail for ahu-chatbot
Paste into a Claude Code session that can reach the deployed platform stack on
the GPU host (ai-ahu· 192.168.83.20) — ideally run inside the
ahu-ai-observatoryrepo, withsshaccess to the host fordocker/curl.
This is a verification + gap-report task, not a code change. Read
ahu-gpu-manager/docs/CONVENTIONS.md(audit schema §5, headers §2) first.
Context
The ai-ahu-chatbot engine is fully flipped onto the gateway (:8200):
planning, synthesis (/synthesis), knowledge, and embeddings all route
through it, and it sends the full §2 header set (X-Tenant-Id: ahu-chatbot,
X-Surface, X-User-Id, X-Request-Id, X-Priority, Idempotency-Key).
Two recent chatbot changes make the audit trail complete:
- Embedding calls are now attributed (
client_params.default_headers) —
previouslyengine=unknownfor retrieval traffic. - Per-turn
X-Request-Idnow rides the agent fan-out too (orchestrator +
public_dash/data-agentmodel calls + embeddings), so one user turn is one
trace_id. Derivation:${sessionId}-t${turn}.
The gateway emits one audit event per AI call to Redis Stream ahu.ai.audit;
the observatory ingests it (consumer group, starts at 0 so backlog is
captured) into Timescale and serves it on the query API (:8300) + dashboard
(:8310).
Timing: chat attribution (planning/synthesis) has been live since the
2026-07-04 flip and should already be visible. Embedding attribution + per-turn
trace grouping across the agent fan-out appear only after the chatbot's next
deploy — if that hasn't shipped yet, note it and check what you can.
What to verify
1. The pipeline is alive
- Gateway is emitting:
redis-cli XLEN ahu.ai.auditgrows under traffic; the
gateway's/metricsshowsgateway_requests_total{tenant="ahu-chatbot"}
climbing. - Observatory is deployed and consuming:
curl -s :8300/healthz→ ok;
:8300/metrics— the consumer-group unacked/pending gauge stays low
(not growing unbounded = the ingester keeps up); no poison-message spikes.
If the observatory stack isn't up, bring it up per its README
(deploy/observatory.yamltokens set; needs the gateway stack's
ahu-platform_defaultnetwork) and report that it was missing.
2. Chatbot events land, correctly attributed
Using an operator/auditor token (Authorization: Bearer <token> from
deploy/observatory.yaml):
- GET /api/calls?engine=ahu-chatbot&limit=20 returns recent events. Confirm
surface is public/internal as expected, upstream is qwen-35b
(planning/knowledge) and ext-dashscope-397b (synthesis), status ok.
- GET /api/summary?engine=ahu-chatbot (and /api/series) show non-zero
volume with a sane latency/error breakdown.
3. The two new attributions (post-deploy)
- Embeddings: filter calls for
operation=embed(orupstream=tei-embeddings).
They should carryengine=ahu-chatbot— notunknown.unknown
embedding calls = the chatbot embedder-header change hasn't deployed yet
(orEMBEDDER_BASE_URLisn't the gateway). Report which. - Per-turn trace grouping: pick one recent chatbot
trace_idand
GET /api/calls?trace_id=<id>. A single public turn should group the
orchestrator's planning + synthesis calls and thepublic_dashagent's
model call(s) and the embedding call under onetrace_id. If agent calls
sit under their own random trace ids instead, the per-turnX-Request-Id
isn't reaching the agent — report it (expected only after the chatbot deploy).
4. It's visible to a human
- Dashboard (
:8310) renders: an engine/tenant filter includesahu-chatbot,
and a trace drill-down shows the grouped fan-out from §3. If the dashboard
can't filter by tenant or open a trace, that's the gap that makes the audit
work unusable — flag it.
Report back
- Pipeline health (stream growing, ingester lag, observatory + dashboard up?).
- Chat attribution present? Embedding attribution present or still
unknown? - Does one turn's
trace_idgroup orchestrator + agent + embedding calls? - Any schema/field mismatch between what the gateway emits and what the
observatory stores or the dashboard shows (e.g.enginevstenantnaming,
missingtrace_id). - Concrete next actions split by owner: gateway (
ahu-gpu-manager),
observatory (ahu-ai-observatory/dashboard), or chatbot (needs a deploy).