This repository contains the reproducibility code for the paper:
Auditing Unsupervised Trajectory Clustering in LLM-Agent Failure Analysis: A Multi-Dataset Validation Protocol.
The project audits a common claim in LLM-agent observability: that unsupervised clusters over agent trajectories align with failure labels. The paper does not propose a new failure taxonomy or a new clustering algorithm. It implements a four-part validation protocol for interpreting cluster-label alignment:
- outcome-leakage audit,
- stratified label validation against obvious task/framework confounds,
- per-tag validation for multilabel annotations,
- matched-
Kbaselines against random, single-feature, and confound-oracle partitions.
The committed outputs are summary artifacts used for numeric checks. Raw datasets are not stored in this repository; they are downloaded from their public or gated upstream sources via the pinned downloader.
configs/ Experiment YAML files.
src/ Dataset loaders, feature extraction, clustering, validation, reporting.
scripts/ Dataset download, robustness, ablation, case-study, and figure scripts.
outputs/ Summary CSV outputs and run manifests used by the paper.
figures/ Paper figures generated from the summary outputs.
main.py Config-driven experiment entry point.
Excluded from the public release:
- raw datasets under
data/, - virtual environments and local caches,
- per-trajectory feature matrices and cluster-assignment CSVs,
- manuscript drafts and venue-specific submission files.
Python 3.10 or newer is required. The original experiments were run with Python 3.11.
Using uv:
uv venv
uv pip install -e ".[all]"Using pip:
python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[all]"The downloader recreates the expected directory layout under
data/external/. Hugging Face revisions and git commits are pinned in
scripts/download_external_datasets.py.
python scripts/download_external_datasets.py --datasets coreNotes:
microsoft/AgentRxis gated on Hugging Face and requires prior access.- If you want to run only the public non-gated downloads first:
python scripts/download_external_datasets.py --datasets core --skip-gatedRun the three main benchmark configurations:
python main.py --config configs/experiments/aftraj.yaml
python main.py --config configs/experiments/agenterrorbench.yaml
python main.py --config configs/experiments/agentrx.yamlRun the within-domain AFTraj configurations:
python main.py --config configs/experiments/aftraj_math.yaml
python main.py --config configs/experiments/aftraj_coding.yaml
python main.py --config configs/experiments/aftraj_agentic.yamlRun the analysis scripts used for robustness and paper tables:
python scripts/seed_variance_analysis.py
python scripts/feature_group_ablation.py
python scripts/planning_phenotype_analysis.py
python scripts/agentrx_root_cause_analysis.py
python scripts/render_figures.pyEach run writes a run_manifest.json and run_manifest.yaml with the
resolved configuration, config hash, software versions, and headline metrics.
This public release includes compact summary outputs such as
cluster_label_validation.csv, cluster_baseline_comparison.csv,
k_sensitivity.csv, seed-variance summaries, and run manifests.
It intentionally excludes raw trajectories and per-trajectory derived files
(trajectory_features.csv, cluster_assignments.csv) so the repository stays
small and source-focused. These files are regenerated by running the commands
above after downloading the datasets.
If you use this code, cite the archived Zenodo release:
Lee, R., & Oh, T. (2026). Agent Trajectory Cluster Audit (v0.1.0). Zenodo. https://doi.org/10.5281/zenodo.20344064
The GitHub repository alone is not the archival citation target.
This code is released under the MIT License. See LICENSE.