/agent-skills:agent-observability-auto-experimentfrom agent-skills
Runs an iterative hill-climb loop that improves code, agents, or prompts against real Datadog LLM-Observability traces. Establishes baselines, makes focused changes, and keeps improvements validated against held-out test splits.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Local, Claude-Code-driven hill-climb loop against real Datadog LLM-Obs data (git commits, a local
eval harness, and Datadog MCP or pup).
| File | When to load / how to use | Canonical authority for |
|---|---|---|
references/rubrics.md | Read before Step 2.5 | Non-negotiable rules: scoring policy, goal/guardrails, keep/discard matrix, two uncertainties, data isolation & 5-gram memorization, failure census, feasibility probe, mechanism audit, stall taxonomy, result.json schema |
references/eval_audit.md | Read at Step 2.2 | Three pre-climb gates: Gate 1 (harness trust), Gate 2 (zero triage), Gate 3 (climbability) |
references/reporting.md | Read at Step 2.4 / Final Report | LLM-Obs auto_experiment_score contract, tag normalization, narrative.md, final report |
references/eval_harness_template.{py,mjs} | Copy only the matching runtime at Step 2 | Language-parity harness skeletons (generate on redacted row, grade on full row, AUTO_EXP_SPLIT, AUTO_EXP_WORKERS, AUTO_EXP_REGRADE) |
scripts/stats.py & scripts/loop_helper.py | Copy with cp — never Read their source code; use loop_helper.py <subcmd> --help for flags | Deterministic CLI for split, audit-corpus, summarize-signals, verify-mean, check-climbability, calibrate, check-memorization, distribution, audit, decide, pool-confirm, record, stop-check, build-tags, submit-payload, render-narrative, init-baseline, finish-iteration, verify-final |
Split vocabulary: This skill names the two splits val (the 70% search/analysis split —
equivalent to train in standard ML terminology, read by census,
describers, and improvement sub-agents) and test (the 30% held-out-from-analysis selection
split, scored every iteration to decide keeps and catch val overfitting, stored under gitignored
.auto_experiment/holdout/ which no sub-agent may open).
.auto_experiment/ locally and the user's
own Datadog LLM-Obs org (via $experiment-id). Never send run data elsewhere; keep reasoning
free of secrets or full source dumps.build_judge_prompt (sealed delimiters, separate trusted <domain_notes>, score ONLY against
<evaluators>).Repo = current working directory.
| Field | Meaning | Source |
|---|---|---|
files_to_optimize | Edit scope: file(s), folder, or globs — any in-scope code (tools, retrieval, pipeline, config, prompts) is fair game; everything outside is off-limits | must ask |
goal | {text, target: "score"|"cost_usd"|"latency_s", direction: "higher"|"lower", hold: []} | must ask (text verbatim; default {target:"score", hold:[]} proposed in recap unless cost/latency is mentioned) |
evaluators | Explicit scoring rubric verbatim — never fall back to goal, never alter metric or direction | must ask |
| data source | dataset_id, annotation_queue_id, ml_app (+ optional trace_ids), or local_dataset_path (if local file, also ask dataset_mode: datadog vs local_file) | must ask |
annotation_label_map | Queue sources only: {expected_output: <label|null>, filter: <{label,equals}|null>} chosen from queue's annotation_schema.label_schemas | must ask (queues) |
project_id | LLM-Obs project UUID for dataset writes (not needed in dataset_mode: local_file) | must ask unless unambiguous |
datadog_backend | mcp or pup for every Datadog call (recommend pup for corpora >19 records) | must ask (or propose in recap if only one is authenticated) |
domain_notes | List of product/domain facts agents can't read from code (grows mid-run when user corrects a misread; injected into sub-agents, describers, and judge) | ask explicitly (in batched turn; [] is fine) |
min_shippable_delta | Smallest improvement user would ship on (Step 2.6 climbability gate) | default 0.05 (confirmed in recap) |
max_iterations | Max improvement iterations (clamp 1–50) | default 8 |
max_runs | Ceiling on derived runs (clamp 3–20; propose 3 on deterministic metrics) | default 5 |
stratify_by | Optional field name for split stratification | default auto |
runtime | Harness runtime (python | node) | default auto-detected |
model / base_branch | Judge model id / baseline branch | default session model / current branch |
runs, min_delta, and guardrail_floors are derived in Step 2.4 (never asked at intake).
The cost estimate is derived once at intake (never asked).
$experiment-id:
project_id, create the experiment at step 3 via
create_llmobs_experiment / pup llm-obs experiments create (experiment_name:
auto-exp-<slug>-<TS>, is_auto_experiment: true), record experiment_created_by_run: true,
and report the id to the user. STOP if creation fails.lapdog is on PATH, run lapdog tags set auto_experiment_id:<EXPERIMENT_ID> 2>/dev/null.domain_notes into ONE AskUserQuestion turn (avoid
multi-round interrogation). Never infer files_to_optimize, evaluators, or the data source
from a detailed goal. If goal and evaluators conflict, STOP and ask which governs.0 judge cost for
deterministic metrics). Always state plainly that orchestration cost (sub-agents, census)
is additional and excluded. Never refine the intake estimate mid-run.case_count cheaply (dataset metadata / queue annotated_count / trace_ids count
or ~100 for ml_app / local file line count). Every scored iteration evaluates both splits
(100% of the corpus, ~1.43× a val-only pass), plus the final pooled test confirm run.cost_basis: "historical_traces", preferred), else (2) static analysis of files_to_optimize
(cost_basis: "static_analysis"), else "unavailable".claude-api pricing skill if present, else
WebFetch provider pricing page — never recalled from memory) and save the rate card to
config.json.prices.estimated_pilot_cost = 3 × case_count × cost_per_case and
estimated_run_cost_range = [max_iterations × 3, max_iterations × max_runs] × case_count × cost_per_case.config.json or touching git: resolved files_to_optimize, goal object, verbatim
evaluators, data source, datadog_backend, defaults (min_shippable_delta, max_iterations,
max_runs with a 1-line explanation of repeated runs), the 1.43× two-split cost note, and the
cost estimate..auto_experiment/config.json schema{
"repo_url": "...", "base_branch": "...", "start_sha": null, "files_to_optimize": [...],
"goal": {"text": "...", "target": "score", "direction": "higher", "hold": []},
"evaluators": "...", "min_shippable_delta": 0.05, "ml_app": null,
"local_dataset_path": null, "dataset_id": null, "trace_ids": [],
"annotation_queue_id": null, "annotation_label_map": {"expected_output": null, "filter": null},
"dd_auto_experiment_id": null, "experiment_created_by_run": false,
"domain_notes": [], "project_id": null, "dataset_mode": null,
"split_created_at": null, "corpus_dataset_id": null, "val_dataset_id": null, "select_dataset_id": null, "test_dataset_id": null,
"split_dataset_names": {"corpus": null, "val": null, "select": null, "test": null},
"val_case_count": null, "select_case_count": null, "test_case_count": null, "split_mode": null,
"split_seed": 0, "split_redraws": 0, "stratify_by": null, "split_strata": null,
"superseded_split_dataset_ids": [], "data_note": null,
"case_count": null, "cost_per_case": null, "code_under_test_cost_per_case": null,
"judge_cost_per_case": null, "cost_basis": null, "prices": null,
"estimated_pilot_cost": null, "estimated_run_cost_range": null,
"datadog_backend": null, "backend_used": null,
"backend_version": null, "backend_fallback": false,
"max_iterations": 8, "max_runs": 5, "runtime": null, "harness_path": null,
"runs": null, "min_delta": null, "guardrail_floors": null, "grader_version": 1,
"judge_flip_rate": null, "noise_floor_test": null, "saturation_class": null,
"preflight": null, "stall_buckets": null, "merge_recommendation": null,
"iteration_results": [], "final_result": {}
}
time_start / time_end on every
iteration_results row (including iteration 0).score_distribution: Computed via loop_helper.py (nearest-rank quartiles +
n/zero/perfect counts over per_case_means on the headline split, basis: "case_means_test").domain_notes: Whenever the user corrects a domain misread, append it verbatim as a
new list entry in config.json.domain_notes; the harness reloads config.json every run.mcp or pupOne switch for the entire run (recorded as backend_used + backend_version). Treat MCP tool names
below as a substitution rule for the selected backend:
| Purpose | mcp tool | pup llm-obs … subcommand | Notes |
|---|---|---|---|
| Read whole dataset | ✗ none (REST GET /api/unstable/llm-obs/v1/datasets/{id}/records, page meta.after; note in data_note) | datasets records-all --dataset-id D | ★ |
| Resolve project | get_llmobs_project | projects list | |
| Create dataset | create_llmobs_dataset | datasets create --project-id P --file body.json | ✎ |
| Insert dataset records | add_llmobs_dataset_records (preview confirmed=false, then confirmed=true) | datasets batch-update --project-id P --dataset-id D --file body.json | ✎ |
| Find dataset by name | list_llmobs_datasets --dataset_name N | datasets list --project-id P | |
| List annotation queues | list_llmobs_annotation_queues | annotation-queues list [--project-id P] | |
| Read queue interactions | get_llmobs_annotated_interactions --only_annotated | annotation-queues interactions list <QUEUE_ID> | ⧉ |
| Queue label schema | get_llmobs_annotation_label_schema | in annotation-queues list → annotation_schema.label_schemas | ⧉ |
| Preview / full records | get_llmobs_dataset_records / get_llmobs_full_dataset_records | datasets records / datasets records-full | ⚠️ ~19 cap / max 3 |
| Traces & spans (LLM-Obs) | search_llmobs_spans, get_llmobs_trace, get_llmobs_span_details, get_llmobs_span_content, expand_llmobs_spans | spans search, spans get-trace, spans get-details, spans get-content, spans expand | ⏱ |
| Traces & spans (APM, when instrumented) | search_datadog_spans, get_datadog_trace | pup apm ... / pup spans ... | use during baseline & census to diagnose code/DB/HTTP/tool bottlenecks |
| Create experiment | create_llmobs_experiment | experiments create --file body.json | only when $experiment-id absent |
| Update experiment | update_llmobs_experiment | experiments update --file body.json <EXPERIMENT_ID> | |
| Submit experiment events | submit_llmobs_experiment_events | experiments events submit --metrics '[{…}]' <EXPERIMENT_ID> |
Backend traps to respect:
get_llmobs_dataset_records or pup datasets records — both cap
at ~19 records with no cursor. Always assert loaded count == true dataset size. Under pup, verify
records-all exists (requires DataDog/pup#678; probe exit code, not --help; missing → STOP).project_id. Under mcp, never retry an ambiguous
confirmed=true without reading back first. Under pup, verify the REST --file body shape
empirically on a 1-record probe before bulk writing.pup, filter client-side to entries with non-empty annotations.
Match labels by label_schema_id (not name_when_saved). Exclude pending, empty-label (""/[]),
and reviewer-contested interactions (never break ties); record all three counts in data_note.pup llm-obs spans * command defaults to --from 1h (older traces
404). Always pass --from 7d --to now (not now-7d)..data on reads; pass <EXPERIMENT_ID> positionally on update and
events submit; non-zero exit is a failed write; check pup --version and pup auth status.datadog_backend: pup missing/unauthenticated (check $PUP_BIN
first) → STOP (never silently switch to MCP). datadog_backend: mcp call failure → fall
back to pup loudly (backend_used: "pup", backend_fallback: true).start_sha = git rev-parse HEAD
and expanded files_to_optimize in config.json.base_branch (e.g. auto-experiment/<short-goal>)..auto_experiment/config.json and .auto_experiment/.gitignore:
cache/
holdout/
data*.jsonl
Raw corpus caches and .auto_experiment/holdout/ are gitignored so sub-agents cannot inspect
raw test rows via git log/git show/rg. eval_results.val.jsonl, errors.val.jsonl,
result.json (aggregate val + test stats), census.json, narrative.md, and config.json
stay committed.update_llmobs_experiment inside
metadata (NOT config — the Auto Experiments UI reads metadata.repo, metadata.branch,
metadata.model, and metadata.estimated_duration_time):
mcp: pass metadata: {"repo": "<repo>", "branch": "<scratch-branch>", "model": "<provider/model-id>", "estimated_duration_time": null}.pup: pup llm-obs experiments update --file body.json <EXPERIMENT_ID> with body
{"data": {"type": "experiments", "attributes": {"metadata": {"repo": "<repo>", "branch": "<scratch-branch>", "model": "<provider/model-id>", "estimated_duration_time": null}}}}
(note pup 1.8.x may exit non-zero parsing the 204/empty response — verify via experiments list read-back that attributes.metadata contains all four keys).
After every scored iteration (including iteration 0), refresh estimated_duration_time = round(mean(elapsed_so_far) × iterations_left) (→ 0 after the final iteration), re-sending
all four metadata keys.Setup verification gate (check every row against a concrete artifact BEFORE Step 1):
| # | Check |
|---|---|
| 1 | start_sha recorded; working tree clean |
| 2 | git branch --show-current is the scratch branch off base_branch |
| 3 | config.json written with expanded files_to_optimize, verbatim evaluators, resolved goal object, min_shippable_delta, data source, and explicit datadog_backend |
| 4 | Valid UUID in dd_auto_experiment_id (passed or auto-created) |
| 5 | update_llmobs_experiment succeeded (under pup, verify attributes.metadata.{repo,branch,model} via experiments list read-back) |
| 6 | Backend reachable (pup auth status → authenticated: true under pup; step 5 proves mcp) |
| 7 | project_id resolved (not guessed) in dataset_mode: datadog |
| 8 | git check-ignore -v .auto_experiment/holdout/eval_results.test.jsonl confirms holdout/ and cache/ are ignored |
config.json, census.json, best_sha, harness runs on both
splits, loop_helper.py checks, keep/discard decisions, narrative.md, and LLM-Obs reporting.goal,
evaluators, expanded files_to_optimize, ranked census.json buckets + target bucket,
best_sha, verbatim domain_notes, and 1-line summaries of prior attempts). Include these four
lines verbatim in every sub-agent briefing:
"Never open .auto_experiment/holdout/." (Exhaustive allowed files: eval_results.val.jsonl,
census.json, the val cache.)"Describe the behavior, not the content." (No datapoint phrases/entities/constants in edited
files; verified mechanically by 5-gram diff check.)"When you propose removing something, name which cases you expect to regress.""Investigate BOTH code/traces AND prompts deeply before editing." Read the full call graph in
files_to_optimize, run contrastive analysis on 5–10 failing vs 2–3 passing val cases
(input → execution signals/LLM-Obs/APM spans → prompt/context → output → grader
justification), and audit both code (retrieval, filtering, ranking, tool I/O, preprocessing,
control flow, parsing, retries, model params) and prompts (instruction–rubric alignment,
contradictions/edge-case ambiguity, tool/empty-retrieval rules, output schema & reasoning
order). Fix the complete causal chain for your targeted bucket — including coupled bugs in
the same stage or coupled code + prompt edits (lever_layer: code_and_prompt) when both are
needed — never paper over a code bug with a prompt tweak alone.Re-read config.json first: if val_dataset_id and test_dataset_id are already non-null, reuse
them (never re-split or re-insert). Otherwise mint TS=$(date -u +%Y%m%dT%H%M%SZ) once and load the
corpus in priority order:
local_dataset_path: read .jsonl/.csv from disk, normalize to {id, input, expected_output?}. Under dataset_mode: datadog, upload corpus dataset; under local_file,
stay on disk (still run Corpus size gate, stratification, split stamping, and count checks —
skip only Datadog Dataset API writes).dataset_id: load ALL records (records-all on pup; direct REST fallback on mcp if
19), assert loaded count == dataset size, record
corpus_dataset_id, leave user dataset untouched.
annotation_queue_id: fetch annotated interactions only, exclude pending / empty-label /
contested (record counts in data_note), expand content_id spans per rubrics.md
Messages-source guidance, map annotation_label_map via label_schema_id, use interaction
UUID as id, upload auto-exp-<slug>-corpus-<TS>.trace_ids / 5. ml_app (fetch last ~100 traces, widen window if thin, save
trace_ids to config.json): extract messages from child LLM spans, exclude non-target/infra
traces, upload auto-exp-<slug>-corpus-<TS>.Corpus size gate & split (python .auto_experiment/loop_helper.py split …, see rubrics.md):
< 10 scoreable cases → STOP (widen source).10–29 → warn & ask (AskUserQuestion); if confirmed, split_mode: "all_rows" (all rows scored
in-sample, labeled optimistic, no holdout/).30–49 → warn & ask (AskUserQuestion, showing 1/test_count per flip); if confirmed, val_test.≥ 50 → val_test (~70/30 stratified, seeded by split_seed = 0, split stamped on every
record). At ≥ 150, offer an optional 3-way split (val / select / untouched test) so
both select and test have enough cases for statistical power.Upload auto-exp-<slug>-val-<TS> and auto-exp-<slug>-test-<TS> (plus
auto-exp-<slug>-select-<TS> in split_mode: three_way; or write data.{val,test}.jsonl /
data.{val,select,test}.jsonl in local_file mode), record val_dataset_id, select_dataset_id
(if 3-way), test_dataset_id, val_case_count, select_case_count (if 3-way), test_case_count,
split_mode, split_seed, split_strata, and assert the split counts sum to corpus_count.
val_test mode: .auto_experiment/cache/<val_dataset_id>.jsonl and
.auto_experiment/holdout/cache/<test_dataset_id>.jsonl.three_way mode: .auto_experiment/cache/<val_dataset_id>.jsonl and
.auto_experiment/holdout/cache/<select_dataset_id>.jsonl — do NOT hydrate test until
Final Report Step 2 so the final holdout stays genuinely untouched during selection.{id, split, input, expected_output?} lifting id and split from metadata.<split>_case_count (re-hydrate from the same dataset id if missing; never re-split).local_file mode, verify data.val.jsonl / data.test.jsonl (and data.select.jsonl in
three_way mode) line counts instead.files_to_optimize and trace the real execution path (entrypoint → preprocessing → retrieval /
tool calls → filtering / ranking → LLM calls → post-processing / parsing / retries). Record this
call-graph summary so Step 2.5 writes it into census.json.code_map. If historical production
traces exist for the val cases, inspect their LLM-Obs child spans (tool, retrieval,
workflow, task via get_llmobs_trace / expand_llmobs_spans / get_llmobs_span_details)
and APM traces (when APM-instrumented) to see where time, errors, empty retrievals, or bad
tool calls actually occur in code.node for .js/.ts/.mjs/.cjs or package.json; python otherwise or default)
and copy references/eval_harness_template.{py,mjs} to .auto_experiment/eval_harness.{py,mjs}.
Copy scripts/stats.py and scripts/loop_helper.py to .auto_experiment/.generate(line) (real code under test; receives redacted row) and grade(line, generation) (prefer deterministic ground-truth check; LLM-judge fallback using
build_judge_prompt). Capture all available execution signals in generate(): return a rich
signals dict (tools_called, retrieved_count, filtered_count, branch_taken, retries,
parse_fallbacks, step_latencies_ms, apm_trace_id) and preserve LLM-Obs / APM span links via
_export_span_link(). Set AUTO_EXP_WORKERS=4..8 for I/O-bound LLM calls if helpful.references/eval_audit.md): Run all universal checks
(oracle, ground-truth isolation, mechanism wired, resolved scope, loop_helper.py verify-mean to
1e-9, loop_helper.py audit-corpus incl. val ∩ test == ∅) plus conditional LLM checks
(judge_flip_rate, null-baseline, models_seen). Hard STOP on failure.AUTO_EXP_RUNS=3, AUTO_EXP_ITERATION=0) on the active loop splits (explicit
AUTO_EXP_SPLIT, never passing both AUTO_EXP_DATA and AUTO_EXP_DATASET_ID):
# val_test mode:
AUTO_EXP_SPLIT=val AUTO_EXP_DATASET_ID=<val_id> AUTO_EXP_RUNS=3 AUTO_EXP_ITERATION=0 python .auto_experiment/eval_harness.py
AUTO_EXP_SPLIT=test AUTO_EXP_DATASET_ID=<test_id> AUTO_EXP_RUNS=3 AUTO_EXP_ITERATION=0 python .auto_experiment/eval_harness.py
# three_way mode: score `val` and `select` (NEVER open `test` during the loop):
# AUTO_EXP_SPLIT=select AUTO_EXP_DATASET_ID=<select_id> ...
Price baseline rows from config.json.prices, record baseline cost & p50/p95 latency, and run
python .auto_experiment/loop_helper.py summarize-signals --results-jsonl .auto_experiment/eval_results.val.jsonl
to contrast execution signals between passing vs failing val cases and pull the failing
trace_ids for LLM-Obs child-span & APM trace inspection so you know what the code actually
did during baseline execution (not just what text came out).
Commit harness, stats.py, loop_helper.py, config.json, and eval_results.val.jsonl
(keeping holdout/ gitignored). Defer iteration-0 LLM-Obs reporting until Step 2.4.references/eval_audit.md)Before deriving noise: classify every baseline 0 as harness error vs grader verdict; drop
harness-error rows from both splits' denominators and re-score baselines; spot-check lowest val
verdicts (if >~10% are grader bugs, fix rubric with user approval, re-grade via AUTO_EXP_REGRADE=1,
bump grader_version).
Batch independent setup/Gate-1/baseline shell commands instead of running one command per turn,
and use the single-call composite init-baseline right after Step 2.3 (zero triage):
python .auto_experiment/loop_helper.py init-baseline \
--config .auto_experiment/config.json --sha <start_sha> \
--val-stdout <val.json> --test-stdout <test.json> \
--val-jsonl .auto_experiment/eval_results.val.jsonl \
--test-jsonl .auto_experiment/holdout/eval_results.test.jsonl \
--time-start <iso> --payload-out /tmp/iter0_payload.json
(In three_way mode pass --select-stdout/--select-jsonl; in all_rows mode pass --all-stdout/--all-jsonl.)
In one call this executes:
verify-mean to 1e-9 on both splits (hard-fails before mutating state on mismatch),summarize-signals on val (contrasting passing vs failing execution signals & trace ids),calibrate (σ = max(stdev_val, stdev_test), min_delta using 0.02 floor for score or
0.02 × |baseline| for cost_usd/latency_s, runs = clamp(ceil(8·(σ/min_delta)²), 3, max_runs),
and guardrail_floors for every metric in goal.hold[]),
status == "needs_rerun_at_derived_runs" (derived_runs > pilot_runs), re-run BOTH
baselines at derived_runs and call init-baseline again.check-climbability (noise_floor, headroom, saturation class, val vs test
population check — allowing at most one split re-draw before iteration 1; hard-STOP only on
always_zero, perfect, or population mismatch; tight noise floor emits GO with caveat),config.json, writes Iter-0 result.json, records Iter-0,
renders narrative.md, and builds submit_payload ready to send to LLM-Obs (one
auto_experiment_score event per iteration — see references/reporting.md). Never step over a STOP.val only, grounded in code, prompts & trace signals)Run Phase A (parallel describer sub-agents over every failing val case, capped at a random
200 with "sampling": "random-200" — handing each describer the case's execution signals and
linked LLM-Obs child spans / APM trace details alongside input/output/justification, while keeping
no category list, no expected_output, and never holdout/) and Phase B (orchestrator
synthesizes emergent buckets against code_map, tagging each bucket with likely_layer,
code_locations, trace_evidence, and reachable ceiling
bucket_count / scored × (1 − mean_bucket_score) + bare holdout_failing_total). Write and commit
.auto_experiment/census.json alongside the baseline commit.
Spawn a fresh sub-agent (with the 4 verbatim briefing rules, census.json's code_map, and
ranked remaining failure buckets with likely_layer/code_locations/trace_evidence) to target
the highest-leverage remaining failure bucket and fix its complete causal chain (one
coherent root-cause hypothesis per iteration — fixing coupled bugs within that causal mechanism or
coupled code + prompt changes together as lever_layer: code_and_prompt rather than shipping a
half-fix that scores 0, while avoiding unrelated shotgun edits across buckets).
Require deep investigation across both code and prompts (rubrics.md):
val signals (summarize-signals), child
spans, retrieval/filter/ranking logic, tool schemas/I/O, parsers, retries, and model parameters.
Never edit a prompt to compensate for a code bug; if stop-check reports
require_non_prompt_lever: true, the next attempt MUST target a non-prompt code/param lever.evaluators, (b) conflicting rules or unspecified boundary conditions,
(c) missing tool-use / empty-retrieval / uncertainty guidance, and (d) output schema & reasoning
order expected by parsers/graders — always describing generalizable behavior, never dataset rows.Pass --lever-layer (including code_and_prompt for coupled fixes) into finish-iteration (or
decide). Commit on the scratch branch, then run before spending a full two-split eval:
rubrics.md): if probe reaches 0 failing val cases →
record no_change, skip full eval. If the top single bucket's ceiling is below min_delta, look
for a shared/cross-cutting root cause spanning multiple buckets before giving up as no_change.git diff <best_or_start_sha> -- <files_to_optimize> | python .auto_experiment/loop_helper.py check-memorization --diff-file - --val-cache <val_cache>
Review any hit; unexplained hit → discard (basis:memorized).git diff --quiet -- <harness_path> (modified harness = STOP).AUTO_EXP_SPLIT=val and AUTO_EXP_SPLIT=test in
val_test mode; AUTO_EXP_SPLIT=val and AUTO_EXP_SPLIT=select in three_way mode —
leaving test untouched until Final Report Step 2; AUTO_EXP_SPLIT=all in all_rows mode),
same runs, AUTO_EXP_ITERATION=<n>, verify raw-row mean recomputation to 1e-9, price rows,
and evaluate goal.hold[] guardrails.finish-iteration): run
python .auto_experiment/loop_helper.py finish-iteration --config .auto_experiment/config.json --iteration <n> --sha <sha> --change "<one-line>" --time-start <iso> --best-val … --cand-val … --best-test … --cand-test … [--cand-val-jsonl … --cand-test-jsonl …] --lever-layer <layer>
(pass --best-select/--cand-select in three_way mode or --best-all/--cand-all in
all_rows mode; split_mode, goal.target, goal.direction, min_delta, guardrail_floors,
and dd_auto_experiment_id are read automatically from config.json). In one call this
chains verify-mean (to 1e-9) → id-keyed audit → decide (keep/discard matrix,
stats.py confidence labels, suspicion guard) → write result.json → atomic record into
config.json → render-narrative → build submit_payload → stop-check. If
status: "needs_suspicion_check" is returned, hand-check 3–5 flipped val rows and re-run
with --suspicion-checked (or discard). (The individual subcommands audit, decide,
record, render-narrative, submit-payload, and stop-check remain available when needed.).auto_experiment/result.json, config.json, and narrative.md (keeping holdout/
gitignored).submit_payload, refresh estimated_duration_time from
record.estimated_duration_time, and act on stop_check.action (continue / stall_triage /
stop — see references/reporting.md).files_to_optimize to best-so-far (never git reset --hard, which wipes
discarded iterations from config.json and narrative.md!):
git checkout <best_sha> -- <files_to_optimize>git checkout <start_sha> -- <files_to_optimize>files_to_optimize.kept, re-run python .auto_experiment/loop_helper.py summarize-signals --results-jsonl .auto_experiment/eval_results.val.jsonl
and inspect 5–10 of the remaining failing val rows (and any regressions) before launching the
next sub-agent. Fixing the top failure bucket frequently unmasks downstream bugs (e.g., parser or
prompt issues hidden behind broken retrieval) that were invisible in Iteration 0's census.json.
(If the previous iteration landed basis:unreplicated with a meaningful test gain on a noisy
metric, you may re-run it once to check repeatability before discarding.)val_dataset_id + test_dataset_id, or val_dataset_id +
select_dataset_id in three_way mode) and committed harness (never re-split or recompute
baseline; re-hydrate missing caches per Step 1.5; never touch test in three_way mode).loop_helper.py finish-iteration, commit, LLM-Obs reporting). Continue until
stop-check returns stop (do not stop early after a single kept win while clear failure
buckets and iteration budget remain).Run python .auto_experiment/loop_helper.py stop-check --config .auto_experiment/config.json after
every iteration to evaluate the exact state machine (continue | stall_triage | stop):
imp_done, excluding stall_triage) reaches
max_iterations.plateau_discard_streak == 3): increment on every decision:discarded scored
iteration; reset to 0 on every decision:kept (including within_noise keeps); no_change
neither increments nor resets.
rubrics.md, decision:no_change, basis:stall_triage) and record
stall_dispatch on that iteration_results row so stop-check updates the streak
deterministically:
artifact_gap (reset streak & continue), grader_disagreement (user approval → snapshot →
AUTO_EXP_REGRADE=1 → check ranking flip → basis:regraded, reset streak if continuing),
harness_infra (fix & void/re-run, reset streak), structural (reorganize / breadth_pass,
reset streak; or record stall_dispatch: "out_of_scope" to stop if the lever sits outside
files_to_optimize), variance (stop: "noise floor reached (stall: variance)").stop_reason: "plateau (3 consecutive discards)". Always record
plateau_discard_streak in final_result.no_change streak: stop after 5 consecutive no_change iterations. Every no_change
submits a carried-forward marker (decision:no_change, score_value = best_score), never 0.final_result is written AFTER test confirm)within_noise): re-run best & prior best on
test at max_runs, pool, recompute stats; if promoted, re-submit that iteration with
basis:promoted + promoted:higher_power_confirmation.test confirm run (the real headline):
git checkout <start_sha> -- <files_to_optimize> → run with
AUTO_EXP_SPLIT=test AUTO_EXP_RUNS=<max_runs> AUTO_EXP_RESULTS=.auto_experiment/holdout/confirm_baseline.test.jsonl
(plus AUTO_EXP_DATASET_ID=<test_id> or AUTO_EXP_DATA=.auto_experiment/data.test.jsonl in
local_file mode — never both).git checkout <best_sha> -- <files_to_optimize> → run with
AUTO_EXP_RESULTS=.auto_experiment/holdout/confirm_best.test.jsonl.test runs via
python .auto_experiment/loop_helper.py pool-confirm --config .auto_experiment/config.json --baseline-results … --best-results … --target <goal.target> --min-delta <d> --direction <dir> [--hold-floors-json '<guardrail_floors>'] [--hold-score-min-delta <floor>] --dataset-id <test_id>,
which computes paired_bootstrap_delta, paired_case_test, t_two_sample, wilson (if
binary score), n_moved, held-score guardrail check, and merge_recommendation deterministically.test_dataset_id now for the first and only time, run baseline vs best
on untouched AUTO_EXP_SPLIT=test at max_runs, and pass those two files to pool-confirm as
an unbiased holdout. all_rows: run baseline vs best on AUTO_EXP_SPLIT=all and record under
final_result.all, labeling results in-sample.)merge_recommendation:
test improvement in direction → "do_not_merge_regression", restore original code via
git checkout <start_sha> -- <files_to_optimize>, set best_sha = "".t_case < 2 OR n_moved ≤ 2 →
"do_not_merge_within_noise" (keep best_sha, explicitly advise not merging)."merge".final_result into config.json and commit (explicit val and test blocks,
merge_recommendation, selection_rounds, plateau_discard_streak, noise_calibration,
reasoning — schema in references/reporting.md).python .auto_experiment/loop_helper.py verify-final --config .auto_experiment/config.json.references/reporting.md (confirmed test delta + bootstrap CI +
t_case + n_moved in one sentence + explicit selection-bias disclosure distinguishing rerun
variance from case-selection bias, merge_recommendation, final narrative.md table,
[REQUIRED]/[TUNE], 2–3 before/after val pairs, failure taxonomy of remaining zeros, next
levers, scratch branch + best commit, LLM-Obs experiment link).update_llmobs_experiment once, last (status: "completed" if it reached the final report, "failed" with error only if aborted before any
scored iteration).references/eval_audit.md (opens in a new tab)references/eval_harness_template.mjs (opens in a new tab)references/eval_harness_template.py (opens in a new tab)references/reporting.md (opens in a new tab)references/rubrics.md (opens in a new tab)scripts/loop_helper.py (opens in a new tab)scripts/stats.py (opens in a new tab)scripts/test_auto_experiment.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub datadog-labs/agent-skills --plugin agent-skills78 skills in this plugin
/agent-observability-build-eval-from-annotationsFit a Datadog LLM-Obs evaluator to human labels. Takes an annotation queue, works out where in the trace the labelled property actually lives, drafts an LLM-judge that predicts the human label, scores that judge against the already-labelled rows with a metric agreed with the user, then hill-climbs it — inspect the errors, make one focused change, re-score, keep it only if it beats the best — for a bounded number of iterations, and finally publishes the winner to Datadog as a DISABLED evaluator (not a Datadog draft — a real evaluator with `enabled: false`). Use when the user says "build an eval from my annotations", "build an evaluator from the annotation queue", "turn my annotations into an evaluator", "learn an evaluator from my labels", "fit a judge to the annotation queue", "auto-label", "auto labelling", "automate this annotation queue", "scale up my human labels", or wants the rest of a queue graded the way the humans graded the first rows. Needs an annotation queue with at least two classes present in the human labels (e.g. one true and one false for a boolean)./agent-observability-eval-bootstrapBootstrap evaluators from production traces — by default propose online LLM-judge evaluators and, after you confirm, create them in Datadog as disabled drafts (never auto-enabled); on request emit Python SDK code or a framework-agnostic JSON spec instead. Use when user says "bootstrap evaluators", "generate evaluators", "create evals from traces", "eval bootstrap", "write evaluators", "build eval suite", "publish evaluators", or wants to generate BaseEvaluator/LLMJudge code or online judge configs from production LLM trace data. Works with ml_app and optional RCA report or failure hypothesis.Other plugins' skills for the same job