@holmes-lab/holmes-kit 0.19.0 → 0.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/.build-id +1 -1
  3. package/dist/holmes/cli/agents.d.ts +22 -0
  4. package/dist/holmes/cli/agents.js +76 -1
  5. package/dist/holmes/cli/approve.js +6 -1
  6. package/dist/holmes/cli/doctor.d.ts +51 -1
  7. package/dist/holmes/cli/doctor.js +211 -36
  8. package/dist/holmes/cli/index.js +7 -1
  9. package/dist/holmes/cli/init.js +12 -0
  10. package/dist/holmes/cli/native-deps.d.ts +65 -0
  11. package/dist/holmes/cli/native-deps.js +131 -0
  12. package/dist/holmes/cpg/cycle-observation.d.ts +65 -0
  13. package/dist/holmes/cpg/cycle-observation.js +146 -0
  14. package/dist/holmes/governance/approval-queue.d.ts +23 -4
  15. package/dist/holmes/governance/approval-queue.js +44 -6
  16. package/dist/holmes/hooks/stop.d.ts +15 -0
  17. package/dist/holmes/hooks/stop.js +46 -3
  18. package/dist/holmes/mcp/handlers.d.ts +2 -0
  19. package/dist/holmes/mcp/handlers.js +29 -2
  20. package/dist/holmes/mcp/maintenance-analyze.d.ts +37 -0
  21. package/dist/holmes/mcp/maintenance-analyze.js +73 -1
  22. package/dist/holmes/mcp/maintenance-evidence.d.ts +41 -0
  23. package/dist/holmes/mcp/maintenance-evidence.js +71 -4
  24. package/dist/holmes/project/install-scripts-policy.d.ts +76 -0
  25. package/dist/holmes/project/install-scripts-policy.js +131 -0
  26. package/dist/holmes/project/npx-bin.d.ts +6 -0
  27. package/dist/holmes/project/npx-bin.js +10 -0
  28. package/dist/holmes/review/failed-test-names.d.ts +19 -0
  29. package/dist/holmes/review/failed-test-names.js +43 -0
  30. package/dist/holmes/review/run-replay.d.ts +23 -0
  31. package/dist/holmes/review/run-replay.js +30 -0
  32. package/dist/holmes/review/test-runner.d.ts +27 -0
  33. package/dist/holmes/review/test-runner.js +59 -3
  34. package/docs/install-guide.md +54 -5
  35. package/package.json +4 -1
@@ -91,19 +91,63 @@ Your npm metadata cache predates the release — measured minutes after publishi
91
91
  registry already listed the version while a default-cache install still refused it. Add
92
92
  `--prefer-online`, or retry in a few minutes.
93
93
 
94
+ ### npm 12: `better-sqlite3` has no binary and nothing failed
95
+
96
+ npm 12 (and npm ≥ 11.19) **blocks dependency install scripts by default** and skips them
97
+ silently: `npm ci` exits 0, `better-sqlite3` never runs `prebuild-install`, and the first
98
+ `require` dies with "Could not locate the bindings file". Measured 2026-09-09 (Windows 11,
99
+ npm 12.0.1, Node 24.19.0). `npx holmes-kit doctor` names this cause as `scripts-blocked` and prints
100
+ the commands below; do not reinstall — a reinstall reproduces the same state.
101
+
102
+ Only **one** package needs its script: `better-sqlite3`. The 8 tree-sitter packages are also
103
+ listed as blocked, but they load from their shipped `prebuilds/` without the script (measured on
104
+ all 8), so they are deliberately NOT approved. This repository's `package.json` therefore carries
105
+
106
+ ```json
107
+ "allowScripts": { "better-sqlite3@12.11.1": true }
108
+ ```
109
+
110
+ pinned to the lockfile version, so a dependency bump forces a fresh review (a test fails until the
111
+ pin is updated). Recovery, by how you installed — on Windows use the `.cmd` spellings (see below):
112
+
113
+ | Layout | Commands |
114
+ |---|---|
115
+ | A project that depends on holmes-kit | `npm install-scripts approve better-sqlite3@12.11.1` then `npm rebuild better-sqlite3 --foreground-scripts` (from the project root; this writes the pin into YOUR package.json) |
116
+ | This repository checkout | already approved — `npm rebuild better-sqlite3 --foreground-scripts` if the binary is missing |
117
+ | Global (`npm install -g`) | `npm rebuild -g better-sqlite3 --foreground-scripts --allow-scripts=better-sqlite3` — a per-command flag scoped to one package; no npm config is changed. Target the dependency: `rebuild -g @holmes-lab/holmes-kit` re-links the bin and dies `EEXIST` under npm 12 (measured). If this fails `EPERM` under `C:\Program Files\nodejs`, your prefix is protected — see "Before `npm install -g`" above |
118
+ | Bare `npx` | not repairable in place — do a local install and use the first row |
119
+
120
+ Never use `--dangerously-allow-all-scripts` or a global `allow-scripts` config: the point of the
121
+ policy is that only the reviewed package runs code at install time. Older npm 11 (measured 11.6.2)
122
+ ignores the `allowScripts` field and runs scripts as before; npm 11.19 honours it exactly like 12.
123
+
124
+ ### Windows: `npm`/`npx` are blocked by the PowerShell execution policy
125
+
126
+ `npm`, `npx` and `holmes-kit` resolve to `.ps1` shims first, and a `Restricted`/`AllSigned`
127
+ policy refuses them (PSSecurityException). The `.cmd` shims always run: `npm.cmd`, `npx.cmd`.
128
+ doctor emits `.cmd` commands on Windows and appends the policy note when it can observe a
129
+ blocking policy. Do not change the execution policy to fix this.
130
+
94
131
  ### `better-sqlite3` fails to build
