Skip to content

spec: say the Rego engine also reads the item's field in a tally of a field named like a for alias - #958

Closed
jbpros wants to merge 16 commits into
mainfrom
b3-alias-shadows-field
Closed

jbpros wants to merge 16 commits into
mainfrom
b3-alias-shadows-field

Conversation

@jbpros

@jbpros jbpros commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Stacked on #957, merge in order. The diff against main includes #957's commits until it merges; this change is one line in spec/OPEN.md.

The entry for a tally of a field in front of a list with a whose, named like a for alias, said only the Rust engine is wrong. ergo.rego is wrong too: on count of d of tests whose kind is "unit" is 2 it reads each test's own d and fails as absent with item 1 of tests: d is missing; …, where the rule says the check passes. The entry now says so, and names the case that already pins it (field_of, added in #909, listed in both known-failure lists).

No code changes. The fix for this entry and the one before it (the field named like a for alias in both engines) needs a rule that says where each kept item's field is read from: the item, or the alias's binding plus the rest of the steps. That is larger than one builder round, so B3 stops here as a record, and the code change waits for a decision.

cuts: Rust 27 to 27, Rego 82 to 82 (no code touched).
Not run: everything that needs code; CI runs the checks.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn

jbpros and others added 16 commits December 5, 2026 01:05
…m $params is read before any item

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
… comes after it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…he root read before any item

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…nt of the item's key

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…tem's key has its base read before any item

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…nt of the item's key

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
… spec/OPEN.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…he root before any item of the walked list

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
… of the item's key

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…d line alias is not read before any item

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…line alias

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…m's key, and a bound alias in front of it (guards)

Guards that pass as they are: `m` null and 3, `k` missing, null, 3
and empty in both engines, and a bound line alias in the chain in the
Rust engine.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…puts entry in spec/OPEN.md

The entry for a root read through a key from $params and then the
item's key no longer says the row's inputs are settled: no rule decides
them, and two cases expect different inputs. The entry on a one-line
every with if any names the chain forms, and the entry on roots said
again for each item drops the count form, which ergo.rego now says once.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
… key, in either order

With xs holding an item and no m in the params the check fails as absent naming item 1 of xs, and with xs empty and if any it passes, since the root is read with each item and not at all when there is none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
…st rows in spec/OPEN.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
… field named like a for alias, and name its case, in spec/OPEN.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzW4N4nUhpU9sV5yVyXkyn
@jbpros jbpros added this to the 26.ac milestone Dec 5, 2026
@jbpros jbpros added documentation Improvements or additions to documentation core Relates to the ergo library or format themselves. labels Dec 5, 2026
@jbpros

jbpros commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Closed: the OPEN.md correction moves into the first B3 PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Relates to the ergo library or format themselves. documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant