|
4 | 4 |
|
5 | 5 | from __future__ import annotations |
6 | 6 |
|
7 | | -from mcp_server.core.global_detector import propagates_to_team, resolve_global_scope |
| 7 | +from mcp_server.core.global_detector import resolve_global_scope |
| 8 | +from mcp_server.core.team_scope import is_team_decision, propagates_to_team |
8 | 9 |
|
9 | 10 | _DECISION = "Decision: we keep the ledger layout because the dossier needs it" |
10 | 11 | _PLAIN = "plain note about the weather in the fixture" |
@@ -47,3 +48,26 @@ def test_detector_still_marks_cross_project_content(self): |
47 | 48 | ) |
48 | 49 | assert is_global is True |
49 | 50 | assert reason.startswith("global_") |
| 51 | + |
| 52 | + |
| 53 | +class TestIsTeamDecision: |
| 54 | + def test_deliberate_trusted_decision_under_agent(self): |
| 55 | + assert is_team_decision(_DECISION, "deliberate", "deliberate", "cortex") |
| 56 | + |
| 57 | + def test_local_action_origin_is_trusted(self): |
| 58 | + assert is_team_decision(_DECISION, "local_action", "deliberate", "cortex") |
| 59 | + |
| 60 | + def test_network_origin_is_refused(self): |
| 61 | + assert not is_team_decision(_DECISION, "network", "deliberate", "cortex") |
| 62 | + |
| 63 | + def test_unknown_origin_is_refused(self): |
| 64 | + assert not is_team_decision(_DECISION, "unknown", "deliberate", "cortex") |
| 65 | + |
| 66 | + def test_auto_capture_is_refused(self): |
| 67 | + assert not is_team_decision(_DECISION, "local_action", "auto", "cortex") |
| 68 | + |
| 69 | + def test_plain_content_is_not_a_decision(self): |
| 70 | + assert not is_team_decision(_PLAIN, "deliberate", "deliberate", "cortex") |
| 71 | + |
| 72 | + def test_no_agent_context_stays_local(self): |
| 73 | + assert not is_team_decision(_DECISION, "deliberate", "deliberate", "") |
0 commit comments