Check the keys of the PALS root node#77
Merged
Merged
Conversation
A misspelling in the root node was silent. `extension_names` for `extension_labels` registers no extension at all, and the only sign of it was a complaint about whatever the extension was meant to cover -- an element away from the actual mistake. check_pals_root checks the node's own keys against s:palsroot, plus phase_space_coordinates (coordinates.md) and the two file-reference commands, include and load. A key registered as an extension label is skipped as it is everywhere else, and nothing outside the PALS node is looked at, since that is outside the standard (fundamentals.md). suggest() gained an optional edit cap, default 2, so every existing caller is unchanged. `extension_names` is four edits from `extension_labels`, past the usual cap; the root vocabulary is nine names with nothing in common, so a looser cap there cannot match at random. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The problem
A misspelled key in the
PALSroot node was silent. From a real file:Nothing is registered, so the first sign of the mistake was a complaint about the data the extension was meant to cover, an element away:
Now:
The fix
known_pals_keys— the root's closed vocabulary: the six offundamentals.mds:palsroot, plusphase_space_coordinates(coordinates.md) and the two ways a file names another,includeandload.check_pals_root— checks thePALSnode's own keys, called fromcheck_pals_namesalongside the existingwalk. A key registered as an extension label is skipped as it is everywhere else. Only this node's keys are checked: anything outsidePALSis outside the standard and ignored (fundamentals.md).suggestgained an optional edit cap, default 2, so every existing caller is unchanged.extension_namesis four edits fromextension_labels, past the usual cap; the root vocabulary is nine names with nothing in common, so a looser cap there cannot match at random.Tests
Three new cases in
test_check.cpp(suite: 224 cases, all passing):The first is verified as a real regression by stubbing out the call: that case fails, the rest pass. Every file in
lattice_files/was run through the checker as well -- no new reports, so the vocabulary is not missing anything the examples use.🤖 Generated with Claude Code