End-to-End Experiment Flow

This document traces a single chaos experiment from the moment an operator clicks Run in the UI to the moment the certifier produces a PDF. Every step references the package or manifest that owns it — use this as the “where do I go to debug step N” map.

For the static system architecture see architecture.md; for individual subsystem details, the per-feature docs (registries, fault studio, observability, MCP).


Prerequisites in the platform

Before a single experiment can run, the operator (or a one-shot bootstrap) needs to have:

  1. Signed in — UI at https://localhost:2001, JWT issued by authentication.
  2. Registered an environment — a Kubernetes target. The subscriber pod is installed there via stages 1–4 of the per-namespace manifests (mcp-infrastructure.md covers stage 4 in detail).
  3. Added a ChaosHub pointing at chaos-charts — faults appear in the Fault Studio.
  4. Added an AgentHub pointing at agent-charts — agents appear under Agents.
  5. Added an AppHub pointing at app-charts — apps appear under Applications.
  6. Registered an Agent — see agent-registry.md.
  7. Registered an App — see app-registry.md.
  8. Created a Fault Studio — see fault-studio.md.

After this the operator can create a Benchmark Project or Experiment that binds: an agent + an app + a fault studio + a schedule.


The runtime flow

1AgentCert UI
Operator clicks Run on a Benchmark Project or Experiment in the web UI.
→ GraphQL mutation to chaos_experiment_run/
2GraphQL API — chaos_experiment_run/
1. Mongo: experiment_run.Status = QUEUED
2. Build Argo Workflow from (agent + app + active fault selections)
3. Call observability.TraceExperimentExecution → Langfuse: new trace, root span open
→ Argo Workflow dispatched to Subscriber via gRPC
dispatched via gRPC
3Subscriber pod (target cluster)
Receives the Argo Workflow definition, submits it to the in-cluster Argo controller. Stages 1–4 per-namespace manifests must already be installed.
Argo Workflow
4ainstall-app
agentcert/agentcert-install-app:latest · helm upgrade --install <chart> -n <ns>
4binstall-agent
agentcert/agentcert-install-agent:latest · sets AGENT_ID, MCP_URLS, OPENAI_BASE_URL, LANGFUSE_* via Helm
4cload-test (optional)
Generates background traffic so the agent has meaningful signals to observe.
4dchaos faults
Parallel or sequential per fault studio definition. Each spawns a ChaosEngine → ChaosResult.
faults live — three things happen in parallel
Agent
flash-agent + agent-sidecar
  • Scan/watch loop — no fault visibility
  • LLM calls: agent → sidecar :4001 → LiteLLM :4000 → Azure/OpenAI
  • Sidecar injects trace_id = NOTIFY_ID on every call
  • Langfuse receives: root span, child spans per fault, LLM call spans
Fault
LitmusChaos operator
Runs the fault per ChaosEngine. ChaosResult status updates arrive late (deterministic ID upserts in Langfuse).
Events
Subscriber callbacks
  • → GraphQL Update
  • → observability.EmitFaultSpanAtInjection
Argo workflow ends
5Subscriber callback — CompleteExperimentExecution
Status = COMPLETED / FAILED
ClearEmittedFaults(traceID) · ClearWorkflowNodeStates(traceID)
→ run row updated in Mongo, Langfuse root span closed
6Operator triggers certifier
POST /api/v1/aggregation-certification — reads Langfuse traces for the run, runs Phase 0–3 pipeline
→ 12-section HTML + PDF certification report

The trace correlation contract

The single trick that makes every layer’s data joinable: one stable trace_id per experiment run, propagated through every component.

Component Where the trace_id comes from
GraphQL server (observability.TraceExperimentExecution) Generated when experiment_run is created
Subscriber callbacks Carried as part of the gRPC payload
ConfigMap mounted into agent pod Written by the helm bridge as NOTIFY_ID
agent-sidecar Reads NOTIFY_ID from the mounted ConfigMap, stamps it as Langfuse trace_id on every outbound LLM call
LiteLLM proxy Forwards the trace_id to Langfuse
Certifier Joins on trace_id to find every span for the run

Code-cited summary of each step

Step Code
Create the run row pkg/chaos_experiment_run/
Build Argo workflow from fault studio + agent + app pkg/chaos_experiment/
Open Langfuse trace pkg/observability/langfuse_tracer.go:129 TraceExperimentExecution
Dispatch to subscriber pkg/grpc/
Subscriber runs Argo workflow chaoscenter/subscriber
Stage-1..4 per-namespace install graphql/server/manifests/namespace/
Install target app app-charts/install-app image
Install agent + sidecar agent-charts/install-agent image
Inject trace_id into agent’s LLM calls agent-sidecar/proxy.py
Fault spans (dedup’d) langfuse_tracer.go:500 EmitFaultSpanAtInjection, langfuse_tracer.go:386 EmitFaultSpansForTrace
Close trace langfuse_tracer.go:216 CompleteExperimentExecution
Generate the report certifier — POST /api/v1/aggregation-certification

Failure modes & what they look like

Symptom Likely cause Look at
Run stays QUEUED forever Subscriber unreachable from control plane pkg/chaos_infrastructure connection state
install-app Argo step fails Bad chart name in App registration or missing chart in AppHub git URL app-registry.md + pkg/apphub
install-agent step fails Image pull / Helm timeout / kubeconfig agent-registry.md — helm bridge section
Agent boots but Status stays VALIDATING Health probe failing — wrong HealthPath, wrong port, app not actually serving readiness agent-registry.md — health scheduler section
No Langfuse spans for the run Tracer disabled (IsEnabled() == false) — missing LANGFUSE_HOST env observability.md
Spans show up but agent calls are missing agent-sidecar not wired (OPENAI_BASE_URL points at LiteLLM directly instead of the sidecar) ../../agent-sidecar/README.md
Duplicate fault spans emittedFaults dedup cache reset / signature collision — unlikely observability.md — dedup section


ACE — Agent Certification Engine · Released under the Apache License 2.0.