test(runtime): drop the redundant status casts the new casting gate rejects

This commit is contained in:
Neil
2026-09-17 00:19:23 -07:00
parent 7ea4272c1b
commit e7046b10b3
2 changed files with 13 additions and 3 deletions
@@ -21,7 +21,7 @@ function makeStatus(runtimeId: string): RuntimeStatus {
liveLeafCount: 0,
runtimeProtocolVersion: 3,
minCompatibleRuntimeClientVersion: 3
} as RuntimeStatus
}
}
function makeSnapshot(
@@ -115,7 +115,15 @@ describe('mirror targets and host connection state agree on one host', () => {
})
it('drops the mirror target when the control channel closed', () => {
const closed = { state: 'closed' } as NonNullable<RuntimeStatus['remoteControl']>
const closed: NonNullable<RuntimeStatus['remoteControl']> = {
state: 'closed',
pendingRequestCount: 0,
subscriptionCount: 0,
reconnectAttempt: 0,
lastConnectedAt: null,
lastClose: null,
lastError: null
}
const entry = {
...entryForSnapshot(makeSnapshot({ verification: 'verified' })),
remoteControl: closed
@@ -21,6 +21,7 @@ type Store = ReturnType<typeof createSliceStore>
function createSliceStore() {
return create<RuntimeStatusSlice>()((...a) => ({
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the slice creator is declared against the whole AppState; this store holds only its own slice, which is all the code under test reads.
...createRuntimeStatusSlice(...(a as unknown as Parameters<typeof createRuntimeStatusSlice>))
}))
}
@@ -35,7 +36,7 @@ function makeStatus(runtimeId: string): RuntimeStatus {
liveLeafCount: 0,
runtimeProtocolVersion: 3,
minCompatibleRuntimeClientVersion: 3
} as RuntimeStatus
}
}
function makeSnapshot(
@@ -55,6 +56,7 @@ function makeSnapshot(
/** The mirror-subscription effect dependency, rebuilt from the slice's current state. */
function mirrorKey(store: Store): string {
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the builder takes the whole app state; only the fields below reach the mirror-target scan.
return buildRuntimeSessionMirrorEnvironmentKey({
activeRuntimeEnvironmentId: ENVIRONMENT_ID,
repos: [],