Skip to content

🚨 fix(dashboard): cast intentionally-invalid wire values in prototype-pollution tests - #1767

Merged
Chisanan232 merged 1 commit into
mainfrom
fix/dashboard-typecheck-drift
Jul 28, 2026
Merged

🚨 fix(dashboard): cast intentionally-invalid wire values in prototype-pollution tests#1767
Chisanan232 merged 1 commit into
mainfrom
fix/dashboard-typecheck-drift

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

tsc --noEmit was broken on main (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-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 a literal assignment correctly trips tsc.

Applied the as never cast already established for this exact scenario in agents.test.tsx (toRegistryAgent(rawAgent({ status: 'Quarantined' }) as never)) to each new call site — no application or schema type was widened.

Verified locally: tsc --noEmit clean, eslint clean, full test suite (3014 tests) passing, pnpm run build succeeds.

…-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

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@Chisanan232
Chisanan232 merged commit 59f34e1 into main Jul 28, 2026
40 checks passed
@Chisanan232
Chisanan232 deleted the fix/dashboard-typecheck-drift branch July 28, 2026 01:29
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).
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