Merge origin/main into project grouping rule

This commit is contained in:
Brennan Benson
2026-11-10 16:13:09 -08:00
5098 changed files with 51719 additions and 106896 deletions
@@ -19,7 +19,6 @@ on:
# Contracts without the .performance suffix. Keep in sync with config/vitest.performance.config.ts;
# without these a rename lands green and only breaks the next nightly.
- 'src/main/runtime/session-tabs/session-tabs-phone-layout-moves.test.ts'
- 'src/renderer/src/components/terminal-pane/pty-connection/startup/saved-resume-cancellation.test.ts'
- 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts'
- 'src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts'
- 'src/main/runtime/rpc/methods/projects/repo.test.ts'
@@ -30,7 +29,6 @@ on:
- 'src/main/codex-usage/scanner-incremental-append.test.ts'
- 'src/main/usage/jsonl-file-reader.test.ts'
- 'src/main/usage/jsonl-file-snapshot.test.ts'
- 'src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-queue-retention.test.ts'
- 'src/main/claude-usage/scanner-incremental-append.test.ts'
- 'src/main/claude-usage/store-checkpoint-persistence.test.ts'
+4
View File
@@ -512,6 +512,10 @@ jobs:
if: needs.code_paths.outputs.static_analysis == 'true'
run: bun config/scripts/localization/source-extraction/audit-localization-coverage.mjs --check
- name: Verify startup and worktree localization coverage
if: needs.code_paths.outputs.static_analysis == 'true'
run: bun run verify:startup-worktree-localization-coverage
- name: Verify mobile localization
if: needs.code_paths.outputs.static_analysis == 'true'
run: bun config/scripts/localization/catalog-validation/verify-mobile-localization.mjs
+3
View File
@@ -121,6 +121,9 @@ validation-screenshots/
test-results/
playwright-report/
# Claude Code settings are machine-local.
**/.claude/settings.local.json
# Agent skills are installed per machine.
/.claude/skills/
/.agents/skills/
+2 -4
View File
@@ -292,11 +292,9 @@ Pair with your desktop app to monitor and steer your agents from your phone.
- **Discord:** Join the community on **[Discord](https://discord.gg/fzjDKHxv8Q)**.
- **Twitter / X:** Follow **[@orca_build](https://x.com/orca_build)** for updates and announcements.
- **WeChat:** Scan to join an Orca community WeChat group. If one group is full, join another.
- **WeChat:** Scan to join an Orca community WeChat group.
<img src="docs/assets/wechat-qr-group14.jpg" alt="WeChat QR code for the Orca community" width="160" />
<img src="docs/assets/wechat-qr-group15.jpg" alt="WeChat QR code for the Orca community" width="160" />
<img src="docs/assets/wechat-qr-group16.jpg" alt="WeChat QR code for the Orca community" width="160" />
<img src="docs/assets/wechat-qr.jpg" alt="WeChat QR code for the Orca community" width="160" />
- **Feedback &amp; Ideas:** We ship fast. Missing something? [Request a new feature](https://github.com/stablyai/orca/issues).
- **Privacy:** See the [privacy &amp; telemetry docs](https://www.onorca.dev/docs/telemetry) for what anonymous usage data Orca collects and how to opt out.
@@ -1,5 +1,5 @@
// Later run-all.ts checks against the same host: rebind, orphan grace, silence,
// forced resets and pre-upgrade refusals.
// forced resets.
import WebSocket from 'ws'
import { GRACE_MS, ORIGIN, PING_MS, PORT, SILENCE_MS, makeControl, openPhone, record, sleep, waitFor, type Ctx, type Control } from './run-all-harness'
@@ -89,12 +89,4 @@ export async function runLifecycleChecks(ctx: Ctx, main: Control, mainAck: Ack):
back.client.closeNow()
}
// Bad JWT -> 401 before upgrade; malformed host id -> 429.
{
const bad = new WebSocket(`ws://127.0.0.1:${PORT}/v1/host/control`, { headers: { authorization: 'Bearer nope' } })
const status = await new Promise<number>((res) => bad.on('unexpected-response', (_q, r) => res(r.statusCode ?? 0)))
const badHost = new WebSocket(`ws://127.0.0.1:${PORT}/v1/connect/short`)
const s2 = await new Promise<number>((res) => badHost.on('unexpected-response', (_q, r) => res(r.statusCode ?? 0)))
record('R11/R5 ES256 JWKS rejects bad token (401); malformed host id 429', status === 401 && s2 === 429, `${status},${s2}`)
}
}
-5
View File
@@ -100,11 +100,6 @@ async function runTests(ctx: Ctx): Promise<void> {
const mainAck = await main.client.connect()
const transport = main.bindTransport(mainAck.generation)
// Alarm-driven app ping, answered by the shipped client's pong handler.
await sleep(PING_MS * 3 + 300)
record('R2/R5 alarm-driven JSON ping parsed by shipped client, pong keeps control alive',
main.events.pings >= 2 && main.client.isLive(), `pings=${main.events.pings} live=${main.client.isLive()}`)
// Phone connect -> conn-open (strict, shipped parser) -> host data -> relay-hello (shipped parser).
const phone = openPhone(ctx)
const helloOk = await waitFor(() => phone.hello !== null, 5000)
@@ -191,7 +191,7 @@ export abstract class HostRelayHandshake extends HostRelayBase {
})
// After the ack, which strict shipped parsers must see unchanged; only hosts that asked get it.
if (a.clientKeepalive) { this.send(ws, { type: 'keepalive-offer', v: 1, intervalMs: this.config.pingIntervalMs }) }
metric(this.env, 'control_active', 1, rebind ? 'rebind' : 'new', [], '', a.place)
metric(this.env, 'control_active', 1, rebind ? 'rebind' : 'new', [], a.clientKeepalive ? 'keepalive' : 'legacy', a.place)
await this.reschedule()
}
}
+2 -1
View File
@@ -187,7 +187,8 @@ export class HostRelay extends HostRelayPhones {
// Same order as the cells' heartbeat: expired auth past its grace, then the 6 h lease.
if (now > a.claims.exp + CONTROL_CONTINUITY_LIMITS.expiredAuthExistingSpliceGraceMs) {
const sinceRefreshS = a.lastRefreshAt === undefined ? -1 : Math.round((now - a.lastRefreshAt) / 1000)
metric(this.env, 'auth_expired_close', sinceRefreshS, a.lastRefreshAt === undefined ? 'never' : 'refreshed', [], '', a.place)
const seenAgoS = Math.round((now - seen) / 1000)
metric(this.env, 'auth_expired_close', sinceRefreshS, a.lastRefreshAt === undefined ? 'never' : 'refreshed', [seenAgoS], this.keepalive(a) ? 'keepalive' : 'legacy', a.place)
this.close(ws, RELAY_CLOSE_CODE.BAD_OUTER_CREDENTIAL, 'relay authorization expired')
await this.onSocketGone(ws, RELAY_CLOSE_CODE.BAD_OUTER_CREDENTIAL, '')
continue
+2
View File
@@ -2,6 +2,7 @@
import type { Env } from './env'
export type MetricEvent =
// label 'new' | 'rebind'; reason 'keepalive' | 'legacy' (took the keepalive offer or not).
| 'control_active'
| 'control_close'
| 'phone_open'
@@ -26,6 +27,7 @@ export type MetricEvent =
| 'control_upgrade'
// Control closed 4401 for expired authorization: value = seconds since its last extending
// refresh, label 'refreshed'; -1 and label 'never' when this socket never extended its token.
// double2 = seconds since the host's last inbound frame or keepalive; reason 'keepalive' | 'legacy'.
| 'auth_expired_close'
// Pre-auth socket refused by the per-source limiter: label 'phone' | 'data' | 'health'. Unpushed-host phones: 'not_on_edge'.
| 'preauth_limited'
+3 -3
View File
@@ -50,18 +50,18 @@ export function edgeCohortBucketPermille(relayHostId: string): number {
}
// Mode off or down empties the cohort. Otherwise deny wins, then host allow, then region scope;
// within the region, account allow or the rollout share.
// within the region, account allow or the rollout share. Region 'any' skips the region scope.
export function inEdgeCohort(
config: EdgeRelayConfig,
relayHostId: string,
region: RelayRegion | undefined,
region: RelayRegion | undefined | 'any',
userId?: string
): boolean {
const flags = config.control?.() ?? EDGE_CONTROL_DEFAULTS
if (flags.mode !== 'on') { return false }
if (config.denyHosts.has(relayHostId)) { return false }
if (config.allowHosts.has(relayHostId)) { return true }
if (!config.regions.has(region ?? RELAY_DEFAULT_REGION)) { return false }
if (region !== 'any' && !config.regions.has(region ?? RELAY_DEFAULT_REGION)) { return false }
if (userId !== undefined && config.allowUsers?.has(userId)) { return true }
return edgeCohortBucketPermille(relayHostId) < edgeRolloutPermille(config.rolloutPercent, flags)
}
@@ -108,6 +108,22 @@ describe('edge evacuation under runtime control', () => {
h.evacuation.stop()
})
it('leaves region scope to the assign path: a stored preference outside it drains nobody', async () => {
vi.spyOn(console, 'warn').mockImplementation(() => {})
const flags: EdgeControlFlags = { mode: 'on', rolloutPermille: 1000 }
const h = await harness({ control: () => flags })
// On the edge by its ask (no region, or us-central1); its stored preference says otherwise.
await h.insert(hostId(1))
await h.prefer(hostId(1), 'asia-east2')
await h.insert(hostId(2))
expect(await h.evacuation.sweep()).toBe(0)
expect(h.admin.drained).toEqual([])
// Leaving the cohort still drains, whatever the stored region.
flags.rolloutPermille = 0
expect(await h.evacuation.sweep()).toBe(2)
expect(h.admin.drained.sort()).toEqual([hostId(1), hostId(2)])
})
it(`sends at most ${EDGE_EVACUATION_CONCURRENCY} drains at once`, async () => {
vi.spyOn(console, 'warn').mockImplementation(() => {})
const h = await harness()
@@ -3,7 +3,6 @@
// rows whose host is no longer in the cohort and asks the edge to drain them; the desktop then
// re-asks /v1/assign, and that ask exports its data and places it on a cell (app.ts). Each pass also
// retries fences that did not land after a host left (edge-relay-fence.ts).
import { RELAY_DEFAULT_REGION, RelayRegionSchema } from '@orca-cloud/relay-contract/relay-regions'
import type { RelayDatabase } from './database/database.js'
import { EdgeAdminUnavailableError, type EdgeAdmin } from './edge-admin-client.js'
import { inEdgeCohort, text, type EdgeRelayConfig, type Identity } from './edge-relay-cohort.js'
@@ -116,9 +115,11 @@ export class EdgeEvacuation {
for (const row of rows) {
const identity = { userId: text(row, 'user_id'), relayHostId: text(row, 'relay_host_id') }
pass.cursor = identity
const stored = RelayRegionSchema.safeParse(row.preferred_region)
const region = stored.success ? stored.data : RELAY_DEFAULT_REGION
if (inEdgeCohort(this.config, identity.relayHostId, region, identity.userId)) { continue }
// Region scope is the assign path's call alone: it decides with the region the desktop
// asks for, which the stored preference can miss or lag. Judging it here too drained
// hosts that the next ask put straight back (a drain every few minutes). A host that asks
// for a region outside the scope leaves on that ask.
if (inEdgeCohort(this.config, identity.relayHostId, 'any', identity.userId)) { continue }
if (this.drainedAt.has(drainKey(identity))) { continue }
leaving.push(identity)
// Resume after the last host taken, so the rest of the page is read next tick.
@@ -143,10 +144,8 @@ export class EdgeEvacuation {
private async readPage(pass: Pass) {
const { cursor, origin, wrapped } = pass
return await this.database.query(
`SELECT a.user_id, a.relay_host_id, p.preferred_region
`SELECT a.user_id, a.relay_host_id
FROM relay_assignments a
LEFT JOIN relay_assignment_region_preferences p
ON p.user_id = a.user_id AND p.relay_host_id = a.relay_host_id
WHERE a.cell_id = ? AND (a.user_id > ? OR (a.user_id = ? AND a.relay_host_id > ?))
${wrapped ? 'AND (a.user_id < ? OR (a.user_id = ? AND a.relay_host_id <= ?))' : ''}
ORDER BY a.user_id, a.relay_host_id
@@ -0,0 +1,14 @@
id: claude-chat-entrypoint-callers
snapshots:
"import { withOrcaClaudeChatEntrypoint as stamp } from './claude-chat-entrypoint'":
labels:
- source: withOrcaClaudeChatEntrypoint
style: primary
start: 9
end: 37
'withOrcaClaudeChatEntrypoint(env, platform)':
labels:
- source: withOrcaClaudeChatEntrypoint
style: primary
start: 0
end: 28
@@ -0,0 +1,20 @@
id: claude-chat-entrypoint-owner
snapshots:
"const env = { CLAUDE_CODE_ENTRYPOINT: 'orca' }":
labels:
- source: CLAUDE_CODE_ENTRYPOINT
style: primary
start: 14
end: 36
const identity = 'sdk-cli':
labels:
- source: sdk-cli
style: primary
start: 18
end: 25
"env['claude_code_entrypoint'] = 'other'":
labels:
- source: claude_code_entrypoint
style: primary
start: 5
end: 27
@@ -0,0 +1,14 @@
id: claude-entrypoint-key-owner
snapshots:
"env[CLAUDE_ENTRYPOINT_ENV] = 'orca'":
labels:
- source: CLAUDE_ENTRYPOINT_ENV
style: primary
start: 4
end: 25
"import { CLAUDE_ENTRYPOINT_ENV as key } from './claude-chat-entrypoint'":
labels:
- source: CLAUDE_ENTRYPOINT_ENV
style: primary
start: 9
end: 30
@@ -0,0 +1,6 @@
id: claude-chat-entrypoint-callers
valid:
- 'stripInheritedClaudeSessionEnv(env)'
invalid:
- 'withOrcaClaudeChatEntrypoint(env, platform)'
- "import { withOrcaClaudeChatEntrypoint as stamp } from './claude-chat-entrypoint'"
@@ -0,0 +1,8 @@
id: claude-chat-entrypoint-owner
valid:
- 'const env = withOrcaClaudeChatEntrypoint(configured, platform)'
- "const binary = 'orca'"
invalid:
- "const env = { CLAUDE_CODE_ENTRYPOINT: 'orca' }"
- "env['claude_code_entrypoint'] = 'other'"
- "const identity = 'sdk-cli'"
@@ -0,0 +1,6 @@
id: claude-entrypoint-key-owner
valid:
- "const binary = 'orca'"
invalid:
- "env[CLAUDE_ENTRYPOINT_ENV] = 'orca'"
- "import { CLAUDE_ENTRYPOINT_ENV as key } from './claude-chat-entrypoint'"
@@ -0,0 +1,117 @@
id: claude-chat-entrypoint-owner
language: typescript
severity: error
message: Keep the Claude identity literal in claude-chat-entrypoint.ts.
files: ['src/**']
ignores:
- '**/*.test.*'
- '**/*.test-fixtures.*'
- '**/__fixtures__/**'
- 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts'
rule:
all:
- any:
- kind: string_fragment
- kind: property_identifier
- kind: identifier
- regex: '(?i)^(CLAUDE_CODE_ENTRYPOINT|sdk-cli)$'
---
id: claude-chat-entrypoint-owner-tsx
language: tsx
severity: error
message: Keep the Claude identity literal in claude-chat-entrypoint.ts.
files: ['src/**']
ignores:
- '**/*.test.*'
- '**/*.test-fixtures.*'
- '**/__fixtures__/**'
- 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts'
rule:
all:
- any:
- kind: string_fragment
- kind: property_identifier
- kind: identifier
- regex: '(?i)^(CLAUDE_CODE_ENTRYPOINT|sdk-cli)$'
---
id: claude-chat-entrypoint-callers
language: typescript
severity: error
message: Only structured native chat and its own probes may apply the chat identity.
files: ['src/**']
ignores:
- '**/*.test.*'
- '**/*.test-fixtures.*'
- '**/__fixtures__/**'
- 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts'
- 'src/main/claude/claude-stream-json-connection.ts'
- 'src/main/claude/claude-agent-sdk-process-spawn.ts'
- 'src/main/claude/structured/launch/claude-structured-child-env.ts'
- 'src/main/claude/claude-model-catalog-probe.ts'
rule:
all:
- any:
- kind: string_fragment
- kind: property_identifier
- kind: identifier
- regex: '^withOrcaClaudeChatEntrypoint$'
---
id: claude-chat-entrypoint-callers-tsx
language: tsx
severity: error
message: Only structured native chat and its own probes may apply the chat identity.
files: ['src/**']
ignores:
- '**/*.test.*'
- '**/*.test-fixtures.*'
- '**/__fixtures__/**'
- 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts'
- 'src/main/claude/claude-stream-json-connection.ts'
- 'src/main/claude/claude-agent-sdk-process-spawn.ts'
- 'src/main/claude/structured/launch/claude-structured-child-env.ts'
- 'src/main/claude/claude-model-catalog-probe.ts'
rule:
all:
- any:
- kind: string_fragment
- kind: property_identifier
- kind: identifier
- regex: '^withOrcaClaudeChatEntrypoint$'
---
id: claude-entrypoint-key-owner
language: typescript
severity: error
message: Only the chat identity owner and inherited-session isolation may access this key directly.
files: ['src/**']
ignores:
- '**/*.test.*'
- '**/*.test-fixtures.*'
- '**/__fixtures__/**'
- 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts'
- 'src/shared/agent-launch/startup/claude-parent-session-env.ts'
rule:
all:
- any:
- kind: string_fragment
- kind: property_identifier
- kind: identifier
- regex: '^CLAUDE_ENTRYPOINT_ENV$'
---
id: claude-entrypoint-key-owner-tsx
language: tsx
severity: error
message: Only the chat identity owner and inherited-session isolation may access this key directly.
files: ['src/**']
ignores:
- '**/*.test.*'
- '**/*.test-fixtures.*'
- '**/__fixtures__/**'
- 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts'
- 'src/shared/agent-launch/startup/claude-parent-session-env.ts'
rule:
all:
- any:
- kind: string_fragment
- kind: property_identifier
- kind: identifier
- regex: '^CLAUDE_ENTRYPOINT_ENV$'
@@ -0,0 +1,36 @@
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
// Why: import.meta.url, not dirname — electron-vite's config bundle rewrites only the former.
const REPO_ROOT = fileURLToPath(new URL('../..', import.meta.url))
export const UNCOMPILED_LIST = 'config/react-compiler-uncompiled-files.txt'
// Hand-kept list plus every file still in a hazard ratchet; compiled, these would run differently.
export const UNCOMPILED_FILE_LISTS = [
UNCOMPILED_LIST,
'config/render-path-translate-baseline.txt',
'config/react-compiler-hazard-baseline.txt'
]
/** Repo-relative paths from a list or count baseline: `[count ]path[#detail][ # note]`. */
export function parseListedFiles(text) {
return text
.split('\n')
.map((line) => line.trim())
.filter((line) => line && !line.startsWith('#'))
.map((line) =>
line
.replace(/^\d+\s+/, '')
.split('#')[0]
.trim()
)
}
export function readListedFiles(list, root = REPO_ROOT) {
return parseListedFiles(readFileSync(resolve(root, list), 'utf8'))
}
export function reactCompilerExcludedFiles(root = REPO_ROOT) {
return [...new Set(UNCOMPILED_FILE_LISTS.flatMap((list) => readListedFiles(list, root)))]
}
+1 -21
View File
@@ -1,25 +1,5 @@
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import type { Options } from '@vitejs/plugin-react'
// Hand-kept list plus every file still in a hazard ratchet; compiled, these would run differently.
const UNCOMPILED_FILE_LISTS = [
'config/react-compiler-uncompiled-files.txt',
'config/render-path-translate-baseline.txt',
'config/react-compiler-hazard-baseline.txt'
]
function listedFiles(list: string): string[] {
return readFileSync(resolve(list), 'utf8')
.split('\n')
.map((line) => line.trim())
.filter((line) => line && !line.startsWith('#'))
.map((line) => line.replace(/^\d+\s+/, '').split('#')[0])
}
export function reactCompilerExcludedFiles(): string[] {
return [...new Set(UNCOMPILED_FILE_LISTS.flatMap(listedFiles))]
}
import { reactCompilerExcludedFiles } from './react-compiler-uncompiled-files.mjs'
export function isReactCompilerEnabled(): boolean {
return process.env.ORCA_REACT_COMPILER !== '0'
+2 -17
View File
@@ -30,8 +30,6 @@
3 test-no-in-test-import-actual:src/renderer/src/components/terminal-pane/snapshots/remote-snapshot-alt-screen-host-chain.test.ts
1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-agent-status-pane-teardown.test.ts
1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-agent-status-snapshot-hydration.test.ts
1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts
1 test-no-in-test-import-actual:src/renderer/src/lib/agent-session/launch/new-tab/agent-launch-caller-routing.test.ts
1 test-no-polling-loop:src/main/browser/cookies/browser-cookie-import-concurrency.test.ts
1 test-no-polling-loop:src/main/claude/claude-stop-ack-race.test.ts
1 test-no-polling-loop:src/main/claude/claude-stream-json-connection.test.ts
@@ -257,7 +255,6 @@
1 test-no-real-time-wait:src/main/windows/windows-process-tree-command-line-patch.test.ts
2 test-no-real-time-wait:src/main/windows/windows-pty-job.win32.test.ts
1 test-no-real-time-wait:src/main/worker-thread-child-process/worker-thread-child-process.test.ts
1 test-no-real-time-wait:src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts
1 test-no-real-time-wait:src/main/workspaces/removal/local-worktree-removal-recovery-live.test.ts
2 test-no-real-time-wait:src/main/wsl/execution/wsl-command-loop.test.ts
2 test-no-real-time-wait:src/main/wsl/orcad/wsl-orcad-real-distro-lane.test.ts
@@ -273,7 +270,6 @@
1 test-no-real-time-wait:src/renderer/src/components/terminal-pane/viewport/terminal-fit-restore.test.ts
1 test-no-real-time-wait:src/renderer/src/hooks/runtime-project-refresh-scheduler.test.ts
1 test-no-real-time-wait:src/renderer/src/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation.test.ts
1 test-no-real-time-wait:src/renderer/src/lib/orca-yaml-trust-prompt-slot-eviction.test.ts
2 test-no-real-time-wait:src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal-preflight.test.ts
2 test-no-real-time-wait:src/shared/__tests__/process-host/windows-tree-kill-late-taskkill.win32.test.ts
1 test-no-real-time-wait:src/shared/darwin-process-table-capture.test.ts
@@ -631,14 +627,9 @@
2 test-no-wall-clock:src/renderer/src/components/artifacts/ArtifactCollection.test.tsx
1 test-no-wall-clock:src/renderer/src/components/browser-pane/assemble-chrome/browser-workspace-pane.adoption-chrome.test.tsx
2 test-no-wall-clock:src/renderer/src/components/dashboard/useLiveDashboardSnapshot.test.ts
1 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/slots/NativeChatMessageList.opening-send.test.tsx
1 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/slots/NativeChatMessageList.queued-turn-order.test.tsx
2 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/turns/NativeChatMessageList.turn-indicator.test.tsx
3 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx
1 test-no-wall-clock:src/renderer/src/components/native-chat/session/structured/delivery/NativeChatMessageList.unsent-message.test.tsx
3 test-no-wall-clock:src/renderer/src/components/native-chat/surfaces/integration/NativeChatMessageList.test.tsx
2 test-no-wall-clock:src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.test.tsx
3 test-no-wall-clock:src/renderer/src/components/sidebar/workspace-card/review/use-workspace-reference-details.test.tsx
1 test-no-wall-clock:src/renderer/src/components/sidebar/workspace-card/review/use-workspace-reference-details.test.tsx
1 test-no-wall-clock:src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx
2 test-no-wall-clock:src/renderer/src/components/task-page/jira/task-page-jira-cache-selectors.test.ts
2 test-no-wall-clock:src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme-child-stdin.node-pty.test.ts
@@ -646,15 +637,10 @@
1 test-no-wall-clock:src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx
2 test-no-wall-clock:src/renderer/src/components/workspace-cleanup/use-workspace-cleanup-removal.agent-stop.test.tsx
1 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.behavior.test.tsx
4 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.test.tsx
2 test-no-wall-clock:src/renderer/src/hooks/ipc-events/agent-status-terminal-title-tab-write.test.ts
1 test-no-wall-clock:src/renderer/src/hooks/useIpcEvents-agent-status-hook-titles.test.ts
1 test-no-wall-clock:src/renderer/src/lib/paired-runtime-closed-tab-resume.test.ts
2 test-no-wall-clock:src/renderer/src/lib/use-tab-agent-observed-signal-dispatch.test.tsx
2 test-no-wall-clock:src/renderer/src/lib/wake-sleeping-agents-live-unmounted-pane.test.ts
2 test-no-wall-clock:src/renderer/src/lib/agent-session/tab-identity/use-tab-agent-observed-signal-dispatch.test.tsx
1 test-no-wall-clock:src/renderer/src/lib/workspace/ownership/workspace-terminal-host-authority.test.ts
1 test-no-wall-clock:src/renderer/src/lib/workspace/activation/worktree-activation-emptied-workspace-reseed.test.ts
2 test-no-wall-clock:src/renderer/src/runtime/native-chat/tab-retirement/structured-agent-session-tab-retirement.test.ts
2 test-no-wall-clock:src/renderer/src/store/github/pull-requests/github-pr-branch-linked-pr-divergence.test.ts
6 test-no-wall-clock:src/renderer/src/store/slices/jira/jira.test.ts
5 test-no-wall-clock:src/renderer/src/store/slices/worktrees/metadata/worktree-meta-hosted-review.test.ts
@@ -678,7 +664,6 @@
2 test-no-wall-clock:tests/e2e/cross-version-wire/release-source-retention.unit.test.ts
1 test-no-wall-clock:tests/e2e/host-cold-park-remote-subscriber.unit.test.ts
2 test-no-wall-clock:tests/e2e/omp-child-session-recovery.unit.test.ts
1 test-no-wall-clock:tests/e2e/structured-session-tab-close-regressions.unit.test.ts
2 test-timeout-needs-reason:mobile/src/terminal/document/native-document-bundle.test.ts
1 test-timeout-needs-reason:mobile/src/test-support/rpc-recording/family-recordings.test.ts
1 test-timeout-needs-reason:mobile/src/test-support/rpc-recording/mutants/family-mutants.test.ts
+16 -16
View File
@@ -12,17 +12,17 @@
3 src/renderer/src/components/LinearIssueTextEditor.tsx
3 src/renderer/src/components/LinearIssueWorkspace.tsx
5 src/renderer/src/components/LinearItemDrawer.tsx
1 src/renderer/src/components/NativeChatResumeOnRestartGroups.tsx
1 src/renderer/src/components/native-chat-recovery/tree/NativeChatResumeOnRestartGroups.tsx
1 src/renderer/src/components/activity/ActivityPrototypePage.tsx
1 src/renderer/src/components/activity/activity-scope-filter-controls.tsx
2 src/renderer/src/components/activity/activity-thread-actions.ts
1 src/renderer/src/components/activity/use-agent-pane-thread-store-data.ts
1 src/renderer/src/components/activity/use-agent-pane-threads.ts
4 src/renderer/src/components/agent/AgentSettingsDialog.tsx
1 src/renderer/src/components/automations/automation-host-client.ts
1 src/renderer/src/components/automations/hosts/automation-host-client.ts
1 src/renderer/src/components/automations/automations-page-fixtures.ts
1 src/renderer/src/components/automations/use-automations-page-controller.ts
1 src/renderer/src/components/automations/use-automations-page-destination-form.ts
1 src/renderer/src/components/automations/authoring/use-automations-page-destination-form.ts
1 src/renderer/src/components/browser-pane/ReopenBrowserPageOnServerButton.tsx
1 src/renderer/src/components/browser-pane/browser-reopen-on-server.ts
1 src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-stream.ts
@@ -202,11 +202,11 @@
1 src/renderer/src/hooks/ipc-events/runtime-environment-subscription-selection.ts
1 src/renderer/src/hooks/ipc-events/settings-sidebar-ipc-bridge.ts
1 src/renderer/src/hooks/ipc-events/terminal-request-ipc-bridge.ts
1 src/renderer/src/hooks/use-active-skill-discovery-runtime-target.ts
1 src/renderer/src/hooks/skills/discovery/use-active-skill-discovery-runtime-target.ts
2 src/renderer/src/hooks/use-integration-provider-status-refresh.ts
1 src/renderer/src/hooks/useActiveProjectSkillRuntime.ts
1 src/renderer/src/hooks/skills/runtime/useActiveProjectSkillRuntime.ts
1 src/renderer/src/hooks/useEditorExternalWatch.ts
1 src/renderer/src/hooks/useInstalledAgentSkills.ts
1 src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.ts
1 src/renderer/src/hooks/useIpcEvents.ts
4 src/renderer/src/hooks/useIssueMetadata.ts
2 src/renderer/src/hooks/useLinearIssuePublication.ts
@@ -218,21 +218,21 @@
1 src/renderer/src/lib/browser/navigation/http-link-localhost-route.ts # extracted from http-link-routing.ts
1 src/renderer/src/lib/browser/navigation/http-link-routing.ts
2 src/renderer/src/lib/browser/workspace/workspace-browser-tab-open.ts
1 src/renderer/src/lib/client-creation-action-error.ts
2 src/renderer/src/lib/client-creation-action-policy.ts
1 src/renderer/src/lib/workspace/creation/surface-policy/client-creation-action-error.ts
2 src/renderer/src/lib/workspace/creation/surface-policy/client-creation-action-policy.ts
1 src/renderer/src/runtime/hosts/selection/default-creation-host.ts # the sanctioned reader of the default host
1 src/renderer/src/lib/launch-ai-vault-session.ts
1 src/renderer/src/lib/local-preflight-context.ts
1 src/renderer/src/lib/agent-session/resume/history/launch-ai-vault-session.ts
1 src/renderer/src/runtime/hosts/preflight/local-preflight-context.ts
2 src/renderer/src/runtime/hosts/observations/provider-runtime-context.ts
2 src/renderer/src/lib/workspace/ownership/repo-runtime-owner.ts
1 src/renderer/src/lib/workspace/ownership/runtime-session-mirror-owners.ts
1 src/renderer/src/lib/runtime-session-mirror-targets.ts
1 src/renderer/src/runtime/web-session-tabs-sync/subscriptions/runtime-session-mirror-targets.ts
1 src/renderer/src/lib/workspace/ownership/single-runtime-legacy-owner.ts
1 src/renderer/src/lib/skill-runtime-command.ts
1 src/renderer/src/lib/terminal-close-route.ts
4 src/renderer/src/lib/terminal-worktree-route.ts # resolveTerminalPtyOwner: teardown, close and PTY identity read spawn's attribution (round 3 F8), which retired the deprecated resolver's readers
3 src/renderer/src/lib/unread-badge-count-selector.ts
1 src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts
1 src/renderer/src/lib/skills/runtime/skill-runtime-command.ts
1 src/renderer/src/lib/workspace/ownership/terminal-close-route.ts
4 src/renderer/src/lib/workspace/ownership/terminal-worktree-route.ts # resolveTerminalPtyOwner: teardown, close and PTY identity read spawn's attribution (round 3 F8), which retired the deprecated resolver's readers
3 src/renderer/src/attention/unread/unread-badge-count-selector.ts
1 src/renderer/src/runtime/hosted-terminals/restoration/web-runtime-worktree-terminal-after-wake.ts
1 src/renderer/src/lib/work-items/linear/linear-issue-url-lookup.ts
1 src/renderer/src/lib/work-items/linear/linear-issue-write.ts
1 src/renderer/src/lib/workspace/activation/worktree-activation.ts
+1 -1
View File
@@ -1,7 +1,7 @@
# JSX mapped straight over a host collection, per file, outside components/host-picker.
# This is a RATCHET: counts may only go DOWN. Draw host lists with HostCombobox or
# useBoundedHostRows. Prune after a fix: pnpm check:host-list-render-ratchet --prune
1 src/renderer/src/components/automations/AutomationRunsDashboard.tsx
1 src/renderer/src/components/automations/runs/AutomationRunsDashboard.tsx
1 src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelControls.tsx
1 src/renderer/src/components/right-sidebar/source-control/ai/SourceControlAgentActionDialogForm.tsx
1 src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx
+1 -2
View File
@@ -479,7 +479,7 @@
2 src/main/runtime/mobile-cloud-relay/relay-revoke-outbox.ts
1 src/main/runtime/orchestration/db/runtime-orchestration-database-access.ts
2 src/main/runtime/push/push-unregister-outbox.ts
2 src/main/runtime/rpc/methods/mobile-delivery/bundled-mobile-web-bundle.ts
1 src/main/runtime/rpc/methods/mobile-delivery/bundled-mobile-web-bundle.ts
1 src/main/runtime/rpc/server/network-source-policy-store.ts
2 src/main/runtime/rpc/server/pairing/device-registry-corruption.ts
2 src/main/runtime/rpc/server/pairing/device-registry-disk-merge.ts
@@ -551,7 +551,6 @@
2 src/main/worker-threads/forked-child-entry-path.ts
4 src/main/workspace-hooks/hooks.ts
10 src/main/workspace-hooks/issue-command-file.ts
4 src/main/workspace-hooks/worktree-runner-script.ts
1 src/main/workspaces/catalog/folder-repo-git-conversion.ts
2 src/main/workspaces/catalog/folder-upgrade-worktree-path.ts
3 src/main/workspaces/execution-host/project-runtime-git-router.ts
@@ -42,70 +42,70 @@
"count": 1
},
{
"filePath": "mobile/src/components/accounts-snapshot.ts",
"filePath": "mobile/src/accounts/accounts-snapshot.ts",
"kind": "object-property:message",
"text": "Claude limits use the wrong provider identity",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/accounts-snapshot.ts",
"filePath": "mobile/src/accounts/accounts-snapshot.ts",
"kind": "object-property:message",
"text": "Codex limits use the wrong provider identity",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/accounts-snapshot.ts",
"filePath": "mobile/src/accounts/accounts-snapshot.ts",
"kind": "object-property:message",
"text": "Host Codex accounts cannot name a WSL distro",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/accounts-snapshot.ts",
"filePath": "mobile/src/accounts/accounts-snapshot.ts",
"kind": "object-property:message",
"text": "Host rate-limit targets cannot name a WSL distro",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/accounts-snapshot.ts",
"filePath": "mobile/src/accounts/accounts-snapshot.ts",
"kind": "object-property:message",
"text": "Inactive Claude limits use the wrong provider identity",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/accounts-snapshot.ts",
"filePath": "mobile/src/accounts/accounts-snapshot.ts",
"kind": "object-property:message",
"text": "Inactive Codex limits use the wrong provider identity",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/accounts-snapshot.ts",
"filePath": "mobile/src/accounts/accounts-snapshot.ts",
"kind": "object-property:message",
"text": "WSL Codex accounts require an exact distro",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/accounts-snapshot.ts",
"filePath": "mobile/src/accounts/accounts-snapshot.ts",
"kind": "object-property:message",
"text": "WSL rate-limit targets require an exact distro",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/codex-reset-credit-reply-schema.ts",
"filePath": "mobile/src/accounts/usage/codex-reset-credit-reply-schema.ts",
"kind": "object-property:message",
"text": "Host reset scopes cannot name a WSL distro",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/components/codex-reset-credit-reply-schema.ts",
"filePath": "mobile/src/accounts/usage/codex-reset-credit-reply-schema.ts",
"kind": "object-property:message",
"text": "WSL reset scopes require an exact distro",
"dynamic": false,
@@ -560,21 +560,21 @@
"count": 1
},
{
"filePath": "mobile/src/transport/hosts/mobile-relay-host-overlay.ts",
"filePath": "mobile/src/host-catalog/mobile-relay-host-overlay.ts",
"kind": "object-property:message",
"text": "Expected exactly one endpoint for configured relay metadata",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/transport/hosts/mobile-relay-host-overlay.ts",
"filePath": "mobile/src/host-catalog/mobile-relay-host-overlay.ts",
"kind": "object-property:message",
"text": "Relay host identity mismatch",
"dynamic": false,
"count": 1
},
{
"filePath": "mobile/src/transport/hosts/mobile-relay-host-overlay.ts",
"filePath": "mobile/src/host-catalog/mobile-relay-host-overlay.ts",
"kind": "object-property:message",
"text": "Relay identity and endpoint must coexist",
"dynamic": false,
+33 -33
View File
@@ -28,27 +28,27 @@
1 src/renderer/src/components/artifacts/ArtifactPublishButton.tsx
2 src/renderer/src/components/artifacts/ArtifactsPage.tsx
2 src/renderer/src/components/artifacts/useArtifactPagination.ts
2 src/renderer/src/components/automations/AutomationEditorPromptEditor.tsx
1 src/renderer/src/components/automations/AutomationHostFilterNotice.tsx
1 src/renderer/src/components/automations/AutomationProjectCombobox.tsx
1 src/renderer/src/components/automations/AutomationRunHistory.tsx
1 src/renderer/src/components/automations/AutomationRunsDashboard.tsx
1 src/renderer/src/components/automations/AutomationRunsTable.tsx
2 src/renderer/src/components/automations/authoring/AutomationEditorPromptEditor.tsx
1 src/renderer/src/components/automations/hosts/AutomationHostFilterNotice.tsx
1 src/renderer/src/components/automations/authoring/AutomationProjectCombobox.tsx
1 src/renderer/src/components/automations/runs/AutomationRunHistory.tsx
1 src/renderer/src/components/automations/runs/AutomationRunsDashboard.tsx
1 src/renderer/src/components/automations/runs/AutomationRunsTable.tsx
1 src/renderer/src/components/automations/AutomationsPageSurface.tsx
1 src/renderer/src/components/automations/use-automation-agent-picker-entries.ts
2 src/renderer/src/components/automations/use-automation-create-destination.ts
4 src/renderer/src/components/automations/use-automation-host-catalog.ts
4 src/renderer/src/components/automations/use-automation-list-search.ts
2 src/renderer/src/components/automations/use-automation-migrate-action.ts
1 src/renderer/src/components/automations/use-automation-runs-dashboard.ts
1 src/renderer/src/components/automations/use-automations-page-list-state.ts
1 src/renderer/src/components/automations/authoring/use-automation-agent-picker-entries.ts
2 src/renderer/src/components/automations/authoring/use-automation-create-destination.ts
4 src/renderer/src/components/automations/hosts/use-automation-host-catalog.ts
4 src/renderer/src/components/automations/listing/use-automation-list-search.ts
2 src/renderer/src/components/automations/authoring/use-automation-migrate-action.ts
1 src/renderer/src/components/automations/runs/use-automation-runs-dashboard.ts
1 src/renderer/src/components/automations/listing/use-automations-page-list-state.ts
1 src/renderer/src/components/automations/use-automations-page-local-state.ts
1 src/renderer/src/components/automations/use-automations-page-refresh.ts
1 src/renderer/src/components/automations/use-automations-page-setup-state.ts
1 src/renderer/src/components/automations/authoring/use-automations-page-setup-state.ts
1 src/renderer/src/components/automations/use-automations-page-store-state.ts
1 src/renderer/src/components/automations/use-external-automation-scope-retention.ts
2 src/renderer/src/components/automations/use-scoped-external-automations.ts
16 src/renderer/src/components/automations/use-selected-automation-run-history.ts
1 src/renderer/src/components/automations/external/use-external-automation-scope-retention.ts
2 src/renderer/src/components/automations/external/use-scoped-external-automations.ts
16 src/renderer/src/components/automations/runs/use-selected-automation-run-history.ts
7 src/renderer/src/components/browser-extension-install-dialog.tsx
1 src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.tsx
2 src/renderer/src/components/browser-pane/annotate/MarkupOverlay.tsx
@@ -206,7 +206,7 @@
1 src/renderer/src/components/mobile/WindowsFirewallNotice.tsx
2 src/renderer/src/components/mobile/use-mobile-page-paired-devices.ts
1 src/renderer/src/components/mobile/use-mobile-pairing-generation.ts
1 src/renderer/src/components/native-chat-restart-runtimes.ts
1 src/renderer/src/components/native-chat-recovery/offers/native-chat-restart-runtimes.ts
1 src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx
8 src/renderer/src/components/native-chat/attachments/chips/use-native-chat-composer-attachments.ts
2 src/renderer/src/components/native-chat/attachments/intake/use-native-chat-resolved-path-attachments.ts
@@ -545,16 +545,16 @@
4 src/renderer/src/components/sidebar/worktree-list/viewport/use-row-measurement.ts
1 src/renderer/src/components/sidebar/worktree-list/viewport/use-scroll-to-top.ts
1 src/renderer/src/components/sidebar/worktree-list/viewport/use-virtualizer.ts
1 src/renderer/src/components/skills/SkillBundleInstallFlow.tsx
2 src/renderer/src/components/skills/SkillInstallDialog.tsx
4 src/renderer/src/components/skills/SkillInstallManagementDialog.tsx
1 src/renderer/src/components/skills/SkillShareDialog.tsx
1 src/renderer/src/components/skills/SkillSharedLinkRow.tsx
1 src/renderer/src/components/skills/installation/SkillBundleInstallFlow.tsx
2 src/renderer/src/components/skills/installation/SkillInstallDialog.tsx
4 src/renderer/src/components/skills/installation/SkillInstallManagementDialog.tsx
1 src/renderer/src/components/skills/sharing/SkillShareDialog.tsx
1 src/renderer/src/components/skills/sharing/SkillSharedLinkRow.tsx
1 src/renderer/src/components/skills/SkillsPage.tsx
1 src/renderer/src/components/skills/setup/WslAgentSkillSetupPanel.tsx
2 src/renderer/src/components/skills/use-owned-skill-shares.ts
1 src/renderer/src/components/skills/use-reviewed-skill-plan.ts
1 src/renderer/src/components/skills/use-skill-delete-flow.ts
2 src/renderer/src/components/skills/sharing/use-owned-skill-shares.ts
1 src/renderer/src/components/skills/freshness/use-reviewed-skill-plan.ts
1 src/renderer/src/components/skills/deletion/use-skill-delete-flow.ts
1 src/renderer/src/components/sparse/SparseCheckoutPresetSelect.tsx
1 src/renderer/src/components/ssh-host-recovery/SshHostMoveAnywayAction.tsx
2 src/renderer/src/components/star-nag/StarNagAgentValueMomentObserver.tsx
@@ -654,7 +654,7 @@
2 src/renderer/src/components/terminal-pane/mobile-driver/MobileDriverOverlay.tsx
1 src/renderer/src/components/terminal-pane/mobile-driver/TerminalPaneMobileDriverPortals.tsx
1 src/renderer/src/components/terminal-pane/mounting/use-terminal-pane-mount-lifecycle.ts
2 src/renderer/src/components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.ts
1 src/renderer/src/components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.ts
1 src/renderer/src/components/terminal-pane/parking/retention/terminal-pending-startup-park-presence.ts
1 src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalPaneRecoveryPortals.tsx
2 src/renderer/src/components/terminal-pane/session-fork/TerminalAgentSessionForkDialog.tsx
@@ -697,21 +697,21 @@
1 src/renderer/src/hooks/composer-state/workspace-identity-state.ts
3 src/renderer/src/hooks/linear-issue-committed-state.ts
1 src/renderer/src/hooks/use-audio-capture.ts
1 src/renderer/src/hooks/use-bundled-skill-install.ts
1 src/renderer/src/hooks/skills/installation/use-bundled-skill-install.ts
2 src/renderer/src/hooks/useDetectedAgents.ts
2 src/renderer/src/hooks/useGitHubTaskItems.ts
2 src/renderer/src/hooks/useImmediateMutation.ts
6 src/renderer/src/hooks/useInstalledAgentSkills.ts
6 src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.ts
1 src/renderer/src/hooks/useIssueMetadata.ts
3 src/renderer/src/hooks/useLinearIssuePublication.ts
1 src/renderer/src/hooks/useMacTccAttributionSeveredNotice.ts
1 src/renderer/src/hooks/useSettingsNavigationMetadata.ts
4 src/renderer/src/hooks/useSkillFreshness.ts
4 src/renderer/src/hooks/skills/freshness/useSkillFreshness.ts
1 src/renderer/src/hooks/useTaskPageGitHubWorkItemMutation.ts
6 src/renderer/src/hooks/useVirtualizedScrollAnchor.ts
1 src/renderer/src/lib/host-chat-program-acquisition.ts
1 src/renderer/src/lib/quick-open-file-history.ts
2 src/renderer/src/lib/worker-auto-close.ts
1 src/renderer/src/lib/agent-session/launch/inventory/host-chat-program-acquisition.ts
1 src/renderer/src/lib/files/search/quick-open-file-history.ts
2 src/renderer/src/runtime/agent-orchestration/worker-auto-close.ts
1 src/renderer/src/runtime/native-chat/naming/structured-chat-name-observation.ts
1 src/renderer/src/store/plugins/appearance/plugin-icon-themes.ts
5 src/renderer/src/store/retained-views/app-state-view.ts
+1 -1
View File
@@ -1,5 +1,5 @@
# Grandfathered code React Compiler would run differently (<file>#<function>:<hazard>).
# Generated; never hand-edit. Lower after a fix: pnpm check:react-compiler-compat-ratchet --prune
1 src/renderer/src/components/agent/agent-launch-picker-drafts.ts#useAgentPickerSetup:discarded-subscription
1 src/renderer/src/components/native-chat-restart-runtimes.ts#useNativeChatRestartRuntimes:discarded-subscription
1 src/renderer/src/components/native-chat-recovery/offers/native-chat-restart-runtimes.ts#useNativeChatRestartRuntimes:discarded-subscription
1 src/renderer/src/components/right-sidebar/source-control/ai/use-source-control-action-agent-choice.ts#useSourceControlActionAgentChoice:store-read-in-memo-block
+3 -3
View File
@@ -85,9 +85,9 @@
1 src/renderer/src/components/terminal-pane/render-health/terminal-render-desync-sentinel.ts
1 src/renderer/src/hooks/use-now.ts
1 src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.ts
1 src/renderer/src/lib/crash-diagnostics.ts
1 src/renderer/src/lib/window-visibility-interval.ts
1 src/renderer/src/lib/worker-auto-close.ts
1 src/renderer/src/diagnostics/crash-reporting/crash-diagnostics.ts
1 src/renderer/src/lib/window-activity/window-visibility-interval.ts
1 src/renderer/src/runtime/agent-orchestration/worker-auto-close.ts
1 src/renderer/src/runtime/hosts/wsl/wsl-refused-read-watch.ts
1 src/shared/remote-runtime/control/remote-runtime-shared-control-app-heartbeat.ts
1 src/shared/remote-runtime/remote-runtime-socket-liveness.ts
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -2,7 +2,7 @@
# This is a RATCHET: counts may only go DOWN. Use useTranslate()/useIntlLocale() from
# @/i18n/use-translate. Prune after a fix: pnpm check:render-path-translate-ratchet --prune
2 src/renderer/src/components/agent/AgentLaunchPromptComposer.tsx
5 src/renderer/src/components/automations/use-external-automation-actions.ts
5 src/renderer/src/components/automations/external/use-external-automation-actions.ts
1 src/renderer/src/components/diff-comments/useDiffCommentDecorator.tsx
2 src/renderer/src/components/editor/markdown-preview/render-tree/use-markdown-preview-components.tsx
1 src/renderer/src/components/tab-group/useTabGroupCreationCommands.ts
+1 -1
View File
@@ -17,7 +17,7 @@
4 src/renderer/src/components/terminal-pane/render-health/recovery/terminal-recovery-ledger-test-store.ts
3 src/renderer/src/components/worktree-jump/worktree-jump-palette-status-inputs.ts
1 src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.ts
4 src/renderer/src/lib/floating-workspace-terminal-actions.ts
4 src/renderer/src/components/floating-terminal/floating-workspace-terminal-actions.ts
1 src/renderer/src/lib/pane-manager/client-hosted-browser-row-state.ts
4 src/renderer/src/lib/workspace/persistence/session-write-subscriber.ts
1 src/renderer/src/lib/workspace/persistence/workspace-session-browser-tabs.ts
@@ -1,4 +1,4 @@
import { readFile } from 'node:fs/promises'
import { readFile, readdir } from 'node:fs/promises'
import { readRouteSnapshot } from '../../mobile-web-app/mobile-web-app-route-snapshot.mjs'
import { MOBILE_WEB_APP_DEPENDENCY_PATH } from '../../mobile-web-app/mobile-web-app-bundle-dependencies.mjs'
import { existsSync, realpathSync } from 'node:fs'
@@ -457,6 +457,32 @@ export async function mobileWebAppModuleClosure(entryModules, { absWorkingDir }
// One lazily imported chunk per UI language; the page fetches only the active one after init.
const LOCALE_CATALOG_INPUT = /(^|\/)src\/i18n\/locales\/[^/]+\.json$/
const localeCatalogDir = join(mobileDir, 'src', 'i18n', 'locales')
// The same catalogs as JSON for the host to serve one at a time, to shells that skip the chunks;
// English is the page's inline fallback, so it has none.
export async function readLocaleCatalogs(directory = localeCatalogDir) {
const names = (await readdir(directory))
.filter((name) => name.endsWith('.json') && name !== 'en.json')
.sort()
return Promise.all(
names.map(async (name) => {
// Minify: the host sends and the phone keeps the parsed object, not the source layout.
const bytes = Buffer.from(
JSON.stringify(JSON.parse(await readFile(join(directory, name), 'utf8'))),
'utf8'
)
const sha256 = sha256Hex(bytes)
return {
locale: name.slice(0, -'.json'.length),
bytes,
path: `catalogs/${sha256}.json`,
sha256,
byteLength: bytes.byteLength
}
})
)
}
function localeCatalogOutputs(metafile) {
return new Set(
@@ -586,11 +612,13 @@ export async function buildMobileWebAppBundle({
desktopVersion,
protocolWindow,
{ script, chunks, images, catalogChunks, entryStaticBytes, chunkCount, routeChunks, routeKeys },
catalogs,
scrollbarStyle
] = await Promise.all([
readDesktopVersion(),
readProtocolWindow(),
bundleMobileWebApp({ appDir }),
readLocaleCatalogs(),
readFile(join(projectDir, 'src/shared/styles/scrollbar-sleek.css'), 'utf8').then((style) =>
// The shared desktop stylesheet can be checked out as CRLF on Windows.
style.replace(/\r\n/g, '\n')
@@ -598,9 +626,14 @@ export async function buildMobileWebAppBundle({
])
// Names already hash final bytes, so hashedAsset must reproduce them.
const scriptAsset = hashedAsset(script, 'js')
const catalogChunkSet = new Set(catalogChunks)
const written = [
scriptAsset,
...[...chunks, ...images].map(({ name, bytes }) => hashedAsset(bytes, extname(name).slice(1)))
...[...chunks, ...images].map((output) => ({
...hashedAsset(output.bytes, extname(output.name).slice(1)),
// Shells that read catalogs from the host skip these; older shells download them as before.
...(catalogChunkSet.has(output) ? { kind: 'catalog' } : {})
}))
]
// Root-absolute URLs survive nested routes; CSP allows only about: base. ESM entry/chunks load under existing self policy.
@@ -624,6 +657,7 @@ export async function buildMobileWebAppBundle({
const { manifest } = await writeMobileWebBundleTree({
outDir,
written: [indexAsset, ...written],
catalogs,
desktopVersion,
protocolWindow,
routes: resolveMobileWebPageRoutes(routeKeys, pageRoutes),
@@ -133,6 +133,8 @@ async function compressWithBrotli(written) {
export async function writeMobileWebBundleTree({
outDir,
written,
// Host-only JSON outside `assets` and buildId, served one at a time over RPC.
catalogs = [],
desktopVersion,
protocolWindow,
// Empty route list makes shell render every screen natively.
@@ -143,14 +145,15 @@ export async function writeMobileWebBundleTree({
}) {
const brotliCopies = brotli ? await compressWithBrotli(written) : new Map()
const assets = written
.map(({ path, sha256, byteLength, contentType }) => {
.map(({ path, sha256, byteLength, contentType, kind }) => {
const copy = brotliCopies.get(path)
return {
path,
sha256,
byteLength,
contentType,
...(copy === undefined ? {} : { brotliByteLength: copy.byteLength })
...(copy === undefined ? {} : { brotliByteLength: copy.byteLength }),
...(kind === undefined ? {} : { kind })
}
})
.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0))
@@ -164,14 +167,27 @@ export async function writeMobileWebBundleTree({
entrypoint: MOBILE_WEB_BUNDLE_ENTRYPOINT,
totalBytes: assets.reduce((total, asset) => total + asset.byteLength, 0),
assets,
routes
routes,
...(catalogs.length === 0
? {}
: {
catalogs: catalogs.map(({ locale, path, sha256, byteLength }) => ({
locale,
path,
sha256,
byteLength
}))
})
}
// Clear entire output or stale unreferenced assets ship inside asar.
await rm(outDir, { recursive: true, force: true })
await mkdir(join(outDir, 'assets'), { recursive: true })
for (const asset of written) {
await writeFile(join(outDir, asset.path), asset.bytes)
if (catalogs.length > 0) {
await mkdir(join(outDir, 'catalogs'), { recursive: true })
}
for (const file of [...written, ...catalogs]) {
await writeFile(join(outDir, file.path), file.bytes)
}
for (const [path, copy] of brotliCopies) {
await writeFile(join(outDir, mobileWebBundleBrotliPath(path)), copy)
@@ -29,6 +29,8 @@ export function mobileWebAppBundleMaxAssets(routeCount, imageCount, catalogChunk
// fetched only for the active language, never before the first route. Code keeps its own fence.
export const MOBILE_WEB_APP_BUNDLE_MAX_CATALOG_CHUNKS = 10
export const MOBILE_WEB_APP_BUNDLE_MAX_CATALOG_BYTES = 3 * 1024 * 1024
// The host sends a catalog's JSON in one reply, which must fit a 1 MiB relay frame once encrypted.
export const MOBILE_WEB_APP_HOST_CATALOG_MAX_BYTES = 384 * 1024
// Our own fence on the page's code, well inside the phone contract (32 MiB total, 10 MiB per asset in
// manifest-contract.ts); it fails the build before the code weighs more than any one asset may.
@@ -185,6 +187,23 @@ export async function verifyMobileWebAppBundle({ bundleDir = defaultBundleDir }
`${String(MOBILE_WEB_APP_BUNDLE_MAX_CATALOG_BYTES)} bytes`
)
}
// buildId leaves the host's JSON catalogs out, so a stale copy shows only here.
const hostCatalogsOf = (built) => JSON.stringify(built.catalogs ?? [])
if (hostCatalogsOf(first.manifest) !== hostCatalogsOf(second.manifest)) {
fail('host language catalogs are not reproducible')
}
if (hostCatalogsOf(first.manifest) !== hostCatalogsOf(manifest)) {
fail(`${bundleDir} is stale: its host language catalogs differ from a fresh build's`)
}
const oversized = (manifest.catalogs ?? []).find(
(catalog) => catalog.byteLength > MOBILE_WEB_APP_HOST_CATALOG_MAX_BYTES
)
if (oversized) {
fail(
`the ${oversized.locale} host catalog is ${String(oversized.byteLength)} bytes, over the ` +
`${String(MOBILE_WEB_APP_HOST_CATALOG_MAX_BYTES)} one reply carries`
)
}
const budgetBytes = mobileWebAppBundleBudgetBytes(manifest) - first.catalogBytes
if (budgetBytes > MOBILE_WEB_APP_BUNDLE_MAX_TOTAL_BYTES) {
fail(
File diff suppressed because it is too large Load Diff
@@ -106,6 +106,19 @@ function parseManifest(bundleDir) {
}
}
}
if (manifest.catalogs !== undefined && !Array.isArray(manifest.catalogs)) {
throw failure('manifest catalogs is not a list')
}
for (const catalog of manifest.catalogs ?? []) {
if (typeof catalog !== 'object' || catalog === null || typeof catalog.locale !== 'string') {
throw failure('manifest catalog entry has no locale')
}
assertSafeRelativePath(catalog.path)
if (typeof catalog.sha256 !== 'string' || !SHA256_PATTERN.test(catalog.sha256)) {
throw failure(`manifest catalog ${catalog.path} has no sha256 digest`)
}
assertInteger(catalog.byteLength, `catalogs[${catalog.path}].byteLength`)
}
if (!manifest.assets.some((asset) => asset.path === manifest.entrypoint)) {
throw failure(`manifest entrypoint ${manifest.entrypoint} is not one of its assets`)
}
@@ -126,6 +139,11 @@ function parseManifest(bundleDir) {
return manifest
}
// Assets go to the phone; catalogs stay on the host, which serves one on request.
function servedFiles(manifest) {
return [...manifest.assets, ...(manifest.catalogs ?? [])]
}
function listBundleFiles(directory, prefix = '') {
const found = []
for (const entry of readdirSync(directory, { withFileTypes: true })) {
@@ -164,7 +182,7 @@ function assertNoUnlistedFiles(bundleDir, manifest) {
const listed = new Set([
'manifest.json',
...darkBuildMarkerFileNames(),
...manifest.assets.map((asset) => asset.path),
...servedFiles(manifest).map((file) => file.path),
...brotliCopies(manifest).map((asset) => brotliPath(asset))
])
const strays = listBundleFiles(bundleDir).filter((path) => !listed.has(path))
@@ -180,7 +198,7 @@ function assertNoUnlistedFiles(bundleDir, manifest) {
function assertMobileWebBundleBuilt(bundleDir = MOBILE_WEB_BUNDLE_DIR) {
const manifest = parseManifest(bundleDir)
assertNoUnlistedFiles(bundleDir, manifest)
for (const asset of manifest.assets) {
for (const asset of servedFiles(manifest)) {
const assetPath = join(bundleDir, asset.path)
const size = statSize(bundleDir, asset.path)
if (size !== asset.byteLength) {
@@ -6,10 +6,11 @@ import process from 'node:process'
// TypeScript 7 is a native CLI; AST consumers still need the legacy JavaScript API.
import ts from 'typescript-api'
import { isTestOnlySourcePath } from '../../static-analysis/process-boundaries/test-only-source-path.mjs'
import { isVisibleObjectKey } from './localization-visible-object-keys.mjs'
const SOURCE_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx', '.mts', '.cts'])
const SKIP_PATH_PARTS = new Set(['.git', 'dist', 'node_modules', 'out', '__snapshots__', 'assets'])
const LOCALIZATION_CALL_NAMES = new Set(['t', 'translate'])
const LOCALIZATION_CALL_NAMES = new Set(['t', 'translate', 'translateMain'])
const CLASS_PROPERTY_NAMES = new Set(['className', 'classNames'])
// Why: the children of these elements are CSS or code, never copy a translator should see.
const NON_COPY_JSX_ELEMENTS = new Set(['style', 'script'])
@@ -35,25 +36,6 @@ const USER_VISIBLE_JSX_ATTRIBUTES = new Set([
'toggleDescription',
'tooltip'
])
const USER_VISIBLE_OBJECT_KEYS = new Set([
'accessibilityHint',
'accessibilityLabel',
'ariaLabel',
'badge',
'description',
'emptyText',
'error',
'headerTitle',
'helperText',
'keywords',
'label',
'message',
'placeholder',
'subtitle',
'title',
'toggleDescription',
'tooltip'
])
const USER_VISIBLE_FUNCTION_NAMES = new Set([
'alert',
'confirm',
@@ -331,7 +313,7 @@ function isInsideNonCopyJsxElement(node) {
return Boolean(element && NON_COPY_JSX_ELEMENTS.has(element.openingElement.tagName.getText()))
}
function classifyStringNode(node) {
function classifyStringNode(node, includeNativeDialogFields = false) {
if (
hasAncestorObjectPropertyName(node, CLASS_PROPERTY_NAMES) ||
isInsideNonCopyJsxElement(node)
@@ -369,12 +351,15 @@ function classifyStringNode(node) {
}
const objectPropertyName = nearestObjectPropertyName(node)
if (objectPropertyName && !USER_VISIBLE_OBJECT_KEYS.has(objectPropertyName)) {
if (objectPropertyName && !isVisibleObjectKey(objectPropertyName, includeNativeDialogFields)) {
return undefined
}
const ancestorObjectPropertyName = nearestAncestorObjectPropertyName(node)
if (ancestorObjectPropertyName && !USER_VISIBLE_OBJECT_KEYS.has(ancestorObjectPropertyName)) {
if (
ancestorObjectPropertyName &&
!isVisibleObjectKey(ancestorObjectPropertyName, includeNativeDialogFields)
) {
return undefined
}
@@ -407,7 +392,12 @@ function areaForFile(relativePath) {
return `renderer/${parts[0] ?? 'root'}`
}
export function collectLocalizationCandidates(filePath, sourceText, root = process.cwd()) {
export function collectLocalizationCandidates(
filePath,
sourceText,
root = process.cwd(),
options = {}
) {
const sourceKind =
filePath.endsWith('.tsx') || filePath.endsWith('.jsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS
const sourceFile = ts.createSourceFile(
@@ -450,7 +440,7 @@ export function collectLocalizationCandidates(filePath, sourceText, root = proce
ts.isNoSubstitutionTemplateLiteral(node) ||
ts.isTemplateExpression(node)
) {
const kind = classifyStringNode(node)
const kind = classifyStringNode(node, options.includeNativeDialogFields)
if (kind) {
for (const part of stringParts(node)) {
pushReport(node, kind, part.text, part.dynamic)
@@ -521,6 +511,7 @@ function parseArgs(argv) {
allowlistPath: path.join('config', 'localization-coverage-allowlist.json'),
check: false,
format: 'summary',
includeNativeDialogFields: false,
outputPath: null,
sourceRoots: []
}
@@ -531,6 +522,8 @@ function parseArgs(argv) {
options.format = 'json'
} else if (arg === '--markdown') {
options.format = 'markdown'
} else if (arg === '--native-dialog-fields') {
options.includeNativeDialogFields = true
} else if (arg === '--check') {
options.check = true
} else if (arg === '--allowlist') {
@@ -616,7 +609,7 @@ export async function main(root = process.cwd(), argv = process.argv.slice(2)) {
for (const filePath of files) {
const sourceText = await fs.readFile(filePath, 'utf8')
reports.push(...collectLocalizationCandidates(filePath, sourceText, root))
reports.push(...collectLocalizationCandidates(filePath, sourceText, root, options))
}
if (options.check) {
@@ -0,0 +1,59 @@
import { describe, expect, it, vi } from 'vitest'
import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { collectLocalizationCandidates, main } from './audit-localization-coverage.mjs'
const path = '/repo/src/main/startup/dialog.ts'
const source = `
const options = {
message: translateMain('message', 'Translated message'),
detail: 'Untranslated detail',
buttons: ['Proceed', translateMain('cancel', 'Cancel')],
body: 'Untranslated body',
buttonLabel: 'Retry',
checkboxLabel: 'Remember choice'
}
`
describe('native dialog localization coverage', () => {
it('finds untranslated native dialog fields while ignoring translated copy', () => {
const candidates = collectLocalizationCandidates(path, source, '/repo', {
includeNativeDialogFields: true
})
expect(candidates.map(({ kind, text }) => [kind, text])).toEqual([
['object-property:detail', 'Untranslated detail'],
['object-property:buttons', 'Proceed'],
['object-property:body', 'Untranslated body'],
['object-property:buttonLabel', 'Retry'],
['object-property:checkboxLabel', 'Remember choice']
])
})
it('does not change the existing renderer scan by default', () => {
expect(collectLocalizationCandidates(path, source, '/repo')).toEqual([])
})
it('fails the opt-in check for a new native dialog literal', async () => {
const root = await mkdtemp(join(tmpdir(), 'orca-native-localization-'))
const report = vi.spyOn(console, 'error').mockImplementation(() => {})
try {
await mkdir(join(root, 'src'))
await writeFile(join(root, 'src', 'dialog.ts'), "const options = { detail: 'Raw detail' }")
await writeFile(join(root, 'allowlist.json'), '[]')
await expect(
main(root, [
'--check',
'--native-dialog-fields',
'--source-root',
'src',
'--allowlist',
'allowlist.json'
])
).resolves.toBe(1)
} finally {
report.mockRestore()
await rm(root, { recursive: true, force: true })
}
})
})
@@ -0,0 +1,33 @@
const USER_VISIBLE_OBJECT_KEYS = new Set([
'accessibilityHint',
'accessibilityLabel',
'ariaLabel',
'badge',
'description',
'emptyText',
'error',
'headerTitle',
'helperText',
'keywords',
'label',
'message',
'placeholder',
'subtitle',
'title',
'toggleDescription',
'tooltip'
])
const NATIVE_DIALOG_OBJECT_KEYS = new Set([
'detail',
'buttons',
'body',
'buttonLabel',
'checkboxLabel'
])
export function isVisibleObjectKey(name, includeNativeDialogFields) {
return (
USER_VISIBLE_OBJECT_KEYS.has(name) ||
(includeNativeDialogFields && NATIVE_DIALOG_OBJECT_KEYS.has(name))
)
}
@@ -32,7 +32,7 @@ import { View } from 'react-native'
import { GestureHandlerRootView } from 'react-native-gesture-handler'
import { MobileNativeChatQueuedMessages } from './src/session/native-chat/input/MobileNativeChatQueuedMessages'
import { MobileNativeChatComposer } from './src/session/native-chat/composer/MobileNativeChatComposer'
import { mobileQueuedMessageCards } from './src/session/mobile-structured-queued-message-cards'
import { mobileQueuedMessageCards } from './src/session/native-chat/input/mobile-structured-queued-message-cards'
import { activateMobileUiLocale, translate } from './src/i18n/mobile-i18n'
const [mode, locale] = location.hash.slice(1).split(':')
@@ -19,7 +19,7 @@ export function stageOrcadMobileWebBundle(outputDir, bundleDir = MOBILE_WEB_BUND
// The release template refuses the variable itself.
assertNoDarkOutputOfOffSwitches([bundleDir])
assertMobileWebBundleBuilt(bundleDir)
// The guard refuses unlisted files, so the tree is the manifest, its assets and a dark marker.
// The guard refuses unlisted files, so the tree is the manifest, its assets and catalogs, and a dark marker.
cpSync(bundleDir, join(outputDir, ...ORCAD_MOBILE_WEB_DIR.split('/')), { recursive: true })
}
@@ -18,7 +18,7 @@ const { sortJiraIssues } = await jiti.import(
'../../../../src/renderer/src/components/jira-issue-sorter.ts'
)
const { sortAutomationListViewItems } = await jiti.import(
'../../../../src/renderer/src/components/automations/automation-list-view.ts'
'../../../../src/renderer/src/components/automations/listing/automation-list-view.ts'
)
const automationLocale = 'en-US'
@@ -4,7 +4,7 @@ import { performance } from 'node:perf_hooks'
import { transform } from 'esbuild'
import { buildCounterbalancedSchedule } from '../measurement/counterbalanced-benchmark-schedule.mjs'
const path = 'src/renderer/src/components/skills/skill-source-inventory.ts'
const path = 'src/renderer/src/components/skills/catalog/skill-source-inventory.ts'
const arms = {}
for (const [name, source] of [
['baseline', readFileSync(0, 'utf8')],
@@ -48,6 +48,7 @@ const RATCHET_INPUTS = {
'check-repo-host-read-ratchet.mjs': ['src/cli/', 'src/main/', 'src/shared/'],
'check-runtime-electron-ratchet.mjs': ['src/main/', 'src/cli/', 'src/shared/'],
'check-tab-map-seam-ratchet.mjs': ['src/renderer/src/'],
'check-terminal-parking-ownership-ratchet.mjs': ['src/renderer/src/'],
'check-unproven-pty-retirement-ratchet.mjs': ['src/main/'],
'check-workspace-record-read-ratchet.mjs': ['src/renderer/src/'],
'check-worktree-id-composer-ratchet.mjs': ['src/', 'mobile/src/']
@@ -102,7 +103,33 @@ export const VERIFY_CHECKS = [
'config/scripts/localization/source-extraction/audit-localization-coverage.mjs',
'--check'
],
inputs: ['src/renderer/src/', LOCALES]
inputs: [
'src/renderer/src/',
LOCALES,
'config/scripts/localization/source-extraction/audit-localization-coverage',
'config/scripts/localization/source-extraction/localization-visible-object-keys'
]
},
{
name: 'startup and worktree localization coverage',
args: [
'config/scripts/localization/source-extraction/audit-localization-coverage.mjs',
'--check',
'--native-dialog-fields',
'--source-root',
'src/main/startup',
'--source-root',
'src/shared/worktree',
'--allowlist',
'config/startup-worktree-localization-allowlist.json'
],
inputs: [
'src/main/startup/',
'src/shared/worktree/',
'config/scripts/localization/source-extraction/audit-localization-coverage',
'config/scripts/localization/source-extraction/localization-visible-object-keys',
'config/startup-worktree-localization-allowlist.json'
]
},
{
name: 'mobile localization',
@@ -145,7 +172,8 @@ export const VERIFY_CHECKS = [
'mobile/web-entry/',
'config/mobile-localization-coverage-allowlist.json',
'config/scripts/audit-localization-coverage',
'config/scripts/localization/source-extraction/audit-localization-coverage'
'config/scripts/localization/source-extraction/audit-localization-coverage',
'config/scripts/localization/source-extraction/localization-visible-object-keys'
]
},
{
@@ -18,6 +18,7 @@ export const LINT_STEPS = [
'check:test-file-runners',
'verify:localization-catalogs',
'verify:localization-coverage',
'verify:startup-worktree-localization-coverage',
'verify:mobile-localization',
'verify:mobile-localization-coverage',
'lint:ast-grep-gates',
@@ -40,6 +41,7 @@ export const LINT_STEPS = [
'check:ts-nocheck-ratchet',
'check:workspace-record-read-ratchet',
'check:tab-map-seam-ratchet',
'check:terminal-parking-ownership-ratchet',
'check:unproven-pty-retirement-ratchet',
'check:daemon-blocking-call-ratchet',
'check:main-sync-fs-ratchet',
@@ -299,7 +299,7 @@ function renderEvents({ events, eventContribution, typeText }, { services, frame
const { REFERENCE_TYPE_TEXT, zodTypeText } = typeText
const workerEvents = eventContribution.PLUGIN_EVENT_NAMES.map(
(name) =>
`- ${code(name)} (capability ${code(eventContribution.PLUGIN_EVENT_CAPABILITY[name])}; since ${eventContribution.PLUGIN_EVENT_SINCE[name]}): ${events.PLUGIN_EVENT_SUMMARIES[name]}\n ${code(zodTypeText(events.PLUGIN_EVENT_PAYLOAD_SCHEMAS[name], 'output', REFERENCE_TYPE_TEXT))}`
`- ${code(name)} (${eventContribution.PLUGIN_EVENT_CAPABILITY[name] ? `capability ${code(eventContribution.PLUGIN_EVENT_CAPABILITY[name])}` : 'no capability'}; since ${eventContribution.PLUGIN_EVENT_SINCE[name]}): ${events.PLUGIN_EVENT_SUMMARIES[name]}\n ${code(zodTypeText(events.PLUGIN_EVENT_PAYLOAD_SCHEMAS[name], 'output', REFERENCE_TYPE_TEXT))}`
)
return document(
'Events',
@@ -27,6 +27,10 @@ import {
renderLiveReadLines,
renderStoreReadLines
} from './react-compiler-hazards.mjs'
import {
UNCOMPILED_LIST,
readListedFiles
} from '../../../../build-plugins/react-compiler-uncompiled-files.mjs'
// Runs React Compiler (analysis only, nothing is written) over the renderer so code that compiles
// today keeps compiling, and code that would change behavior once compiled can't be added.
@@ -34,8 +38,6 @@ import {
const SCAN_ROOT = 'src/renderer/src'
const BAILOUT_BASELINE = 'config/react-compiler-bailout-baseline.txt'
const HAZARD_BASELINE = 'config/react-compiler-hazard-baseline.txt'
// The build leaves these files uncompiled, so their hazards cannot run.
const UNCOMPILED_LIST = 'config/react-compiler-uncompiled-files.txt'
const COMMAND = 'pnpm check:react-compiler-compat-ratchet'
const NOT_SHIPPED =
/(?:^|\/)__(?:mocks|fixtures|tests)__\/|\.(?:test|spec|bench)\.[cm]?tsx?$|[.-]test-|[.-]fixtures?\.tsx?$/
@@ -101,18 +103,31 @@ function addTo(map, key, value) {
map.set(key, [...(map.get(key) ?? []), value])
}
// The build leaves these files uncompiled, so their hazards cannot run.
function readUncompiledFiles(root) {
const file = path.join(root, UNCOMPILED_LIST)
if (!fs.existsSync(file)) {
return new Set()
return fs.existsSync(path.join(root, UNCOMPILED_LIST))
? new Set(readListedFiles(UNCOMPILED_LIST, root))
: new Set()
}
// Why: the build matches the exact id, so `\`, `../`, a directory or another case would silently compile.
function isCanonicalFile(root, rel) {
try {
const file = path.join(root, rel)
return (
!rel.includes('\\') &&
path.posix.normalize(rel) === rel &&
fs.statSync(file).isFile() &&
fs.realpathSync.native(file) === path.join(fs.realpathSync.native(root), rel)
)
} catch {
return false
}
return new Set(
fs
.readFileSync(file, 'utf8')
.split('\n')
.map((line) => line.trim())
.filter((line) => line && !line.startsWith('#'))
)
}
/** Listed paths that name no renderer file; a renamed file would silently compile. */
export function findStaleUncompiledFiles(uncompiled, exists) {
return [...uncompiled].filter((rel) => !rel.startsWith(`${SCAN_ROOT}/`) || !exists(rel))
}
/** Virtualizer hooks plus every hook that returns one, followed through wrappers of wrappers. */
@@ -210,12 +225,14 @@ async function scanFile(rel, text, result) {
export async function scanRenderer(root = process.cwd()) {
const sources = [...readTrackedSources(root, [SCAN_ROOT], isScannedPath)]
const uncompiled = readUncompiledFiles(root)
const result = {
files: 0,
compiled: 0,
diagnostics: new Map(),
hazards: new Map(),
uncompiled: readUncompiledFiles(root),
uncompiled,
staleUncompiled: findStaleUncompiledFiles(uncompiled, (rel) => isCanonicalFile(root, rel)),
virtualizerHooks: collectVirtualizerHooks(sources),
liveReaders: collectLiveReaders(sources)
}
@@ -341,8 +358,15 @@ export async function main(root = process.cwd(), arg = undefined) {
)
return 0
}
for (const rel of scan.staleUncompiled) {
console.error(
`::error::${UNCOMPILED_LIST}: ${rel} is not a renderer file. ` +
'Point it at the renamed file, or remove it once the file is gone.'
)
}
const touched = listTouchedFiles(root)
const ok = [
scan.staleUncompiled.length === 0,
check(root, 'bailout(s)', BAILOUT_BASELINE, bailouts, scan.diagnostics, touched),
check(root, 'hazard(s)', HAZARD_BASELINE, hazards, scan.hazards, touched)
].every(Boolean)
@@ -1,87 +0,0 @@
import { describe, expect, it } from 'vitest'
import { CONSUMERS, consumerViolations, writerViolations } from './check-tab-map-seam-ratchet.mjs'
const BRIDGE =
'src/renderer/src/components/native-chat/session/status/StructuredAgentSessionStatusBridge.tsx'
const rules = CONSUMERS.get(BRIDGE)
describe('tab-map seam guard', () => {
it('rejects an ordinary handler reaching the cold path or walking a map', () => {
const text = [
'const reconcileFromSnapshot = () => getStructuredAgentSessionTabs(source)',
'const reconcile = () => reconcileFromSnapshot()',
'const ordinary = () => { reconcileFromSnapshot(); Object.keys(source) }'
].join('\n')
expect(consumerViolations('bridge.tsx', text, rules)).toEqual([
'bridge.tsx:3 reconcileFromSnapshot() outside a named cold path',
'bridge.tsx:3 Object.keys outside a named cold path'
])
})
it('rejects an unreviewed value import, not type imports', () => {
const text = [
"import { wholeMap } from './new-walk'",
"import type { Walk } from './new-walk'"
].join('\n')
expect(consumerViolations('bridge.tsx', text, rules)).toEqual([
'bridge.tsx:1 imports wholeMap; repaired consumers import only reviewed helpers'
])
})
it('follows a raw record through a local binding unless it is marked full resync', () => {
const text = [
'function raw(state) {',
' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }',
' set({ unifiedTabsByWorktree: next })',
'}',
'function annotated(state) {',
' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }',
' markFullResync(next, "hydration")',
' set({ unifiedTabsByWorktree: next })',
'}'
].join('\n')
expect(writerViolations('writer.ts', text)).toEqual([
'writer.ts:3 raw unifiedTabsByWorktree record; build it with a replace helper or draft, or mark it full resync'
])
})
it('follows aliases of cold helpers and enumerators', () => {
const text = [
'const reconcileFromSnapshot = () => getStructuredAgentSessionTabs(source)',
'const reconcile = () => reconcileFromSnapshot()',
'const resync = reconcileFromSnapshot',
'const keys = Object.keys'
].join('\n')
expect(consumerViolations('bridge.tsx', text, rules)).toEqual([
'bridge.tsx:3 reconcileFromSnapshot() outside a named cold path',
'bridge.tsx:4 Object.keys outside a named cold path'
])
})
it('follows aliased raw records and requires annotation before publication', () => {
const raw =
'raw unifiedTabsByWorktree record; build it with a replace helper or draft, or mark it full resync'
const text = [
'function aliased(state) {',
' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }',
' const unifiedTabsByWorktree = next',
' set({ unifiedTabsByWorktree })',
'}',
'function late(state) {',
' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }',
' set({ unifiedTabsByWorktree: next })',
' markFullResync(next, "hydration")',
'}',
'function early(state) {',
' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }',
' const alias = next',
' markFullResync(alias, "hydration")',
' set({ unifiedTabsByWorktree: alias })',
'}'
].join('\n')
expect(writerViolations('writer.ts', text)).toEqual([
`writer.ts:4 ${raw}`,
`writer.ts:8 ${raw}`
])
})
})
@@ -0,0 +1,475 @@
import fs from 'node:fs'
import path from 'node:path'
import process from 'node:process'
import { pathToFileURL } from 'node:url'
import ts from 'typescript-api'
const RENDERER = 'src/renderer/src/'
const WATCHERS = `${RENDERER}components/terminal-pane/parking/output-watchers/`
const ROOTS = new Map([
[
`${RENDERER}components/terminal/terminal-provider-snapshot-bound-pty-ids.ts`,
['createTerminalProviderSnapshotBoundPtyIdsSelector']
],
[`${RENDERER}components/use-terminal-watcher-effects.ts`, ['useTerminalWatcherEffects']],
[`${RENDERER}components/use-terminal-parking-pass.ts`, ['useTerminalParkingPass']],
[
`${RENDERER}components/terminal-parking-pass-candidates.ts`,
['collectTerminalParkingPassCandidates']
],
[`${RENDERER}components/terminal/split-group-mount.ts`, ['anyMountedWorktreeHasLayout']],
[
`${RENDERER}components/terminal-pane/parking/lifecycle/use-parked-terminal-watcher-synchronization.ts`,
['useParkedTerminalWatcherSynchronization']
],
[
`${RENDERER}components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.ts`,
['useTerminalTabColdParking']
],
[`${WATCHERS}terminal-parked-tab-watchers.ts`, ['syncParkedTerminalTabWatchers']],
[`${WATCHERS}parked-terminal-tab-coverage.ts`, ['canWatcherCoverParkedTerminalTab']],
[
`${RENDERER}lib/agent-session/resume/resume-sleeping-agent-session.ts`,
['resumeSleepingAgentSessionsForWorktree']
]
])
const HOT_MAPS = new Set([
'tabsByWorktree',
'unifiedTabsByWorktree',
'terminalLayoutsByTabId',
'sleepingAgentSessionsByPaneKey'
])
const OWNER_ROOTS = [
{
rel: 'store/terminals/terminal-parking-input-owner.ts',
name: 'acceptTerminalParkingInputs',
inputs: []
},
{
rel: 'store/terminals/terminal-parking-input-owner.ts',
name: 'publishAcceptedTerminalParkingInputs',
inputs: []
},
{
rel: 'store/terminals/terminal-parking-input-owner.ts',
name: 'invalidateTerminalParkingPtyInputs',
inputs: []
},
{
rel: 'store/terminals/terminal-tab-owner-index.ts',
name: 'update',
inputs: ['tabsByWorktree']
},
{ rel: 'store/terminals/sleeping-agent-record-index.ts', name: 'update', inputs: ['records'] },
{
rel: 'store/terminals/sleeping-agent-record-index.ts',
name: 'acceptTransition',
inputs: ['previous', 'next']
},
{
rel: 'lib/workspace/tabs/worktree-tab-bucket-projection.ts',
name: 'project',
inputs: ['source']
}
]
const KEY_DIFFS = new Set([
`${RENDERER}store/terminals/terminal-parking-input-owner.ts#diffUnknownParkingRecordKeys`,
`${RENDERER}store/terminals/terminal-tab-owner-index.ts#diffUnknownTabOwnerKeys`,
`${RENDERER}store/terminals/sleeping-agent-record-index.ts#diffUnknownSleepingRecordKeys`,
`${RENDERER}lib/workspace/tabs/worktree-tab-bucket-projection.ts#diffUnknownProjectionKeys`
])
const COLD_RESYNCS = new Set([
`${RENDERER}store/terminals/terminal-parking-input-owner.ts#resyncTerminalParkingWorkspaceIds`,
`${RENDERER}store/terminals/sleeping-agent-record-index.ts#resyncSleepingAgentRecordKeys`
])
function isColdResyncCall(node, source) {
for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
if (
ts.isConditionalExpression(ancestor) &&
ancestor.condition.getText(source) === 'previous' &&
node.pos >= ancestor.whenFalse.pos
) {
return true
}
if (
ts.isBinaryExpression(ancestor) &&
ancestor.operatorToken.kind === ts.SyntaxKind.QuestionQuestionToken &&
ancestor.left.getText(source) === 'keys'
) {
return true
}
if (
ts.isIfStatement(ancestor) &&
node.pos >= ancestor.thenStatement.pos &&
node.end <= ancestor.thenStatement.end
) {
const condition = ancestor.expression.getText(source).replace(/\s+/g, ' ')
if (
condition === 'ptyIds === undefined' ||
condition.includes(
'previous.settings?.terminalSshViewParking !== state.settings?.terminalSshViewParking'
)
) {
return true
}
}
}
return false
}
const STORE_BOUNDARIES = new Set([`${RENDERER}store/index.ts`, `${RENDERER}store.ts`])
// Resource delivery and startup recovery are separate entry points, not parking input discovery.
const EFFECT_BOUNDARIES = new Set([
`${RENDERER}components/terminal/terminal-provider-snapshot-bound-pty-ids.ts#resyncUnknownSnapshot`,
`${RENDERER}components/terminal/use-terminal-startup-activation.ts#useTerminalStartupActivation`,
`${WATCHERS}terminal-parked-pty-watcher.ts#startParkedPtyWatcher`,
`${RENDERER}components/terminal-pane/parking/capture/parked-terminal-buffer-capture.ts#captureParkedTerminalBuffers`,
`${RENDERER}lib/agent-session/resume/sleeping-agent-session-launch.ts#launchSleepingAgentSession`,
`${RENDERER}lib/agent-session/resume/host-mirror-handle-gap-wait.ts#parkUntilHostMirrorHandleLands`,
`${RENDERER}runtime/web-session-tabs-sync/hydration/host-session-mirror-hydration.ts#parkUntilHostSessionMirrorHydrates`
])
const ENUMERATORS = new Set(['entries', 'values', 'keys', 'assign'])
const ADDRESSED_FIELDS = new Set([
'terminalLayoutsByTabId',
'ptyIdsByTabId',
'lastKnownRelayPtyIdByTabId',
'runtimePaneTitlesByTabId',
'pendingStartupByTabId',
'sleepingAgentSessionsByPaneKey'
])
const ORDINARY_WRITERS = [
'store/terminals/terminal-layout-state.ts',
'store/terminals/terminal-pane-hibernation.ts',
'store/terminals/terminal-pty-bindings.ts',
'store/terminals/terminal-pty-release.ts',
'store/terminals/terminal-orphan-cleanup.ts',
'store/terminals/terminal-startup-queues.ts',
'store/terminals/terminal-tab-presentation.ts',
'store/terminals/terminal-shutdown-state.ts',
'store/terminals/window-tab-start-in-main.ts',
'store/slices/agent-status/agent-status-live-reducer.ts',
'store/slices/agent-status/agent-status-launch-actions.ts',
'store/slices/agent-status/agent-status-provider-session-actions.ts',
'store/slices/agent-status/agent-status-recovery-actions.ts',
'store/slices/agent-status/agent-status-authority-actions.ts'
].map((rel) => RENDERER + rel)
const RECORD_TRANSITIONS = new Set([
'replaceRecordEntries',
'removePaneKeys',
'removePaneKeysByTabPrefix'
])
function collectUnaddressedWrites(root) {
const violations = []
for (const rel of ORDINARY_WRITERS) {
const { source, aliases, assignments } = readModule(root, rel)
function addressed(value, field, seen = new Set()) {
if (ts.isCallExpression(value) && ts.isIdentifier(value.expression)) {
return RECORD_TRANSITIONS.has(value.expression.text)
}
if (ts.isPropertyAccessExpression(value)) {
return value.name.text === field
}
if (ts.isConditionalExpression(value)) {
return addressed(value.whenTrue, field, seen) && addressed(value.whenFalse, field, seen)
}
if (ts.isIdentifier(value)) {
if (seen.has(value.text)) {
return false
}
seen.add(value.text)
const alias = aliases.get(value.text)
return (
alias !== undefined &&
[alias, ...(assignments.get(value.text) ?? [])].every((replacement) =>
addressed(replacement, field, new Set(seen))
)
)
}
return false
}
function visit(node) {
if (ts.isPropertyAssignment(node) || ts.isShorthandPropertyAssignment(node)) {
const field =
ts.isIdentifier(node.name) || ts.isStringLiteral(node.name) ? node.name.text : null
const value = ts.isPropertyAssignment(node) ? node.initializer : node.name
if (ADDRESSED_FIELDS.has(field) && !addressed(value, field)) {
const line = source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1
violations.push(`${rel}:${line}: ${field} write needs complete record-key provenance.`)
}
}
ts.forEachChild(node, visit)
}
visit(source)
}
return violations
}
function resolveImport(root, from, specifier) {
const base = specifier.startsWith('@/')
? RENDERER + specifier.slice(2)
: specifier.startsWith('.')
? path.posix.join(path.posix.dirname(from), specifier)
: null
if (!base) {
return null
}
return (
[base, `${base}.ts`, `${base}.tsx`, `${base}/index.ts`].find(
(candidate) =>
fs.existsSync(path.join(root, candidate)) &&
fs.statSync(path.join(root, candidate)).isFile()
) ?? null
)
}
function readModule(root, rel) {
const source = ts.createSourceFile(
rel,
fs.readFileSync(path.join(root, rel), 'utf8'),
ts.ScriptTarget.Latest,
true
)
const imports = new Map()
const functions = new Map()
const aliases = new Map()
const assignments = new Map()
function visit(node) {
if (
ts.isBinaryExpression(node) &&
ts.isIdentifier(node.left) &&
node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment &&
node.operatorToken.kind <= ts.SyntaxKind.LastAssignment
) {
const values = assignments.get(node.left.text) ?? []
values.push(node.right)
assignments.set(node.left.text, values)
}
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
const target = resolveImport(root, rel, node.moduleSpecifier.text)
const bindings = node.importClause?.namedBindings
if (target && bindings && ts.isNamedImports(bindings)) {
for (const binding of bindings.elements) {
imports.set(binding.name.text, {
rel: target,
name: binding.propertyName?.text ?? binding.name.text
})
}
}
}
if (
(ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node)) &&
node.name &&
node.body
) {
functions.set(node.name.text, node)
}
if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {
aliases.set(node.name.text, node.initializer)
if (ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer)) {
functions.set(node.name.text, node.initializer)
}
}
ts.forEachChild(node, visit)
}
visit(source)
return { source, imports, functions, aliases, assignments }
}
export function collectParkingOwnershipViolations(root = process.cwd()) {
const modules = new Map()
const pending = [...ROOTS].flatMap(([rel, names]) =>
names.map((name) => ({ rel, name, tainted: new Set() }))
)
for (const { rel, name, inputs } of OWNER_ROOTS) {
pending.push({ rel: RENDERER + rel, name, tainted: new Set(inputs) })
}
const visited = new Set()
const violations = new Set()
while (pending.length) {
const { rel, name, tainted } = pending.pop()
if (STORE_BOUNDARIES.has(rel) || EFFECT_BOUNDARIES.has(`${rel}#${name}`)) {
continue
}
const identity = `${rel}#${name}#${[...tainted].sort().join(',')}`
if (visited.has(identity)) {
continue
}
visited.add(identity)
let mod = modules.get(rel)
if (!mod) {
modules.set(rel, (mod = readModule(root, rel)))
}
const fn = mod.functions.get(name)
if (!fn) {
continue
}
function hotMap(node, seen = new Set()) {
if (ts.isPropertyAccessExpression(node)) {
if (HOT_MAPS.has(node.name.text)) {
return true
}
if (ts.isIdentifier(node.expression)) {
const value = mod.aliases.get(node.expression.text)
if (value && ts.isObjectLiteralExpression(value)) {
const property = value.properties.find(
(candidate) =>
ts.isPropertyAssignment(candidate) &&
candidate.name.getText(mod.source) === node.name.text
)
if (property && ts.isPropertyAssignment(property)) {
return hotMap(property.initializer, seen)
}
}
}
return false
}
if (ts.isElementAccessExpression(node)) {
return (
ts.isStringLiteral(node.argumentExpression) && HOT_MAPS.has(node.argumentExpression.text)
)
}
if (ts.isIdentifier(node)) {
if (HOT_MAPS.has(node.text) || tainted.has(node.text)) {
return true
}
if (seen.has(node.text)) {
return false
}
seen.add(node.text)
const alias = mod.aliases.get(node.text)
return alias ? hotMap(alias, seen) : false
}
if (
ts.isParenthesizedExpression(node) ||
ts.isAsExpression(node) ||
ts.isNonNullExpression(node)
) {
return hotMap(node.expression, seen)
}
if (
ts.isBinaryExpression(node) &&
node.operatorToken.kind === ts.SyntaxKind.QuestionQuestionToken
) {
return hotMap(node.left, seen)
}
return false
}
function report(node) {
const line = mod.source.getLineAndCharacterOfPosition(node.getStart(mod.source)).line + 1
violations.add(
`${rel}:${line}: ${name} enumerates a whole parking input; use the addressed owner or a named source resync.`
)
}
function visit(node) {
if (
ts.isFunctionDeclaration(node) &&
node.name &&
EFFECT_BOUNDARIES.has(`${rel}#${node.name.text}`)
) {
return
}
if (ts.isForInStatement(node) && hotMap(node.expression)) {
report(node)
}
if (ts.isCallExpression(node)) {
const callee = node.expression
if (
ts.isPropertyAccessExpression(callee) &&
ts.isIdentifier(callee.expression) &&
callee.expression.text === 'Object' &&
ENUMERATORS.has(callee.name.text) &&
node.arguments.some((arg) => hotMap(arg)) &&
!(callee.name.text === 'keys' && KEY_DIFFS.has(`${rel}#${name}`)) &&
!COLD_RESYNCS.has(`${rel}#${name}`)
) {
report(node)
}
if (ts.isIdentifier(callee)) {
const target = mod.imports.get(callee.text) ?? { rel, name: callee.text }
if (
COLD_RESYNCS.has(`${target.rel}#${target.name}`) &&
!isColdResyncCall(node, mod.source)
) {
report(node)
}
if (!STORE_BOUNDARIES.has(target.rel)) {
let targetModule = modules.get(target.rel)
if (!targetModule) {
modules.set(target.rel, (targetModule = readModule(root, target.rel)))
}
const called = targetModule.functions.get(target.name)
const parameters = new Set()
called?.parameters.forEach((parameter, index) => {
if (
ts.isIdentifier(parameter.name) &&
node.arguments[index] &&
hotMap(node.arguments[index])
) {
parameters.add(parameter.name.text)
}
})
if (called) {
pending.push({ ...target, tainted: parameters })
}
}
}
}
ts.forEachChild(node, visit)
}
visit(fn.body)
}
return [...violations].sort()
}
function collectPublicCoverageViolations(root) {
const rel = `${WATCHERS}parked-terminal-tab-coverage.ts`
const { source } = readModule(root, rel)
const privateNames = new Set([
'fallbackParkedPaneCandidates',
'resolveParkedTerminalPaneCandidates',
'capturedCoversFallback'
])
const violations = []
for (const statement of source.statements) {
const exported =
ts.canHaveModifiers(statement) &&
ts.getModifiers(statement)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)
const leaksDeclaration =
exported && ts.isFunctionDeclaration(statement) && privateNames.has(statement.name?.text)
const leaksNamedExport =
ts.isExportDeclaration(statement) &&
statement.exportClause &&
ts.isNamedExports(statement.exportClause) &&
statement.exportClause.elements.some((element) =>
privateNames.has(element.propertyName?.text ?? element.name.text)
)
if (leaksDeclaration || leaksNamedExport) {
violations.push(`${rel}: raw coverage derivation must stay private to its owner.`)
}
}
return violations
}
export function main(root = process.cwd()) {
const violations = [
...collectParkingOwnershipViolations(root),
...collectUnaddressedWrites(root),
...collectPublicCoverageViolations(root)
]
for (const violation of violations) {
console.error(violation)
}
if (violations.length) {
return 1
}
console.log(
'terminal-parking-ownership: addressed consumer paths contain no whole input enumeration'
)
return 0
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
process.exitCode = main()
}
@@ -0,0 +1,16 @@
import { TestRunner } from 'vitest'
export default class SharedWorkerSetupRunner extends TestRunner {
importFile(filepath, source) {
if (source === 'setup') {
// Warm transforms can key setup roots by a different URL than Vitest invalidates.
const modules = this.moduleRunner.evaluatedModules
for (const node of modules.getModulesByFile(filepath) ?? []) {
if (node.evaluated) {
modules.invalidateModule(node)
}
}
}
return super.importFile(filepath, source)
}
}
@@ -27,8 +27,6 @@ const NODE_RUNTIME_INCLUDE = [
'src/main/browser/extensions/native-messaging/browser-extension-native-host-process-backpressure.test.ts',
'src/main/daemon/providers/lifecycle/testing/daemon-init-provider-installation.test.ts',
'src/renderer/src/components/terminal-pane/pty-transport/input/pty-input-write-queue.test.ts',
'src/renderer/src/lib/react-commit-cascade-observer.test.ts',
'src/renderer/src/lib/react-commit-cascade-telemetry.test.ts',
// Asserts payloads are collected; Bun's GC scans the stack conservatively and may keep one alive.
'src/shared/ws-inbound-message-queue.test.ts',
'src/renderer/src/lib/agent-session/history/title-sync/ai-vault-tab-title-sync-inputs.test.ts',
@@ -36,6 +34,7 @@ const NODE_RUNTIME_INCLUDE = [
// Asserts an observer survives a forced collection; conservative retention would hide a lost one.
'config/scripts/test-runtime/dom/happy-dom-mutation-observer-retention.test.ts',
// These reach Node SQLite through a shared helper or a dynamic import, which the scan skips.
'src/main/agent-hooks/server/testing/providers/codex/server-codex-session-start.test.ts',
'src/main/claude/claude-transcript-catch-up.test.ts',
'src/main/claude/claude-transcript-duration.test.ts',
'tests/e2e/native-chat-startup-option-pickers.unit.test.ts',
@@ -136,7 +135,7 @@ const NODE_RUNTIME_INCLUDE = [
'src/main/gitlab/gitlab-known-host-retirement.test.ts',
'src/main/window/main-window-updater-deferred-setup.test.ts',
'src/renderer/src/components/terminal-pane/host-state/terminal-pane-host-state-memo.test.ts',
'src/renderer/src/components/automations/use-automation-runs-dashboard-payload.test.tsx',
'src/renderer/src/components/automations/runs/use-automation-runs-dashboard-payload.test.tsx',
'src/main/native-chat/agent-session-journal/**/*.test.ts',
'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts',
'src/main/runtime/agent-session/records/agent-session-conversation-name-store.test.ts',
@@ -168,7 +167,14 @@ const NODE_RUNTIME_INCLUDE = [
'src/main/claude/claude-agent-sdk-contract-pins.test.ts',
'config/scripts/orcad-distribution/server-bundle/profile-state-worker-smoke.test.mjs',
'config/scripts/desktop-distribution/runtime-verification/process-host-dev-rebuild.test.ts',
'config/scripts/test-runtime/node-worker/vitest-node-runtime-pool.test.ts'
'config/scripts/test-runtime/node-worker/vitest-node-runtime-pool.test.ts',
// Reopen WAL-backed row caches read-only, which Bun on macOS cannot.
'src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts',
'tests/e2e/helpers/persisted-profile-state.unit.test.ts',
'src/main/runtime/push/notifications/mobile-notification-dismissal-store.test.ts',
'src/main/runtime/push/notifications/mobile-notification-dismissal-read-failure.test.ts',
'src/main/ipc/notifications-subject-retirement.test.ts',
'src/main/ipc/notifications-external-acknowledgement.test.ts'
]
/** `filters` limits the SQLite import scan to the tests a filtered CLI run can select. */
@@ -25,7 +25,7 @@ const LAYOUT_ORACLE_PREFIXES = [
'src/renderer/src/store/workspace-layout/workspace-layout-cache',
'src/renderer/src/components/terminal-pane/',
'src/renderer/src/components/agent-session-continuation/AgentSessionContinuationMenuItem.tsx',
'src/renderer/src/components/orchestration-crew/WorkerAutoCloseBanner.tsx',
'src/renderer/src/components/terminal-pane/worker-lifetime/WorkerAutoCloseBanner.tsx',
'src/renderer/src/attention/orca-window-foreground-focus.ts',
'src/renderer/src/attention/notification-workspace-labels.ts',
'src/renderer/src/lib/agent-session/identity/pane-agent-session-id.ts',
@@ -0,0 +1,26 @@
[
{
"filePath": "src/main/startup/main-process-quit.ts",
"kind": "object-property:message",
"text": "before-quit allowed for update install",
"dynamic": false,
"count": 1,
"reason": "Updater lifecycle diagnostics are not displayed as UI copy."
},
{
"filePath": "src/main/startup/main-process-quit.ts",
"kind": "object-property:message",
"text": "will-quit cleanup for update install; daemonTeardown=disconnect",
"dynamic": false,
"count": 1,
"reason": "Updater lifecycle diagnostics are not displayed as UI copy."
},
{
"filePath": "src/main/startup/profile-state-recovery-preflight.ts",
"kind": "object-property:message",
"text": "Invalid profile-state recovery launch.",
"dynamic": false,
"count": 1,
"reason": "Existing recovery detail is user-visible and remains untranslated; tracked in issue 32207."
}
]
+1 -2
View File
@@ -24,8 +24,7 @@
"../src/cli/runtime/runtime-access-denied.ts",
"../src/cli/runtime/runtime-pid-liveness.ts",
"../src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts",
"../src/renderer/src/lib/orca-hook-trust.ts",
"../src/renderer/src/lib/sha256.ts",
"../src/renderer/src/runtime/repo-hooks/orca-hook-trust.ts",
"../src/renderer/src/components/native-chat/native-chat-resolution-receipt.ts",
"../src/renderer/src/components/native-chat/structured-agent-question-projection.ts",
"../src/renderer/src/components/native-chat/subagents/native-chat-subagent-delegation.ts",
-1
View File
@@ -3,7 +3,6 @@
"exclude": [
"../src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-main-surface.test.ts",
"../src/renderer/src/components/task-page/linear/task-page-linear-detail-query.test.tsx",
"../tests/e2e/terminal-agent-pane-launch.unit.test.ts",
"../src/renderer/src/runtime/provider-accounts/observations/provider-account-observation.test-fixture.ts",
"../src/shared/**/*.test.ts",
"../src/shared/**/*.test.tsx",
-1
View File
@@ -5,7 +5,6 @@
"../src/main/runtime/orchestration/terminal-authority/structured-sessions/structured-chat-coordinator-mail.test.ts",
"../src/main/runtime/rpc/methods/orchestration/orchestration-check-ambiguous-caller.test.ts",
"../src/renderer/src/components/task-page/linear/task-page-linear-detail-query.test.tsx",
"../tests/e2e/terminal-agent-pane-launch.unit.test.ts",
"../src/renderer/src/runtime/observed-provider-accounts.test.tsx",
"../src/renderer/src/components/status-bar/ClaudeSwitcherMenu.observation.test.tsx",
"../src/renderer/src/runtime/provider-accounts/observations/provider-account-observation.test-fixture.ts",
-1
View File
@@ -13,7 +13,6 @@
"exclude": [
"../src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-main-surface.test.ts",
"../src/renderer/src/components/task-page/linear/task-page-linear-detail-query.test.tsx",
"../tests/e2e/terminal-agent-pane-launch.unit.test.ts",
"../src/renderer/src/app-shell/project-grouping-authored-peer-writes.test.tsx",
"../src/renderer/src/components/sidebar/project-group-actions-test-fixtures.ts",
"../src/renderer/src/components/sidebar/qualified-group-actions-lifetime.test.tsx",
+6 -1
View File
@@ -116,10 +116,12 @@ const bunProject = {
}
// Files whose state the per-file reset can undo share one worker's module cache instead of
// re-importing thousands of modules each. ORCA_VITEST_ISOLATE_EVERY_FILE=1 turns it off.
// Windows workers that keep native addons (process tree, ConPTY) across files die of heap
// corruption (0xC0000374); production code loads them lazily, so the file scan can't see them.
const runtimeProject = process.versions.bun ? bunProject : nodeProject
const nodeRuntimeFiles = new Set(nodeRuntimeInclude.map((file) => file.replaceAll('\\', '/')))
const sharedWorkerFiles =
process.env.ORCA_VITEST_ISOLATE_EVERY_FILE === '1'
process.env.ORCA_VITEST_ISOLATE_EVERY_FILE === '1' || process.platform === 'win32'
? []
: filesSafeToShareWorker(
process.cwd(),
@@ -141,6 +143,9 @@ const sharedProjects =
name: `${runtimeProject.test.name}-shared`,
include: sharedWorkerFiles,
isolate: false,
runner: resolve(
'config/scripts/test-runtime/execution-policy/vitest-shared-worker-setup-runner.mjs'
),
setupFiles: [
...runtimeProject.test.setupFiles,
resolve('config/scripts/test-runtime/environment/vitest-shared-worker-file-reset.mjs')
-2
View File
@@ -6,7 +6,6 @@ import { nodeRuntimePool } from './scripts/test-runtime/node-worker/vitest-node-
const contracts = [
'src/main/runtime/session-tabs/session-tabs-phone-layout-moves.test.ts',
'src/renderer/src/components/terminal-pane/pty-connection/startup/saved-resume-cancellation.test.ts',
'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts',
'src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts',
'src/main/runtime/rpc/methods/projects/repo.test.ts',
@@ -18,7 +17,6 @@ const contracts = [
'src/main/codex-usage/scanner-incremental-append.test.ts',
'src/main/usage/jsonl-file-reader.test.ts',
'src/main/usage/jsonl-file-snapshot.test.ts',
'src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-queue-retention.test.ts',
'config/scripts/static-analysis/oxlint-contracts/app-store-performance-plugin.test.mjs',
'config/scripts/static-analysis/oxlint-contracts/quadratic-buffer-concat-plugin.test.mjs',
'src/main/claude-usage/scanner-incremental-append.test.ts',
+6 -7
View File
@@ -8,7 +8,6 @@
4 src/renderer/src/components/dashboard/build-dashboard-bucket-counts.ts # P5b-2 must clear: optional state fields; memo compare goes stale when absent
3 src/renderer/src/components/dashboard/dashboard-card-terminal-input.ts # P5b-2 must clear: optional state fields default to empty
1 src/renderer/src/components/dashboard/dashboard-snapshot-workspaces.ts # P5b-2 must clear: optional state field defaults to empty
1 src/renderer/src/components/dashboard/dashboard-worktree-launch-options.ts # P5b-2 must clear: optional state field defaults to empty
4 src/renderer/src/components/dashboard/useDashboardPopoutBridge.ts # P5b-2 must clear: change detection on optional fields never fires when absent
2 src/renderer/src/components/dashboard/useRetainedAgents.ts # reads a passed-in copy
1 src/renderer/src/components/editor/markdown/documents/markdown-document-worktree-path-selector.ts # P5b-2 must clear: optional state field
@@ -22,7 +21,7 @@
1 src/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.ts # reads a passed-in copy
1 src/renderer/src/components/sidebar/worktree-list/navigation/use-pending-reveal.ts # reads a passed-in copy
2 src/renderer/src/components/sidebar/worktree-list/viewport/VirtualizedWorktreeViewport.tsx # reads a passed-in copy
2 src/renderer/src/components/skills/skill-install-workspace-choices.ts # reads a passed-in copy
2 src/renderer/src/components/skills/installation/skill-install-workspace-choices.ts # reads a passed-in copy
1 src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.ts # P5b-2 must clear: loosely typed state param
1 src/renderer/src/components/workspace-space/space-window-state.ts # reads a passed-in copy
1 src/renderer/src/hooks/composer-state/composer-source-state.ts # P5b-2 must clear: composer store snapshot
@@ -31,15 +30,15 @@
1 src/renderer/src/lib/browser/navigation/http-link-localhost-route.ts # P5b-2 must clear: optional state field defaults to empty; extracted from http-link-routing.ts
1 src/renderer/src/lib/workspace/ownership/connection-owner-resolution.ts # P5b-2 must clear: optional-chain compare of a previous slice
2 src/renderer/src/lib/workspace/ownership/direct-ssh-target-scope.ts # P5b-2 must clear: optional input fields default to empty
3 src/renderer/src/lib/duplicate-paired-servers.ts # P5b-2 must clear: optional state fields default to empty
3 src/renderer/src/lib/workspace/ownership/duplicate-paired-servers.ts # P5b-2 must clear: optional state fields default to empty
1 src/renderer/src/lib/workspace/ownership/folder-workspace-runtime-owner.ts # P5b-2 must clear: loosely typed state param
1 src/renderer/src/runtime/hosts/wsl/local-project-runtime-workspace.ts # P5b-2 must clear: optional state field defaults to empty
1 src/renderer/src/lib/resolved-worktree-execution-host.ts # P5b-2 must clear: loosely typed state param
1 src/renderer/src/lib/workspace/ownership/resolved-worktree-execution-host.ts # P5b-2 must clear: loosely typed state param
2 src/renderer/src/lib/workspace/ownership/runtime-session-mirror-owners.ts # P5b-2 must clear: optional state fields default to empty
2 src/renderer/src/lib/terminal-worktree-route.ts # P5b-2 must clear: the unattributed-twin check reads both catalogs directly
2 src/renderer/src/lib/workspace/ownership/terminal-worktree-route.ts # P5b-2 must clear: the unattributed-twin check reads both catalogs directly
3 src/renderer/src/lib/typing-latency/diagnostic-summary.ts # P5b-2 must clear: optional state field
2 src/renderer/src/lib/unread-badge-count.ts # reads a passed-in copy
1 src/renderer/src/lib/workspace-directory.ts # P5b-2 must clear: optional state field defaults to empty
2 src/renderer/src/attention/unread/unread-badge-count.ts # reads a passed-in copy
1 src/renderer/src/lib/workspace/paths/workspace-directory.ts # P5b-2 must clear: optional state field defaults to empty
2 src/renderer/src/lib/workspace/ownership/workspace-terminal-host-authority.ts # P5b-2 must clear: optional state fields
1 src/renderer/src/lib/workspace/activation/initial-surface/worktree-initial-terminal-seeding.ts # P5b-2 must clear: treats an undefined field as a narrow adapter
1 src/renderer/src/lib/workspace/activation/worktree-activation-pty-inventory.ts # P5b-2 must clear: loosely typed state param
+4 -4
View File
@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="113" height="20" role="img" aria-label="downloads: 162m">
<title>downloads: 162m</title>
<svg xmlns="http://www.w3.org/2000/svg" width="113" height="20" role="img" aria-label="downloads: 168m">
<title>downloads: 168m</title>
<linearGradient id="s" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
@@ -15,7 +15,7 @@
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="11">
<text x="37" y="15" fill="#010101" fill-opacity=".3">downloads</text>
<text x="37" y="14">downloads</text>
<text x="93.5" y="15" fill="#010101" fill-opacity=".3">162m</text>
<text x="93.5" y="14">162m</text>
<text x="93.5" y="15" fill="#010101" fill-opacity=".3">168m</text>
<text x="93.5" y="14">168m</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 943 B

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 KiB

After

Width:  |  Height:  |  Size: 395 KiB

+1 -1
View File
@@ -53,5 +53,5 @@ pnpm dev:fresh [--keep] [--seed-from[=<profile dir>]] # temporary profile, rem
- Slow main-process rebuilds: set `ORCA_DEV_MAIN_SOURCEMAPS=0` before `pnpm dev` when you don't need main-process source maps.
- Renderer misbehaving in dev: set `ORCA_DEV_BUNDLED=0` to turn off bundled dev mode, and report it.
- Test passes alone but fails after others: add `// @orca-isolated-worker` to the file; `ORCA_VITEST_ISOLATE_EVERY_FILE=1` isolates every file to confirm a leak.
- Test passes alone but fails after others: add `// @orca-isolated-worker` to the file; `ORCA_VITEST_ISOLATE_EVERY_FILE=1` isolates every file to confirm a leak. Windows always isolates every file, because native addons kept across files corrupt the heap.
- Slow typechecks: where supported, `pnpm tc` keeps incremental caches in `.cache/typecheck/`; delete it to force a fresh check.
+2 -4
View File
@@ -249,11 +249,9 @@ Associez-la à l'app de bureau pour surveiller et piloter vos agents depuis votr
- **Discord :** Rejoignez la communauté sur **[Discord](https://discord.gg/fzjDKHxv8Q)**.
- **Twitter / X :** Suivez **[@orca_build](https://x.com/orca_build)** pour les news et annonces.
- **WeChat :** Scannez pour rejoindre un groupe WeChat de la communauté Orca. Si un groupe est complet, rejoignez-en un autre.
- **WeChat :** Scannez pour rejoindre un groupe WeChat de la communauté Orca.
<img src="../assets/wechat-qr-group14.jpg" alt="QR code du groupe WeChat de la communauté Orca" width="160" />
<img src="../assets/wechat-qr-group15.jpg" alt="QR code du groupe WeChat de la communauté Orca" width="160" />
<img src="../assets/wechat-qr-group16.jpg" alt="QR code du groupe WeChat de la communauté Orca" width="160" />
<img src="../assets/wechat-qr.jpg" alt="QR code du groupe WeChat de la communauté Orca" width="160" />
- **Feedback &amp; idées :** On ship vite. Il manque quelque chose ? [Demandez une feature](https://github.com/stablyai/orca/issues).
- **Confidentialité :** Voir la [doc confidentialité &amp; télémétrie](https://www.onorca.dev/docs/telemetry) pour ce qu'Orca collecte en anonyme et comment désactiver la télémétrie.
+2 -4
View File
@@ -244,11 +244,9 @@ yay -S stably-orca-bin
- **Discord:** **[Discord](https://discord.gg/fzjDKHxv8Q)** 커뮤니티에 참여하세요.
- **Twitter / X:** 업데이트와 공지는 **[@orca_build](https://x.com/orca_build)** 를 팔로우하세요.
- **WeChat:** QR 코드를 스캔해 Orca 커뮤니티 WeChat 그룹에 참여하세요. 한 그룹이 가득 찼다면 다른 그룹에 참여하세요.
- **WeChat:** QR 코드를 스캔해 Orca 커뮤니티 WeChat 그룹에 참여하세요.
<img src="../assets/wechat-qr-group14.jpg" alt="Orca 커뮤니티 WeChat 그룹 QR 코드" width="160" />
<img src="../assets/wechat-qr-group15.jpg" alt="Orca 커뮤니티 WeChat 그룹 QR 코드" width="160" />
<img src="../assets/wechat-qr-group16.jpg" alt="Orca 커뮤니티 WeChat 그룹 QR 코드" width="160" />
<img src="../assets/wechat-qr.jpg" alt="Orca 커뮤니티 WeChat 그룹 QR 코드" width="160" />
- **피드백과 아이디어:** 우리는 빠르게 출시합니다. 필요한 기능이 있나요? [새 기능을 요청](https://github.com/stablyai/orca/issues)하세요.
- **개인정보 보호:** Orca가 수집하는 익명 사용 데이터와 수집 거부 방법은 [개인정보 및 텔레메트리 문서](https://www.onorca.dev/docs/telemetry)를 참고하세요.
+2 -4
View File
@@ -245,11 +245,9 @@ yay -S stably-orca-bin
- **Discord:** Присоединяйтесь к сообществу в **[Discord](https://discord.gg/fzjDKHxv8Q)**.
- **Twitter / X:** Подпишитесь на **[@orca_build](https://x.com/orca_build)**, чтобы узнавать об обновлениях и анонсах.
- **WeChat:** Отсканируйте QR-код, чтобы присоединиться к группе сообщества Orca в WeChat. Если одна группа заполнена, присоединяйтесь к другой.
- **WeChat:** Отсканируйте QR-код, чтобы присоединиться к группе сообщества Orca в WeChat.
<img src="../assets/wechat-qr-group14.jpg" alt="QR-код группы сообщества Orca в WeChat" width="160" />
<img src="../assets/wechat-qr-group15.jpg" alt="QR-код группы сообщества Orca в WeChat" width="160" />
<img src="../assets/wechat-qr-group16.jpg" alt="QR-код группы сообщества Orca в WeChat" width="160" />
<img src="../assets/wechat-qr.jpg" alt="QR-код группы сообщества Orca в WeChat" width="160" />
- **Отзывы и идеи:** Мы быстро выпускаем обновления. Чего-то не хватает? [Предложите новую возможность](https://github.com/stablyai/orca/issues).
- **Конфиденциальность:** В [документации о конфиденциальности и телеметрии](https://www.onorca.dev/docs/telemetry) описано, какие анонимные данные об использовании собирает Orca и как отказаться от их сбора.
+2 -4
View File
@@ -242,11 +242,9 @@ Ajanlarınızı telefonunuzdan izlemek ve yönlendirmek için masaüstü uygulam
- **Discord:** Topluluğa **[Discord](https://discord.gg/fzjDKHxv8Q)** üzerinden katılın.
- **Twitter / X:** Güncellemeler ve duyurular için **[@orca_build](https://x.com/orca_build)** hesabını takip edin.
- **WeChat:** Orca topluluğunun bir WeChat grubuna katılmak için karekodu okutun. Bir grup doluysa başka bir gruba katılabilirsiniz.
- **WeChat:** Orca topluluğunun bir WeChat grubuna katılmak için karekodu okutun.
<img src="../assets/wechat-qr-group14.jpg" alt="Orca topluluğunun WeChat grubu karekodu" width="160" />
<img src="../assets/wechat-qr-group15.jpg" alt="Orca topluluğunun WeChat grubu karekodu" width="160" />
<img src="../assets/wechat-qr-group16.jpg" alt="Orca topluluğunun WeChat grubu karekodu" width="160" />
<img src="../assets/wechat-qr.jpg" alt="Orca topluluğunun WeChat grubu karekodu" width="160" />
- **Geri bildirim ve fikirler:** Hızlı sürüm çıkarıyoruz. Eksik bulduğunuz bir şey mi var? [Yeni bir özellik isteyin](https://github.com/stablyai/orca/issues).
- **Gizlilik:** Orca'nın hangi anonim kullanım verisini topladığını ve bunu nasıl kapatacağınızı [gizlilik ve telemetri dokümanlarında](https://www.onorca.dev/docs/telemetry) bulabilirsiniz.
+2 -4
View File
@@ -242,11 +242,9 @@ yay -S stably-orca-bin
- **Discord:** 加入 **[Discord](https://discord.gg/fzjDKHxv8Q)** 社区。
- **Twitter / X:** 关注 **[@orca_build](https://x.com/orca_build)** 获取更新和公告。
- **微信:** 扫码加入 Orca 社区微信群。如果一个群已满,可以加入其他群。
- **微信:** 扫码加入 Orca 社区微信群。
<img src="../assets/wechat-qr-group14.jpg" alt="Orca 社区微信群二维码" width="160" />
<img src="../assets/wechat-qr-group15.jpg" alt="Orca 社区微信群二维码" width="160" />
<img src="../assets/wechat-qr-group16.jpg" alt="Orca 社区微信群二维码" width="160" />
<img src="../assets/wechat-qr.jpg" alt="Orca 社区微信群二维码" width="160" />
- **反馈与想法:** 我们发布很快。缺少什么功能?[提交功能请求](https://github.com/stablyai/orca/issues)。
- **隐私:** 查看[隐私与遥测文档](https://www.onorca.dev/docs/telemetry),了解 Orca 收集哪些匿名使用数据以及如何退出。
+15 -5
View File
@@ -2,7 +2,7 @@
<!-- Generated by `pnpm generate:plugin-schemas` from src/shared/plugins. Do not edit. -->
Host API 1.5 (`"pluginApi": 1`). Workers call a method with `await orca.host.call(name, params)`; panels and custom editors call the same methods through `window.orca.host.call(name, params)`. Each method lists the surfaces allowed to call it; any other surface gets `not_permitted`. `orca.host.has(name)` answers synchronously whether this Orca offers a method on the current surface, and `orca.api` is `{ major, minor }`. See [Plugin authoring](./plugin-authoring.md) for the frame API.
Host API 1.6 (`"pluginApi": 1`). Workers call a method with `await orca.host.call(name, params)`; panels and custom editors call the same methods through `window.orca.host.call(name, params)`. Each method lists the surfaces allowed to call it; any other surface gets `not_permitted`. `orca.host.has(name)` answers synchronously whether this Orca offers a method on the current surface, and `orca.api` is `{ major, minor }`. See [Plugin authoring](./plugin-authoring.md) for the frame API.
Every call is checked against the capabilities the user approved, and params are validated before Orca runs anything: params are strict, so a field this Orca does not know is refused with `invalid_params` instead of being dropped. Mutations are recorded in the audit log as `plugin:<publisher>.<id>`.
@@ -29,7 +29,7 @@ Methods whose capability is `none` need no capability but still need the plugin
| [`files.saveAs`](#filessaveas) | none | panel, editor | yes | 1.1 | Offers data (a string or ArrayBuffer, up to 64 MiB) in Orca's save dialog; the plugin never learns the path. Needs a click or key press in the frame; desktop app only. |
| [`plugin.request`](#pluginrequest) | none | panel, editor | no | 1.2 | Asks the plugin's own worker to run the handler it registered with `orca.panels.handle(name)`, starting the worker if needed; resolves with what the handler returned. `unknown_method` when no handler has that name. |
| [`agents.list`](#agentslist) | `agent:read` | worker, panel, editor | no | 1.2 | The agents in the focused workspace: their terminal, title, agent kind and status. `agent.status.changed` reports each change after. |
| [`events.subscribe`](#eventssubscribe) | none | panel, editor | no | 1.2 | Delivers a workspace or agent event to this panel as `orca.on(event)`; needs the event's read capability. The frame APIs call it for you. |
| [`events.subscribe`](#eventssubscribe) | none | panel, editor | no | 1.2 | Delivers a workspace, agent or editor event to this panel as `orca.on(event)`; needs the event's read capability, when it has one. The frame APIs call it for you. |
| [`statusBar.update`](#statusbarupdate) | none | worker | no | 1.2 | Changes one of the plugin's `contributes.statusBarItems` (named by `id`): fields given replace their current value, `visible: false` hides it. Desktop app only; lasts until Orca restarts, and is hidden while the plugin is disabled. A plugin with `main` and status bar items has its worker started when it is enabled and kept running while it stays enabled, so a worker can poll and update its items without an event or a hook. |
| [`appearance.read`](#appearanceread) | `appearance:write` | worker | no | 1.4 | Reads the current desktop appearance revision for a conditional update. |
| [`appearance.apply`](#appearanceapply) | `appearance:write` | worker | yes | 1.4 | Publishes owned app/editor and terminal colors and selects them in the desktop. Returns publication, not renderer acknowledgement. |
@@ -41,6 +41,7 @@ Methods whose capability is `none` need no capability but still need the plugin
| [`agent.launch`](#agentlaunch) | `agent:launch` | worker | yes | 1.3 | Starts an agent's CLI in a new terminal of a workspace, in the background, and returns as soon as it starts; a `prompt` is sent once the agent is ready. |
| [`editor.open`](#editoropen) | `workspace:write` | worker | yes | 1.3 | Opens a file of a workspace in an editor tab of Orca's window; desktop app only. `workspace.open` shows the workspace. |
| [`commands.run`](#commandsrun) | `workspace:write` | worker | yes | 1.3 | Runs one of Orca's built-in actions in its window, never a plugin's replacement of it; desktop app only. |
| [`editor.readTypography`](#editorreadtypography) | none | worker, panel, editor | no | 1.6 | The font family, size, weight, line height, ligatures, word wrap and minimap Orca's file editor uses now, editor zoom included. `editor.typography.changed` reports each change after. |
### `workspace.readContext`
@@ -180,10 +181,10 @@ The agents in the focused workspace: their terminal, title, agent kind and statu
### `events.subscribe`
Delivers a workspace or agent event to this panel as `orca.on(event)`; needs the event's read capability. The frame APIs call it for you.
Delivers a workspace, agent or editor event to this panel as `orca.on(event)`; needs the event's read capability, when it has one. The frame APIs call it for you.
```ts
(params: { event: "workspace.created" | "workspace.removed" | "agent.status.changed" | "workspace.changed" }) => { ok: true }
(params: { event: "workspace.created" | "workspace.removed" | "agent.status.changed" | "workspace.changed" | "editor.typography.changed" }) => { ok: true }
```
### `statusBar.update`
@@ -274,9 +275,17 @@ Runs one of Orca's built-in actions in its window, never a plugin's replacement
(params: { action: "worktree.history.back" | "worktree.history.forward" | "sidebar.left.toggle" | "sidebar.sleepingWorkspaces.toggle" | "floatingWorkspace.maximize" | "tab.rename" | "workspace.rename" | "workspace.openBoard" | "view.tasks" | "sidebar.right.toggle" | "sidebar.explorer.toggle" | "sidebar.search.toggle" | "sidebar.sourceControl.toggle" | "sidebar.checks.toggle" | "sidebar.ports.toggle" }) => { ran: true }
```
### `editor.readTypography`
The font family, size, weight, line height, ligatures, word wrap and minimap Orca's file editor uses now, editor zoom included. `editor.typography.changed` reports each change after.
```ts
(params?: {}) => { fontFamily: string; cssFontFamily: string; fontSize: number; fontWeight: string; lineHeight: number; fontLigatures: boolean; wordWrap: "on" | "off"; minimap: boolean }
```
## Events
A worker receives the events its manifest lists in `contributes.events` through `orca.events.on(event, handler)`, which returns `{ dispose() }`. Each needs `main`, the `trusted-worker` profile and its domain's capability (`workspace:read` or `agent:read`). `orca plugin types` writes the payloads as `PluginEvents` in `orca/host`.
A worker receives the events its manifest lists in `contributes.events` through `orca.events.on(event, handler)`, which returns `{ dispose() }`. Each needs `main`, the `trusted-worker` profile and its domain's capability (`workspace:read` or `agent:read`; editor events need none). `orca plugin types` writes the payloads as `PluginEvents` in `orca/host`.
| Event | Payload | Summary |
| --- | --- | --- |
@@ -284,6 +293,7 @@ A worker receives the events its manifest lists in `contributes.events` through
| `workspace.removed` | `{ workspaceId: string; kind: "worktree" \| "folder"; path: string }` | A worktree workspace was removed. |
| `agent.status.changed` | `{ workspaceId: string \| null; paneKey: string; terminalId?: string; title?: string; state: "working" \| "blocked" \| "waiting" \| "done"; receivedAt: number; mainAgent?: { state: "working" \| "blocked" \| "waiting" \| "done"; outcome?: "success" \| "failure" \| "cancellation" \| "superseded" \| "interruption" \| "unconfirmed"; stateStartedAt: number } }` | An agent in a terminal pane changed status; `workspaceId` is null when Orca cannot tie the pane to a workspace, and `terminalId` names its terminal when Orca lists it. |
| `workspace.changed` | `{ context: { branch: string; displayName: string; terminals: { id: string; title?: string }[] } \| null }` | The focused workspace changed, or its terminals were opened, closed or renamed; `context` is what `workspace.readContext` now answers. Each new subscriber first gets the current context. |
| `editor.typography.changed` | `{ fontFamily: string; cssFontFamily: string; fontSize: number; fontWeight: string; lineHeight: number; fontLigatures: boolean; wordWrap: "on" \| "off"; minimap: boolean }` | What Orca's file editor uses changed (a setting or the editor zoom); the payload is what `editor.readTypography` now answers. Needs no capability. |
## Hooks
+3 -3
View File
@@ -32,7 +32,7 @@ Add `"$schema": "https://raw.githubusercontent.com/stablyai/orca/main/docs/schem
| `contributes` | object | no | 1.4.160 | What the plugin adds to Orca. Every point defaults to empty. |
| `contributes.panels` | [PanelContribution](#panelcontribution)[] | no | 1.4.160 | Sidebar panels. At most 64. |
| `contributes.commands` | [CommandContribution](#commandcontribution)[] | no | 1.4.160 | Command palette entries. At most 256. |
| `contributes.events` | [EventContribution](#eventcontribution)[] | no | 1.4.160 | Events delivered to the plugin worker. At most 4. |
| `contributes.events` | [EventContribution](#eventcontribution)[] | no | 1.4.160 | Events delivered to the plugin worker. At most 5. |
| `contributes.hooks` | [HookContribution](#hookcontribution)[] | no | 1.4.248 | Hooks the worker runs before or after Orca acts; Orca waits only on plugins that list one. At most 8. |
| `contributes.languagePacks` | [LanguagePackContribution](#languagepackcontribution)[] | no | 1.4.160 | Interface translations. At most 16. |
| `contributes.keybindings` | [KeybindingContribution](#keybindingcontribution)[] | no | 1.4.160 | Keyboard shortcuts for contributed commands. At most 256. |
@@ -85,11 +85,11 @@ A command palette entry. Requires the `declarative` execution profile or higher.
## EventContribution
An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events.
An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events. Editor events need no capability.
| Field | Type | Required | Since | Description |
| --- | --- | --- | --- | --- |
| `on` | `"workspace.created"` \| `"workspace.removed"` \| `"agent.status.changed"` \| `"workspace.changed"` | yes | 1.4.160 | Event delivered to the plugin worker. |
| `on` | `"workspace.created"` \| `"workspace.removed"` \| `"agent.status.changed"` \| `"workspace.changed"` \| `"editor.typography.changed"` | yes | 1.4.160 | Event delivered to the plugin worker. |
## HookContribution
@@ -208,9 +208,9 @@
},
"events": {
"default": [],
"description": "Events delivered to the plugin worker. At most 4.",
"description": "Events delivered to the plugin worker. At most 5.",
"x-orca-since": "1.4.160",
"maxItems": 4,
"maxItems": 5,
"type": "array",
"items": {
"$ref": "#/$defs/EventContribution"
@@ -736,7 +736,8 @@
"workspace.created",
"workspace.removed",
"agent.status.changed",
"workspace.changed"
"workspace.changed",
"editor.typography.changed"
],
"description": "Event delivered to the plugin worker.",
"x-orca-since": "1.4.160",
@@ -744,7 +745,8 @@
"workspace.created": "1.4.245",
"workspace.removed": "1.4.245",
"agent.status.changed": "1.4.160",
"workspace.changed": "1.4.246"
"workspace.changed": "1.4.246",
"editor.typography.changed": "1.4.256"
}
}
},
@@ -752,7 +754,7 @@
"on"
],
"additionalProperties": false,
"description": "An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events."
"description": "An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events. Editor events need no capability."
},
"HookContribution": {
"type": "object",
+15
View File
@@ -233,6 +233,21 @@ orca chat rename --name "Migrate auth"
Renames a chat tab, the same as renaming it by hand. `--session` takes the `sessionId` that `orca agent launch` prints. Run inside a chat, it defaults to that chat; with `--environment` it is required.
Agents that run as chats are read and messaged with `chat` commands. `--session` takes the session id from `chat list` or the handle `agent launch` returns.
```bash
orca chat list --json
orca chat list --state working --json
orca chat read --session <session> --limit 10 --json
orca chat send --session <session> --text "Run the tests, then summarize failures" --json
orca chat send --session <session> --text "<message>" --wait --timeout-ms 600000 --json
orca chat wait --session <session> --timeout-ms 600000 --json
```
`chat read` returns the newest messages, tool calls, errors, approvals and questions; an approval or question waiting for an answer has `pending: true`. `chat send` sends the text as your message. While the agent is working, hosts with a message queue hold it until the turn ends and report `delivery: "queued"`. A chat that restarted since it was read refuses the send. `--text-file -` reads the message from stdin.
`chat send --wait` and `chat wait` return once the chat's own turn settles, in the words `chat list` uses: `settled: "done"`, or `settled: "blocked"` when an approval or question needs an answer. Background agents the chat started can still show as `working` or `waiting` in `chat list`. They print the entries since the last user message. A wait past `--timeout-ms` returns `settled: "timeout"`, and a message held in a stopped or failed queue returns `settled: "held"`; both exit 1. `chat read --json` returns a `cursor` for the newest row read, and `truncated: true` when older rows it needed were past the 200-row read. `chat list --state` takes `working`, `blocked`, `waiting` or `done`. Paired hosts (`--environment`, `--pairing-code`) can list chats but not read, send or wait yet.
## Files
```bash
+1 -1
View File
@@ -27,7 +27,7 @@ import {
} from '../src/notifications/push-receive'
import { startPushTokenSync } from '../src/notifications/push-registration'
import { ensureDesktopNotificationChannel } from '../src/notifications/desktop-notification-channel'
import { loadHostCatalog } from '../src/transport/hosts/host-store'
import { loadHostCatalog } from '../src/host-catalog/host-store'
import { usePairingLinks } from '../src/navigation/use-pairing-links'
import { consumeInitialLaunchIntent } from '../src/navigation/initial-launch-intent'
import { recoverMobileRelayPairing } from '../src/pairing/mobile-relay-pairing-recovery'
+2 -2
View File
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from
import { View, Text, Pressable } from 'react-native'
import { useLocalSearchParams, useRouter } from 'expo-router'
import * as Clipboard from 'expo-clipboard'
import { loadHosts } from '../src/transport/hosts/host-store'
import { loadHosts } from '../src/host-catalog/host-store'
import { connectionLogStore } from '../src/diagnostics/connection/persisted-connection-log-store'
import { useRpcClientContext } from '../src/transport/connection/client-context'
import { useHostClient } from '../src/transport/connection/host-client-hooks'
@@ -22,7 +22,7 @@ import { connectionDiagnosticsScreenStyles as styles } from '../src/diagnostics/
import { useMobileColorScheme } from '../src/theme/use-mobile-color-scheme'
import { NATIVE_APP_LOG_ID } from '../src/diagnostics/native-render-log'
import type { ConnectionLogEntry } from '../src/diagnostics/connection/connection-log-types'
import type { HostProfile } from '../src/transport/hosts/host-profile'
import type { HostProfile } from '../src/host-catalog/host-profile'
import { pressedStyle } from '../src/theme/mobile-theme'
// Keep empty snapshot identity stable or useSyncExternalStore rerenders forever.
+4 -4
View File
@@ -18,7 +18,7 @@ import { NavBar } from '../../../src/components/nav-bar/NavBar'
import { NavBarButton } from '../../../src/components/nav-bar/NavBarButton'
import { themedStyleSheet } from '../../../src/theme/themed-styles'
import { useMobileColorScheme } from '../../../src/theme/use-mobile-color-scheme'
import { loadHosts, updateHostNameAndEndpoint } from '../../../src/transport/hosts/host-store'
import { loadHosts, updateHostNameAndEndpoint } from '../../../src/host-catalog/host-store'
import { displayHostEndpoint } from '../../../src/transport/hosts/host-endpoint'
import { resolveHostEndpointEdit } from '../../../src/transport/hosts/host-endpoint-edit'
import {
@@ -26,12 +26,12 @@ import {
usePrimeHosts,
useRefreshHostClient
} from '../../../src/transport/connection/host-client-hooks'
import { removeHostAndCloseClient } from '../../../src/transport/hosts/host-removal-lifecycle'
import { useHostDisplay } from '../../../src/transport/hosts/use-host-display'
import { removeHostAndCloseClient } from '../../../src/host-catalog/host-removal-lifecycle'
import { useHostDisplay } from '../../../src/host-descriptors/use-host-display'
import { leaveHostRoute } from '../../../src/host-route-exit'
import { ConfirmModal } from '../../../src/components/ConfirmModal'
import { ListGroup, ListRow } from '../../../src/components/list/ListGroup'
import type { HostProfile } from '../../../src/transport/hosts/host-profile'
import type { HostProfile } from '../../../src/host-catalog/host-profile'
import { hostOs } from '../../../src/platform/host-os'
import { translate } from '../../../src/i18n/mobile-i18n'
import { useMobileTranslation } from '../../../src/i18n/use-mobile-translation'
+2 -2
View File
@@ -12,8 +12,8 @@ import { colors, spacing } from '../src/theme/mobile-theme'
import { useMobileColorScheme } from '../src/theme/use-mobile-color-scheme'
import type { Translate } from '../src/i18n/mobile-i18n'
import { useMobileTranslation } from '../src/i18n/use-mobile-translation'
import { loadHosts, peekHosts } from '../src/transport/hosts/host-store'
import type { HostProfile } from '../src/transport/hosts/host-profile'
import { loadHosts, peekHosts } from '../src/host-catalog/host-store'
import type { HostProfile } from '../src/host-catalog/host-profile'
import { useFocusedSettingsHostClients } from '../src/settings/settings-host-client-connections'
import type { RpcClient } from '../src/transport/rpc/rpc-client-contract'
import { LIST_LEADING_INSET, ListRow } from '../src/components/list/ListGroup'
+2 -2
View File
@@ -1,7 +1,7 @@
import { useEffect, useMemo, useState } from 'react'
import { useRouter } from 'expo-router'
import { loadHosts, peekHosts } from '../src/transport/hosts/host-store'
import type { HostProfile } from '../src/transport/hosts/host-profile'
import { loadHosts, peekHosts } from '../src/host-catalog/host-store'
import type { HostProfile } from '../src/host-catalog/host-profile'
import { useFocusedSettingsHostClients } from '../src/settings/settings-host-client-connections'
import VoiceSettingsScreen from '../src/settings/voice-settings-screen'
import { nativeVoiceSettingsOperations } from '../src/settings/native-voice-settings-operations'
@@ -38,7 +38,7 @@ internal enum class MobileWebShellBridgeInstall {
/** The prop is false, so nothing is registered and Phase B behaviour is byte-identical. */
SKIP,
INSTALL,
/** The WebView provider is older than `WEB_MESSAGE_LISTENER` (Chromium 88). Terminal. */
/** The WebView provider is older than `WEB_MESSAGE_LISTENER` (Chromium 83). Terminal. */
UNAVAILABLE
}
@@ -201,7 +201,7 @@ internal class MobileWebShellDocument(private val context: Context) {
view.destroy()
}
// Keep explicit settings for the Chromium 83 floor, even where newer WebViews ignore deprecated options.
// Keep explicit settings even where newer WebViews ignore deprecated options; the floor is Chromium 101.
// B4 requires device proofs: no network, persistent state, file/content access, cleartext or navigation escape.
@Suppress("DEPRECATION")
private fun createWebView(): WebView {
@@ -17,7 +17,7 @@ internal val MOBILE_WEB_SHELL_NETWORK_API_BLOCKER = """
})();
""".trimIndent()
/** Query document-start-script capability (Chromium 83 floor), not version strings. */
/** Query capability, not version strings; stable WebView has it from Chromium 101. */
internal fun installMobileWebShellNetworkApiBlocker(
webView: WebView,
allowedOrigin: String
@@ -8,6 +8,8 @@ import android.content.res.Configuration
import android.net.Uri
import android.os.Handler
import android.os.Looper
import androidx.webkit.WebViewCompat
import androidx.webkit.WebViewFeature
import expo.modules.kotlin.exception.CodedException
import expo.modules.kotlin.exception.Exceptions
import expo.modules.kotlin.functions.Queues
@@ -68,6 +70,17 @@ class OrcaMobileWebShellModule : Module() {
Uri.fromFile(directory).toString()
}
// Lets isolation-unavailable name the WebView to update.
Function("currentWebViewProvider") {
val context = appContext.reactContext ?: return@Function null
val info = WebViewCompat.getCurrentWebViewPackage(context) ?: return@Function null
val version = info.versionName ?: return@Function null
val name = info.applicationInfo?.loadLabel(context.packageManager)?.toString() ?: info.packageName
val hasShellFeatures = WebViewFeature.isFeatureSupported(WebViewFeature.DOCUMENT_START_SCRIPT) &&
WebViewFeature.isFeatureSupported(WebViewFeature.WEB_MESSAGE_LISTENER)
mapOf("name" to name, "version" to version, "hasShellFeatures" to hasShellFeatures)
}
AsyncFunction("prepareSpareDocument") { directory: String, sessionId: String ->
val activity = appContext.currentActivity ?: return@AsyncFunction false
MobileWebShellSparePool.prepare(activity, directory, sessionId)
@@ -18,7 +18,7 @@ export type OrcaMobileWebShellViewProps = ViewProps & {
generationDirectory: string
/** `[A-Za-z0-9_-]{1,128}`. Scopes the private origin, so every mount must mint a fresh one. */
sessionId: string
// Bridge is off by default with nothing registered. Opt-in on Android below WEB_MESSAGE_LISTENER/Chromium 88 fails isolation-unavailable instead of loading unfenced.
// Bridge is off by default with nothing registered. Opt-in on Android below WEB_MESSAGE_LISTENER/Chromium 83 fails isolation-unavailable instead of loading unfenced.
bridgeEnabled?: boolean
onLoadState?: (event: NativeSyntheticEvent<MobileWebShellLoadStatePayload>) => void
// Raw JSON from window.orcaBridge; native silently rejects other origins/frames/WebViews and envelopes above 640 KiB (MobileWebShellBridge.maxMessageByteCount).
@@ -82,6 +82,23 @@ export function warmUpWebShell(): void {
}
}
export type WebViewProvider = { name: string; version: string; hasShellFeatures: boolean }
// Android only: the WebView provider and whether it has the shell's fences. Null when unknown.
export function currentWebViewProvider(): WebViewProvider | null {
if (Platform.OS !== 'android') {
return null
}
const shell = requireOptionalNativeModule<{
currentWebViewProvider?: () => WebViewProvider | null
}>('OrcaMobileWebShell')
try {
return shell?.currentWebViewProvider?.() ?? null
} catch {
return null
}
}
export {
MOBILE_WEB_SHELL_FAILURE_REASONS,
parseMobileWebShellLoadState,
+38 -26
View File
@@ -16601,7 +16601,7 @@
"id": "notifications-push-registered",
"operation": "notifications.push-registration",
"family": "notifications.push-registration",
"sites": ["mobile/src/notifications/push-registration.ts"],
"sites": ["mobile/src/notifications/mobile-push-registration-operations.ts"],
"schedules": [],
"steps": [
{
@@ -16650,7 +16650,7 @@
"id": "notifications-push-gateway-rejected",
"operation": "notifications.push-registration",
"family": "notifications.push-registration",
"sites": ["mobile/src/notifications/push-registration.ts"],
"sites": ["mobile/src/notifications/mobile-push-registration-operations.ts"],
"schedules": [],
"steps": [
{
@@ -18029,7 +18029,7 @@
"id": "native-chat-write-accepted",
"operation": "nativeChat.terminal-write",
"family": "nativeChat.terminal-write",
"sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"],
"sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"],
"schedules": [],
"steps": [
{
@@ -18065,7 +18065,7 @@
"id": "native-chat-write-rejected",
"operation": "nativeChat.terminal-write",
"family": "nativeChat.terminal-write",
"sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"],
"sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"],
"schedules": [],
"steps": [
{
@@ -18101,7 +18101,7 @@
"id": "native-chat-write-delivery-unknown",
"operation": "nativeChat.terminal-write",
"family": "nativeChat.terminal-write",
"sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"],
"sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"],
"schedules": [],
"steps": [
{
@@ -18133,7 +18133,7 @@
"id": "native-chat-write-clear-line",
"operation": "nativeChat.terminal-write",
"family": "nativeChat.terminal-write",
"sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"],
"sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"],
"schedules": [],
"steps": [
{
@@ -18169,7 +18169,7 @@
"id": "native-chat-write-typed-command",
"operation": "nativeChat.terminal-write",
"family": "nativeChat.terminal-write",
"sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"],
"sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"],
"schedules": [],
"steps": [
{
@@ -18840,7 +18840,9 @@
"id": "structured-launch-unsupported",
"operation": "agentSession.structured-launch",
"family": "agentSession.structured-launch",
"sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"],
"sites": [
"mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts"
],
"schedules": [],
"steps": [
{
@@ -18870,7 +18872,9 @@
"id": "structured-launch-support-refused",
"operation": "agentSession.structured-launch",
"family": "agentSession.structured-launch",
"sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"],
"sites": [
"mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts"
],
"schedules": [],
"steps": [
{
@@ -18900,7 +18904,9 @@
"id": "structured-launch-created",
"operation": "agentSession.structured-launch",
"family": "agentSession.structured-launch",
"sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"],
"sites": [
"mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts"
],
"schedules": [],
"steps": [
{
@@ -18951,7 +18957,9 @@
"id": "structured-launch-definitive-refusal",
"operation": "agentSession.structured-launch",
"family": "agentSession.structured-launch",
"sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"],
"sites": [
"mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts"
],
"schedules": [],
"steps": [
{
@@ -19003,7 +19011,9 @@
"id": "structured-launch-replays-dropped-create",
"operation": "agentSession.structured-launch",
"family": "agentSession.structured-launch",
"sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"],
"sites": [
"mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts"
],
"schedules": [],
"steps": [
{
@@ -19443,7 +19453,7 @@
"id": "native-chat-stop-accepted",
"operation": "session.native-chat-stop",
"family": "session.native-chat-stop",
"sites": ["mobile/src/session/native-chat/use-mobile-native-chat-stop.ts"],
"sites": ["mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts"],
"schedules": [],
"steps": [
{
@@ -19504,7 +19514,7 @@
"id": "native-chat-stop-both-rejected",
"operation": "session.native-chat-stop",
"family": "session.native-chat-stop",
"sites": ["mobile/src/session/native-chat/use-mobile-native-chat-stop.ts"],
"sites": ["mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts"],
"schedules": [],
"steps": [
{
@@ -19562,7 +19572,7 @@
"id": "native-chat-stop-delivery-unknown",
"operation": "session.native-chat-stop",
"family": "session.native-chat-stop",
"sites": ["mobile/src/session/native-chat/use-mobile-native-chat-stop.ts"],
"sites": ["mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts"],
"schedules": [],
"steps": [
{
@@ -19962,7 +19972,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -20039,7 +20049,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -20117,7 +20127,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -20152,7 +20162,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -20188,7 +20198,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -20224,7 +20234,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -20280,7 +20290,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -21035,7 +21045,7 @@
"id": "codex-reset-credit-consumed",
"operation": "accounts.codex-reset-credit",
"family": "components.codex-reset-credit",
"sites": ["mobile/src/components/codex-reset-credit.ts"],
"sites": ["mobile/src/accounts/usage/codex-reset-credit.ts"],
"schedules": [],
"deviceStore": {},
"steps": [
@@ -24889,7 +24899,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -24944,7 +24954,7 @@
"mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts",
"mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts",
"mobile/src/session/native-chat/mobile-native-chat-stale-input.ts"
"mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts"
],
"schedules": [],
"steps": [
@@ -25018,7 +25028,9 @@
"id": "structured-agent-session-created",
"operation": "agentSession.structured-launch",
"family": "agentSession.structured-create",
"sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"],
"sites": [
"mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts"
],
"schedules": [],
"steps": [
{
+6 -5
View File
@@ -3,7 +3,7 @@ import { View, Text, ScrollView, ActivityIndicator } from 'react-native'
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'
import { useFocusEffect, useLocalSearchParams } from 'expo-router'
import { ChevronLeft, RefreshCw, User } from 'lucide-react-native'
import { loadHosts, peekHosts } from '../transport/hosts/host-store'
import { loadHosts, peekHosts } from '../host-catalog/host-store'
import { useForceReconnect, useHostClient } from '../transport/connection/host-client-hooks'
import { useHostConnectionInputs } from '../transport/connection/client-context-connection-metrics'
import { classifyConnection, isConnectionOutage } from '../transport/connection/connection-health'
@@ -16,22 +16,23 @@ import { useMobileTranslation } from '../i18n/use-mobile-translation'
import { styles } from './mobile-accounts-screen-styles'
import { useNow } from '../hooks/use-now'
import { ClaudeIcon, OpenAIIcon } from '../components/AgentIcons'
import './usage/UsageBar'
import {
type ProviderKey,
getActiveProviderRateLimits,
getInactiveProviderUsage,
getOtherUsageProviders,
hasActiveProviderUsage
} from '../components/AccountUsage'
} from './usage/usage-selectors'
import { MobileAgentIcon } from '../components/MobileAgentIcon'
import { getProviderDisplayName } from '../../../src/shared/usage-provider-windows'
import { ProviderUsageWindows } from './ProviderUsageWindows'
import {
getActiveCodexAccountIdForRateLimitTarget,
getCodexResetCreditSummary
} from '../components/codex-reset-credit'
import { CodexResetCreditAction } from '../components/CodexResetCreditAction'
import { useCodexResetCreditAction } from '../components/use-codex-reset-credit-action'
} from './usage/codex-reset-credit'
import { CodexResetCreditAction } from './usage/CodexResetCreditAction'
import { useCodexResetCreditAction } from './usage/use-codex-reset-credit-action'
import { ConfirmModal } from '../components/ConfirmModal'
import { NavBar } from '../components/nav-bar/NavBar'
import { NavBarButton } from '../components/nav-bar/NavBarButton'
+3 -6
View File
@@ -4,12 +4,9 @@ import {
getUsageWindowSections,
type UsageWindowSection
} from '../../../src/shared/usage-provider-windows'
import {
getUsageBarState,
getWindowResetLabel,
UsageBar,
type ProviderRateLimits
} from '../components/AccountUsage'
import { UsageBar } from './usage/UsageBar'
import { getUsageBarState, getWindowResetLabel } from './usage/usage-selectors'
import type { ProviderRateLimits } from './accounts-snapshot'
import type { Translate } from '../i18n/mobile-i18n'
import { useMobileTranslation } from '../i18n/use-mobile-translation'
import { spacing } from '../theme/mobile-theme'
@@ -1,6 +1,6 @@
import { queryOptions, skipToken } from '@tanstack/react-query'
import { AccountsSnapshotSchema, decodeAccountsSnapshot } from '../components/accounts-snapshot'
import type { AccountsSnapshot } from '../components/AccountUsage'
import { AccountsSnapshotSchema, decodeAccountsSnapshot } from './accounts-snapshot'
import type { AccountsSnapshot } from './accounts-snapshot'
import { hostQueryKey, type HostQueryKey } from '../query/host-query-key'
import type { PersistedHostFamily } from '../query/host-query-persistence'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
@@ -1,11 +1,11 @@
import { ActivityIndicator, Pressable, StyleSheet, Text } from 'react-native'
import { RotateCcw } from 'lucide-react-native'
import { useMobileTranslation } from '../i18n/use-mobile-translation'
import { colors, feedback, radii, spacing, typography } from '../theme/mobile-theme'
import { themedStyleSheet } from '../theme/themed-styles'
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
import { useMobileTranslation } from '../../i18n/use-mobile-translation'
import { colors, feedback, radii, spacing, typography } from '../../theme/mobile-theme'
import { themedStyleSheet } from '../../theme/themed-styles'
import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme'
import type { CodexResetCreditSummary } from './codex-reset-credit'
import { ListRow } from './list/ListGroup'
import { ListRow } from '../../components/list/ListGroup'
export function CodexResetCreditAction({
summary,
@@ -1,29 +1,9 @@
import { View, Text, ActivityIndicator, type StyleProp, type ViewStyle } from 'react-native'
import { colors, spacing, typography } from '../theme/mobile-theme'
import { themedStyleSheet } from '../theme/themed-styles'
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
import { colors, spacing, typography } from '../../theme/mobile-theme'
import { themedStyleSheet } from '../../theme/themed-styles'
import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme'
// Re-export pure account-usage-state selectors/types to keep imports stable and tests free of RN.
export type {
RateLimitWindow,
ProviderRateLimits,
InactiveAccountUsage,
ClaudeAccountSummary,
CodexAccountSummary,
AccountsSnapshot,
ProviderKey,
UsageBarState
} from './account-usage-state'
export {
decodeAccountsSnapshot,
getActiveProviderRateLimits,
getInactiveProviderUsage,
getOtherUsageProviders,
getUsageBarState,
getWindowResetLabel,
hasActiveProviderUsage,
hasRenderableUsage
} from './account-usage-state'
import './usage-selectors'
/** A meter's fill: the rounded, clamped percent and its consumption colour, shared by every usage meter. */
export function usageBarFill(
@@ -1,10 +1,7 @@
import { useEffect, useState } from 'react'
import { CODEX_RESET_CREDIT_RUNTIME_CAPABILITY } from '../../../src/shared/account-runtime-capabilities'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import { startRuntimeCapabilityProbe } from '../transport/connection/runtime-capability-probe'
// Use shared capability constant so host/mobile versions cannot silently drift.
export const MOBILE_CODEX_RESET_CREDIT_CAPABILITY = CODEX_RESET_CREDIT_RUNTIME_CAPABILITY
import { CODEX_RESET_CREDIT_RUNTIME_CAPABILITY } from '../../../../src/shared/account-runtime-capabilities'
import type { RpcClient } from '../../transport/rpc/rpc-client-contract'
import { startRuntimeCapabilityProbe } from '../../transport/connection/runtime-capability-probe'
export function useCodexResetCreditCapability(
client: RpcClient | null,
@@ -18,7 +15,7 @@ export function useCodexResetCreditCapability(
return
}
return startRuntimeCapabilityProbe(client, (capabilities) => {
setSupported(capabilities.includes(MOBILE_CODEX_RESET_CREDIT_CAPABILITY))
setSupported(capabilities.includes(CODEX_RESET_CREDIT_RUNTIME_CAPABILITY))
})
}, [client, connected])
@@ -1,5 +1,5 @@
import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/rpc-operation'
import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader'
import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation'
import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader'
import { codexResetCreditReplySchema } from './codex-reset-credit-reply-schema'
// Use require-result-or-throw-message so confirm shows host sentence. Keep payload opaque: call-site decodeResetResult alone checks attempt scope/snapshot.
@@ -1,20 +1,20 @@
import {
buildCodexResetCreditExpectedScope,
type CodexResetCreditExpectedScope
} from '../../../src/shared/codex-reset-credit-scope'
} from '../../../../src/shared/codex-reset-credit-scope'
import {
codexResetCreditConsume,
type MobileCodexResetCreditRpcSender,
type MobileCodexResetCreditSendScope
} from './codex-reset-credit-consume-operations'
import { CodexResetCreditExpectedScopeSchema } from './codex-reset-credit-reply-schema'
import { randomV4Uuid } from '../platform/random-v4-uuid'
import { translate } from '../i18n/mobile-i18n'
import { randomV4Uuid } from '../../platform/random-v4-uuid'
import { translate } from '../../i18n/mobile-i18n'
import {
decodeAccountsSnapshot,
type AccountsSnapshot,
type ProviderRateLimits
} from './accounts-snapshot'
} from '../accounts-snapshot'
export type CodexResetCreditOutcome = 'reset' | 'nothingToReset' | 'noCredit' | 'alreadyRedeemed'
@@ -1,29 +1,13 @@
// Keep shapes aligned with shared types/rate-limit-types without pulling Electron-coupled desktop graph into mobile.
// Pure RN-free selectors stay directly testable; AccountUsage re-exports them with UsageBar.
import { formatResetCountdown } from '../../../src/shared/rate-limit-reset-format'
import { hasUsageData } from '../../../src/shared/usage-provider-windows'
import { formatResetCountdown } from '../../../../src/shared/rate-limit-reset-format'
import { hasUsageData } from '../../../../src/shared/usage-provider-windows'
import {
ProviderRateLimitsSchema,
type AccountsSnapshot,
type InactiveAccountUsage,
type ProviderRateLimits,
type RateLimitWindow
} from './accounts-snapshot'
export {
AccountsSnapshotSchema,
decodeAccountsSnapshot,
ProviderRateLimitsSchema,
RateLimitRuntimeTargetSchema,
type AccountProviderRateLimits,
type AccountsSnapshot,
type ClaudeAccountSummary,
type CodexAccountSummary,
type InactiveAccountUsage,
type ProviderRateLimits,
type RateLimitRuntimeTarget,
type RateLimitWindow
} from './accounts-snapshot'
} from '../accounts-snapshot'
export type ProviderKey = 'claude' | 'codex'

Some files were not shown because too many files have changed in this diff Show More