Skip to content

Killing Agents with SIGKILL (240 Trials) & Why Flat Markdown Breaks Hierarchical RAG

Published: 2026-11-30 · Repos: Harness3 (agent-chaos) · GraphRAGAgent (doc-hierarchy-bench) · AgentReliabilityLab (bench-audit)


Part 1: agent-chaos — 240 Real OS Process Kills Across 4 Crash Boundaries

Claim

Checkpointing an agent after a tool executes does not prevent duplicate side effects. Across 240 live OS process kills (subprocess.Popen + hard proc.kill() = SIGKILL / TerminateProcess) against an idempotency-counted SQLite side-effect ledger (charge_card → write_record → send_webhook), naive retries produced 160 duplicate executions, uncoordinated checkpoints (reproducing the langgraph#8039/#7417/#5672 persistence-ordering boundary) produced 80 duplicate executions + 20 orphaned writes + 20 corrupt streams, while Harness3's write-ahead SQLite WAL operation-ID journal achieved 80/80 clean recoveries with 0 duplicates.

agent-chaos 240 SIGKILL Matrix

Measured Matrix (N=20 real OS kills per cell, 73.35s total runtime)

Runtime Architecture pre_checkpoint post_write_pre_ack mid_stream on_cancel Total Duplicate Side Effects Verdict
naive_retry (no journal) 0/20 clean (20 dups, 106.1 ms p50) 0/20 clean (40 dups, 100.0 ms p50) 0/20 clean (60 dups, 20 corrupt) 0/20 clean (40 dups, 98.0 ms p50) 160 FAIL
uncoordinated_checkpoint (put_writes ordering race) 0/20 clean (20 dups, 161.3 ms p50) 0/20 clean (20 dups, 20 orphans) 0/20 clean (20 dups, 20 corrupt) 0/20 clean (20 dups, 95.9 ms p50) 80 FAIL
harness3_wal_journal (WAL + pre-call op-ID) 20/20 (0 dups, 77.0 ms p50) 20/20 (0 dups, 52.4 ms p50) 20/20 (0 dups, 28.8 ms p50) 20/20 (0 dups, 55.7 ms p50) 0 PASS

Reproduce locally:

git clone https://github.com/cuhawk/Harness3 && cd Harness3
pip install -e .
agent-chaos run --trials 20


Part 2: doc-hierarchy-bench — 4-Way Document Hierarchy Retrieval Ablation

Claim

Flattening PDFs into fixed 512-char chunks or collapsing Markdown headings to H2 (docling#1023) destroys multi-section retrieval and table attribution. Preserving full H1 > H2 > H3 > Table breadcrumbs (docling#287) plus hybrid graph traversal raises Recall@5 from 0.5208 → 1.0000, MRR@10 from 0.4050 → 0.9167, and Section-Attribution Accuracy from 0.1458 → 0.8542 across 48 hierarchical queries (2,000-resample bootstrap 95% CIs).

doc-hierarchy-bench 4-way retrieval ablation

Measured Results (benchmarks/doc_hierarchy_ablation.csv, 48 queries, seed=42)

Strategy Chunks Recall@5 (95% CI) MRR@10 (95% CI) nDCG@10 (95% CI) Section Attribution Median Latency
flat_fixed_512 100 0.5208 [0.375, 0.646] 0.4050 [0.295, 0.522] 0.4762 [0.364, 0.592] 0.1458 0.30 ms
flat_markdown_h2 (docling#1023) 168 0.7500 [0.625, 0.875] 0.4269 [0.331, 0.532] 0.5176 [0.417, 0.613] 0.0000 5.27 ms
hierarchy_breadcrumb_chunks 168 0.9583 [0.896, 1.000] 0.8698 [0.792, 0.941] 0.9020 [0.841, 0.957] 0.7917 10.02 ms
hierarchy_plus_hybrid_graph 168 1.0000 [1.000, 1.000] 0.9167 [0.854, 0.969] 0.9378 [0.892, 0.977] 0.8542 21.30 ms

One surprising result: flat_markdown_h2 boosted Recall@5 over fixed 512-char chunking (0.5208 → 0.7500) yet collapsed Section-Attribution Accuracy to 0.0000—because flattening every heading to H2 erased the parent H1/H3 path needed to distinguish identically named subsections across chapters.


Part 3: Catching Silent Denominator Inflation (bench-audit)

Inspired by real evaluation disputes (MemPalace#27 +234 👍, inspect_ai#4286), AgentReliabilityLab now ships bench-audit to verify pinned-commit LongMemEval, LoCoMo, and RAG JSONL runs against full intended denominators. On our sample audit suite (benchmarks/bench_audit_sample_report.csv), silently dropping 4 errored + 4 missing items inflated a LongMemEval-S score by +10.77 pp (0.7000 strict vs 0.8077 filtered vs 0.8167 claimed) — flagged immediately as INTEGRITY_FAILURE.


What I'd Distrust in These Experiments

  1. Idempotency requires cooperative downstream keys: harness3_wal_journal prevents duplicate calls from the agent runtime and deduplicates against idempotency-keyed tools. If a third-party external webhook ignores Idempotency-Key headers and the OS dies between TCP packet transmission and socket ACK, no client-side WAL alone can guarantee exactly-once external delivery—only at-most-once or at-least-once with reconciliation.
  2. Corpus size in doc-hierarchy-bench (48 queries, 6 technical specs): Our corpus isolates hierarchical and cross-section failure modes cleanly, so the lift (+47.9 pp Recall@5) represents structured technical docs—not unstructured prose where flat chunking performs much closer to hierarchy-aware chunking.
  3. Latency overhead of graph traversal (0.30 ms → 21.30 ms): hierarchy_breadcrumb_chunks alone captures 95.8% of Recall@5 at half the latency (10.02 ms). Only pay the graph-hop cost when your queries genuinely cross sections.