Skip to content

Commit 8e1c5b5

Browse files
committed
sync: replay v1.4.190 into the fork exceptions that discarded it
A whole-file exception wins outright, so upstream's unrelated work under those paths is dropped every sync. Replay v1.4.188..v1.4.190 into each, keeping the fork's own lines: - package.json: take the runtime-electron ratchet in lint, the four new build/smoke scripts, and the @vscode/windows-process-tree optional dep and patch entry. pnpm-lock.yaml resolves to the tag, so --frozen-lockfile fails without the dep. - package-electron-runtime-contract.test.mjs: take the process-tree contract and the loosened rebuild-script assertions, keeping the fork's macOS-only release and golden-matrix expectations. - pr.yml: take the runtime-electron ratchet, the orcad terminal smoke, the new shell-contract and Windows test files, and the patched node-pty rebuild, keeping fork_ownership_guard. - TerminalPane.tsx: take the TerminalProcessExitOverlay feature, which the tag's pty-connection deps already expect. - reliability-gates.jsonc: take the tag outright. The fork copy holds no fork-specific threshold — identical policy block, no fork-only gate, just four missing gates and nine stale evidence sets. - max-lines-baseline.txt: prune the pty.ts entry the module split retired. - STYLEGUIDE.md: name the shadow-floating token main.css now defines.
1 parent 6a79baa commit 8e1c5b5

23 files changed

Lines changed: 1238 additions & 98 deletions

‎.github/workflows/pr.yml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ jobs:
122122
- name: Enforce max-lines ratchet
123123
run: pnpm run check:max-lines-ratchet
124124

125+
- name: Enforce runtime Electron-import ratchet
126+
run: pnpm run check:runtime-electron-ratchet
127+
128+
# Why both: the ratchet proves nothing reachable from the runtime imports electron,
129+
# which is a property of the import graph. This proves the Node artifact it enables
130+
# actually boots, pairs, creates a worktree and round-trips a real PTY.
131+
- name: Boot orcad and round-trip a terminal
132+
run: pnpm run smoke:orcad-terminal
133+
125134
- name: Verify bundled skill guides
126135
run: pnpm run verify:bundled-skill-guides
127136

@@ -433,6 +442,8 @@ jobs:
433442
src/main/daemon/node-pty-fd-leak.test.ts \
434443
src/main/providers/local-pty-shell-ready-zsh-launch-environment.test.ts \
435444
src/main/providers/__tests__/shell-ready-framework-example.test.ts \
445+
src/main/pty/codex-shell-launch-preflight.test.ts \
446+
src/main/pty/omp-shell-wrapper-alias-safety.test.ts \
436447
src/main/pty/omp-shell-wrapper.node-pty.test.ts \
437448
src/main/shell-startup-feature-channel.test.ts \
438449
src/main/terminal-history-fish-session.node-pty.test.ts \
@@ -650,11 +661,30 @@ jobs:
650661
- name: Install dependencies
651662
run: pnpm install --frozen-lockfile
652663

664+
# Why: node-pty prefers its upstream prebuild, which does not contain
665+
# Orca's Windows patch, so the job-object exports would be absent and the
666+
# suite below would test an unpatched binary. build_from_source removes
667+
# the prebuild, and the package's postinstall restores the ConPTY runtime
668+
# files that a bare node-gyp rebuild would miss.
669+
- name: Rebuild node-pty from patched source
670+
env:
671+
npm_config_build_from_source: 'true'
672+
run: pnpm rebuild node-pty
673+
653674
- name: Test Windows-specific boundaries
654675
run: >-
655676
pnpm exec vitest run --config config/vitest.config.ts
656677
src/main/providers/windows-conpty-wide-char-duplication.node-pty.test.ts
657678
src/main/providers/pty-repaint-wide-char-buffer.node-pty.test.ts
679+
src/shared/child-process/windows-command-line.win32.test.ts
680+
src/main/windows/windows-pty-job.win32.test.ts
681+
src/main/windows/windows-host-job.win32.test.ts
682+
src/main/wsl/wsl-runner.test.ts
683+
src/main/wsl/wsl-guest-environment.test.ts
684+
src/main/wsl/wsl-invocation-boundary.test.ts
685+
src/main/wsl/wsl-executable-path.win32.test.ts
686+
src/main/wsl/wsl-w1-w3-contract.test.ts
687+
src/shared/source-scan/source-tree-scan.test.ts
658688
src/main/cli/wsl-cli-powershell-boundary.test.ts
659689
src/main/orca-profiles/profile-index-store.test.ts
660690
src/main/runtime/repo-worktree-admin-fingerprint.test.ts

