Skip to content

fix(ci): packed schema verification, native CLI exec, Node 26 baseline - #8

Merged
P-Theo merged 2 commits into
refactor/project-layout-and-options-schemafrom
hoplite/pyrrha-2c2a79f6--ci-hardening
Sep 16, 2026
Merged

P-Theo merged 2 commits into
refactor/project-layout-and-options-schemafrom
hoplite/pyrrha-2c2a79f6--ci-hardening

Conversation

@usehoplite

@usehoplite usehoplite Bot commented Sep 16, 2026

Copy link
Copy Markdown

Stacked on #7 — hardening from its final review pass plus two follow-up fixes.

What this fixes

CI never verified the packed schema (the headline feature of #7). The packed-artifact step imported dist/tui.js and asserted the entrypoint id, but nothing checked that options.schema.json made it into the tarball or that the opencode2-tps/options.schema.json export resolves from an installed copy. tests/options-schema.test.ts reads the repo file, so a files:/exports regression would have shipped a broken schema export with everything green. The step now asserts the tarball contains package/options.schema.json and imports the export through the package's exports map (with the required with { type: "json" } attribute).

scripts/check-compatibility.mjs was cwd-dependent and shell-dependent. It resolved node_modules/.bin against process.cwd() (breaking node scripts/check-compatibility.mjs from any other directory) and used npm's .bin wrapper, whose .cmd shim on Windows cannot be execFileSync'd without a shell. It now resolves against the script's location and executes @opencode/cli's real declared bin target (bin/opencode2.exe) — the native binary runs unshelled on every platform despite the .exe name, and both a normal install's postinstall and CI's existing --ignore-scripts prepare step put it there. The process.platform branch is gone.

CI ran Node 24 below the toolchain's documented floor. @opentui/core (0.5.11, what ^0.5.10 resolves to upstream) declares engines: { bun: ">=1.3.0", node: ">=26.4.0" }. CI's Node-side work (npm ci, tsc, oxlint, scripts/*.mjs, the packed-artifact check) moves to node-version: 26.4.0, and @types/node follows to ^26.0.0 (lock regenerated; resolves 26.6.1) so typechecking matches what CI actually runs. Node 26's setInterval typing adds a conditional rest-args overload that no two-parameter test double can satisfy, so the two timer doubles in tests/plugin.test.ts and tests/entrypoint.test.tsx now assert to typeof globalThis.setInterval at the assignment boundary — behavior unchanged.

Verification

All run locally under the actual CI baseline (Node 26.4.0 via mise, npm 11.17):

  • lint: 0 warnings, 0 errors; tsc --noEmit clean with @types/node 26.6.1.
  • bun test: 68 pass, 0 fail.
  • scripts/build.mjs produces dist; check-compatibility passes from the repo root and from a foreign cwd, executing the native bin/opencode2.exe.
  • Full pack cycle re-verified under Node 26.4.0 with the dev-resolved peers (@opentui/solid@0.5.11, solid-js@1.9.12): tarball contains package/options.schema.json, dist/tui.js imports with id === "opencode2.tps", and opencode2-tps/options.schema.json resolves through the exports map.
  • No runtime source changes — src/ is untouched, so refactor: adopt src/tests/scripts layout and ship options.schema.json #7's verified behavior (including live hot-reload from src/, confirmed against a real opencode2 TUI) is unaffected.

Merge into #7 before merging #7 to main; when #7 lands and its branch is deleted, GitHub retargets this to main automatically and the diff collapses to just these commits.

Open in Hoplite

P-Theo and others added 2 commits September 16, 2026 11:03
… cwd-independent

- The packed-artifact step now asserts options.schema.json is in the tarball
  and that the opencode2-tps/options.schema.json export resolves (with the
  JSON import attribute) and carries the expected title.
- scripts/check-compatibility.mjs resolves node_modules/.bin against the
  script location instead of cwd, matching its other path resolutions.

Co-authored-by: Panagiotis Theologou <p.theologou@protonmail.com>
- check-compatibility runs @opencode/cli's real bin target
  (bin/opencode2.exe) instead of npm's .bin wrapper: .cmd shims need a
  shell on Windows, while the native binary executes unshelled on every
  platform; also drops the process.platform branch.
- CI's node-version moves 24 -> 26.4.0, @opentui/core's documented Node
  floor, and @types/node follows (^26.0.0, lock regenerated).
- The two setInterval test doubles cast to typeof globalThis.setInterval:
  Node 26 types add a conditional rest-args overload no two-parameter
  double can satisfy.

Co-authored-by: Panagiotis Theologou <p.theologou@protonmail.com>
@usehoplite usehoplite Bot changed the title fix(ci): verify packed schema export and cwd-independent compatibility check fix(ci): packed schema verification, native CLI exec, Node 26 baseline Sep 16, 2026
@P-Theo
P-Theo merged commit 8d591b1 into refactor/project-layout-and-options-schema Sep 16, 2026
1 check passed
@P-Theo
P-Theo deleted the hoplite/pyrrha-2c2a79f6--ci-hardening branch September 16, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant