项目文件夹

文件
Seth Hobson bdf6e19a83 fix: address CodeRabbit/codex review feedback on #591/#598 work
- judge: guard _measured_score against non-dict JSON; strip whitespace text
  before the result fallback (typed result param as Any for ty).
- monte_carlo: use the shared result fallback for activation/quality; sum real
  SDK usage token fields via _sdk.usage_total_tokens (no fake total_tokens=0).
- tests: importorskip claude_agent_sdk so dev-only (no llm extra) collection
  doesn't fail; add tests for non-dict scores, whitespace/result fallback,
  result-only activation, and token summing.
- run-tests.sh: cd guard + multiline-tolerant in-on-String detection.
- docs: cedar-validate if/else, repo-root-safe path, and #598 narrative
  corrected to the verified conclusion (reporter essentially correct;
  protect-mcp evaluate/sign subcommands absent -> separate issue).
2026-06-25 20:53:10 +09:00
..

review-agent-governance policy tests

Guards policies/review-agent-governance.cedar against the #598 in-on-String forbid bug.

./run-tests.sh   # exit 0 pass · 1 fail
  • Part A (always runs, needs only grep): asserts the policy contains no context.<attr> in [ ... ] forbid pattern (which Cedar silently discards) and uses [ ... ].contains(context.<attr>) instead.
  • Part B (runs only if the cedar CLI is installed): cedar validate the policy against review-agent-governance.cedarschema. With the context attributes typed as String, cedar validate rejects the in-on-String form at load time and accepts .contains().

Note: the shipped runtime is protect-mcp serve (Cedar-via-WASM); this test validates the policy source directly and does not depend on protect-mcp.