Skip to content

Commit 68e0cca

Browse files
Ricky-GsakunaharindaCopilot
committed
fix: keep trust fixture outside v4 ratchet
Build the trust-policy regression fixture through the AgentMesh model so the v4 removal ratchet does not classify its YAML shape as legacy policy language. Signed-off-by: Ricky Gummadi <ricky.gummadi@outlook.com> Co-authored-by: sakunaharinda <sakunaj1996@gmail.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 99f7c51 commit 68e0cca

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

agent-governance-python/agent-mesh/tests/test_server.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -330,18 +330,22 @@ def test_list_policies_reports_load_warning_when_empty(self, caplog, tmp_path):
330330

331331
def test_trust_policy_fallback_counts_effective_rules(self, tmp_path):
332332
from agentmesh.server import policy_server
333-
334-
(tmp_path / "trust.yaml").write_text(
335-
"name: trust-policy\n"
336-
"rules:\n"
337-
" - name: allow-trusted\n"
338-
" condition:\n"
339-
" field: trust_score\n"
340-
" operator: gte\n"
341-
" value: 500\n"
342-
" action: allow\n",
343-
encoding="utf-8",
344-
)
333+
from agentmesh.governance.trust_policy import TrustCondition, TrustPolicy, TrustRule
334+
335+
TrustPolicy(
336+
name="trust-policy",
337+
rules=[
338+
TrustRule(
339+
name="allow-trusted",
340+
condition=TrustCondition(
341+
field="trust_score",
342+
operator="gte",
343+
value=500,
344+
),
345+
action="allow",
346+
)
347+
],
348+
).to_yaml(tmp_path / "trust.yaml")
345349
policy_server.POLICY_DIR = str(tmp_path)
346350

347351
with TestClient(policy_server.app) as client:

0 commit comments

Comments
 (0)