Make plugin name validation regex-portable - #79
Open
jonathanhefner wants to merge 1 commit into
Open
Conversation
Replace the 1.1.0 manifest `name` lookahead with simple assertions that compile on RE2-based JSON Schema validators. Preserve the constraints defined by §5.5, including mixed `-.` and `.-` sequences, while explicitly rejecting disallowed characters so regex engines with differing `$` semantics agree on terminal line breaks.
This was referenced Aug 31, 2026
Open
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.
Problem
The plugin manifest schema uses a negative lookahead to enforce
nameconstraints. Although the expression is valid ECMA-262, lookaround is outside the portable subset recommended by JSON Schema and cannot be compiled by RE2-based validators, such as those using Goregexp.The full-string expression also relies on
$behavior that differs across regular-expression engines. In particular, engines that let$match before a terminal newline can accept a name that §5.5 rejects.Resolution
Replace the lookahead with two ordinary JSON Schema assertions:
patternrequires the name to begin with a lowercase ASCII alphanumeric character.not.patternrejects disallowed characters, punctuation at the end,--, and...Both
patternandnotare standard Draft 2020-12 keywords, so the correction introduces no custom validation mechanism.This keeps all patterns within the broadly portable subset and preserves the constraints defined by §5.5. Explicitly rejecting disallowed characters also makes terminal-line-break behavior consistent across engines.
The correction applies to the 1.1.0 working draft. The published 1.0.0 schema retains its canonical contents.
Validation
An AI agent:
schemas/1.1.0/plugin.schema.jsonas Draft 2020-12 with Ajv.Closes #76.