Skip to content

test: add unit tests for FrameTracer and DivergenceDetector (closes #208)#220

Open
acailic wants to merge 5 commits into
mainfrom
test/frame-tracer-divergence-detector-208
Open

test: add unit tests for FrameTracer and DivergenceDetector (closes #208)#220
acailic wants to merge 5 commits into
mainfrom
test/frame-tracer-divergence-detector-208

Conversation

@acailic

@acailic acailic commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/test_frame_tracer_and_divergence_detector.py with 79 unit tests
  • Covers frame_tracer.py: TokenUsage, ExceptionInfo, FrameEvent, FrameCost, FrameLifetimeTrace, FrameCaptureContext, capture_function_call decorator, build_frame_tree, get_cost_breakdown, to_dict/from_dict round-trip, _serialize_value
  • Covers divergence_detector.py: DivergencePoint, SessionComparison, detect_divergences, compare_session_structures, analyze_temporal_divergence, analyze_behavioral_divergence, and all internal helper functions

Test plan

  • python3 -m pytest tests/test_frame_tracer_and_divergence_detector.py -q → 79 passed, 0 failed
  • ruff check tests/test_frame_tracer_and_divergence_detector.py → All checks passed

Closes #208

🤖 Generated with Claude Code

acailic and others added 5 commits June 13, 2026 15:03
- Extract StrEnum 3.10 compat shim into agent_debugger_sdk.core._compat
  (removed 7 duplicate copies from core modules)
- Fix duplicate CoordinationIssue in core/__init__.py __all__
- Add composite indexes: events(session_id,timestamp), events(tenant_id,event_type),
  events(tenant_id,timestamp), sessions(tenant_id,started_at), checkpoints(session_id,sequence)
- Add session-scoped shared_app fixture in conftest.py replacing module-level
  _shared_app in 7 test files
- Enable pyright type checking in CI (remove || true, add --ignoreexternal)
- Create CHANGELOG.md

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
- api/schemas.py → re-export facade for backward compatibility
- api/schemas_core.py: sessions, events, checkpoints, traces, API keys
- api/schemas_alerts.py: anomaly alerts, alert policies, fix notes
- api/schemas_analysis.py: workflow, safety, redundancy, causal, drift, baseline

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
- Move test_collector_*.py → tests/collector/
- Move test_research_*.py → tests/research/
- Move test_alert_*.py → tests/alerts/
- Move test_e2e_*.py, test_phase2_*.py → tests/integration/
- Add frontend/src/utils/logger.ts centralized logging utility
- Replace 30+ raw console.log/warn/error with logger in 14 files
- Add deprecation note to core/__init__.py barrel module

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
…ks, docs

- Add /api/version endpoint for API contract versioning
- Add frontend/src/api/httpClient.ts typed fetch wrapper
- Add tests/contract/test_schema_alignment.py (Session + TraceEvent fields)
- Add agent_debugger_sdk/telemetry/ OpenTelemetry integration (opt-in)
- Add tests/test_performance_regression.py (app startup, serialization, queries)
- Add TraceEventSchema documentation explaining flat-union pattern
- Add redaction/ module documentation
- Add frontend/src/utils/d3.ts typed D3 wrapper for visualization
- Add core/__init__.py barrel deprecation note

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
79 tests covering TokenUsage, ExceptionInfo, FrameEvent, FrameCost,
FrameLifetimeTrace, FrameCaptureContext, capture_function_call decorator,
build_frame_tree, get_cost_breakdown, to_dict/from_dict round-trip,
DivergencePoint, SessionComparison, detect_divergences, and all public
and internal helper functions in both modules.

Closes #208

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add unit tests for FrameTracer and DivergenceDetector (zero coverage)

1 participant