Skip to content

Step13 conversation observability#15

Merged
fdidonato merged 14 commits into
mainfrom
step13-conversation-observability
May 18, 2026
Merged

Step13 conversation observability#15
fdidonato merged 14 commits into
mainfrom
step13-conversation-observability

Conversation

@fdidonato
Copy link
Copy Markdown
Owner

No description provided.

fdidonato and others added 14 commits May 13, 2026 18:41
The _build_controller_with_constitution fixture was assigning
overlay_policy.is_overlay_sensitive and controller.is_overlay_sensitive
directly via module attribute assignment (without monkeypatch). This made
the patches LEAK across tests: after TestLedgerPostureSymmetry ran, the
global is_overlay_sensitive function retained the last test's lambda for
the rest of the pytest session.

This corrupted 5 tests in test_orchestrator.py that depend on the real
is_overlay_sensitive returning False for non-sensitive domains:
- TestOrchestratorFastPath::test_fast_path_low_risk
- TestOrchestratorFastPath::test_fast_path_no_critic
- TestIntegration::test_full_flow_benign_request
- TestControllerRouteDispatching::test_dispatch_to_route_benign
- TestControllerRouteDispatching::test_dispatch_to_route_fast_path

These tests passed when test_orchestrator.py was run in isolation but
failed in the full suite. The 5 failures were not regressions in
production code — production was fine — but pure test isolation bugs.

Fix: switch the fixture to take a monkeypatch parameter and use
monkeypatch.setattr, which pytest auto-restores at test teardown.
The four test methods that call the fixture now accept monkeypatch
and forward it to the fixture.

The fifth test in the file (TestActiveOverlayFieldNotRelied) already
used monkeypatch correctly — no change there.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fdidonato fdidonato merged commit 12a5240 into main May 18, 2026
2 of 6 checks passed
@fdidonato fdidonato deleted the step13-conversation-observability branch May 18, 2026 08:50
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.

2 participants