mirror of
https://github.com/stablyai/orca.git
synced 2026-10-09 08:02:35 +00:00
* fix(session): at startup a local copy never overrides an SSH-owned workspace's own copy Rows the local partition holds for a workspace whose repo the catalog places on an SSH target are residue (pre-#19572 builds, relay reattach). Startup used to keep them whenever they held a tab and skip the SSH partition for that workspace, dropping live tabs, restoring closed ones and erasing agent-resume records on the first save. Boot hydration now drops those local rows (keeping open files and visit recency) so adoption takes the SSH partition whole. * refactor(session): let adoption take a catalog-owned SSH workspace instead of pre-filtering local Replaces the sentinel-partition split with one rule in adoption: the base's terminal tabs no longer keep out the partition the repo catalog places the workspace on (contested ids keep today's behavior). * fix(session): an SSH-owned workspace's records win under shared keys; unsaved local drafts survive Addresses review: a stale local tab sharing an id with the SSH tab kept its layout and resume records (fill-only), and a replaced open-files row dropped local-only unsaved drafts. * fix(session): an SSH copy with no tabs never replaces local tabs Addresses review: an owned workspace the SSH partition holds no tabs for keeps today's rule, so its empty tab row cannot wipe the local tabs. * refactor(session): drop a superseded local copy before adoption; publish path passes owned ids Simplifies the rule: for a workspace the catalog places on this SSH host, uncontested and with host tabs, the base's rows are dropped and the existing gap-fill adoption runs unchanged; unsaved local drafts survive. One resolver says which workspace each scoped entry belongs to, shared by the census, the drop and adoption. The upload path (persistedSessionForTarget) now passes owned ids too, so main cannot publish the stale local copy to the host. * fix(session): match host tab rows by workspace id; a local draft beats a clean host entry Addresses review: a host tab row under a workspace key now counts toward superseding the local copy, and a local unsaved draft for a path the host holds clean is kept instead of dropped. * fix(session): scope catalog-owned ids to the ssh partition the catalog names A workspace homed on one SSH target with leftover rows in another target's partition no longer has the owner's adopted rows removed by the leftover's pass.
126 lines
4.9 KiB
JavaScript
126 lines
4.9 KiB
JavaScript
import { pathToFileURL } from 'node:url'
|
|
|
|
export const DOCKER_SSH_E2E_SPECS = [
|
|
'tests/e2e/local-ssh-browser-routing.spec.ts',
|
|
'tests/e2e/ssh-client-hosted-browser-drop-reconnect.spec.ts',
|
|
'tests/e2e/pty-input-write-queue-ssh.spec.ts',
|
|
'tests/e2e/ssh-ai-vault-session-history.spec.ts',
|
|
'tests/e2e/ssh-codex-display-artifacts-repro.spec.ts',
|
|
'tests/e2e/ssh-cold-activation-restore.spec.ts',
|
|
'tests/e2e/ssh-cold-hydration-gap-tab-seeding.spec.ts',
|
|
'tests/e2e/ssh-emptied-worktree-reactivation.spec.ts',
|
|
'tests/e2e/ssh-docker-five-pane-input-under-flood.spec.ts',
|
|
'tests/e2e/ssh-docker-bulk-open-freeze-repro.spec.ts',
|
|
'tests/e2e/ssh-docker-half-open-link.spec.ts',
|
|
'tests/e2e/ssh-docker-quick-open-large-listing.spec.ts',
|
|
'tests/e2e/ssh-docker-reconnect-pane-restore.spec.ts',
|
|
'tests/e2e/ssh-docker-relay-stall-credential.spec.ts',
|
|
'tests/e2e/ssh-docker-resource-accumulation.spec.ts',
|
|
'tests/e2e/ssh-docker-transport-drop-recovery.spec.ts',
|
|
'tests/e2e/ssh-external-image-preview.spec.ts',
|
|
'tests/e2e/ssh-lost-kill-tab-resurrection.spec.ts',
|
|
'tests/e2e/ssh-pi-compatible-agent-title.spec.ts',
|
|
'tests/e2e/ssh-port-forward-lifecycle.spec.ts',
|
|
'tests/e2e/ssh-reattach-home-partition.spec.ts',
|
|
'tests/e2e/ssh-reconnect-tab-destruction.spec.ts',
|
|
'tests/e2e/ssh-restart-tab-accumulation.spec.ts',
|
|
'tests/e2e/ssh-skill-installation.spec.ts',
|
|
'tests/e2e/ssh-stale-resume-execution-host-scope.spec.ts',
|
|
'tests/e2e/ssh-startup-local-shadow.spec.ts',
|
|
'tests/e2e/ssh-terminal-window-wake-stale-grid-repro.spec.ts',
|
|
'tests/e2e/terminal-inline-images-ssh.spec.ts',
|
|
'tests/e2e/ssh-docker-watcher-isolation.spec.ts',
|
|
'tests/e2e/ssh-terminal-parking.spec.ts',
|
|
'tests/e2e/terminal-retention-budget.spec.ts',
|
|
'tests/e2e/ssh-startup-exec-readiness.spec.ts',
|
|
'tests/e2e/paired-startup-exec-readiness.spec.ts'
|
|
]
|
|
|
|
export const NODE_NETWORK_E2E_SPEC =
|
|
'tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts'
|
|
export const LOCALHOST_SSH_E2E_SPEC = 'tests/e2e/ssh-localhost.spec.ts'
|
|
export const NATIVE_IME_E2E_SPEC = 'tests/e2e/terminal-ibus-hangul-native.spec.ts'
|
|
// Needs the packaged orcad slot, which only its own job builds.
|
|
export const ORCAD_SERVE_MODE_SWITCH_E2E_SPEC = 'tests/e2e/orcad-serve-mode-switch.spec.ts'
|
|
// Needs the orcad template for its host's target, which only its own job builds.
|
|
export const ORCAD_AUTO_CONVERT_E2E_SPEC = 'tests/e2e/ssh-orcad-auto-convert.spec.ts'
|
|
// Windows-only; its own job runs it on a Windows runner.
|
|
export const WINDOWS_MISSING_APPDATA_E2E_SPEC = 'tests/e2e/windows-missing-appdata-startup.spec.ts'
|
|
// Runs in the auto-convert job, which builds the template it needs.
|
|
export const ORCAD_IDLE_EXIT_E2E_SPEC = 'tests/e2e/ssh-orcad-idle-exit.spec.ts'
|
|
export const DEDICATED_E2E_SPECS = [
|
|
...DOCKER_SSH_E2E_SPECS,
|
|
NODE_NETWORK_E2E_SPEC,
|
|
LOCALHOST_SSH_E2E_SPEC,
|
|
NATIVE_IME_E2E_SPEC,
|
|
ORCAD_SERVE_MODE_SWITCH_E2E_SPEC,
|
|
ORCAD_AUTO_CONVERT_E2E_SPEC,
|
|
WINDOWS_MISSING_APPDATA_E2E_SPEC,
|
|
ORCAD_IDLE_EXIT_E2E_SPEC
|
|
]
|
|
const dedicatedSpecs = new Set(DEDICATED_E2E_SPECS)
|
|
const dockerSpecs = new Set(DOCKER_SSH_E2E_SPECS)
|
|
|
|
export function selectGeneralE2eSpecs(specs) {
|
|
return specs.filter((spec) => !dedicatedSpecs.has(spec))
|
|
}
|
|
|
|
function parseSpecs(input) {
|
|
const specs = JSON.parse(input)
|
|
if (!Array.isArray(specs) || specs.some((spec) => typeof spec !== 'string' || !spec)) {
|
|
throw new Error('Expected a JSON array of nonempty E2E spec paths')
|
|
}
|
|
return specs
|
|
}
|
|
|
|
export function classifyE2eJobs(input, sshSourceChanged = 'false') {
|
|
const conservative = { e2e_run_changed: true, e2e_needs_build: true }
|
|
let specs
|
|
try {
|
|
specs = parseSpecs(input)
|
|
} catch {
|
|
return conservative
|
|
}
|
|
// Empty evidence keeps allocations; the consumer still validates its input.
|
|
if (specs.length === 0) {
|
|
return conservative
|
|
}
|
|
const runChanged = selectGeneralE2eSpecs(specs).length > 0
|
|
return {
|
|
e2e_run_changed: runChanged,
|
|
e2e_needs_build:
|
|
runChanged ||
|
|
sshSourceChanged !== 'false' ||
|
|
specs.some(
|
|
(spec) =>
|
|
dockerSpecs.has(spec) ||
|
|
spec === LOCALHOST_SSH_E2E_SPEC ||
|
|
spec === ORCAD_SERVE_MODE_SWITCH_E2E_SPEC ||
|
|
spec === ORCAD_AUTO_CONVERT_E2E_SPEC ||
|
|
spec === ORCAD_IDLE_EXIT_E2E_SPEC
|
|
)
|
|
}
|
|
}
|
|
|
|
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
let input = ''
|
|
process.stdin.setEncoding('utf8')
|
|
for await (const chunk of process.stdin) {
|
|
input += chunk
|
|
}
|
|
if (process.argv.includes('--job-outputs')) {
|
|
for (const [name, value] of Object.entries(
|
|
classifyE2eJobs(input, process.env.E2E_SSH_SOURCE_CHANGED ?? 'false')
|
|
)) {
|
|
process.stdout.write(`${name}=${value}\n`)
|
|
}
|
|
} else {
|
|
for (const spec of selectGeneralE2eSpecs(parseSpecs(input))) {
|
|
if (/[\r\n]/.test(spec)) {
|
|
throw new Error('E2E spec paths cannot contain newlines')
|
|
}
|
|
process.stdout.write(`${spec}\n`)
|
|
}
|
|
}
|
|
}
|