Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: npm
- run: npm ci
- name: Unit tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: npm
- run: npm ci
- name: Refuse to release without the updater public key
Expand Down
25 changes: 25 additions & 0 deletions .kiln/work/20261121-fix-test-command-so-runs-node/brief.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Brief — test command runs on Node 22; CI on Node 22

Follows spike 20261121-review-each-items-above-one-one, finding F4 (audit item 2).

## What is asked
- Who: the maintainer and any contributor running the unit tests.
- What: `npm test` must run the unit suite on current Node; CI and release must run on Node 22.
- Success: `npm test` passes 214 of 214 on Node 22.17; workflows set `node-version: 22`.
- Constraint: nothing else changes.

## What I found
- `package.json:7` is `node --test tests/`. On Node 22.17.1 it fails: `Cannot find module '<repo>/tests'`.
- `node --test "tests/*.test.js"` passes 214 of 214 on Node 22.17.1. Node 22 expands the quoted glob itself, so it does not depend on the shell (Windows CI uses pwsh/cmd for `npm test`).
- `.github/workflows/ci.yml:18` and `.github/workflows/release.yml:16` pin `node-version: 20`.
- Every test file is `tests/*.test.js`; `tests/dom.js` is a helper, not a test, and must not run as one. The glob excludes it.
- `test:e2e` names one file and is unaffected.

## Still unknown
- None blocking. Node 20's end of life (April 2026) is from my knowledge, not checked.

## Past learnings
- None: no learnings store (`.kiln/learnings/` does not exist), recall not run.

## Design (bounded: two sentences)
Change the script to the quoted glob, and set both workflows to Node 22. No new file, no new dependency.
4 changes: 4 additions & 0 deletions .kiln/work/20261121-fix-test-command-so-runs-node/ledger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Pre-flight: no shared interfaces
Task 1: Step 1 matched (Cannot find module .../tests).
Task 1: complete (tests: node --test "tests/*.test.js" -> exit 0; npm test -> 214 pass, 0 fail)
Ruling: recorded with --phase full, since the project has no fast phase (test_fast blank) - cost if wrong: none.
65 changes: 65 additions & 0 deletions .kiln/work/20261121-fix-test-command-so-runs-node/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Test command on Node 22 — Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: use kiln-implement to work this plan task by task. Steps use checkbox (`- [ ]`) syntax, and a checked box is a claim kiln re-checks rather than believes.

**Goal:** `npm test` runs the unit suite on Node 22, and CI and release run on Node 22.

**Architecture:** Replace the folder argument with a quoted glob that Node expands itself; bump `node-version` in both workflows.

**Tech Stack:** Node `node:test`, GitHub Actions `actions/setup-node@v4`.

**Spec:** `.kiln/work/20261121-fix-test-command-so-runs-node/brief.md`

## Global Constraints

- Test script: exactly `node --test "tests/*.test.js"` (JSON-escaped in package.json).
- Workflows: `node-version: 22`.
- No new dependency, no other file.

## Risk flags

- none

## I/O & Edge-Case Matrix

| Scenario | Input / State | Expected Output / Behavior | Error Handling |
|----------|---------------|----------------------------|----------------|
| Node 22 run | `npm test` on Node 22.17 | 214 tests, 214 pass | n/a |
| Helper file | `tests/dom.js` exists | not run as a test file (glob needs `.test.js`) | n/a |

## Review Focus

- Windows shell quoting: `npm test` runs through cmd.exe on the CI runner; the double quotes must reach Node so Node, not the shell, expands the glob. Covered by CI's "Unit tests" step on windows-2022; not runnable here.
- Node 20 locally: the glob form requires Node ≥ 21 for glob expansion; on Node 20 it would look for a file literally named `tests/*.test.js`. Acceptable because both workflows move to 22; noted for contributors.

---

### Task 1: Test script and workflows

**Files:**
- Modify: `package.json:7`
- Modify: `.github/workflows/ci.yml:18`
- Modify: `.github/workflows/release.yml:16`

**Acceptance:**
- `npm test` passes 214 of 214 on Node 22.17.
- Both workflows set `node-version: 22`.

**Verification:** `npm test` → `# pass 214` and `# fail 0`.
**Depends on:** none · **Size:** S

**Interfaces:**
- Consumes: none
- Produces: none

- [ ] **Step 1: Run the current command to see it fail**

Run: `npm test`
Expected: FAIL with `Cannot find module '<repo>/tests'`

- [ ] **Step 2: Set `"test": "node --test \"tests/*.test.js\""` in `package.json:7`; set `node-version: 22` in `.github/workflows/ci.yml:18` and `.github/workflows/release.yml:16`**

