Repository navigation
Close the review gaps in the Claude adapter gates #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 (optional) Maintainers who use a YAML merge key (
<<: *anchor) in overlay.yaml will now get a load failure; the baseyaml.safe_loadaccepted it. The duplicate check callsconstruct_objecton every raw key node beforeflatten_mappingruns, which includes the<<node taggedtag:yaml.org,2002:merge. SafeLoader has no constructor for that tag, so loading fails with "could not determine a constructor for the tag", which does not point to the merge key. Fix: skip key nodes taggedtag:yaml.org,2002:mergein the duplicate scan and check only explicit keys. Merged keys that explicit keys override are legal YAML and must still load. [also at: scripts/repository_metadata.py:170 - nit: A malformed overlay with a non-scalar mapping key now crashes with a raw TypeError traceback instead of a clean MetadataError.]Why this was flagged
The trigger is an overlay.yaml that uses a merge key, for example an edit entry written as
- <<: *commonplusfind:. No such entry exists today, so this is conditional on a maintainer adding one. UniqueKeyLoader.construct_mapping (repository_metadata.py:163-164) loops overnode.valueand callsself.construct_object(key_node)for every key. It does this beforesuper().construct_mappingrunsflatten_mapping, the step that removes merge-key nodes. The<<scalar resolves totag:yaml.org,2002:merge. SafeConstructor registers no constructor for that tag, soconstruct_undefinedraises a ConstructorError. repository_metadata.py:176-177 turns that into MetadataError "could not read adapter-sources/claude/overlay.yaml: ... could not determine a constructor for the tag 'tag:yaml.org,2002:merge'". On the base,yaml.safe_loadflattens merge keys and loads the file. After this change, generation, validation and test_contracts all fail on a valid overlay, with an error that does not mention a merge key.Verification: Trigger: a maintainer adds a YAML merge key (
<<: *anchor) anywhere in adapter-sources/claude/overlay.yaml. The current file has none. In scripts/repository_metadata.py:161-170, construct_object runs on every key beforereturn super().construct_mapping(node, deep=deep), and only the super call runsself.flatten_mapping(node). Baseyaml.safe_loadflattened merge keys and accepted the same file.