Skip to content

chore: pin the dev Node floor at 22.12, distinct from the consumer floor - #47

Merged
dangrondahl merged 2 commits into
mainfrom
chore/dev-node-floor-22-12
Oct 22, 2026
Merged

dangrondahl merged 2 commits into
mainfrom
chore/dev-node-floor-22-12

Conversation

@dangrondahl

@dangrondahl dangrondahl commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Follows #31 (vitest 4), now merged — so the dev floor described below is the one in effect on main today.

Addresses the two open points from the review on #31.

The CI matrix wasn't testing the floor

This is the substantive one. node-version: '22' resolves to the latest 22.x, so the band that actually breaks — 22.0–22.11, which Vite 8 rejects — was never exercised. The matrix looked like it covered the bottom of the supported range and didn't.

Pinned to '22.12', so the tested floor is the real floor.

Two floors, on purpose

value why
Consumer floor engines.node >= 22 what the published server needs
Dev floor >= 22.12 vitest 4 → Vite 8 (^20.19.0 || >=22.12.0)

Deliberately not raising engines.node: it constrains consumers, and nothing under devDependencies ships (files: ["dist"]). Agreeing with the review on this — tightening the published floor for a test-only dependency would misrepresent what users need.

Made discoverable rather than found via a mystery EBADENGINE:

  • .nvmrc pinning 22.12 (nvm use picks it up)
  • A prerequisites line in CONTRIBUTING.md, right above the npm install block, stating both floors and what goes wrong below 22.12

@types/node → ^22.12.0

Vite 8 declares "@types/node": "^20.19.0 || >=22.12.0" as a peer. ^22.0.0 permitted versions outside that. Resolved version is unchanged at 22.19.17 — this only tightens the declared range, keeping it consistent with CLAUDE.md's rule that @types/node tracks the floor.

CLAUDE.md

Records the two-floor distinction explicitly, so nobody "fixes" the apparent inconsistency by raising engines.node. The "Raising the Node floor" checklist gains .nvmrc and the CONTRIBUTING note.

Verification

npm run build clean, npm test green (67 tests), lockfile regenerated with npm install --package-lock-only — one line changed, no dependency re-resolved.

@claude

claude Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Claude finished @dangrondahl's task in 24s —— View job


Follow-up review (b23fab6)

  • @types/node floor ambiguity (package.json): resolved. CLAUDE.md now says it tracks the consumer floor's major (22), explains why the range is ^22.12.0, and notes that it floats within 22.x.
  • Stale CI comment (ci.yml): resolved. The job comment now points to the matrix comment. The consumer floor is still untested, which is a limit of the toolchain rather than a regression.
  • CONTRIBUTING claim / update-catalog.yml floating (CONTRIBUTING.md): resolved. chore: bump vitest from 3.2.4 to 4.1.10 #31 has merged, so the Vite 8 claim now holds, and update-catalog.yml is pinned to 22.12.

No new inline comments. I resolved all three threads.

