Skip to content

test(contracts): preserve validated validator export names - #935

Merged
matteius merged 2 commits into
mainfrom
ai-findings-autofix/scripts-contracts-generate.mjs
Nov 9, 2026
Merged

matteius merged 2 commits into
mainfrom
ai-findings-autofix/scripts-contracts-generate.mjs

Conversation

@matteius

@matteius matteius commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

The suggested identifier sanitizer renames accepted schema names such as class from validateclass to validate_class, changing the public validator API unnecessarily.

Preserve the original names. validateSource already rejects selected schema names outside [A-Za-z][A-Za-z0-9_]* before interpolation, including when exports default to all components. The validate and __contract_ prefixes make reserved words valid identifiers.

Add regression tests for stable runtime and declaration exports, and rejection of unsafe names for both explicit and default selection. The reserved-word test fails on the original autofix and passes with this correction. No generated artifact changes are needed.

Validation: all 71 contract tooling tests passed, including 38,025 differential validation cases; contract regeneration check and TypeScript check passed.

matteius and others added 2 commits November 8, 2026 19:04
…tofix

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@matteius matteius changed the title Potential fix for 1 code quality finding test(contracts): preserve validated validator export names Nov 9, 2026
@matteius
matteius marked this pull request as ready for review November 9, 2026 00:11
@matteius
matteius merged commit a9fbfe9 into main Nov 9, 2026
4 of 12 checks passed
@matteius
matteius deleted the ai-findings-autofix/scripts-contracts-generate.mjs branch November 9, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant