@adhdev/ghostty-vt-node 1.0.82-rc.99 → 1.0.83-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/ghostty-vt-node",
3
- "version": "1.0.82-rc.99",
3
+ "version": "1.0.83-rc.1",
4
4
  "description": "Native Node binding for libghostty-vt",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -13,7 +13,7 @@
13
13
  // (loading alone proves nothing: a stale binary loads fine).
14
14
  // (c) native-ci the native CI build compiles from source instead of copying
15
15
  // the tracked prebuilt, and verifies + stamps what it built;
16
- // the release job checks every prebuilt it is about to publish.
16
+ // the release job checks every committed prebuilt it is about to publish.
17
17
  // (d) host-paths every shipped native file is free of absolute home-directory
18
18
  // paths (ASCII and UTF-16LE), see scripts/host-path-scan.mjs.
19
19
  //
@@ -30,6 +30,12 @@ import { printVerifyReport, verifyPrebuilt } from './verify-prebuilt.mjs';
30
30
 
31
31
  const WORKFLOW_DIR = join(PACKAGE_DIR, '..', '..', '.github', 'workflows');
32
32
 
33
+ function workflowJob(workflow, name) {
34
+ const normalized = workflow.replace(/\r\n/g, '\n');
35
+ const jobs = normalized.match(/^jobs:[ \t]*\n([\s\S]*?)(?=^\w|$(?![\s\S]))/m)?.[1] ?? '';
36
+ return jobs.match(new RegExp(`^ ${name}:[ \\t]*\\n([\\s\\S]*?)(?=^ \\S|$(?![\\s\\S]))`, 'm'))?.[1] ?? '';
37
+ }
38
+
33
39
  function checkExactHostPrebuilt() {
34
40
  const triplet = shippedTripletFor();
35
41
  if (!triplet) {
@@ -71,7 +77,29 @@ export function nativeCiFindings(workflowDir = WORKFLOW_DIR, packageDir = PACKAG
71
77
  findings.push(['native build forces a compile', forced, buildStep ? buildText.trim().replace(/\s+/g, ' ') : 'no "Build ghostty-vt-node" step']);
72
78
  findings.push(['native build verifies the exact staged artifact', /scripts\/verify-prebuilt\.mjs "?dist-prebuilt\//.test(native), 'verify-prebuilt.mjs on dist-prebuilt/<triplet>']);
73
79
  findings.push(['native build stamps a manifest from the built binary', /scripts\/prebuilt-manifest\.mjs write "?dist-prebuilt\//.test(native), 'prebuilt-manifest.mjs write dist-prebuilt/<triplet>']);
74
- findings.push(['release gate checks every downloaded prebuilt', /scripts\/check-prebuilts\.mjs --all-present/.test(ci), 'ci.yml runs check-prebuilts.mjs --all-present']);
80
+ const publish = workflowJob(ci, 'publish');
81
+ const gate = ' run: bash packages/ghostty-vt-node/scripts/check-release-prebuilts.sh';
82
+ const publishLines = publish.split('\n').filter((line) => !/^\s*#/.test(line));
83
+ const publishSteps = publishLines.join('\n').split(/^ - /m).slice(1);
84
+ const downloadSteps = publishSteps.filter((step) => /uses:\s*actions\/download-artifact@/.test(step));
85
+ findings.push(['release gate checks committed prebuilts', publishLines.includes(gate), 'publish runs check-release-prebuilts.sh']);
86
+ const replacesPrebuilts = publishLines.some((line) => line !== gate
87
+ && !/^\s*- name:/.test(line)
88
+ && /prebuilt|\bgh\s+run\s+download\b|\bgh\s+api\b/i.test(line));
89
+ const onlyDistDownload = downloadSteps.length === 1
90
+ && /^ with:\n name: publish-artifacts\n path: packages\s*$/m.test(downloadSteps[0])
91
+ && !/^ (?:pattern|run-id|artifact-ids|github-token|repository):/m.test(downloadSteps[0]);
92
+ const build = workflowJob(ci, 'build');
93
+ const uploadPaths = build.match(/^ path: \|\r?\n((?: {12}\S[^\n]*\n)+)/m)?.[1] ?? '';
94
+ const distPaths = ['session-host-core', 'session-host-daemon', 'mcp-server', 'daemon-core', 'daemon-standalone', 'web-standalone']
95
+ .map((name) => `packages/${name}/dist`).sort().join('\n');
96
+ findings.push(['publish downloads only build dist', !replacesPrebuilts && onlyDistDownload
97
+ && uploadPaths.trim().split(/\n/).map((line) => line.trim()).sort().join('\n') === distPaths,
98
+ 'publish-artifacts is same-run dist only; no Ghostty replacement']);
99
+ const windows = workflowJob(native, 'native-build').split(/^ - runner: /m).slice(1)
100
+ .filter((entry) => /^ platform: win32\s*$/m.test(entry));
101
+ findings.push(['Windows native build uses windows-2022', windows.length === 1 && windows[0].startsWith('windows-2022\n'),
102
+ 'Windows x64 must use the VS 2022 runner']);
75
103
 
76
104
  const plan = spawnSync(process.execPath, [join(packageDir, 'scripts', 'build-or-use-prebuilt.mjs'), '--plan'], {
77
105
  cwd: packageDir,
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ package=packages/ghostty-vt-node
5
+ # Include ignored files because extra ABI directories can otherwise take
6
+ # precedence in the loader and end up in the npm tarball.
7
+ changes=$(git status --porcelain --untracked-files=all --ignored -- "$package/prebuilt")
8
+ if [[ -n "$changes" ]]; then
9
+ echo "Release prebuilts must match the checkout without extra files:" >&2
10
+ printf '%s\n' "$changes" >&2
11
+ exit 1
12
+ fi
13
+
14
+ if [[ "$(uname -s)-$(uname -m)" != Linux-x86_64 ]] || ! awk '
15
+ /^flags[[:space:]]*:/ {
16
+ seen = 1
17
+ for (i = 2; i <= NF; i++) if ($i ~ /^avx512/) avx512 = 1
18
+ }
19
+ END { exit !(seen && !avx512) }
20
+ ' /proc/cpuinfo; then
21
+ echo "Release load verification requires a Linux x64 runner without AVX-512." >&2
22
+ exit 1
23
+ fi
24
+ echo "Linux x64 runner without AVX-512 at $(git rev-parse HEAD)"
25
+
26
+ # Validate all committed bytes before executing any of them.
27
+ node "$package/scripts/prebuilt-manifest.mjs" check --all-present
28
+ node "$package/scripts/ensure-prebuilt-sonames.mjs" --check --load
29
+ node "$package/scripts/check-prebuilts.mjs" --all-present