Repository navigation
fix(provider): count string-entity lexer errors as validateEdits syntaxError - #587
Merged
Merged
Conversation
…axError Review follow-up to #578: invalid-string-entity and unknown-string-entity are lexer verdicts on the document's own text — the entity table is fixed vocabulary needing no project context — so their omission from DOCUMENT_SYNTAX_CODES made an edit introducing "\&bogus;" return valid:true instead of syntaxError. Adds both codes, documents the intentionally deferred code classes on the allowlist, and covers both entity error kinds in the normative-rules test. The new assertions fail without the allowlist entries.
Teakowa
approved these changes
Oct 18, 2026
Teakowa
left a comment
Contributor
There was a problem hiding this comment.
LGTM — the two entity codes are fixed-vocabulary lexer verdicts (lexer.rs:310-330), and the deferred-class inventory documents why binding/macro/script/external-file verdicts stay out. New assertions verified to fail without the allowlist entries.
This was referenced Oct 18, 2026
Merged
e54-bot
added a commit
that referenced
this pull request
Oct 19, 2026
…#593) The DOCUMENT_SYNTAX_CODES allowlist shipped incomplete twice (#587, #588): every omission silently returned valid:true for malformed documents. Adds EXCLUDED_CODES plus NON_DIAGNOSTIC_LITERALS and a unit test scanning all kebab-case literals in ../opy-rs/src — every diagnostic code must appear in exactly one list, so a new code fails until a reviewer classifies it. The deferred classes are documented on the list itself. Fixes #591 Co-authored-by: Teakowa <git@teakowa.dev>
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.
Summary
Review follow-up to #578 (#576):
DOCUMENT_SYNTAX_CODESomittedinvalid-string-entityandunknown-string-entity, the lexer/parser verdicts for malformed\&entity;escapes (crates/opy-rs/src/lexer.rs,parser/expressions.rs). The entity table is fixed vocabulary — no project context is needed — matching the constant's own criterion. Before this change, an edit introducing"\&bogus;"returned{"valid": true}where amended spec §16.3 requiressyntaxError.Also documents the intentionally deferred code classes on the allowlist (binding verdicts, merged-table duplicates, macro/script verdicts, external-file verdicts, catalog/environment verdicts) so future document-local codes are triaged consciously rather than silently absorbed by the fail-open list.
Deferred codes were audited against their emit sites:
settings-not-found/translations-invalidread external files,rule-prefix-template-*/replacement-duplicate/post-compile-hook-duplicatetest tables merged across includes,settings-expressionevaluates constants possibly defined in siblings,script-*executes external script files, andmacro-*verdicts can involve include-provided definitions.Test plan
validate_edits_applies_normative_rulesassertions: unknown entity and unterminated entity both producesyntaxError; verified they fail without the allowlist entries (stash + rerun)cargo test -p opy-provider --test lpp— 69/69 passcargo fmt --all -- --check,cargo clippy -p opy-provider --all-targets -- -D warnings