Files
lucisv/docs/features/editor-platform-vsix/README.md
T
Guoliang ChenandClaude Mythos 5.2 71d13b5fbe
ci / checks (push) Successful in 1m0s
ci / corpus (push) Successful in 18s
ci / linux (push) Successful in 6m4s
release / build-and-publish (push) Successful in 5m31s
Release 0.66.2: every source file names its author
Every tracked file that can carry a comment (880 of them) now opens with
"Author: Guoliang Chen, a Senior Digital Design Engineer" and closes with
"Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love,
luciochen.com", in the file's own comment syntax. No behaviour change: the
diff outside the version bump and changelogs is comment lines only.

- tools/stamp_author.py: writes the lines; idempotent, `--check` lists
  what is missing. Headers go under a shebang and under Markdown front
  matter.
- Left alone: test fixtures, cases and snapshots (byte-exact inputs), JSON
  and JSONL, logs, images, lockfiles, docs/site/dist (regenerated) and the
  LICENSE files (already carry the copyright line).
- tools/linux_check.sh: --help reads its header from line 3, now that the
  author line sits under the shebang.
- tools/gates.sh green on this tree: 5 545 tests, corpus 814/6 as before.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-24 12:11:09 -08:00

790 lines
61 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- Author: Guoliang Chen, a Senior Digital Design Engineer -->
# editor-platform-vsix
## Goal
Installing the VS Code extension has always been half an install: the `.vsix`
is platform-independent JavaScript and the *server it spawns* is a binary the
user has to build or download and put on `PATH` first. This round closes that
gap the way rust-analyzer and ruff close it — **platform-specific `.vsix`
packages that carry the binaries inside them**. Five packages, one per
platform we cross-build for; VS Code picks the one matching the machine by the
`--target` stamped into the package, downloads only that one, and the
extension spawns the server out of its own install directory. The old
platform-independent package stays, unchanged in behaviour, as the universal
fallback for a platform we do not build (and for anyone who prefers their own
binary on `PATH`).
## Assumptions
- **`vsce`'s target names and rustc's triples are two different vocabularies**,
and the mapping between them is a hand-written table. `vsce` validates
`--target` against its own fixed list; nothing derives one name from the
other.
| vsce target | rust triple | why that triple |
|---|---|---|
| `darwin-arm64` | `aarch64-apple-darwin` | the host build |
| `darwin-x64` | `x86_64-apple-darwin` | Intel Macs (also runs under Rosetta) |
| `linux-x64` | `x86_64-unknown-linux-musl` | static, so it runs on every distro |
| `linux-arm64` | `aarch64-unknown-linux-musl` | same, for ARM servers/Pi/Asahi |
| `win32-x64` | `x86_64-pc-windows-gnu` | `.exe`, DLLs Windows 10+ ships |
- **Linux gets the musl build, not the glibc one.** `x86_64-unknown-linux-gnu`
is still built and shipped as a loose artifact (it exists for shops that
require a native glibc link — see `tools/RELEASING.md`), but the *extension*
embeds musl: a statically linked binary runs on any distro at any glibc
vintage, which is exactly the property an extension installed by a stranger
needs. There is no second `linux-x64` package to choose between.
- **Alpine is an accepted gap in the *targeted* packages.** `vsce` has separate
`alpine-x64` / `alpine-arm64` targets and VS Code running on Alpine looks for
*those*, not for `linux-x64` — so an Alpine user gets no platform package.
Building two more `--target`ed packages with identical contents to satisfy a
name is not worth the release-matrix growth today; if someone asks, it is a
two-line change (`alpine-x64` ← the same musl triple). Since 2026-08-27 the
all-platforms package covers that user anyway (see below): it is target-less,
so Alpine is offered it, and Node's `process.platform` there is plain
`'linux'`, which is the directory our static-musl binaries sit in.
- **VSIX extraction does not preserve the executable bit.** This is why
`extension.js` chmods what it is about to spawn rather than trusting the
package's file modes — the same thing rust-analyzer's extension does, for the
same reason. `release.sh` still `chmod +x`es the staged binaries before
packaging, so the mode inside the zip is right; the client-side chmod is the
belt to that suspenders.
- **No version handshake.** The bundled server is the one built from the same
tree as the extension, so extension and server always match by construction.
A user who points `lucisv.serverPath` at something else takes that risk, as
before.
- **The binaries are the same ones `dist/` ships.** `release.sh` stages them
*out of* `dist/`, so the file a user gets from the release page and the file
inside the `.vsix` are byte-identical (and the `.vsix` copies are covered
transitively by `SHA256SUMS`' entry for the package).
## Handshakes
**Consumed from `editor-packaging`** — the spawn contract, unchanged: binary
name `lucisv-server`, no arguments, LSP on stdin/stdout. The only thing this
feature changes is *which path* is spawned, never how.
**Consumed from `tools/release.sh`** — the `dist/lucisv[-server]-<version>-<triple>`
naming. The staging step reads those exact names; renaming an artifact breaks
packaging loudly (a missing `cp` source), not silently.
**Promised to `extension.js`** — the `bin/` layout contract, three shapes and
no fourth:
| package | `bin/` holds |
|---|---|
| universal `lucisv-<v>.vsix` | **nothing** — no `bin/` directory at all |
| a platform `lucisv-<v>-<target>.vsix` | exactly `lucisv` and `lucisv-server` (`.exe` on Windows), flat |
| the all-platforms `lucisv-<v>-all.vsix` | exactly ten files, `<platform>-<arch>/lucisv{,-server}` for the five platforms |
Names are always plain — no version, no triple. `release.sh` asserts all three
shapes with `unzip -Z1` after every package it builds, so "the extension found a
stale binary from the previous target" cannot ship. The all-platforms
directory names are literally the `${process.platform}-${process.arch}` strings
`extension.js` builds at runtime; that they also happen to equal vsce's target
names is a convenience, not a dependency (nothing passes `--target` for that
package).
**Promised to `tools/audit_artifacts.sh`** — every loose binary in `dist/` is
still named `lucisv[-server]-<version>-<triple>`; the `.vsix` names all end in
`.vsix` — `lucisv-<v>-all.vsix` included — and are skipped by the audit's
existing case arm before its "unrecognized artifact name" arm can see them.
**Promised to `tools/prune_release_assets.sh`** — a `--cross` run produces
exactly seven `.vsix` names, and those are the names the prune script checks
one by one: `lucisv-<v>.vsix`, the five `lucisv-<v>-<vsce-target>.vsix`, and
`lucisv-<v>-all.vsix`. Adding or renaming a package means editing that script's
suffix list too, or the release fails naming the file it could not find.
**Requested of `editor-marketplace-page`** — that round rewrote
`editors/vscode/README.md` end-to-end for a marketplace audience while this one
was running, and any further rewrite of it must keep two things: its install
table naming **seven** packages, not six (the five platform ones, `all`, and the
universal fallback), and a bundled-binaries sentence covering both layouts —
`bin/lucisv-server` in a platform package,
`bin/<platform>-<arch>/lucisv-server` in the all-platforms one. Both were
re-applied additively onto their rewrite; see the work log.
**Requested of other modules** — none.
## Resolution order in the extension
`extension.js` picks the server command from three candidates, most specific
first:
1. **A `lucisv.serverPath` the user actually set.** Detected with
`inspect('serverPath')`, not `get()`: `get()` cannot tell a user's setting
from the manifest's own `"default": "lucisv-server"`, and that default would
otherwise shadow the bundled binary for *everyone*. Any of
`globalValue`, `workspaceValue`, `workspaceFolderValue` or their three
language-scoped variants counts as "the user set it"; `defaultValue` and
`defaultLanguageValue` do not, because those are contributed defaults, not
user intent. Most specific wins, matching VS Code's own `get()` precedence.
2. **The bundled binary**, whichever of two layouts this package uses —
`<extension>/bin/lucisv-server`(`.exe`) first, then
`<extension>/bin/<platform>-<arch>/lucisv-server`(`.exe`). A file existing is
the whole runtime test for "which kind of package am I" — no build-time flag,
no manifest field. Both misses mean no bundled binary.
3. **The bare name `lucisv-server`**, looked up on `PATH`. What the universal
package has always done, and what a `cargo build` + `PATH` install still
does.
The CLI (`bin/lucisv`) is chmod'ed alongside the server even though nothing in
the extension spawns it: it is shipped so a user who installed the extension
already has the command-line tool, and a non-executable file would make that
claim false.
## The all-platforms package
`lucisv-<version>-all.vsix` is one package carrying **all five platforms'
binary pairs**, sorted into directories and chosen between at runtime:
```
bin/
darwin-arm64/lucisv, lucisv-server
darwin-x64/lucisv, lucisv-server
linux-x64/lucisv, lucisv-server (static musl)
linux-arm64/lucisv, lucisv-server (static musl)
win32-x64/lucisv.exe, lucisv-server.exe
```
**The directory names are `${process.platform}-${process.arch}`**, not vsce
target names — `extension.js` concatenates those two Node values and looks the
result up. That the five strings happen to be spelled the same way vsce spells
its targets is a coincidence worth having (one vocabulary in the release script
instead of two) and nothing more: this package is built **without** `--target`,
so vsce's names never enter the picture. Picking Node's own vocabulary is what
makes the lookup a two-line function with no table in it, and what makes a
platform we do not ship fail the obvious way — nothing on disk, fall through to
`PATH`, exactly like the universal package.
Why it exists, given five perfectly good targeted packages:
- **Alpine, and anything else vsce names separately.** VS Code on Alpine asks
the marketplace for `alpine-x64`, not `linux-x64`, so it is never offered our
Linux package — but its `process.platform` is plain `'linux'` (Node does not
distinguish libc), so it walks straight into `bin/linux-x64/`, and the binary
there is statically linked musl, which is precisely what Alpine wants. The
gap the targeted matrix leaves open is closed by not participating in the
targeting at all.
- **One file to mirror.** An internal file share, a locked-down machine, an
offline lab: one `.vsix` that works on whatever the person on the other end
turns out to be running beats a table of five and a question.
- **Unknown or mixed fleets**, where whoever hands out the package does not know
the architecture in advance.
The trade-off is size, and it is not small: every user downloads every
platform's binaries — 13.0 MB against 3.0 MB for a platform package (and 0.75 MB
for the universal one; measured on 0.10.1). That is why it is a seventh option
rather than the only one; when the platform is known, the platform package is
still the right answer.
**Built only with `--cross`**, because it needs all five pairs to exist. An
ordinary `tools/release.sh` produces six of the seven names and no `-all` one.
## What gets built, and when
| | `release.sh` | `release.sh --cross` |
|---|---|---|
| universal `lucisv-<v>.vsix` | yes | yes |
| `darwin-arm64` (host) | yes | yes |
| the other four | no | yes |
| `lucisv-<v>-all.vsix` | no | yes |
Without `--cross` there are no cross binaries to embed, so only the host
package can be built — building it anyway (rather than only the universal one)
keeps the packaging path exercised on every ordinary release run, including the
embedded-server smoke test. The CI release workflow runs `--cross`, so releases
always carry all seven.
## Status / TODO
- [x] `rustup target add --toolchain stable aarch64-unknown-linux-musl` on the
build Mac, and the line recorded in `tools/RELEASING.md`'s one-time setup.
- [x] `tools/release.sh`: `aarch64-unknown-linux-musl` in the `--cross` set,
same rust-lld linker and `DYLD_FALLBACK_LIBRARY_PATH` as the x86-64 musl
build; its two binaries land in `dist/` and in `SHA256SUMS`.
- [x] `editors/vscode/extension.js`: three-step server resolution, `inspect()`
for user intent, chmod of both bundled binaries.
- [x] `editors/vscode/package.json`: `lucisv.serverPath` description mentions
the bundled default.
- [x] `tools/release.sh`: stage `bin/`, package per target, remove `bin/`,
with an `EXIT` trap so a failure cannot leave binaries in the tree.
- [x] `tools/release.sh`: `unzip -Z1` content assertions for every package, and
an LSP smoke test of the server unzipped out of the host package.
- [x] `tools/audit_artifacts.sh`: `aarch64-unknown-linux-musl` arm.
- [x] `editors/vscode/.gitignore`: `bin/`.
- [x] Docs: this file, `tools/RELEASING.md`, `editors/vscode/README.md`.
- [x] **The all-platforms package** (2026-08-27): `extension.js`'s layered
`bin/` lookup, `release.sh`'s `package_all_vsix` under `--cross`, the
ten-entry content assertion, and a second embedded-server smoke test
driven out of `bin/<host-target>/` inside that package.
- [x] `tools/prune_release_assets.sh`: the seven-package check moved out of
`release.yml`'s inline step into a tools/ script, checked by name.
- [x] Docs for the all package: this file, `tools/RELEASING.md`, the top-level
`README.md`, `docs/features/ci-release/README.md`, and
`editors/vscode/README.md` (re-applied onto the concurrent
`editor-marketplace-page` rewrite — see the work log).
- [ ] **Not done, and not doable here:** none of the seven packages has been
*installed into a real VS Code*. `require('vscode')` resolves only in the
extension host, so the resolution order above is proven by reading it,
by a stubbed-`context` harness over a fake directory tree, and by the
packaging assertions — not by an editor picking the right package off a
marketplace. The Linux and Windows packages have additionally never
been *executed* anywhere — same standing limitation the loose binaries
have had since `--cross` existed. The Alpine claim in particular is
reasoned from Node's documented `process.platform` values, not observed
on an Alpine machine.
- [ ] **Not done, deliberate:** `alpine-x64` / `alpine-arm64` packages (see
Assumptions), and a `linux-x64` glibc variant.
## Work log
### 2026-08-27 — dev agent
- **Toolchain.** `rustup target add --toolchain stable
aarch64-unknown-linux-musl` ran clean (`rust-std` component only, no linker
needed — `rust-lld` links it, exactly like the x86-64 musl target).
`rustup target list --installed` now shows six targets. The line is in
`tools/RELEASING.md`'s one-time-setup block.
- **`release.sh` structure.** The new `aarch64-unknown-linux-musl` build sits
next to the x86-64 musl one with the identical env pair
(`DYLD_FALLBACK_LIBRARY_PATH="$tc/lib"` +
`CARGO_TARGET_..._LINKER=rust-lld`); the copy loop just gained the triple.
Packaging became three pieces: `vsce_target_for` (the triple→vsce-target
table), `package_vsix` (stage `bin/`, package, remove `bin/`), and
`expect_vsix_bins` (assert what a package carries). `bin_dir` is removed by an
`EXIT` trap set before the first build, so an interrupted or failed run cannot
leave a stale binary where the next package — or a developer's `git status` —
would pick it up.
- **The universal package is packaged first and with `bin/` provably absent**
(`rm -rf` immediately before, `expect_vsix_bins` with no expected entries
immediately after). That ordering matters: the universal package is the one
that must never accidentally carry a platform's binaries.
- **The embedded smoke test is a real round trip.** The host package is
unzipped into `target/vsix-check/` (gitignored, outside the session
scratchpad), both binaries are asserted present, the server is chmod'ed and
driven through the same `smoke.js` LSP session the loose binary gets, and the
directory is removed. So the claim "installing the extension gives you a
working server" is tested against a file that has actually been through the
zip.
- **`inspect()` and not `get()`** is the one non-obvious line in
`extension.js`, and the reason is in the file: `get()` returns
`"lucisv-server"` for a user who has never touched the setting, because that
is the manifest default — so a `get()`-based check would make the bundled
binary unreachable for every user who did not explicitly override it. The
scope list is most-specific-first and excludes `defaultValue` /
`defaultLanguageValue`.
- **The objdump question was answered by running it, not guessed.** This
machine's `x86_64-unknown-linux-gnu-objdump` *does* parse an aarch64 ELF —
`-p` prints `file format elf64-little` and the full program header table, and
finds zero `NEEDED` entries in our static binary — so the new arm keeps the
same `NEEDED` check the x86-64 musl arm uses. It also asserts `file -b`'s own
`ARM aarch64` and `statically linked`, for two reasons the comment states:
objdump's `elf64-little` does not name the architecture at all (so `file` is
the only thing checking we did not ship an x86-64 binary under an aarch64
name), and a future binutils that stopped parsing aarch64 would make the
`NEEDED` grep pass *by finding nothing* — the exact quiet failure the audit
exists to prevent.
- **`x86_64-unknown-linux-gnu` gets no `.vsix`.** It is still built and still
audited; `linux-x64` is the musl build because a static binary is the right
thing to hand a stranger. Recorded in Assumptions so nobody re-litigates it
silently.
- **The no-`--cross` path was run too**, into a throwaway `-o` directory, to
confirm the decision in "What gets built": host pair, universal package,
`darwin-arm64` package, embedded smoke test, checksums, exit 0.
- **`.vscodeignore` was left alone** and confirmed not to exclude `bin/` (it
lists `smoke.js`, `.vscode/**`, `.gitignore` and nothing else). `bin/` is in
`editors/vscode/.gitignore` instead, as a second line of defence behind the
`EXIT` trap.
- Did not bump any version, did not `git commit`/`git push`, did not touch
`crates/`. `TODO.md` was read; the two items that touch editor packaging
(§6 "Editor packaging", §6 "Release prep") are already `[x]` and neither
mentions platform-specific packages, so nothing was checked off.
**Validation run on this machine (from the real repo path, never the
scratchpad — `vsce` collects zero files under the scratchpad's UUID segment,
`docs/features/editor-packaging` QA Finding 2):**
| Check | Result |
|---|---|
| `bash -n tools/release.sh tools/audit_artifacts.sh` | clean |
| `node --check editors/vscode/extension.js` | clean |
| `python3 -c json.load` on `editors/vscode/package.json` | valid |
| `cargo fmt --check` | clean |
| `cargo clippy --all-targets` | clean, no new warnings |
| `cargo test -p lucisv_server` | **1015 unit + 50 e2e + 3 grammar green**, 5 ignored, 0 failed |
| `tools/release.sh --cross` | exit 0 — 18 artifacts + `SHA256SUMS` (table below) |
| `tools/release.sh -o target/relcheck-dist` (no `--cross`) | exit 0 — host pair, universal `.vsix`, `darwin-arm64` `.vsix`, `SHA256SUMS` |
| `tools/audit_artifacts.sh dist` | **12 binaries audited, exit 0** |
| embedded-server smoke (host `.vsix`, unzipped to `target/vsix-check/`) | `smoke: OK`, 10 messages |
| `shasum -a 256 -c SHA256SUMS` in `dist/` | 18/18 OK |
**Artifacts from `tools/release.sh --cross` (lucisv 0.10.0):**
| `.vsix` | size | `extension/bin/` |
|---|---|---|
| `lucisv-0.10.0.vsix` (universal) | 487,837 | *(nothing — `unzip -Z1` reports "filename not matched")* |
| `lucisv-0.10.0-darwin-arm64.vsix` | 2,721,294 | `lucisv-server`, `lucisv` |
| `lucisv-0.10.0-darwin-x64.vsix` | 2,991,683 | `lucisv-server`, `lucisv` |
| `lucisv-0.10.0-linux-x64.vsix` | 3,121,350 | `lucisv-server`, `lucisv` |
| `lucisv-0.10.0-linux-arm64.vsix` | 2,970,545 | `lucisv-server`, `lucisv` |
| `lucisv-0.10.0-win32-x64.vsix` | 2,906,955 | `lucisv-server.exe`, `lucisv.exe` |
Plus the twelve loose binaries, now including
`lucisv-0.10.0-aarch64-unknown-linux-musl` (1,930,768) and
`lucisv-server-0.10.0-aarch64-unknown-linux-musl` (4,022,088). `file -b` on the
latter: `ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically
linked, not stripped`.
Three things were checked beyond "it built":
- **The `--target` really is stamped in.** `extension.vsixmanifest` carries
`TargetPlatform="darwin-arm64"` / `"linux-arm64"` / `"win32-x64"` in the
respective packages, and the universal one contains no `TargetPlatform`
attribute at all — that attribute is how VS Code picks a package.
- **The executable bit survives packaging.** `unzip -Z` reports `-rwxr-xr-x`
for both entries inside the packages. The client-side chmod stays anyway,
because it is *VS Code's extraction*, not the zip, that drops the bit.
- **The `EXIT` trap was negative-controlled**, not assumed: with an `npx` stub
on `PATH` that fails whenever it sees `--target`, `release.sh` staged
`editors/vscode/bin/`, failed the platform package, and exited — and
`editors/vscode/bin/` was gone afterwards, with `git status --short
editors/vscode` showing only the intended edits. A packaging failure cannot
leave a binary in the tree.
**Not run, and why:** no package was installed into VS Code (the extension host
is the only place `require('vscode')` resolves — unchanged limitation since
2026-08-19), so the resolution order in `extension.js` is proven by reading and
by the packaging assertions, not by an editor. The Linux and Windows binaries
were not executed anywhere (no such machine in the release loop; `file`- and
`objdump`-audited instead), which means the four non-host packages have never
had their embedded server spawned. The marketplace's own `--target` selection
was likewise not exercised: nothing here is published, so the check that
`TargetPlatform` is present is as far as it goes.
### 2026-08-27 — lead (post-QA): chmod both bundled binaries unconditionally
QA's Finding 1: with a user-set `lucisv.serverPath`, the `||` chain in
`activate` short-circuited past `bundledBinary(context, 'lucisv-server')`, so
only the CLI got chmod'ed and `editors/vscode/README.md`'s "makes both
executable" was one clause too strong. Fixed at the code, not the wording:
the bundled server is now resolved into a `bundledServer` local before the
`||` chain, so both binaries are made executable on every activation and the
README sentence is exactly true. Two lines plus a comment; `node --check`
clean. Lead-authored directly — the dev/QA loop would add latency, not safety
(precedent: the 0.4.2 entry in docs/features/editor-packaging).
### 2026-08-27 — lead (follow-up): the release publishes the packages only
Owner decision, implemented in the ci-release feature (see
docs/features/ci-release/README.md, 2026-08-27 work log entry): the release
page now carries the six `.vsix` packages and `SHA256SUMS` only. The loose
per-triple binaries are still built and audited — the packages are made from
them — but no longer attached; standalone binaries are build-your-own.
Nothing in this feature's scripts changed: `release.sh` still produces the
full `dist/`, and the pruning lives in `release.yml` after the audit.
### 2026-08-27 — dev agent (round 2): the all-platforms package
Owner request: a seventh package carrying every platform's binaries, chosen at
runtime — plus a consolidation of the CI release flow. Four code files.
- **`extension.js`: `bundledBinary` became a two-candidate lookup**, flat first,
`bin/<platform>-<arch>/` second, `undefined` if both miss. It is a `.find()`
over two `asAbsolutePath` results and nothing else: no package-kind flag, no
manifest field, no table of platform names. Everything downstream — the
`.exe` suffix, the chmod-in-`try`/`catch`, the
`userServerPath() || bundledServer || 'lucisv-server'` order, the two calls in
`activate` — is untouched, so the fat layout is covered for the CLI and the
server at once. The doc comment now describes both layouts and states the
fall-through for a platform we ship nothing for (`win32-arm64`): nothing on
disk in either layout, so `PATH`, exactly like the universal package.
- **Node's vocabulary, not vsce's.** The directory names are
`${process.platform}-${process.arch}` because that is the string the extension
can build with no lookup table. That the five values happen to be spelled the
way vsce spells its targets is why `release.sh` can reuse `vsce_target_for`
for the staging directory names — a convenience recorded in Assumptions, not
a dependency: the package is built with **no** `--target`, so vsce's naming
never enters it. Verified in the artifact: `extension.vsixmanifest` in
`lucisv-0.10.1-all.vsix` carries no `TargetPlatform` attribute at all, same as
the universal package.
- **`release.sh`: `package_all_vsix`**, called only under `--cross`, and given
`$vsix_triples` — the same list the per-platform loop just used — rather than
a second copy of the five triples. It stages each pair into
`bin/<vsce-target>/`, `chmod +x`es them, packages with no `--target`, removes
the staging dir, and asserts the contents. It builds its expected-entry list
in the same loop that stages, so the assertion cannot drift from what was
staged.
- **`expect_vsix_bins` needed no change, which I checked rather than assumed.**
Info-ZIP's `*` matches `/` (unlike a shell glob), so `extension/bin/*` lists
nested paths — confirmed on a hand-built zip with both a flat and a nested
entry before touching `release.sh`. The one wrinkle that could have bitten:
the same test showed Info-ZIP *also* returns directory entries
(`extension/bin/`, `extension/bin/darwin-arm64/`), which would have broken an
exact-set comparison — but vsce writes **no** directory entries at all
(`unzip -Z1 … | grep -c '/$'` = 0 on a real package), so the ten filenames
come back and nothing else. Both facts are now in the function's comment.
- **The embedded smoke test was made a function and called twice**, once per
layout: the host platform package out of `extension/bin/`, the all-platforms
package out of `extension/bin/darwin-arm64/`. That is the difference that
matters — a fat package whose binaries were staged one directory too deep
would package, assert fine, and then fail to spawn for every user; driving a
real LSP session out of the nested path is what rules that out.
- **`tools/prune_release_assets.sh`** is new and is the CI-flow half of the
round; it is logged in full in `docs/features/ci-release/README.md`. The
handshake it creates with this feature — the seven exact package names — is
now in Handshakes above.
- Did not bump any version, did not `git commit`/`git push`, did not touch
`CHANGELOG.md` or `crates/`. `TODO.md` was read again; §6's editor-packaging
and release-prep items are still `[x]` and still say nothing about the package
matrix, so nothing was checked off.
**Validation, all from the real repo path (never the scratchpad — `vsce`
collects zero files there, `docs/features/editor-packaging` QA Finding 2):**
| Check | Result |
|---|---|
| `bash -n` on `release.sh`, `audit_artifacts.sh`, `prune_release_assets.sh` | clean |
| `node --check editors/vscode/extension.js` | clean |
| `cargo fmt --check` | clean |
| `cargo clippy --all-targets` | clean, 0 warnings |
| `cargo test -p lucisv_server` | **1015 unit + 50 e2e + 3 grammar**, 5 ignored, 0 failed |
| `tools/release.sh --cross` | exit 0 — 12 loose binaries + **7** `.vsix` + `SHA256SUMS`, every `bin/ contents ok` |
| `tools/release.sh -o target/relcheck-dist` (no `--cross`) | exit 0 — host pair, universal `.vsix`, `darwin-arm64` `.vsix`, `SHA256SUMS`, **no `-all.vsix`**, one embedded smoke test rather than two |
| `tools/audit_artifacts.sh dist` | **12 binaries audited, exit 0** — the 7 `.vsix`, `-all` included, all skipped by the `*.vsix` arm before the "unrecognized artifact name" arm sees them |
| `shasum -a 256 -c SHA256SUMS` in `dist/` | 19/19 OK |
| embedded smoke, host platform package (`extension/bin/`) | `smoke: OK`, 10 messages |
| embedded smoke, all package (`extension/bin/darwin-arm64/`) | `smoke: OK`, 10 messages |
**`lucisv-0.10.1-all.vsix` — what is actually in it**, checked rather than
assumed:
- **Exactly ten `extension/bin/` entries**, no more: `darwin-arm64/`,
`darwin-x64/`, `linux-x64/`, `linux-arm64/` each with `lucisv` and
`lucisv-server`, `win32-x64/` with the two `.exe`s. Mode `-rwxr-xr-x` inside
the zip for all ten.
- **All ten are byte-identical to the audited loose binaries.** Compared by
SHA-256 of `unzip -p` output against `dist/lucisv[-server]-0.10.1-<triple>`
for all five triples, both binaries each — ten of ten match. So the audit that
gates the release covers what is inside this package too, transitively, the
same way it does for the platform packages.
- **No `TargetPlatform`** in its `extension.vsixmanifest` (checked), which is
what makes VS Code offer it to any machine — Alpine included.
- Size 13,025,877 bytes against 2,987,672 for `darwin-arm64` and 754,239 for the
universal package. The "13.0 MB vs 3.0 MB" in the section above is that
measurement, not an estimate.
- The universal package still carries **no** `bin/` — `unzip -Z1
lucisv-0.10.1.vsix 'extension/bin/*'` answers "filename not matched". It is
asserted at build time by `expect_vsix_bins` with an empty expected set, and
it is packaged before anything is staged, so nothing built later can reach
back into an already-written zip.
**The extension's layered lookup was exercised, not only read.** The extension
host is still the only place `require('vscode')` resolves, so I wrote a harness
that stubs `vscode` and `vscode-languageclient/node` through
`Module._load`, hands `activate()` a `context` whose `asAbsolutePath` points at
a fake extension directory, and reads back the `command` the `LanguageClient`
was constructed with. Thirteen assertions, all passing:
| Fake package | Resolved to |
|---|---|
| no `bin/` at all | `lucisv-server` (PATH) |
| flat `bin/` | `bin/lucisv-server` |
| `bin/darwin-arm64/` | `bin/darwin-arm64/lucisv-server` |
| both layouts present | the **flat** one — most specific first |
| only a foreign platform's directory | `lucisv-server` (PATH) |
| `bin/darwin-arm64/` + a user `serverPath` | the user's path |
plus: both binaries come out `0755` in the flat and the nested layouts **and**
when a user setting won the spawn (the lead's unconditional-chmod fix from round
1 still holds in the nested layout), and a directory for another platform is
left at `0644` — we do not chmod what we did not choose. This proves the file
resolution and the chmod, and nothing about how VS Code behaves around it.
**The `EXIT` trap was negative-controlled against the new nested staging**, not
assumed to still work: a fake `npx` on `PATH` proxying to the real one except
when an argument ends in `-all.vsix`, where it exits 23. `tools/release.sh -o
target/relfail --cross` built the universal package and all five platform
packages (each asserted `bin/ contents ok`), then died on the all package with
exit 23 — and `editors/vscode/bin/` was gone afterwards, five subdirectories and
ten binaries included, with `git status --short editors/vscode` showing only
this round's edits. A failure in the fat-package path cannot leave 13 MB of
binaries in the working tree.
**Not verified, honestly:**
- **No package was installed into a real VS Code**, so which package the
marketplace/`code --install-extension` hands a given machine, and whether the
extension host's `context.asAbsolutePath` behaves as the harness stubs it, are
still unproven here. Unchanged limitation since 2026-08-19.
- **The Alpine claim is reasoning, not an observation.** It rests on two facts I
did not test on an Alpine box: Node reports `process.platform === 'linux'`
there (it does not distinguish libc), and VS Code on Alpine requests
`alpine-x64`/`alpine-arm64` from a marketplace. Both are documented behaviour,
and the second one is moot for a package with no `TargetPlatform` — but nobody
here has watched an Alpine VS Code start our server.
- **The Linux and Windows binaries inside the fat package have never been
executed**, same as the loose ones and the platform packages. Only the
`darwin-arm64` directory's server has been spawned.
- **`x86_64-unknown-linux-gnu` is still in no package**, fat one included: the
fat package carries the same five platforms the targeted packages do.
- **A concurrent round was editing the tree.** `editors/vscode/package.json` and
`editors/vscode/images/` were being changed by another agent (marketplace
metadata, `docs/features/editor-marketplace-page/`) while these runs happened;
one intermediate run of mine failed on *their* half-landed `"icon"` field
before `images/icon.png` existed, which is a race between two agents and not a
finding about either change. The numbers quoted above are from a final
`--cross` run made after that settled, so they describe the tree as it stands.
I did not touch either of their files.
**`editors/vscode/README.md` was written twice, and the second version is the
one that survives — lead, this file has two rounds in it.** I first updated the
old developer-facing README as this round asked: §0 gained the all-platforms
package, the bundled-binary sentence covered both layouts, the
`lucisv.serverPath` settings row and the Troubleshooting entry stopped naming
only the universal package. The `editor-marketplace-page` round then **deleted
that file** mid-round and replaced it, 70 seconds later, with a complete
marketplace-audience rewrite — taking those edits with it. I did not restore my
version over theirs; theirs is the better file for its audience and clobbering a
finished rewrite to recover four paragraphs would be the wrong trade. Instead I
re-applied the *requirement* onto their structure, additively and in their
voice: an `all` row in their install table, a paragraph on when to pick it (with
the Alpine reason and the 13 MB-vs-3 MB cost) and where the binaries sit in each
layout, and one clause in their "Release 0.10.1 highlights" list. Their
`lucisv.serverPath` row already reads "bundled" and their Troubleshooting entry
already avoids naming the universal package, so those two needed nothing. The
standing requirement is in Handshakes above for whoever edits that file next.
If the lead lands only one of the two rounds, note the dependency: their README
now names a package that only *this* round's `release.sh` builds.
## QA log
### 2026-08-27 — QA agent
Scope: everything the dev's work log claims — gates, `--cross` and non-`--cross`
`release.sh` runs, `.vsix` contents, `TargetPlatform`, `SHA256SUMS`,
`audit_artifacts.sh`'s new aarch64 arm, `extension.js`'s resolution order and
`inspect()` usage, the `EXIT` trap, and the docs. Ran everything from the real
repo path (`/Users/guoliangchen/repo/verilogrustformatter`), never the session
scratchpad (`docs/features/editor-packaging` QA Finding 2). All work in this
entry; no source file was edited.
**Gates — all green, matching the dev's numbers exactly.**
| Check | Result |
|---|---|
| `bash -n tools/release.sh tools/audit_artifacts.sh` | clean |
| `node --check editors/vscode/extension.js` | clean |
| `python3 -c json.load` on `package.json` | valid |
| `cargo fmt --check` | clean |
| `cargo clippy --all-targets` (workspace) | clean, 0 warnings |
| `cargo test -p lucisv_server` | **1015 unit + 50 e2e + 3 grammar**, 5 ignored, 0 failed — exact match |
| `cargo test --workspace` | all green (also run, not just the dev's subset) |
**`tools/release.sh --cross`, re-run independently — exit 0, 18 artifacts, matching the claimed set exactly.**
- `dist/` after the run: 12 loose binaries (six triples × 2), 6 `.vsix`, `SHA256SUMS` — file names and sizes match the dev's table (`lucisv-server-0.10.0-aarch64-unknown-linux-musl` 4,022,088 bytes, `lucisv-0.10.0-aarch64-unknown-linux-musl` 1,930,768 — identical to the dev's numbers).
- `shasum -a 256 -c SHA256SUMS` in `dist/`: **18/18 OK**.
- `unzip -Z1`/`unzip -Z` on all six `.vsix`, independently: the universal package (`lucisv-0.10.0.vsix`, 324 entries) carries no `extension/bin/*` entries and no `TargetPlatform` attribute in `extension.vsixmanifest`. Each of the five platform packages (326 entries — exactly 2 more than universal) carries exactly `extension/bin/lucisv{,-server}` (`.exe` suffix on `win32-x64`), mode `-rwxr-xr-x` inside the zip, and the correct `TargetPlatform="…"` (`darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `win32-x64` respectively — checked all five, not just one).
- Grepped every `.vsix`'s file list for `smoke`, `.gitignore`, `.vscodeignore`, `test`, `.git/`: nothing found in any of them — no dev-only clutter shipped.
- `tools/audit_artifacts.sh dist`: **12 binaries audited, exit 0** — matches exactly (the six `.vsix` are correctly skipped by the pre-existing `*.vsix` case arm, not part of this round's diff).
- Embedded smoke test ran as part of the build: `smoke: OK` against the server unzipped out of the `darwin-arm64` package, 10 messages — matches.
**`tools/release.sh` without `--cross`, re-run into a throwaway `-o` dir:** exactly host pair + `lucisv-0.10.0.vsix` (universal) + `lucisv-0.10.0-darwin-arm64.vsix`, 4 files total, `editors/vscode/bin/` absent afterward. Matches the "What gets built" table exactly.
**Breaking it, independently (not reusing the dev's own runs):**
1. **Ran `release.sh` twice in a row** (non-`--cross`, into two different `-o` dirs). Both exit 0, `editors/vscode/bin/` absent after each run, identical artifact name sets both times, `git status --short editors/vscode` showed only this round's four intended edits both times — no residue from run 1 leaking into run 2.
2. **Pre-existing junk in `editors/vscode/bin/` before a run.** Created `editors/vscode/bin/lucisv-server` and `editors/vscode/bin/some-other-file` with garbage content by hand, then ran `release.sh -o /tmp/relcheck3 --no-vsix`. The script's `rm -rf "$bin_dir"` at line 53 (before the first build, unconditional on `--no-vsix`) wiped it; `bin/` was absent afterward and the run succeeded normally. A stale `bin/` from an interrupted prior run cannot contaminate the next one.
3. **Independently re-ran the `EXIT`-trap negative control**, with my own fake `npx` (not the dev's), rather than trusting the dev's own report: a wrapper script on `PATH` that proxies to the real `npx` for everything except an invocation containing `--target`, which it fails with exit 17. Ran `release.sh -o /tmp/relcheck_fail`: the universal package built and was asserted clean (`bin/ contents ok`), then the `darwin-arm64` package's `vsce package --target darwin-arm64` hit the fake npx and failed; the script exited 17. `editors/vscode/bin/` was absent afterward and `git status --short editors/vscode` showed only the four intended edits — the trap covers a real mid-packaging failure, checked with a genuinely different negative control than the dev used, not a re-run of theirs.
**Audit script — the aarch64-musl arm checked adversarially.**
- **Unknown artifact name still fails**, confirmed on a copy: `lucisv-0.10.0-unknown-triple-xyz` (a renamed copy of the real `aarch64-apple-darwin` binary) produces `FAIL: … unrecognized artifact name — teach this script about it`, exit 1.
- **Corrupted the aarch64-musl arm**, on a copy, never on `dist/` originals: overwrote a copy of `lucisv-server-0.10.0-aarch64-unknown-linux-musl` with `/bin/ls` (a Mach-O binary) under the same aarch64-musl-suffixed name. Audit failed it twice over — `not an aarch64 ELF: Mach-O universal binary …` and `musl build is not statically linked: …` — before even reaching the `objdump` `NEEDED` check, and exited 1 overall. This proves the arm's `file`-based architecture/static checks fire on a corrupted artifact, but it is a weaker test than I wanted: **I did not manage to isolate the `objdump -p … | grep NEEDED` line specifically** (no genuine dynamically-linked aarch64 Linux ELF was available on this Mac to substitute in — the closest available wrong-arch swap fails at the earlier `file`-based checks first, so the `NEEDED` grep is never reached in this control). The two checks are independent by construction (read separately in the source, matching the "two independent opinions" comment at `tools/audit_artifacts.sh:56`), so I read the `NEEDED` branch by inspection rather than exercising it in isolation — noting this as an honest gap in my own coverage, not a defect found.
**`extension.js` resolution logic, read line by line against the claims.**
- **`inspect()` scope order verified correct against VS Code's own documented precedence** (`SERVER_PATH_SCOPES`, `extension.js:58-65`) — not assumed from memory. VS Code's own `vscode.d.ts` doc comment for `WorkspaceConfiguration.inspect()` states the effective-value merge order, lowest to highest, as: `defaultValue`, `globalValue`, `workspaceValue`, `workspaceFolderValue`, `defaultLanguageValue`, `globalLanguageValue`, `workspaceLanguageValue`, `workspaceFolderLanguageValue`. That means *every* language-specific value outranks *every* non-language-specific one — a genuinely counter-intuitive rule (a `[verilog]`-scoped **User** setting beats a plain **workspace folder** setting) that I checked rather than trusted. Reversed and excluding the two `default*` entries (correctly excluded — see the file's own comment), the highest-to-lowest order is exactly `workspaceFolderLanguageValue, workspaceLanguageValue, globalLanguageValue, workspaceFolderValue, workspaceValue, globalValue` — which is the code's list, verbatim, in that order. The claim is correct.
- **The bundled-CLI call is unconditional; the bundled-server call is short-circuited — worth documenting, not a bug (Finding 1 below).**
- **`chmodSync` is in a `try { } catch { }` with no binding** (`extension.js:104-109`) — cannot throw uncaught; a read-only install or permission error is swallowed exactly as the comment says.
- **`deactivate()`** (`extension.js:211-214`) is untouched by this round's diff (confirmed via `git diff HEAD~1`) and still calls `clearTimeout` + `client.stop()`.
- **Windows `.exe` suffix** is handled consistently in both `bundledBinary()` (`extension.js:100`, via `process.platform === 'win32'`) and `release.sh`'s `package_vsix`/loose-binary loops (`case $triple in *windows*) exe=.exe ;;`) — same convention, both places.
- **Activation with `bin/` absent (the universal package) does not throw**: `bundledBinary` returns `undefined` via `fs.existsSync` before any chmod attempt, and the `||` chain falls through to `'lucisv-server'` on `PATH`, exactly as before this round. `git diff HEAD~1 -- editors/vscode/extension.js` confirms the entire diff is additive (two new `require`s, two new functions, and the `activate()` server-path line) — the pre-existing behavior for the universal package's happy path is untouched code, not just untouched behavior.
**Finding 1 (confirmed, cosmetic, not blocking) — `editors/vscode/README.md:29`'s "makes both executable on first activation" is not quite true when a user has set `lucisv.serverPath`.**
`extension.js:120` calls `bundledBinary(context, 'lucisv')` unconditionally, so the CLI is always chmod'ed if present. But `extension.js:124` is
```js
const serverPath = userServerPath() || bundledBinary(context, 'lucisv-server') || 'lucisv-server';
```
— plain JavaScript `||` short-circuits, so if `userServerPath()` returns a truthy value (the user set `lucisv.serverPath` in any of the six scopes `SERVER_PATH_SCOPES` checks), `bundledBinary(context, 'lucisv-server')` is **never called**, and the bundled `bin/lucisv-server` is never chmod'ed on that activation. This is not a functional bug — the binary in question is not the one being spawned in that scenario, so its mode is irrelevant — but `editors/vscode/README.md:29`'s "the extension spawns the server from there and makes both executable on first activation" states an unconditional "both" that has this one exception. The feature README's own Handshakes section is more careful — "chmods what it is about to spawn" (line 46) — which is the actually-accurate description and does not have this gap. Recommend loosening `README.md:29`'s wording to match the feature README's, or noting the exception; not fixed here since it is a one-clause doc-precision issue, not a typo, and the instructions ask QA to file rather than redesign.
**Pre-existing, out of scope for this round, flagged for the lead anyway — `tools/RELEASING.md:229-231` has a garbled sentence in the Appendix**, predating this round (confirmed via `git diff HEAD~1 -- tools/RELEASING.md`; the Appendix section is untouched by this diff): "that id registered with vsce by the owner\n has created in the Visual Studio Marketplace." reads as a broken edit — a clause was apparently left mid-rewrite. Not this feature's doc to fix (it's about marketplace publishing, unrelated to platform packaging), and not introduced by this round, but noted since I read the whole file.
**Docs cross-checked against reality, no other issues found:**
- `tools/RELEASING.md`'s `.vsix`-in-detail section (staging, `--target` invocation shape, `bin/` transience, the `unzip -Z1` assertion contract) matches `release.sh`'s actual code line for line.
- `editors/vscode/README.md`'s section 0 install instructions, the `lucisv.serverPath` settings-table row, and the Troubleshooting section's "clear the setting, don't set it back to the default string" advice all match `extension.js`'s actual behavior (the last one specifically depends on the `inspect()`-not-`get()` distinction verified above — a user who explicitly sets `lucisv.serverPath` to the literal string `"lucisv-server"` does still count as "set", by design, since `inspect()` sees it in a scope, not as the manifest default).
- The feature README's own Handshakes ("Promised to `extension.js`", "Promised to `tools/audit_artifacts.sh`") match what the code actually does, verified independently above rather than taken on the doc's word.
- `TODO.md` was not re-checked in depth; the dev's claim that no existing checkbox needed updating was not disputed by anything found here.
**No BLOCKING findings.** Every claim in the dev's work log was independently reproduced with fresh runs and, where possible, fresh negative controls rather than re-trusting the dev's own — gates, both `release.sh` modes, all six `.vsix` contents (all five `TargetPlatform`s, not a sample), `SHA256SUMS`, the `EXIT` trap (with an independently-written stub), the audit script's new arm, and the `inspect()` precedence claim (checked against VS Code's own documented merge order, not memory). Finding 1 is cosmetic and already partially self-corrected by the feature README's own more careful wording elsewhere. The un-exercised `NEEDED`-check branch (audit script) is a coverage gap in this QA pass, not a defect — recorded honestly rather than papered over.
**Verdict: ship.**
### 2026-08-27 — QA agent (round 2): the all-platforms package + CI consolidation
Scope: the dev's round-2 work log claims only — the seventh `lucisv-<v>-all.vsix`
package, `extension.js`'s layered `bundledBinary` lookup, `release.sh`'s
`package_all_vsix`/`expect_vsix_bins` under `--cross`, `tools/prune_release_assets.sh`,
and the `release.yml` step that calls it. Did not re-review the earlier
six-package round (its own QA log entry above stands) or the concurrent
`editor-marketplace-page` round, except where its output could break packaging.
Ran everything from the real repo path (`/Users/guoliangchen/repo/verilogrustformatter`),
never the scratchpad. No source file was edited; `dist/` was rebuilt by my own
`--cross` run and left intact afterward (verified: 20 files, `shasum -c` 19/19
OK, as the last action before writing this entry).
**Gates — all green.**
| Check | Result |
|---|---|
| `bash -n tools/release.sh tools/audit_artifacts.sh tools/prune_release_assets.sh` | clean |
| `node --check editors/vscode/extension.js` | clean |
| `python3 -c "import yaml; yaml.safe_load(...)"` on `.gitea/workflows/release.yml` | valid |
| `cargo fmt --check` | clean |
| `cargo clippy --all-targets` | clean, 0 warnings |
| `cargo test -p lucisv_server` | **1015 unit + 50 e2e + 3 grammar**, 5 ignored, 0 failed — exact match to the dev's numbers |
**`tools/release.sh --cross`, re-run independently on this machine (lucisv 0.10.1) — exit 0, 12 loose binaries + 7 `.vsix` + `SHA256SUMS` (20 files, 19 checksummed entries), matching the dev's claimed set.**
- `unzip -Z1 lucisv-0.10.1-all.vsix 'extension/bin/*'`: exactly 10 entries — `darwin-arm64/`, `darwin-x64/`, `linux-x64/`, `linux-arm64/` each with `lucisv`+`lucisv-server`, `win32-x64/` with `lucisv.exe`+`lucisv-server.exe` only (`.exe` confirmed absent from the other four directories). `unzip -Z1 ... | grep -c '/$'` = 0, confirming vsce writes no directory entries here either.
- Universal package still has no `bin/`: `unzip -Z1 lucisv-0.10.1.vsix 'extension/bin/*'` → "filename not matched". The five platform packages are unchanged — flat two entries each (`extension/bin/lucisv[-server]`, `.exe` only for `win32-x64`).
- `extension.vsixmanifest`: no `TargetPlatform` attribute in `lucisv-0.10.1-all.vsix` or the universal package; `TargetPlatform="darwin-arm64"`/`"darwin-x64"`/`"linux-x64"`/`"linux-arm64"`/`"win32-x64"` present and correct in the respective five platform packages (checked all five).
- Both embedded smoke tests ran during the build: `smoke: OK`, 10 messages, for the host platform package (`extension/bin/`) and for the all package (`extension/bin/darwin-arm64/`).
- `tools/audit_artifacts.sh dist`: 12 binaries audited, exit 0.
- `shasum -a 256 -c SHA256SUMS` in `dist/`: 19/19 OK.
- `dist/` left intact at the end (re-verified after all later runs used throwaway `-o` dirs or copies).
**Byte-identity spot-check, `all` package vs. loose `dist/` binaries (SHA-256, both directions of the pair, two platforms as asked):**
- `darwin-arm64`: `unzip -p lucisv-0.10.1-all.vsix extension/bin/darwin-arm64/lucisv` and `extension/bin/darwin-arm64/lucisv-server` both hash identically to `dist/lucisv-0.10.1-aarch64-apple-darwin` and `dist/lucisv-server-0.10.1-aarch64-apple-darwin` (`51ca1cf2...` and `edaff0df...` respectively).
- `win32-x64`: `unzip -p lucisv-0.10.1-all.vsix extension/bin/win32-x64/lucisv.exe` and `.../lucisv-server.exe` both hash identically to `dist/lucisv-0.10.1-x86_64-pc-windows-gnu.exe` and `dist/lucisv-server-0.10.1-x86_64-pc-windows-gnu.exe` (`f6c2dbfc...` and `6628bfeb...` respectively).
Four of four match. Confirms the audit that gates the release covers the fat package's contents transitively, as claimed.
**`tools/prune_release_assets.sh`, on copies of `dist/`, never the original — independent runs, not the dev's.**
- **Positive**: copied the full 20-file `dist/` to a scratch dir, ran `prune_release_assets.sh <dir> 0.10.1` — exit 0, 8 survivors (the 7 `.vsix` + `SHA256SUMS`), `shasum -c` re-verify inside the script passed for all 7.
- **Negative, missing `-all.vsix`**: removed it from a fresh copy before running — `missing lucisv-0.10.1-all.vsix` on stderr, exit 1, **file count unchanged (19 before and after)** — the name-check loop runs entirely before any deletion, so a missing package deletes nothing rather than partially pruning.
- **Negative, wrong version arg**: ran with `9.9.9` against the real 0.10.1 tree — `missing lucisv-9.9.9.vsix`, exit 1, file count unchanged (20 before and after, since this copy still had its original `dist/` contents).
- **Negative, missing directory**: ran against a nonexistent path — `no dist directory at ...`, exit 2, as coded.
**`extension.js`'s layered `bundledBinary` lookup — exercised with my own harness, not the dev's** (none was left in the tree to re-run; confirmed via `find` and `git status --short`, which shows no untracked harness file). Wrote an independent Node script (`/tmp/qa_ext_harness/harness.js`, discarded after use) that stubs `vscode` and `vscode-languageclient/node` via `Module._load`, builds fake extension directories with `fs`, and calls `activate()` against a fake `context.asAbsolutePath`, reading back `serverOptions.command` from the `LanguageClient` constructor call and the on-disk file modes afterward. Eight cases, all matching the documented behaviour:
| Case | Result |
|---|---|
| no `bin/` at all | `lucisv-server` (PATH) |
| flat `bin/` only | flat path, chmod 755 |
| nested `bin/<own-platform>/` only | nested path, chmod 755 |
| both layouts present | **flat** wins (most specific first); flat chmod'ed to 755, **nested left at 644 — not touched** |
| only a foreign platform's directory present | falls through to `lucisv-server` (PATH) |
| nested layout + user `serverPath` set (`globalValue`) | **user's path wins the spawn**, but the nested bundled server is **still chmod'ed to 755** — confirms the lead's round-1 fix (unconditional `bundledServer` resolution ahead of the `\|\|` chain) survived the new two-candidate lookup |
| flat layout + user `serverPath` set to the literal string `"lucisv-server"` | counts as "set" (per `inspect()`, not `get()`); command resolves to that string, flat binary still chmod'ed |
| nested layout + user `serverPath` set to a whitespace-only string | counts as unset; falls through to the nested bundled path |
This independently confirms: flat-over-nested precedence, foreign-platform fall-through, the "only chmod what was chosen" behavior the dev's own harness claimed, and — the specific thing this round's instructions flagged as a prior finding to re-check — that both bundled binaries still get chmod'ed even when a user-set `serverPath` wins the spawn, in the nested layout as well as the flat one.
**`EXIT` trap, negative-controlled a third way** (independently of both the round-1 QA control and the dev's round-2 control): a fake `npx` on `PATH` that fails only when an argument ends in `-all.vsix` (exit 42), proxying to the real `npx` otherwise. `tools/release.sh -o /tmp/qa_relfail --cross` built the universal package and all five platform packages (each asserted `bin/ contents ok`) before dying on the all-platforms step; `editors/vscode/bin/` (which by then holds five subdirectories, ten binaries) was gone immediately after, and `git status --short editors/vscode` showed only this round's four tracked-file edits — no residue.
**Docs vs. reality.**
- `tools/RELEASING.md`'s "twelve binaries and seven `.vsix` files" claim, the `.vsix`-in-detail section's staging/assertion description, and the publishing section's "seven `.vsix` packages plus `SHA256SUMS`" all match the actual `--cross` output above.
- `docs/features/ci-release/README.md`'s seven-package claims, its `prune_release_assets.sh` validation table (20-file copy → 8 survivors, missing `-all.vsix` → exit 1 deletes nothing), and its description of the `release.yml` step order all match what I independently reproduced above.
- `.gitea/workflows/release.yml` calls the script as `tools/prune_release_assets.sh dist "${GITHUB_REF_NAME#v}"`, between the artifact audit and the release-notes extraction — confirmed by reading the file; `RELEASE_NOTES.md` is written into `dist/` *after* pruning, so the prune step (which deletes everything not `*.vsix`/`SHA256SUMS`) cannot touch it.
- Top-level `README.md` (lines 623, 710) states the `all` package and the seven-package release claim; both match reality.
- `tools/audit_artifacts.sh`'s `*.vsix | SHA256SUMS | RELEASE_NOTES.md` skip arm (line 39) still covers `-all.vsix` before the "unrecognized artifact name" arm — confirmed by the clean 12-binary audit above.
- `editors/vscode/.vscodeignore` still does not exclude `bin/`; `editors/vscode/.gitignore` still ignores it with a comment pointing at this feature.
**Finding 1 (confirmed, moderate, not blocking build/packaging) — `editors/vscode/README.md`'s install table names six packages, not the seven this feature's own Handshakes section promises.**
This feature's Handshakes section (`docs/features/editor-platform-vsix/README.md:103-104`, written by the dev in this same round) states as a requirement of `editor-marketplace-page`'s rewrite: "its install table naming **seven** packages, not six (the five platform ones, `all`, and the universal fallback)". The dev's own round-2 work log (lines 552-558) claims to have "re-applied the *requirement* onto their structure" and that the marketplace README's `lucisv.serverPath` row and Troubleshooting entry "already" satisfied the requirement, needing no change — but does not claim to have added the universal package to the install table, and it was never there. Checked directly: `editors/vscode/README.md:36-43`'s install table has exactly six rows (`darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `win32-x64`, `all`); `grep -n "universal\|lucisv-<version>\.vsix\|PATH\\b" editors/vscode/README.md` finds no mention of the universal/platform-independent package anywhere in the file — not in the install table, not in Troubleshooting, not elsewhere. A reader of this developer-facing README has no way to learn the plain `lucisv-<version>.vsix` (PATH-based, smallest download, the fallback for a platform none of the six named packages cover) exists at all. This does not break packaging or any gate — `vsce package` for the universal target still runs and is still asserted `bin/`-free by `release.sh` — it is purely a documentation gap against the feature's own stated (and, per the work log, believed-satisfied) handshake. Filed rather than fixed, per QA's scope (verify, don't redesign); the fix is one added table row plus a clause, in `editor-marketplace-page`'s voice, matching the pattern already used for the `all` row.
**No other findings.** Every claim in the dev's round-2 work log — the seventh package's build and contents, the layered lookup and its chmod behavior (including the specific "still chmod'ed when a user setting wins" fix-survival check this round asked for), `expect_vsix_bins`'s handling of nested paths, the `EXIT` trap under the new nested staging, `prune_release_assets.sh`'s positive and negative behavior, and the docs — was independently reproduced with fresh runs, fresh negative controls, and a fresh harness rather than re-trusting the dev's own. The concurrent `editor-marketplace-page` round's `package.json` changes (icon, keywords, homepage) do not break packaging: the full `--cross` run above packaged all seven `.vsix` cleanly against the current tree, icon file present and valid.
**Verdict: ship, with Finding 1 (moderate, doc-only) for the lead to route — either fix `editors/vscode/README.md`'s install table now or hand it back to `editor-marketplace-page`.**
## Review
**2026-08-27 — lead. Verdict: accepted; commits with this round.**
Reviewed the full diff (7 files + this README), the dev's work log against the
scripts' actual code, and QA's independent reproduction. Points reviewed and
accepted:
1. **The staging design is the right shape**: `editors/vscode/bin/` exists only
between `mkdir` and the post-package `rm -rf`, with an `EXIT` trap both
agents negative-controlled independently, and every package's `bin/`
contents asserted with `unzip -Z1` rather than assumed. The failure this
guards against — one platform's server shipping inside another platform's
package, or inside the universal one — is a corruption-adjacent class of
bug, and it cannot happen silently.
2. **The resolution order in `extension.js` is correct and honestly detected**:
`inspect()` across all six user-writable scopes, in VS Code's own merge
order (QA verified the order against documentation, including the
language-scoped-beats-general rule), with the manifest default deliberately
not counting as "set". The chmod-in-try/catch matches rust-analyzer's
long-standing practice for the same VSIX-extraction reality.
3. **`linux-x64` shipping musl is the right call** — a static server is what an
extension installed by a stranger needs — and the gaps are recorded rather
than hidden: no `x86_64-unknown-linux-gnu` package, no Alpine targets
(universal fallback covers them), four non-host packages never executed on
their own platforms.
4. **QA's Finding 1** (short-circuited chmod of the unused bundled server) was
fixed at the code level by the lead — see the work log — so the user-facing
README's "both" is now unconditionally true. **Finding 2** (garbled
pre-existing sentence in the RELEASING.md appendix) is real, predates this
round, and is fixed by the lead in this same round. QA's disclosed coverage
gap (the aarch64 `NEEDED` branch never fired against a genuine dynamic
aarch64 ELF) is accepted: the branch is nine lines, read by three agents,
and structurally identical to the x86-64 arm that *was* mutation-tested.
No version bump here: the packages are cut from whatever version the tree is
at, and the next tagged release ships all six automatically via the unchanged
`release.yml` → `release.sh --cross` path.
**2026-08-27 — lead review of round 2 (the all-platforms package + CI
consolidation). Verdict: accepted; commits with this round; ships as 0.10.2.**
Reviewed the diff, the dev's work log, and QA's independent reproduction
(its own Node harness for the layered lookup, its own `EXIT`-trap stub, a
fresh `--cross` run, byte-identity spot-checks). Points accepted:
1. **The layered `bundledBinary` lookup is the smallest correct shape**: the
file's existence remains the only runtime test for "which package am I",
the flat layout wins so a platform package can never accidentally pick a
foreign binary out of a fat layout, and the prior round's
chmod-both-binaries fix survives (QA proved it with a user-set
`serverPath` against a nested layout).
2. **The `-all` package is target-less on purpose** — no `TargetPlatform` in
its manifest, asserted by `release.sh` — which is precisely what makes it
the honest answer for Alpine and any platform vsce refuses to name.
3. **`tools/prune_release_assets.sh` consolidates the release contract in
one place**: seven names checked, audited hashes preserved by filtering
rather than recomputing, deletion only after every check passes (QA's
negative controls confirm a failure deletes nothing).
4. **QA's Finding 1** (the marketplace rewrite dropped the universal package
from the install table, breaking this round's requested Handshake) was
fixed by the lead in the marketplace round's review — a seventh row names
the universal fallback.
Accepted limitations, unchanged from round 1: no real-editor run, four
non-host platforms' binaries never executed, Alpine reasoned not observed.
<!-- Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love, luciochen.com -->