- [ ] **Step 3: Run the command to see it pass**

Run: `npm test`
Expected: `# tests 214`, `# pass 214`, `# fail 0`
21 changes: 21 additions & 0 deletions .kiln/work/20261121-fix-test-command-so-runs-node/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 20261121-fix-test-command-so-runs-node — test command on Node 22

## Change
- Fixed: `npm test` runs the unit suite on Node 22, and CI and release builds run on Node 22. Nothing changes for people using the app.

## Before release
- [x] The change carries no migration and reads no new configuration value. (checked)
- [x] `kiln verify` ran the full unit suite (`npm test`'s new form): exit 0, 214 of 214 pass on Node 22.17.1. (checked)
- [ ] The CI "Unit tests" step on windows-2022 shows `# tests 214` on this pull request. (confirm)

## Release steps
1. Merge the pull request once CI is green.
2. Nothing else: the release workflow picks up Node 22 at the next `v*` tag.

## After release
- [ ] The next `v*` tag's Release run passes its `npm test` step on Node 22. (confirm)

## Rollback
- Trigger: CI or the Release run fails on Node 22 in its install or unit-test step.
- Steps: `git revert` the merge commit, then open and merge that pull request.
- Time: one revert pull request.
44 changes: 44 additions & 0 deletions .kiln/work/20261121-fix-test-command-so-runs-node/review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Review — 20261121-fix-test-command-so-runs-node

lenses: reviewer reported, blind-hunter reported, edge-case-hunter reported, verification-gap reported, intent-alignment reported, code-review-specialist reported, security-auditor reported, test-engineer reported

Scope — predicted 3 · actual 3

Rules: no rule is routed to this change, so there is no checklist.

Bar: nothing lowers the bar.

## Triage log

| # | Reader(s) | Location | Finding | Verdict | Grade | Route |
|---|---|---|---|---|---|---|
| 1 | verification-gap, edge-case, blind, security, code-review, reviewer, test-engineer | package.json (no `engines`), README.md:141-146 | Nothing tells a contributor Node ≥ 21 is needed; on Node 20 `npm test` fails loudly with a "Could not find" error | real: Node 21+ expands the glob (doc/api/test.md); README names no Node version | Minor · Possible | note |
| 2 | edge-case, reviewer, code-review, test-engineer | package.json:7 | `tests/*.test.js` does not recurse; a future `tests/sub/x.test.js` would be skipped | real but no subfolder exists today (`tests/` has 24 `*.test.js` files and `dom.js`) | Minor · Unlikely | drop |
| 3 | test-engineer | package.json:7 | a glob that matches nothing exits 0 with 0 tests, so a moved `tests/` folder would pass CI | real: `node --test "nonexist/*.test.js"` exited 0 here | Minor · Unlikely | drop |
| 4 | intent, reviewer, code-review, test-engineer | package.json:7 on windows-2022 | cmd.exe quoting not run here | not a defect: Node's own docs recommend the double-quoted form; CI's "Unit tests" step shows `# tests 214` | Minor · Unlikely | note (Not checked) |
| 5 | blind | ci.yml:18, release.yml:16 | Node version copied in two workflows | pre-existing pattern, not introduced here | — | deferred |
| 6 | blind | PR body | the PR should say what broke | taken: the PR body states the Node 22 error | — | note (SHIP) |
| 7 | blind | CI e2e and `npx tauri build` | not exercised on Node 22 by this diff | real gap; CI runs both on the PR | Minor · Unlikely | note |
| 8 | blind, intent | .gitignore | the kiln line is in the tree but not in the diff | kiln setup, not this change; kept out of the change's paths | — | declined to judge |
| 9 | blind | changelog | no changelog entry | false: the repository has no changelog file (`git ls-files` finds none) | false | drop |
| 10 | security | release.yml, ci.yml | third-party actions pinned by tag; msedgedriver-tool unpinned | pre-existing, outside the diff | — | deferred |
| 11 | security, reviewer, code-review, test-engineer | repo root | empty sandbox placeholder dotfiles are untracked | not part of the change; SHIP stages named paths only | — | declined to judge |

## Fixed

None: no finding landed in a fix-now cell.

## Rulings

- Ruling: finding 1 (Node version note) is not added — the brief says nothing else changes, and the failure is loud, not silent — cost if wrong: a contributor on Node 20 reads one confusing error.

## Deferred

- Node version kept in two workflows; `actions/setup-node` can read `node-version-file` once `engines` or `.nvmrc` exists (finding 5).
- Pin third-party actions to commit SHAs, and `cargo install --git` msedgedriver-tool with `--rev` and `--locked` (finding 10).

## Declined to judge

- The `.gitignore` kiln line and `.kiln/`: kiln setup, not this change.
- Empty read-only dotfiles at the repo root (`.bashrc`, `.mcp.json`, `.claude/…`): sandbox placeholders, not the user's files.
- Node 20's end-of-life date: changes nothing about correctness.
152 changes: 152 additions & 0 deletions .kiln/work/20261121-fix-test-command-so-runs-node/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"schema_version": 1,
"id": "20261121-fix-test-command-so-runs-node",
"follows": "20261121-review-each-items-above-one-one",
"status": "shipped",
"session_id": "0b73138a-cf32-4ba7-ac23-30a61cd6d8d6",
"path": "bounded",
"type": "ci",
"auto": false,
"stage": "VERIFY",
"step": null,
"gates": {
"plan": {
"decision": "approved",
"artifact_sha": "d909bc3111c71124ff3a5217abc16094cc98272dcf17075ad395787c41caf8f4",
"answer": "ruled by auto mode, not by the user",
"by": "auto",
"at": "2026-11-21T06:41:22.042Z"
},
"review": {
"decision": "approved",
"artifact_sha": "1fa7f61f2c61dcbac845a14ee0989d3280d305254ecd6b0aa77524302ed2852b",
"answer": "ruled by auto mode, not by the user",
"by": "auto",
"at": "2026-11-21T06:44:50.515Z"
}
},
"predicted": [
{
"path": "package.json"
},
{
"path": ".github/workflows/ci.yml"
},
{
"path": ".github/workflows/release.yml"
}
],
"base": "10da06c82d4f1920b2252dcdac2559cc86786f8f",
"last_verified": "10da06c82d4f1920b2252dcdac2559cc86786f8f",
"dirty_at_open": [
".gitignore"
],
"verify": [
{
"id": "unit",
"cmd": "node --test \"tests/*.test.js\"",
"exit": 0,
"ms": 3598,
"range": "10da06c82d4f1920b2252dcdac2559cc86786f8f..10da06c82d4f1920b2252dcdac2559cc86786f8f",
"phase": "full",
"tree": "dfd84b0caf6f2e8dc57092c59b0489487d5042ef"
},
{
"id": "unit",
"cmd": "node --test \"tests/*.test.js\"",
"exit": 0,
"ms": 5455,
"range": "10da06c82d4f1920b2252dcdac2559cc86786f8f..10da06c82d4f1920b2252dcdac2559cc86786f8f",
"phase": "full",
"tree": "65e3189a01c595dc7702427d08be04076745be4d"
},
{
"id": "unit",
"cmd": "node --test \"tests/*.test.js\"",
"exit": 0,
"ms": 5474,
"range": "10da06c82d4f1920b2252dcdac2559cc86786f8f..10da06c82d4f1920b2252dcdac2559cc86786f8f",
"phase": "full",
"tree": "65e3189a01c595dc7702427d08be04076745be4d"
}
],
"pass": 1,
"carry_over": [],
"displaced": [],
"rules": [
{
"stage": "plan",
"files": []
},
{
"stage": "review",
"files": []
}
],
"knowledge": [],
"practices": [
{
"stage": "investigate",
"ids": []
},
{
"stage": "plan",
"ids": [
"planning-and-task-breakdown"
]
},
{
"stage": "implement",
"ids": [
"incremental-implementation",
"test-driven-development",
"source-driven-development",
"ci-cd-and-automation"
]
},
{
"stage": "review",
"ids": [
"reviewer",
"blind-hunter",
"edge-case-hunter",
"verification-gap",
"intent-alignment",
"code-review-specialist",
"security-auditor",
"test-engineer"
]
},
{
"stage": "ship",
"ids": [
"git-workflow-and-versioning",
"shipping-and-launch"
]
}
],
"snapshots": [
{
"name": "task/0",
"commits": {
".": "320e798bf757f16f72d8f1f0841d0702a396719a"
},
"at": "2026-11-21T06:41:22.082Z"
},
{
"name": "task/1",
"commits": {
".": "fc6c94f88f861e7a39033d4b5bb652b72e154aac"
},
"at": "2026-11-21T06:42:14.921Z"
}
],
"baseline": null,
"checklist": [],
"opened": [
"https://github.com/ttncode/notelet/pull/103"
],
"branches": {
".": "ci/20261121-fix-test-command-so-runs-node"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"test": "node --test tests/",
"test": "node --test \"tests/*.test.js\"",
"tauri": "tauri",
"test:e2e": "node --test tests-e2e/app.e2e.js"
},
Expand Down
Loading