wshobson--agents
bdf6e19a83
- 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).
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 nocontext.<attr> in [ ... ]forbid pattern (which Cedar silently discards) and uses[ ... ].contains(context.<attr>)instead. - Part B (runs only if the
cedarCLI is installed):cedar validatethe policy againstreview-agent-governance.cedarschema. With the context attributes typed asString,cedar validaterejects thein-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.