Skip to content

core: fail an any_of with a stray path instead of stopping the report - #156

Merged
jbpros merged 1 commit into
mainfrom
core/any-of-stray-path
Oct 7, 2026
Merged

jbpros merged 1 commit into
mainfrom
core/any-of-stray-path

Conversation

@jbpros

@jbpros jbpros commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

An any_of with a path field it doesn't use, like one left over from an equals it replaced, gave two different inputs for the same row. OPA then stopped the whole evaluation with eval_conflict_error, so there was no report at all:

{"op": "any_of", "path": ["y"], "options": {"o": [{"op": "equals", "path": ["x"], "value": 1}]}}

The check is now written wrong and fails as ill_formed, which is what REFERENCE.md already says about a field an op doesn't use.

What I ran: every check in AGENTS.md, plus Wasm, OPA 1.20.2 and the JS runtime, 878/878. The new test errors without the fix.

  • Tests cover the change, and the checks in AGENTS.md pass
  • REFERENCE.md and README.md are updated if behaviour changed
  • If the report changes for an existing policy, the description has a line starting with Changes the report:

🤖 Generated with Claude Code

@jbpros jbpros added bug Something isn't working core Relates to the ergo library or format themselves. labels Oct 7, 2026
@jbpros
jbpros changed the base branch from main to core/reject-non-json-values October 7, 2026 17:01
@jbpros
jbpros force-pushed the core/any-of-stray-path branch from b6d0408 to 674c83f Compare October 7, 2026 17:01
@jbpros
jbpros added this pull request to stack #157 October 7, 2026 17:08
@jbpros
jbpros marked this pull request as ready for review October 7, 2026 17:08
Base automatically changed from core/reject-non-json-values to main October 7, 2026 17:09
An any_of with a path field it doesn't use, like a leftover from an
equals it replaced, gave two different inputs for the same row, so OPA
stopped the whole evaluation with eval_conflict_error and there was no
report at all. The check is now written wrong, as the docs already say.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jbpros
jbpros force-pushed the core/any-of-stray-path branch from 674c83f to 39a41e5 Compare October 7, 2026 17:10
@jbpros
jbpros merged commit b4eb645 into main Oct 7, 2026
5 checks passed
@jbpros
jbpros deleted the core/any-of-stray-path branch October 7, 2026 17:14
jbpros added a commit that referenced this pull request Oct 7, 2026
Extracts the cases again after #155, #156 and #158, leaving out policies
that aren't objects, since their reports use numbers as keys. The Rust
port now writes every number in its plain form, as #158 does, and its
runner compares number text exactly to check it. generate.sh lets OPA
write each file's text, because jq rewrote numbers like 0.000000123 as
1.23E-7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core Relates to the ergo library or format themselves.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant