fix(language): a macro template nothing calls is held to every rule a call site is - #628
Merged
FBumann merged 2 commits intoSep 23, 2026
Conversation
Documentation build overview
9 files changed ·
|
FBumann
added this pull request to stack #637
September 22, 2026 20:48
… call site is The template check was a second walker that looked at names only. It is now the resolver, with the template's formals left bare, so a label parameter used as a value or an unknown relation column is refused at load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017XwKgY5wZXv1bKgkfCW2q1
FBumann
force-pushed
the
claude/blissful-heisenberg-z5rpwo-template
branch
from
September 23, 2026 08:16
8090026 to
3d7584d
Compare
…typo in by= is refused beside formal columns A formal along= beside a by= was handed to the partition as a dimension and refused as one the relation has no key column over, so a valid template was refused. A relation that names nothing loaded once the columns beside it were formals, because the formals sent the call back first. The over= and by= refusals inside a template say "or a formal of this macro" again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015h57WkBDnpxrknuJ5zZy9F
FBumann
removed this pull request from stack #637
September 23, 2026 11:30
FBumann
added this pull request to stack #644
September 23, 2026 11:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
The following content was generated by AI.
_check_template_nameswas a second resolver that checked only names. It is deleted. The resolver now checks a template, with the template's formals left bare. So a template now gets every refusal that a call site gets. Stacked on #627.Method, gate output, alternatives
What this changes
_Resolverhas aformalsfield, andresolve_expression(..., formals=)passes it in. A formal stays bare in a value,edge=, a dimension kwarg,dual(), andby=with its column roles.validation._check_template_names(69 lines) is deleted.dual(),over=andby=say "or a formal of this macro".Found in review, fixed in the second commit
along=besideby=/within=, such asshift(x, along=d, offset=1, by=tg, within=g), was handed to the partition as a dimension and refused as'tg' has no key column over 'd', even with a valid call. A formalalong=now builds no partition, and the call site does.sum(x, by=nope, over=a, into=b)withaandbformals loaded, because the formal columns sent the call back before the relation was read. The relation is read first.over=andby=refusals had lost "or a formal of this macro".The five tests for these fail on the first commit and pass on the second.
What the language now refuses
A template that nothing calls now gets the same refusals as a call site. Before, these passed load:
strorboolparameter used as a value (x * tag).sum(x, by=lk, over=nope, into=h)).over=1, andedge='nope'.by=. It now gets the "one call reads one table" refusal, not "does not name a relation" for the first name.Test coverage moved:
a-typo-in-a-relation-listis nowa-list-of-relationsand asserts the resolver's message.Tests
test_a_template_is_held_to_the_rules_a_call_site_is: both cases fail on the base branch and pass here.test_a_formal_stands_where_a_call_site_will_bind_it: one case for each guard. I deleted each guard in turn and ran the suite:_arith: 20 tests fail._edge:an-edgefails._dual:a-constraintfails.Gates
pixi run lint: green.pixi run test: 1560 passed on the first commit; 1541 withtests/test_docs.pydeselected on the second, where the docs dependencies were absent.docs-buildandcompile-texdid not run: the session proxy blocks their downloads.🤖 Generated with Claude Code
https://claude.ai/code/session_017XwKgY5wZXv1bKgkfCW2q1
Generated by Claude Code