mirror of
https://github.com/stablyai/orca.git
synced 2026-09-25 16:02:38 +00:00
refactor(mobile): drop the casts the changed-code gate flags
Seven type assertions the gate counted as new, all removed rather than silenced where the type system could already answer. `normalizeMobileFilePreviewResponse` narrows on `ok` instead of asserting each arm; the snapshot adapter narrows on the fetch result's own discriminant; and the drawer's two probe reads go through one overloaded member read that keeps their optional-chaining behaviour. The remaining three keep a cast and now carry the rationale on the asserting line. No behaviour change. The two adapter edits re-digest the sixteen goldens mounted through them, one adapterSha256 line each with no observation moved, recorded from the pinned baseline the same way. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "88570b9d2376863c7f88d7ed8c745a5fb771deddbc7409f8944fa861dd4bdce9",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "d4052f119c7ed68dc922c8beeb0074701f1532b10e48e284fb71aa165a17e437",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "2e0d3021621698b63117e250dd5e9762b5bfb3dc1911e27c510e9539bd2ee6c9",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "82b891c7a7a2f255e2d22a372ee6112c9cc1f650259244e87f2e8c1356e97e5f",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "06c2ad6d4b464f889a640be7a238f6d0ff7c54b0e93fb5ea22aaa856dadb0336",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "f88ee2f5d19b19cc53dca5180a9b5936a13a00a82e8a4636a5e895262b669dec",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "79a49cddf66935007afb9be8a30593b778f02237894e5fd4d2898b526fc125df",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "8b8f7fe7227d44330e216e0bf5d366c41b54d9bf76acfb24df2c1770984b9f27",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "6832d23c6500e4fcb20abe7c53bc4f5abe72180dc0ad747a4907b82d99bc75d0",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "1be0396a852c508a5ba3e1b483e69bea1438a374967fe276ed3ab84209d24cb7",
|
||||
"adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7",
|
||||
"scenarioSha256": "a844134d7bad3c7c12107d60dbd298f5cfba778703fb9dd0f7ad454615d26b07",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "434ed7e7a8cffa1a0a8c19aaee6e43c2f9d35726b33b8d333eff0d67186ad148",
|
||||
"adapterSha256": "6119d409e1958877e4a04b3901f94a3609ac0420f5ca02af20eb8dae5cbf3408",
|
||||
"scenarioSha256": "95ca47f382997c412da974e564a46b1ae0c20d6e0f3ca14258d33c8d8b51a160",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "434ed7e7a8cffa1a0a8c19aaee6e43c2f9d35726b33b8d333eff0d67186ad148",
|
||||
"adapterSha256": "6119d409e1958877e4a04b3901f94a3609ac0420f5ca02af20eb8dae5cbf3408",
|
||||
"scenarioSha256": "fa0e28a167a5fba6fe7ffebb9f4ad28dd413d601c07116a24a7781d156f54beb",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "434ed7e7a8cffa1a0a8c19aaee6e43c2f9d35726b33b8d333eff0d67186ad148",
|
||||
"adapterSha256": "6119d409e1958877e4a04b3901f94a3609ac0420f5ca02af20eb8dae5cbf3408",
|
||||
"scenarioSha256": "d321d6c17e67ae90f6ceefb775495ff765a86a35423ed33a212e71ec5e9e94aa",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "434ed7e7a8cffa1a0a8c19aaee6e43c2f9d35726b33b8d333eff0d67186ad148",
|
||||
"adapterSha256": "6119d409e1958877e4a04b3901f94a3609ac0420f5ca02af20eb8dae5cbf3408",
|
||||
"scenarioSha256": "d2947158840576cbd0f0604ed3d37b0f446c63c6d439b4d1b7def7fe8524523d",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "434ed7e7a8cffa1a0a8c19aaee6e43c2f9d35726b33b8d333eff0d67186ad148",
|
||||
"adapterSha256": "6119d409e1958877e4a04b3901f94a3609ac0420f5ca02af20eb8dae5cbf3408",
|
||||
"scenarioSha256": "4749bb3b871275ba08f026f9b6bcfd383605f443e7bba70a7f89175b91db6fa5",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"baseline": "c6a72169843ececf3a21da370ac50c5c5a4e6462",
|
||||
"lockfileSha256": "788c1234b38a61fc882fca292341fce6690deee9cc6695673b0575cf2c4cf571",
|
||||
"recorderSha256": "2e90933db32efc17d752cf5d506ecdd9ec54ce53ea30ba55021ea3d1bc1d3fb2",
|
||||
"adapterSha256": "434ed7e7a8cffa1a0a8c19aaee6e43c2f9d35726b33b8d333eff0d67186ad148",
|
||||
"adapterSha256": "6119d409e1958877e4a04b3901f94a3609ac0420f5ca02af20eb8dae5cbf3408",
|
||||
"scenarioSha256": "2faa07ee5f12b3ed584117359d3b7aeb9c78a04e8fc49e753372f8c3927a3740",
|
||||
"platform": "darwin",
|
||||
"scenarioVersion": 1,
|
||||
|
||||
@@ -12,6 +12,13 @@ import {
|
||||
import type { NewWorktreeRuntimeSettings } from './new-worktree-agent-selection'
|
||||
import { newWorkspaceUiStateRead } from './new-workspace-operations'
|
||||
|
||||
/** One member off a probe payload the drawer only re-typed, keeping its optional-chaining read. */
|
||||
function readProbeMember(payload: unknown, key: 'glab'): { installed?: boolean } | undefined
|
||||
function readProbeMember(payload: unknown, key: 'connected'): boolean | undefined
|
||||
function readProbeMember(payload: unknown, key: string): unknown {
|
||||
return payload == null ? undefined : Object(payload)[key]
|
||||
}
|
||||
|
||||
/** A settled probe's accepted payload, or undefined when it never landed or was refused. */
|
||||
function settledValue(
|
||||
entry: PromiseSettledResult<RpcResponse>,
|
||||
@@ -82,19 +89,11 @@ export function useNewWorkspaceRuntimeContext(
|
||||
return
|
||||
}
|
||||
const glabInstalled =
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Preserve the established response shape at this boundary.
|
||||
(
|
||||
settledValue(preflightRes, taskPreflightRead.interpret) as
|
||||
| { glab?: { installed?: boolean } }
|
||||
| undefined
|
||||
)?.glab?.installed === true
|
||||
readProbeMember(settledValue(preflightRes, taskPreflightRead.interpret), 'glab')
|
||||
?.installed === true
|
||||
const linearConnected =
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Preserve the established response shape at this boundary.
|
||||
(
|
||||
settledValue(linearRes, taskLinearStatusRead.interpret) as
|
||||
| { connected?: boolean }
|
||||
| undefined
|
||||
)?.connected === true
|
||||
readProbeMember(settledValue(linearRes, taskLinearStatusRead.interpret), 'connected') ===
|
||||
true
|
||||
const visibleProviders = normalizeVisibleTaskProviders(settingsValue?.visibleTaskProviders)
|
||||
setAvailableProviders(
|
||||
filterAvailableTaskProviders(visibleProviders, {
|
||||
|
||||
@@ -42,9 +42,9 @@ export function normalizeMobileFilePreviewResponse(
|
||||
response: RpcResponse
|
||||
): MobileFilePreviewResult {
|
||||
if (!response.ok) {
|
||||
return previewErrorFromRefusal((response as RpcFailure).error)
|
||||
return previewErrorFromRefusal(response.error)
|
||||
}
|
||||
return normalizeMobileFilePreviewResult(relativePath, (response as RpcSuccess).result)
|
||||
return normalizeMobileFilePreviewResult(relativePath, response.result)
|
||||
}
|
||||
|
||||
/** The accepted arm, for a call site whose acceptance policy already admitted the payload. */
|
||||
|
||||
@@ -93,13 +93,15 @@ export function fetchMobileHomeTaskProviders(
|
||||
((settingsResult.value ?? {}) as HomeTaskSettings)
|
||||
: {}
|
||||
const preflightResult = taskPreflightRead.interpret(preflightResponse)
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Preserve the established response shape at this boundary.
|
||||
const preflight = preflightResult.accepted
|
||||
? (preflightResult.value as HomePreflightStatus)
|
||||
? // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Preserve the established response shape at this boundary.
|
||||
(preflightResult.value as HomePreflightStatus)
|
||||
: null
|
||||
const linearResult = taskLinearStatusRead.interpret(linearResponse)
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Preserve the established response shape at this boundary.
|
||||
const linear = linearResult.accepted ? (linearResult.value as HomeLinearStatus) : null
|
||||
const linear = linearResult.accepted
|
||||
? // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Preserve the established response shape at this boundary.
|
||||
(linearResult.value as HomeLinearStatus)
|
||||
: null
|
||||
const providers = filterAvailableTaskProviders(
|
||||
normalizeVisibleTaskProviders(settings.visibleTaskProviders),
|
||||
{
|
||||
|
||||
@@ -63,9 +63,9 @@ export function newWorkspaceMountAdapters(
|
||||
>('mobile/src/components/use-new-workspace-setup-script.ts').useNewWorkspaceSetupScript
|
||||
let state: ReturnType<typeof useSetup>
|
||||
const hook = hookMount(() => {
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the hook reads only the repo's id.
|
||||
state = useSetup({
|
||||
client,
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the hook reads only the repo's id.
|
||||
selectedRepo: REPO as Parameters<typeof useSetup>[0]['selectedRepo']
|
||||
})
|
||||
})
|
||||
|
||||
@@ -51,14 +51,10 @@ export function worktreeCatalogMountAdapters(
|
||||
let admitted: unknown = 'unadmitted'
|
||||
return {
|
||||
action: () =>
|
||||
snapshots.fetch(client, HOST).then((result: unknown) => {
|
||||
snapshots.fetch(client, HOST).then((result) => {
|
||||
fetched = result
|
||||
// Admitting is what advances the snapshot token a later poll sends back.
|
||||
admitted =
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: admit takes the pending half of the result it was just handed.
|
||||
(result as { kind: string; pending?: never }).kind === 'response'
|
||||
? snapshots.admit((result as { pending: never }).pending)
|
||||
: snapshots.admit(null)
|
||||
admitted = snapshots.admit(result.kind === 'response' ? result.pending : null)
|
||||
return result
|
||||
}),
|
||||
state: () => projectObservable({ fetched, admitted }),
|
||||
|
||||
Reference in New Issue
Block a user