Skip to content

fix(opa): reject unhashable mapper decisions - #76

Merged
imran-siddique merged 1 commit into
agentrust-io:mainfrom
1cbyc:1cbyc/75-reject-unhashable-opa-decisions
Oct 2, 2026
Merged

imran-siddique merged 1 commit into
agentrust-io:mainfrom
1cbyc:1cbyc/75-reject-unhashable-opa-decisions

Conversation

@1cbyc

@1cbyc 1cbyc commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Validate an OPA result mapper return type before checking supported decision values, so dictionaries and lists receive the same adapter ValueError as unsupported strings.

Fixes #75.

Contract impact

  • No wire-contract change
  • Backward-compatible contract change with fixtures
  • Breaking contract change with migration notes

Evidence

  • python tools/check_schemas.py
  • python conformance/runner/validate.py
  • python -m unittest discover -s tests -v
  • python -m build
  • wheel and sdist smoke tests
  • TypeScript npm run check

The Python suite passes 142 tests with two optional PyYAML skips. The TypeScript suite passes 44 tests.

Privacy and security

  • No real prompts, source, credentials, personal data, or production identifiers added
  • New fields have capture semantics and privacy classification
  • Security-sensitive changes received maintainer review

Limits

This only normalizes invalid result mapper return values; it does not change valid OPA decision mapping or the wire contract.

Co-authored-by: insisong emmanuelisaacnsisong@gmail.com

Co-authored-by: insisong <emmanuelisaacnsisong@gmail.com>
@1cbyc
1cbyc requested review from a team and imran-siddique as code owners October 2, 2026 00:20
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🟡 Contributor Check: MEDIUM

Check Result
Profile MEDIUM
Credential LOW
Overall MEDIUM

Automated check by AgenTrust Contributor Check.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor check flagged MEDIUM risk label Oct 2, 2026
@imran-siddique
imran-siddique merged commit aa71016 into agentrust-io:main Oct 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:MEDIUM Contributor check flagged MEDIUM risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OPA adapter raises TypeError, not ValueError, when a result mapper returns a dict or list

2 participants