fix(language): a piecewise block its expansion cannot write is refused as the model loads - #685
Merged
FBumann merged 1 commit intoSep 24, 2026
Conversation
…d as the model loads A walked link is read as at() reads its relation, so into must land on the key, the read must be single-valued, and every joined key column must be a dim of dims:. An empty over or into is refused. No two blocks may write the same name. A where over a dim the walk only joins on reads as written. The missing-breakpoint advice and the where-over-a-walked-dim refusal name a rewrite the block can take. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WasiCKk1SebD7S1CsAFQog
Documentation build overview
19 files changed ·
|
FBumann
added this pull request to stack #687
September 24, 2026 13:57
FBumann
removed this pull request from stack #687
September 24, 2026 14:02
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.
Stacked on #630. The model now refuses at load a walked link that
at()refuses. It also refuses an emptyover:/into:and a name two blocks both write. Awhere:over a joined dim loads. Two refusals now name a rewrite the block can take.What this changes
Each change answers one finding of the review of #630. Each finding has a test that fails on #630's head.
awith linkb_xand blocka_bwith linkxboth writea_b_x. Both loaded, and one row overwrote the other. The same happened witha_b_convexityanda_b_completeemitted_name_errorsrefuses a name that two sets or curves both write. It names both blocksintois not on the key, whose read is not single-valued, or whose key column is joined on a dim outsidedims:loaded.expand()then failed and named the emitted rowresolve_walksreads each walk through the resolver'sdirection(), the same code thatat()uses._walk_fitschecks the walk againstdims:and then callspulled_back_dims, the dim rule ofat(). Each refusal names the linkwhere:oversnapshotwas refused when the relation is keyed on[flow, snapshot], although the walked row keepssnapshotover: []orinto: []loaded, and the expansion wroteat(..., over=[]), which does not parsePiecewiseLinkrefuses an empty listwhere:overdims:was told to "declare where:"where:test the breakpoint dim toowhere:overflowwas told to addflowtodims:, which the walk then refusesdims:in thewhere:, or to mask the link's own variable_piecewise_walk_shaperebuilt the relation's role-to-dim map, whichpiecewise._walkalso built_row,_readsand_where_fitsread the typedDirectiontests/test_piecewise.pyhad no messageWhy
Everything that can be decided without data is decided at load (AGENTS.md). Findings 1, 2 and 4 loaded and then failed or silently dropped a row in
expand().Message changes, and coverage that moved
by:are now the refusals ofat(), with the link as their context. Example:piecewise 'coupling' link 'power': at(by=generator_of): into=['flow', 'flow'] names a column twice.Thea-repeated-columncase now matches that text.at(), which ends in "Land on the key, or sum toward [...]". The "sum toward" half does not apply to a link. I left it because the text belongs to the shared resolver.flowintoflowgets the "into reaches ['flow']" refusal._expression_resolver.ExpressionResolver._directionis renamed todirection, becausepiecewise.resolve_walkscalls it.Mutation table: each new guard deleted in turn, full suite
A script took this table. It refuses a dirty tree, and restores each file with
git checkout --. It drops__pycache__on both sides of every mutation. The tree came back clean after every row.PiecewiseLink: emptyover/into[an-empty-over],[an-empty-into]resolve_walks:bynames a relation[a-walk-through-an-undeclared-relation]declaration_of: the_walk_fitscalltest_a_walked_block_the_language_cannot_read_is_refused_walk_fits: over reachesdims:[a-walk-consuming-a-dim-the-block-lacks]_walk_fits: into is offdims:[a-walk-into-a-dim-the-block-has]_walk_fits: into is offalong[a-walk-into-the-breakpoint-dim]_walk_fits: joined dims are indims:[a-walk-joining-on-a-dim-the-block-lacks]_walk_fits:pulled_back_dimsbackstop[a-walk-joining-on-the-dim-it-consumes]_reads: joined dims counted as consumed (the rule on #630)test_a_mask_over_a_dim_the_walk_joins_on_reaches_the_walked_row_as_written_reads: partial-mask refusaltest_a_mask_carrying_part_of_what_a_walk_reads_through_is_refused_where_fits: advice for a dim a walk producestest_a_where_over_a_dim_a_link_walks_into_is_not_sent_to_dimsassumptions_of: advice for awhere:overdims:test_a_missing_breakpoint_names_a_rewrite_the_block_can_take[a-where-over-dims]emitted_name_errors: the_sharedcalltest_a_name_two_blocks_would_both_write_is_refusedGates, and what was not run
The gates ran in a venv, not through pixi, which is not installed here. The tool versions match the pins in
pixi.toml.pytest -q -n autoruff check,ruff format --check(0.16.1)pyrefly check(1.2.0)prettier --checkon the changed pagepython -m tools.schema,python -m tests.typesetting.goldenmkdocs build --strictdocs.python.org, the same as on #630compile-tex,typos,reuseDeliberately not done
maininto this branch.mainis four commits ahead of feat(language): a piecewise block states its dims and names its links, and its where reaches links that walk a relation #630, and bringing it in is feat(language): a piecewise block states its dims and names its links, and its where reaches links that walk a relation #630's work.min_length=1in the schema. Withmin_length, pydantic's own message would come first and would not name the rewrite. So the published schema does not change.🤖 Generated with Claude Code
https://claude.ai/code/session_01WasiCKk1SebD7S1CsAFQog
Generated by Claude Code