🚨 fix(dashboard): cast intentionally-invalid wire values in prototype-pollution tests - #1767
Merged
Merged
Conversation
…-pollution tests
The dashboard's tsc --noEmit gate (Dashboard type-check + lint, and
the Build job that also runs it) was broken on main, blocking every
open PR regardless of what it touches. Six test files pass
deliberately out-of-union wire values (e.g. 'retired', 'constructor',
'__proto__', 'toString') to verify the UI degrades gracefully on an
unrecognised or prototype-colliding status/event_type/decisionLabel
— the whole point of each test is that these values are NOT part of
the schema-generated union type, so TypeScript correctly flags a
literal assignment as a type error even though the test intent is
sound.
Applied the `as never` cast already used for this exact scenario in
agents.test.tsx (toRegistryAgent(rawAgent({ status: 'Quarantined' })
as never)) to each new call site instead of widening any real
application or schema type. Verified: tsc --noEmit clean, eslint
clean, full test suite (3014 tests) passing, and `pnpm run build`
succeeds.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Chisanan232
added a commit
that referenced
this pull request
Jul 28, 2026
Closes AAASM-5237. Rebased onto main after PR #1767 independently fixed the same AAASM-5209 rebase-lag cast issue in 6 shared test files; the duplicate cast commit (04ef002) was dropped during rebase in favor of main's existing `as never` fix. Reviewed and approved by Claude Code (CI green across all 17 checks; requirement-correct; no security concerns). Merged as org admin (enforce_admins=false; self-approval blocked by GitHub).
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.



tsc --noEmitwas broken onmain(introduced by #1749), blocking every open PR's "Dashboard (type-check + lint)" and "Build" checks regardless of what they touch — currently blocking all 12 open agent-assembly dependency-upgrade PRs.Six test files pass deliberately out-of-union wire values (
'retired','constructor','__proto__','toString','hasOwnProperty') to verify the UI degrades gracefully on an unrecognised or prototype-collidingstatus/event_type/decisionLabel— the whole point of each test is that these values are NOT part of the schema-generated union type, so a literal assignment correctly tripstsc.Applied the
as nevercast already established for this exact scenario inagents.test.tsx(toRegistryAgent(rawAgent({ status: 'Quarantined' }) as never)) to each new call site — no application or schema type was widened.Verified locally:
tsc --noEmitclean,eslintclean, full test suite (3014 tests) passing,pnpm run buildsucceeds.