feat(zarr-metadata): with_problems groups a read's problems by field, and canonical_of spells a field read already - #377
Open
d-v-b wants to merge 1 commit into
Conversation
… and canonical_of spells a field read already `with_problems(fields, problems)` gives each field of one read -- a reading's `fields()` and `problems`, or `fields_of` a field and the problems `resolve` gave with it -- with the problems located in it, in the fields it holds too: those it was read with, and those the document found with it where it stands, its place in the pipeline, the chunk it is handed, the array's shape. A field with none is valid there. A function of the problems, as zod's `flattenError` is of the issues, grouping them at every depth; a problem in no field is in none's. `canonical_of(resolved, problems)` spells a field a scope has read already, given its problems, in its simplest equivalent spelling, without reading it again: None for a field with a problem, as `canonicalize` gives, so a key its TypedDict does not declare is never erased. `canonicalize` is `canonical_of(*resolve(...))`. Assisted-by: ClaudeCode:claude-opus-5-5
d-v-b
force-pushed
the
feat/zarr-metadata-field-problems
branch
from
September 29, 2026 10:14
f926004 to
fd999e0
Compare
This was referenced Sep 29, 2026
Open
This branch has not been deployed
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.
🤖 AI text below 🤖
Stacked on #376. It adds the third item on the pydantic/zod list: problems grouped by field, and the canonical form of a field already read.
1.
with_problems(fields, problems)gives each field of one read with its problems. Grouping is a function over the problems, as zod'sflattenErroris over the issues; the readings don't change shape. It takes a reading'sfields()andproblems, orfields_ofa field and the problemsresolvegave with it.2.
canonical_of(field, problems)gives a field already read in its simplest spelling, without reading it again.canonicalizedoes. So it never erases an undeclared key, a stray envelope member or amust_understand, and never spells what doesn't hold.canonicalizeis nowcanonical_of(*resolve(...)). A test checks that the two agree on every example field.Nothing breaks:
fields()is unchanged, andcanonicalizegives what it gave.Scenario re-runs. All four replay unchanged.
field_athelper is gone: the innermost field holding a problem is the last onewith_problemslists it under. Its notes pass callscanonical_ofinstead of re-reading each field throughcanonicalize, and it reports unknown extensions straight from the fields. It shrank from 1,501 to 1,486 lines, and it writes the same repaired files.Reviews
canonical_ofwithout the problems could quietly spell a fieldcanonicalizerefuses. It now takes them.fields()stays as it is, and grouping iswith_problems, as zod has it. The first version changedfields()to yield triples; that was a breaking change, and it gave aresolveuser no way to group.resolvegives. They include what the document finds with it, so "none" means valid in this document.Choices worth a look
treeifyErrorputs an issue only at its exact node. Innermost attribution is still one step away, as above.canonical_oftakes the problems as an argument. Passing()gets a spelling regardless; that's explicit at the call.🤖 Generated with Claude Code