‎config/max-lines-baseline.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ inline src/main/index.ts
3838
inline src/main/ipc/filesystem-watcher.ts
3939
inline src/main/ipc/filesystem.ts
4040
inline src/main/ipc/github.ts
41-
inline src/main/ipc/pty.ts
4241
inline src/main/ipc/repos.ts
4342
inline src/main/ipc/ssh.ts
4443
inline src/main/ipc/worktree-remote.ts

‎config/reliability-gates.jsonc‎

Lines changed: 1070 additions & 70 deletions
Large diffs are not rendered by default.

‎config/scripts/package-electron-runtime-contract.test.mjs‎

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ describe('Electron runtime package contract', () => {
4242
// Why: pnpm installs optional target architectures on every host; the root
4343
// Windows-only rebuild owns this addon so macOS/Linux never run node-gyp for it.
4444
expect(packageJson.pnpm.onlyBuiltDependencies).not.toContain('windows-native-registry')
45-
expect(rebuildScript).toContain(
46-
"rebuildPlatform === 'win32' ? ['windows-native-registry'] : []"
47-
)
48-
expect(ensureScript).toContain(
49-
"process.platform === 'win32' ? ['windows-native-registry'] : []"
50-
)
45+
// Why assert the guard and the member separately: the list now carries more
46+
// than one addon, so pinning the whole literal only tested its formatting.
47+
expect(rebuildScript).toContain("rebuildPlatform === 'win32'")
48+
expect(rebuildScript).toContain("'windows-native-registry'")
49+
expect(ensureScript).toContain("process.platform === 'win32'")
50+
expect(ensureScript).toContain("'windows-native-registry'")
5151
const packageTargets = {
5252
win32: createPackagedRuntimeNodeModuleResources('win32'),
5353
darwin: createPackagedRuntimeNodeModuleResources('darwin'),
@@ -68,6 +68,47 @@ describe('Electron runtime package contract', () => {
6868
}
6969
})
7070

71+
it('keeps the native Windows process-table addon optional and platform-gated', () => {
72+
const rebuildScript = readFileSync(
73+
join(projectDir, 'config/scripts/rebuild-native-deps.mjs'),
74+
'utf8'
75+
)
76+
const ensureScript = readFileSync(
77+
join(projectDir, 'config/scripts/ensure-native-runtime.mjs'),
78+
'utf8'
79+
)
80+
expect(packageJson.optionalDependencies['@vscode/windows-process-tree']).toBe('0.8.0')
81+
// Why: same rule as the registry addon -- pnpm installs optional deps on
82+
// every host, so macOS/Linux must never run node-gyp for a Windows addon.
83+
expect(packageJson.pnpm.onlyBuiltDependencies).not.toContain('@vscode/windows-process-tree')
84+
expect(rebuildScript).toContain("'@vscode/windows-process-tree'")
85+
expect(ensureScript).toContain("'@vscode/windows-process-tree'")
86+
// Why pin the patch: the upstream binding.gyp requires Spectre-mitigated
87+
// libraries our build agents do not carry, and the enumeration stops after
88+
// 1024 processes -- on a busy host that silently hides the very descendants
89+
// teardown is looking for.
90+
expect(packageJson.pnpm.patchedDependencies['@vscode/windows-process-tree@0.8.0']).toBe(
91+
'config/patches/@vscode__windows-process-tree@0.8.0.patch'
92+
)
93+
const packageTargets = {
94+
win32: createPackagedRuntimeNodeModuleResources('win32'),
95+
darwin: createPackagedRuntimeNodeModuleResources('darwin'),
96+
linux: createPackagedRuntimeNodeModuleResources('linux')
97+
}
98+
expect(packageTargets.win32).toEqual(
99+
expect.arrayContaining([
100+
expect.objectContaining({ to: join('node_modules', '@vscode', 'windows-process-tree') })
101+
])
102+
)
103+
for (const platform of ['darwin', 'linux']) {
104+
expect(packageTargets[platform]).not.toEqual(
105+
expect.arrayContaining([
106+
expect.objectContaining({ to: join('node_modules', '@vscode', 'windows-process-tree') })
107+
])
108+
)
109+
}
110+
})
111+
71112
it('guards package scripts that launch Electron tooling', () => {
72113
const scripts = packageJson.scripts
73114
const guardedScripts = [

‎docs/STYLEGUIDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Orca uses shadows sparingly. Three levels in practice:
128128

129129
1. **Inset hairline** — `border` + `border` token. The default. Almost everything sits at this level.
130130
2. **Subtle lift** — `shadow-xs` + a single-token border. Outline buttons, embedded cards.
131-
3. **Floating** — `0 10px 24px rgba(0, 0, 0, 0.18)`. Popovers, popups that escape the editor surface. Reserved.
131+
3. **Floating** — `shadow-floating` (`0 10px 24px rgba(0, 0, 0, 0.18)`). Popovers, popups that escape the editor surface. Reserved.
132132

133133
Don't add a fourth level. If something needs more emphasis than "floating," you're probably reaching for the focus `ring` instead.
134134

‎package.json‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"main": "./out/main/index.js",
1212
"scripts": {
1313
"format": "oxfmt --write .",
14-
"lint": "oxlint && pnpm run audit:code-quality:native && pnpm run audit:code-quality:type-aware && pnpm run check:reliability-gates && pnpm run check:max-lines-ratchet && pnpm run verify:bundled-skill-guides && pnpm run verify:skill-bundle-manifest && pnpm run verify:localization-catalog && pnpm run verify:localization-extraction && pnpm run verify:localization-coverage",
14+
"lint": "oxlint && pnpm run audit:code-quality:native && pnpm run audit:code-quality:type-aware && pnpm run check:reliability-gates && pnpm run check:max-lines-ratchet && pnpm run check:runtime-electron-ratchet && pnpm run verify:bundled-skill-guides && pnpm run verify:skill-bundle-manifest && pnpm run verify:localization-catalog && pnpm run verify:localization-extraction && pnpm run verify:localization-coverage",
1515
"audit:code-quality": "pnpm run audit:code-quality:native && pnpm run audit:code-quality:type-aware && pnpm run audit:react-doctor",
1616
"audit:code-quality:native": "oxlint --config config/oxlint-code-quality-native-plugins.json src config tests mobile --deny-warnings",
1717
"audit:code-quality:type-aware": "oxlint --type-aware --config config/oxlint-code-quality-type-aware.json src config tests --deny-warnings",
@@ -30,6 +30,10 @@
3030
"test:repro:remote-agent-session": "pnpm run build:cli && pnpm run build:electron-vite && node config/scripts/remote-agent-session-authority-repro.mjs",
3131
"check:reliability-gates": "node config/scripts/check-reliability-gates.mjs",
3232
"check:max-lines-ratchet": "node config/scripts/check-max-lines-ratchet.mjs",
33+
"check:runtime-electron-ratchet": "node config/scripts/check-runtime-electron-ratchet.mjs",
34+
"build:orcad": "node config/scripts/build-orcad.mjs",
35+
"smoke:orcad-terminal": "node config/scripts/ensure-native-runtime.mjs --runtime=node && pnpm run build:cli && pnpm run build:orcad && node config/scripts/runtime-serve-terminal-smoke.mjs --target orcad",
36+
"smoke:serve-terminal": "node config/scripts/runtime-serve-terminal-smoke.mjs",
3337
"check:feature-wall-assets": "node config/scripts/check-feature-wall-assets.mjs",
3438
"generate:bundled-skill-guides": "node config/scripts/generate-bundled-skill-guides.mjs --write",
3539
"verify:bundled-skill-guides": "node config/scripts/generate-bundled-skill-guides.mjs --check",
@@ -263,6 +267,7 @@
263267
"zustand": "^5.0.14"
264268
},
265269
"optionalDependencies": {
270+
"@vscode/windows-process-tree": "0.8.0",
266271
"sherpa-onnx-darwin-arm64": "1.12.37",
267272
"sherpa-onnx-darwin-x64": "1.12.37",
268273
"sherpa-onnx-linux-arm64": "1.12.37",
@@ -314,7 +319,8 @@
314319
"@xterm/addon-webgl@0.20.0-beta.286": "config/patches/@xterm__addon-webgl@0.20.0-beta.286.patch",
315320
"@xterm/addon-serialize@0.15.0-beta.287": "config/patches/@xterm__addon-serialize@0.15.0-beta.287.patch",
316321
"@xterm/xterm@6.1.0-beta.287": "config/patches/@xterm__xterm@6.1.0-beta.287.patch",
317-
"lint-staged@16.4.0": "config/patches/lint-staged@16.4.0.patch"
322+
"lint-staged@16.4.0": "config/patches/lint-staged@16.4.0.patch",
323+
"@vscode/windows-process-tree@0.8.0": "config/patches/@vscode__windows-process-tree@0.8.0.patch"
318324
}
319325
},
320326
"reactDoctor": {

‎src/main/native-chat/fork-native-chat-relay/transcript-tail-reader.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FORK-COPY-OF: src/main/native-chat/transcript-tail-reader.ts
2-
// FORK-COPY-SHA: f32ce859047a85a3ea4f507f633604dfbf596a0e
2+
// FORK-COPY-SHA: 6e4f817101daa18d82824b69243d9079baa9c416
33
import { open, stat } from 'node:fs/promises'
44
import type { AgentType, NativeChatMessage } from '../../../shared/native-chat-types'
55
import {

‎src/main/native-chat/fork-native-chat-relay/transcript-watch-subscription.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FORK-COPY-OF: src/main/native-chat/transcript-watch.ts
2-
// FORK-COPY-SHA: f32ce859047a85a3ea4f507f633604dfbf596a0e
2+
// FORK-COPY-SHA: 6e4f817101daa18d82824b69243d9079baa9c416
33
import { extname } from 'node:path'
44
import type { NativeChatMessage } from '../../../shared/native-chat-types'
55
import {

‎src/renderer/src/components/native-chat/fork-agent-composer/AgentComposerActions.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FORK-COPY-OF: src/renderer/src/components/native-chat/NativeChatComposerActions.tsx
2-
// FORK-COPY-SHA: f32ce859047a85a3ea4f507f633604dfbf596a0e
2+
// FORK-COPY-SHA: 6e4f817101daa18d82824b69243d9079baa9c416
33
import { ArrowUp, Mic, Plus, Square } from 'lucide-react'
44
import { Button } from '@/components/ui/button'
55
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'

‎src/renderer/src/components/native-chat/fork-agent-composer/AgentComposerField.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FORK-COPY-OF: src/renderer/src/components/native-chat/NativeChatComposerField.tsx
2-
// FORK-COPY-SHA: f32ce859047a85a3ea4f507f633604dfbf596a0e
2+
// FORK-COPY-SHA: 6e4f817101daa18d82824b69243d9079baa9c416
33
import type {
44
ClipboardEventHandler,
55
CompositionEventHandler,

0 commit comments

Comments
 (0)