Skip to content

Latest commit

 

History

History
111 lines (85 loc) · 6.12 KB

TEST_REPORT.md

File metadata and controls

111 lines (85 loc) · 6.12 KB

DevContext Test Suite & Benchmark Report

Date: 2026-11-21
Target Environment: Python 3.13 / Windows
Frameworks: DevContext Native Test Harness, Model Context Protocol (MCP) SDK


1. Executive Summary

This report documents the verification, unit testing, and empirical benchmarking of DevContext across:

  1. Core Unit & Architecture Tests (Parser, Diagnostic Tools, Benchmark Engine, Multi-Agent Loop): 17 / 17 PASSED (100%)
  2. Deterministic Multi-Format Parser: Verified across JSON-lines, CSV, and Space/Bracketed logs.
  3. 50-Scenario Benchmark (eval.py): Strict evaluation under synthetic production chaos (noisy logs, red-herring deploys, delayed regressions, connection pool saturation).

2. Unit & Integration Test Suite (tests/run_all.py)

Run via:

python tests/run_all.py

Results Summary: 17 / 17 Passed (100.0%)

Test Suite Test Name Assertion Target Status
Suite 1: Parser (test_parser.py) test_parser_JSON-lines parsing Detects JSON-lines schema; extracts log levels PASS
test_parser_CSV parsing Detects comma delimiter; indexes fields PASS
test_parser_Bracketed ISO parsing Parses bracketed ISO 8601 timestamps without schema PASS
Suite 2: Tools (test_tools.py) test_bad_deploy_blames_commit Identifies exact culprit commit f8a1c92 PASS
test_disk_full_is_not_blamed_on_old_deploy Attributes cause to disk exhaustion without falsely blaming old deploy PASS
test_error_signatures_are_grouped Normalizes dynamic tokens (#<N>) into pattern clusters PASS
Suite 3: Benchmark (test_benchmark.py) test_generator_is_deterministic Verifies reproducibility across identical generator seeds PASS
test_handwritten_scenarios_all_pass 5/5 original handwritten scenarios pass PASS
test_scoring_has_no_pass_by_default Strict scorer rejects ungrounded/default predictions PASS
test_bad_deploy_requires_correct_commit Rejects diagnosis if commit SHA is incorrect PASS
Suite 4: Multi-Agent (test_agent.py) test_agent_runs_tools_and_returns_submission Tool-calling loop executes and submits diagnosis PASS
test_invalid_type_becomes_unclear Invalid taxonomy category falls back to unclear PASS
test_agent_that_never_submits_is_unclear Agent loop halts and classifies incomplete runs PASS
test_verifier_can_overturn_draft Skeptical verifier rejects ungrounded draft and overrides PASS
test_verifier_garbage_keeps_draft Malformed verifier output preserves investigator draft PASS
test_llm_raw_baseline_parses_json Single-shot raw baseline parsing works PASS
test_responses_are_cached_per_run_index Response caching avoids redundant API calls per run PASS

3. Format-Adaptive Parser Verification (scripts/parser_demo.py)

Tested against three real-world telemetry formats:

Format 1: JSON-lines
  Detected Structure: {'format': 'json_lines', 'keys': {'ts': 'timestamp', 'level': 'level', 'msg': 'message'}}
  Parsed Events: 4/4 | Normalized Patterns: High CPU (<N>%), Pool Saturated (<N>/<N>), Failed tx (#<N>)

Format 2: CSV
  Detected Structure: {'format': 'csv', 'delimiter': ',', 'indices': {'ts': 0, 'level': 1, 'msg': 2}}
  Parsed Events: 4/4 | Normalized Patterns: Disk capacity (<N>%), HTTP <N> Gateway Timeout (<N>ms)

Format 3: Bracketed ISO 8601
  Detected Structure: {'format': 'space_delimited', 'timestamp': 'bracketed_iso'}
  Parsed Events: 4/4 | Normalized Patterns: Heap alert (<N>%), OOM killer (PID <N>)

4. Benchmark Evaluation: Rule Heuristic Baseline (eval.py)

Overall Benchmark Score: 46.0% (23 / 50)

Evaluated against all 50 scenarios (handwritten + 45 generated test vectors):

METHOD: rule   SET: all   SPLIT: all   SCENARIOS: 50   RUNS: 1
OVERALL ACCURACY: 46.0% (23/50)

Breakdown by Incident Family

Incident Family Accuracy Pass / Total Failure Mode Analysis
bad_deploy 45.5% 5 / 11 Fails on delayed regressions (>10m window)
disk 70.0% 7 / 10 Misfires when decoy health metrics or red-herring deploys exist
memory_leak 70.0% 7 / 10 Misfires when recent red-herring deploy steals attribution
downstream_dependency 40.0% 4 / 10 Keyword heuristic misinterprets external 503s as internal disk/db issues
db_pool 0.0% 0 / 9 Zero rule coverage; connection pool starvation always misdiagnosed

Breakdown by Scenario Variant

Variant Stress Characteristic Rule Accuracy
handwritten Clean baseline, 5 standard scenarios 100.0% (5/5)
clean Single clear signal, sparse log trace 80.0% (12/15)
noisy 300+ lines, benign warnings, decoy metrics 40.0% (6/15)
red_herring_deploy Innocent deploy occurs 2-8 min before failure 0.0% (0/12)
delayed Bug manifests 25-90 min after deploy 0.0% (0/3)

Top Failure Modes (Ground Truth $\rightarrow$ Predicted)

  1. bad_deploy $\rightarrow$ unclear (6 occurrences): Eager window cutoff missed delayed impact.
  2. db_pool $\rightarrow$ unclear / disk / bad_deploy (9 occurrences): Missing rule causes arbitrary misattribution.
  3. disk $\rightarrow$ bad_deploy (3 occurrences): Red-herring deploy hijacked causality.
  4. downstream_dependency $\rightarrow$ disk (3 occurrences): Decoy metric tripped false alarm.

5. Architectural Implications

The empirical evaluation proves why rule-based heuristics cannot scale to distributed production environments:

  1. Red-Herring Vulnerability: A rule engine that correlates on temporal proximity alone suffers a 100% failure rate when innocent deployments precede unrelated outages.
  2. Noise Degradation: Benign warnings degrade accuracy by 40%.
  3. Value of the Multi-Agent Architecture (agent_verified): The Investigator + Skeptical Verifier pattern explicitly addresses these failure modes by verifying commit diffs against error signatures rather than assuming causality from timestamps alone.