95
132
 
96
133
  The one dependency that may need a toolchain. The 8 tree-sitter grammars ship prebuilt binaries
97
134
  (`darwin-arm64`, `darwin-x64`, `linux-x64`, `win32-x64`) and compile nothing; `better-sqlite3`
98
135
  downloads a prebuild at install time and **falls back to compiling** when none matches your
99
- platform and Node ABI. If it compiles, you need:
136
+ platform and Node ABI. doctor reports this as `build-failed` — with the approval in place, the
137
+ script ran and left no binary — and names what it can observe on Windows (Python on PATH, Visual
138
+ Studio C++ Build Tools, a space in the install path). It cannot observe a failed prebuild
139
+ download; rerun with `--foreground-scripts` to see the script's own output. If it compiles, you
140
+ need:
100
141
 
101
142
  | Platform | Toolchain |
102
143
  |---|---|
103
- | Windows | Visual Studio Build Tools (C++ workload) |
144
+ | Windows | Visual Studio Build Tools (C++ workload) + Python 3 on PATH; prefer an install path without spaces |
104
145
  | macOS | Xcode Command Line Tools (`xcode-select --install`) |
105
146
  | Alpine | `apk add --no-cache python3 make g++` |
106
147
 
148
+ A binary that exists but fails with `NODE_MODULE_VERSION` was built for another Node — doctor
149
+ calls that `abi-mismatch`; rebuild against the Node you run.
150
+
107
151
  ### `spawn sh ENOENT` during a git-URL install
108
152
 
109
153
  `npm i -g git+ssh://…` is not a supported path: npm 11 clones the repository into its cache and
@@ -117,15 +161,20 @@ npx holmes-kit doctor # local install
117
161
  holmes-kit doctor # global install
118
162
  ```
119
163
 
120
- Expect `10 pass, 1 warn, 0 fail` on a healthy install. The lines that matter most:
164
+ Expect `0 fail` on a healthy install (a few `warn` lines are normal — measured `12 pass, 4 warn,
165
+ 0 fail` on a Windows source checkout). The lines that matter most:
121
166
 
122
167
  - `global prefix` — whether `-g` would work on this machine, and the remedy if not
123
- - `tree-sitter grammars` / `better-sqlite3` whether the native modules actually load
168
+ - `tree-sitter grammars` every grammar actually PARSES in a fresh process (`8 grammars parse`)
169
+ - `better-sqlite3` — loads and runs a `:memory:` query; on FAIL the detail names the cause
170
+ (`scripts-blocked`, `abi-mismatch`, `build-failed`, or `unknown` with the raw error) and the fix
171
+ is the exact command for your install layout
124
172
 
125
173
  ## What we deliberately do NOT do
126
174
 
127
175
  | Idea | Why not |
128
176
  |---|---|
129
- | A `postinstall` script that prints guidance | Triggers npm 11's `allow-scripts` warning and forfeits this package's current property of running no install scripts at all |
177
+ | A `postinstall` script that prints guidance | Under npm 12 it would be blocked like any other install script, and it forfeits this package's property of running no install scripts of its own |
178
+ | Approving the tree-sitter grammars in `allowScripts` | Measured unnecessary — they load from shipped prebuilds — and every extra approval is code that runs at install time |
130
179
  | Recommending `npx @holmes-lab/holmes-kit init` with no install | `init` writes wiring with absolute paths; under bare `npx` those point into the npx cache and break when it is pruned |
131
180
  | Fixing your npm prefix from inside the package | A package rewriting your npm configuration is exactly the supply-chain behaviour this guide warns about |
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "@implements A-SPEC-209",
3
3
  "name": "@holmes-lab/holmes-kit",
4
- "version": "0.19.0",
4
+ "version": "0.19.3",
5
5
  "description": "Holmes-Kit — deterministic Agentic Software Engineering (ASE) harness with causal traceability (spec chain + D-CPG + RTM + phase guardrail)",
6
6
  "main": "dist/holmes/mcp/server.js",
7
7
  "types": "dist/holmes/mcp/server.d.ts",
@@ -85,5 +85,8 @@
85
85
  },
86
86
  "publishConfig": {
87
87
  "access": "public"
88
+ },
89
+ "allowScripts": {
90
+ "better-sqlite3@12.11.1": true
88
91
  }
89
92
  }