`package.json` declared
"files": ["lib/*.js", "lib/loop.js", "lib/loop/*.js", "lib/types/*.d.ts"]
`lib/*.js` matches ONE level. `lib/embed/http.js` therefore never entered the
tarball, while `lib/index.js:35` imports it:
import { createHttpEmbedder } from './embed/http.js'
## How this survived
Every test in this repo runs from the source tree, where the file obviously
exists. `npm pack --dry-run` printed "10 files" — a plausible number nobody had
reason to read through. The defect is only reachable from the one path that
ships: installing the tarball.
Measured, extracting the tarball and importing it:
IMPORT FAILED: ERR_MODULE_NOT_FOUND
Cannot find module '.../package/lib/embed/http.js'
imported from '.../package/lib/index.js'
After the fix, the same command:
IMPORT OK, exports: StableMem,apply,default,defaultPath,inject,instanceKey,lastUserText,name
## Fix
`lib/embed/*.js` added to the allowlist. The tarball goes from 10 to 11 files
(86.1 kB) and `lib/embed/http.js` is in it.
## Criterion
`test/packaging.test.js`:
1. every `.js` under `lib/` must be matched by at least one `files` pattern.
The patterns compile to regexes the way npm treats them (`*` does not cross
`/`), so the criterion needs no hand-maintained file list and cannot drift.
2. every relative import in `lib/index.js` must resolve on disk — otherwise
criterion 1 could pass vacuously for a file that does not exist.
Reverting `files` to the old list turns criterion 1 red:
not ok 1 - packaging: every file under lib/ is covered by package.json "files"
these files live under lib/ but no "files" pattern reaches them ...
lib/embed/http.js
## Why it belongs in this branch
V6 made the embedder assembly load-bearing (two instances, one per side). A
release that cannot import `lib/embed/http.js` has no embedder at all, so the
distinction V6 introduced would never reach a user. The bug predates this
branch; its blast radius is the shipped artifact.
Gates: npm test 294/294 (0 skipped), npm run check 12/12, npm pack 11 files.
47 lines
1.5 KiB
JSON
47 lines
1.5 KiB
JSON
{
|
|
"name": "dsh-memory",
|
|
"version": "0.1.0",
|
|
"description": "HologramAgent-style block memory (stablemem) for dsh: sqlite + FTS5 recall, no embedding.",
|
|
"type": "module",
|
|
"main": "lib/index.js",
|
|
"exports": {
|
|
".": "./lib/index.js",
|
|
"./loop": "./lib/loop.js"
|
|
},
|
|
"files": [
|
|
"lib/*.js",
|
|
"lib/embed/*.js",
|
|
"lib/loop.js",
|
|
"lib/loop/*.js",
|
|
"lib/types/*.d.ts"
|
|
],
|
|
"engines": {
|
|
"node": ">=22.5.0"
|
|
},
|
|
"scripts": {
|
|
"test": "node --test test/store.test.js test/packaging.test.js test/plugin.test.js test/loader.test.js test/phase-b-a.test.js test/phase-b-g.test.js test/phase-b-g-static.test.js test/phase-b-h.test.js test/phase-b-p1-vector-wiring.test.js test/phase-b-c4-centering.test.js test/phase-b-c5-reasons.test.js test/phase-b-v6-sides.test.js test/memory-log.test.js test/loop.test.js test/loop-ports.test.js test/loop-system-e2e.test.js",
|
|
"check": "node scripts/checkpoints.js"
|
|
},
|
|
"peerDependencies": {
|
|
"@deepseek-ai/cordis": "^4.0.5",
|
|
"@deepseek-ai/dsh-agent-loop": "0.2.1-rc.2",
|
|
"@deepseek-ai/dsh-llm": "0.2.1-rc.2",
|
|
"@deepseek-ai/dsh-session": "0.2.1-rc.2",
|
|
"@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
|
|
"@deepseek-ai/dsh-tools": "0.2.1-rc.2"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"@deepseek-ai/dsh-system-prompt": {
|
|
"optional": true
|
|
},
|
|
"@deepseek-ai/dsh-tools": {
|
|
"optional": true
|
|
},
|
|
"@deepseek-ai/dsh-llm": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"license": "MIT",
|
|
"private": true
|
|
}
|