Problem
agent_debugger_sdk/core/frame_tracer.py (603 lines) and agent_debugger_sdk/core/divergence_detector.py (730 lines) have zero test coverage.
These are substantial modules implementing:
- FrameTracer: function-level tracing, frame lifetime capture, call tree building, cost analysis (ADI / FSE 2026)
- DivergenceDetector: structural, temporal, behavioral, state, and performance divergence detection between sessions
Every other research module (ConformalScorer, CausalTracer, ErrorAttribution, SafetyMonitor, RedundancyScorer) has tests in tests/test_research_features.py. These two do not.
Scope
Add a new test file tests/test_frame_tracer_divergence.py (or extend test_research_features.py) covering:
FrameTracer
TokenUsage arithmetic and serialization
FrameEvent dataclass and to_dict()
FrameLifetimeTrace construction
FrameTracer.trace() decorator/context manager
- Call tree building and cost breakdown
DivergenceDetector
DivergenceType / DivergenceSeverity enum values
DivergencePoint dataclass and to_dict()
detect_divergences() with matching and diverging event lists
compare_session_structures()
analyze_temporal_divergence()
analyze_behavioral_divergence()
Validation
.venv-ci/bin/python3 -m pytest -q tests/test_frame_tracer_divergence.py
.venv-ci/bin/ruff check .
Labels
Problem
agent_debugger_sdk/core/frame_tracer.py(603 lines) andagent_debugger_sdk/core/divergence_detector.py(730 lines) have zero test coverage.These are substantial modules implementing:
Every other research module (
ConformalScorer,CausalTracer,ErrorAttribution,SafetyMonitor,RedundancyScorer) has tests intests/test_research_features.py. These two do not.Scope
Add a new test file
tests/test_frame_tracer_divergence.py(or extendtest_research_features.py) covering:FrameTracer
TokenUsagearithmetic and serializationFrameEventdataclass andto_dict()FrameLifetimeTraceconstructionFrameTracer.trace()decorator/context managerDivergenceDetector
DivergenceType/DivergenceSeverityenum valuesDivergencePointdataclass andto_dict()detect_divergences()with matching and diverging event listscompare_session_structures()analyze_temporal_divergence()analyze_behavioral_divergence()Validation
.venv-ci/bin/python3 -m pytest -q tests/test_frame_tracer_divergence.py .venv-ci/bin/ruff check .Labels