Comment thread package.json Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread CONTRIBUTING.md Resolved
vitest 4 (#31) pulls Vite 8, which requires ^20.19.0 || >=22.12.0. The
consumer floor stays engines.node >=22 — that field constrains users, and
nothing under devDependencies ships — but development now needs 22.12.

The CI matrix said '22', which resolves to the latest 22.x, so the bottom
of the range was never actually tested: the one band that breaks
(22.0-22.11) was invisible to CI. Pinned to '22.12' so the tested floor is
the real floor.

@types/node moves to ^22.12.0 to match Vite 8's peer range
(^20.19.0 || >=22.12.0); ^22.0.0 permitted versions outside it. The
resolved version is unchanged at 22.19.17.

.nvmrc and a CONTRIBUTING prerequisites note make the dev floor
discoverable rather than something found via a mystery EBADENGINE.
@dangrondahl
dangrondahl force-pushed the chore/dev-node-floor-22-12 branch from eb87b31 to e1c8efa Compare October 22, 2026 11:32
…s/node tracks

Addresses the review findings on #47:
- ci.yml's job comment still called 22 the engines floor; the matrix low
  end is now the 22.12 dev floor.
- update-catalog.yml floated on '22'. It runs npm ci with the dev toolchain,
  so it belongs on 22.12 with ci.yml.
- CLAUDE.md said @types/node tracks "the floor" without saying which. It
  tracks the consumer floor's major; the ^22.12.0 range comes from Vite 8's
  peer range, and within 22.x it floats.
@dangrondahl
dangrondahl enabled auto-merge (squash) October 22, 2026 11:42
@dangrondahl
dangrondahl disabled auto-merge October 22, 2026 12:29
@dangrondahl
dangrondahl merged commit 4ee19e1 into main Oct 22, 2026
5 checks passed
@dangrondahl
dangrondahl deleted the chore/dev-node-floor-22-12 branch October 22, 2026 12:29
dangrondahl added a commit that referenced this pull request Oct 22, 2026
…pendabot (#87)

Gives more confidence before the next release by adding checks for
things that so far were only tested by unit tests, or not at all. The
new checks immediately turned up two bugs that were already on `main`,
and both are fixed here: a mistyped test, and a `.mcpb` bundle that
doesn't start on Node 22.0–22.6.

## Fix: the `.mcpb` bundle didn't start on Node 22.0–22.6

`pack-mcpb.sh` deleted `package.json` from the bundle, so nothing
declared `dist/` as ESM. Node 22.7+ detects ESM from the syntax and
prints a warning. Earlier versions parse the file as CommonJS and fail
with `Cannot use import statement outside a module`. Both `engines` and
`manifest.json` allow those versions.

The bundle now ships a one-line `package.json` with `{ "type": "module"
}`, and nothing from the repo's own `package.json`. I reproduced the
failure on the official Node 22.6.0 binary, and confirmed the fixed
bundle starts on 22.0.0, 22.6.0 and 22.7.0.

## Type-check tests and scripts

`tsconfig.json` is `src`-only because it emits `dist/`, and vitest
strips types without checking them. So a type error in `test/` or
`scripts/` never failed anything. One had already slipped through: the
fetch mock in `test/client/kosli-client.test.ts` was typed
`ReturnType<typeof vi.fn>`, which doesn't match `KosliClient`'s
`fetchFn`. That is fixed here.

`tsconfig.test.json` and `npm run typecheck` cover the TypeScript in
`src`, `test` and `scripts`. `scripts/sync-version.mjs` is plain JS and
isn't covered. CI runs the typecheck after the build.

## Stdio smoke test

`scripts/smoke.ts` (`npm run smoke`) starts a built server over real
stdio and checks three things:

- the version it advertises matches `package.json`
- it lists exactly the three tools
- the tools carry the right safety hints: `execute_write_action` is
marked `destructiveHint` and not read-only, and `execute_read_action`
and `search_actions` are marked `readOnlyHint`. These hints are what
make an MCP client ask before a write, and no other test checks them.
- `search_actions` finds `list_environments`

A failed tool call reports the server's own error message rather than a
JSON parse error.

This covers what `test/server.test.ts` can't, because that test runs in
memory: whether the bin starts, whether the JSON imports load, and
whether a bundle's `node_modules` resolve.

The test is offline by default. It does one live read only when
`KOSLI_API_TOKEN` and `KOSLI_SMOKE_ORG` are both set, and CI never sets
them, so it's fork-safe.

CI now runs:

1. build
2. **typecheck**
3. test
4. **smoke `dist/`**
5. pack
6. **unzip the `.mcpb`, run `mcpb validate` on its manifest, and
smoke-test it**
7. **on the leg that sets `consumer-floor` in the matrix: switch to
exactly Node 22.0.0 and smoke-test the bundle again**

There's also a **negative check**: the smoke test must fail against a
missing entry point. That way a later refactor can't turn the smoke
steps into checks that always pass.

Some notes on those steps:

- Validating the bundled manifest, not the repo's copy, matters: the
repo's `manifest.json` holds a placeholder version, and the real one is
only injected at pack time.
- The 22.0.0 step exists because the matrix floor is the *dev* floor
(vitest needs a newer 22.x, see #47), so nothing tested the version
users are promised. The smoke test doesn't need vitest, so it can run
there. I rehearsed it locally on the real 22.0.0 binary: it fails on the
old bundle and passes on the fixed one.
- `@anthropic-ai/mcpb` is now a devDependency rather than an `npx` pin,
so Dependabot keeps it up to date. It adds 49 dev-only packages. None of
them ship (`files: ["dist"]`), and the server's own `zod` is unchanged
at 4.3.6.

## Release workflow: publish only after every check

`release.yml` used to run only build and test, then `npm publish`, and
only then build the bundle. So a failed pack could leave a version on
npm with no GitHub Release. It now runs the same checks as CI:

1. build, typecheck, test
2. smoke `dist/`
3. pack, `mcpb validate`, smoke the bundle
4. only then `npm publish` and the GitHub Release

`npm publish` can't be undone, so it stays last. This also checks the
bundle under the `npm@latest` that the release job installs, which CI
never uses.

Both jobs now have a `timeout-minutes` (15 for CI, 20 for release)
instead of the 6-hour default.

## Dependabot grouping and cooldown

- **Actions:** all SHA bumps go in one group. They edit the same lines,
so as separate PRs they conflict (#80 and #82 do today).
- **npm dev dependencies:** minor and patch bumps are grouped.
- **`@modelcontextprotocol/sdk`:** its minor and patch bumps get their
own group, because it's the only runtime dependency.
- **Majors** stay one PR each.
- **Cooldown:** new releases wait 7 days before being proposed. Security
updates aren't affected.

## Docs

`CONTRIBUTING.md` gets a "Testing locally" section covering typecheck,
smoke (offline and live), MCP Inspector, Claude Code against a checkout,
and installing the `.mcpb`. `README.md` and `CLAUDE.md` are updated to
match.

## Verification

On Node 24 locally:

- `build`, `typecheck` and `npm test` (110 tests) pass.
- The smoke test passes against `dist/` and against the unzipped bundle.
- The smoke test exits 1 when the server fails to start.
- `mcpb validate` passes on the bundled manifest, which carries version
`0.5.0`.
- The live-API smoke test passed against a real org (with SDK 1.30.1).
- The bundle smoke test passes on Node 22.0.0, 22.6.0 and 22.7.0.

Not run locally: the Node 22 matrix leg, which CI covers.

Not run: `release.yml` itself, which only runs on a tag. Its new steps
are the same commands CI runs.

After merge, check the next Dependabot run is still green. `cooldown`
support varies by ecosystem, and an unsupported key invalidates the
whole config, not just that block.

## Merge order for the open PRs

Suggested order once this lands: #47, then this PR, then #80 → #82 → #83
→ #74 → #79 → #84 → #45. Before #79 (SDK), rerun the live smoke test on
its branch. #47 conflicts with this PR on the matrix line: when
resolving, change the `include:` entry to `node-version: '22.12'` as
well. Merge #45 (TypeScript 7) last, after diffing `dist/` output
against 5.9.
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.

2 participants