pikelet-wasm 0.9.1 → 0.9.2
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.
- package/CHANGELOG.md +54 -0
- package/README.md +37 -109
- package/complete/layer-reader.mjs +27 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,60 @@ Through 0.6.0 these were published as `pancake-wasm` and
|
|
|
8
8
|
packages are pre-1.0: a minor bump may carry breaking changes, and each entry lists them
|
|
9
9
|
first.
|
|
10
10
|
|
|
11
|
+
## pikelet-wasm 0.9.2 / pikelet 0.9.2 — 2026-10-01
|
|
12
|
+
|
|
13
|
+
Makes the layered update path work as documented: `append` on a freshly
|
|
14
|
+
compiled pack needs no flag, `pikelet mcp --pack` takes the newest layer,
|
|
15
|
+
and `verify_pack` reports honestly on a chain. Both packages move to 0.9.2
|
|
16
|
+
together, and `pikelet` requires `pikelet-wasm` ^0.9.2, whose chain reader
|
|
17
|
+
supplies the integrity fields `verify_pack` reports.
|
|
18
|
+
|
|
19
|
+
### Compatibility
|
|
20
|
+
|
|
21
|
+
- **A pack compiled from the same source gets a different identity than
|
|
22
|
+
under 0.9.1**, because its manifest gains `corpus.ingest`. Pins and
|
|
23
|
+
citations to packs already published are unaffected; only new compiles
|
|
24
|
+
change.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- **`compile` records how a pack's records were made, so `append` works on
|
|
29
|
+
it with no flag.** New packs carry `corpus.ingest` (the chunker and its
|
|
30
|
+
parameters). Packs compiled before it still need `--assert-ingest`, and
|
|
31
|
+
`append`'s error now prints the exact JSON to assert. `append` refuses a
|
|
32
|
+
chain whose declaration names a chunker this `pikelet` does not
|
|
33
|
+
implement. The new manifest field means a pack compiled from the same
|
|
34
|
+
source gets a different identity than under 0.9.1.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **`verify_pack` on a chain reports what it actually checked.** It returned
|
|
39
|
+
"no tests" with no encoder, integrity or calibration figures, and a note
|
|
40
|
+
blaming an "older build", so an agent concluded no verdict could be
|
|
41
|
+
trusted. It now runs the base's golden queries and probes against the
|
|
42
|
+
chain, labelled as the base's, skips a golden whose expected record a
|
|
43
|
+
layer removed, and reports the base's calibration figures, the chain's
|
|
44
|
+
calibration status and drift, and each member's integrity. A chain's
|
|
45
|
+
`info()` gains `encoderVerified`, `corpusIntegrity` and
|
|
46
|
+
`indexRowIntegrity`, and per-member integrity under `members`.
|
|
47
|
+
- **`pikelet mcp --pack` accepts the newest layer of an updated pack.** A
|
|
48
|
+
layer passed to `--pack`, or named by a shelf entry without a `lineage`,
|
|
49
|
+
failed to mount with "unsupported profile pikelet-layer-v1". It now mounts
|
|
50
|
+
the chain by walking each layer's parent locator, as LAYERED_PROFILE.md 7
|
|
51
|
+
specifies, locally or over HTTP; `#<sha256>` pins the head. Shelf entries
|
|
52
|
+
with a `lineage` mount as before.
|
|
53
|
+
|
|
54
|
+
### Documentation
|
|
55
|
+
|
|
56
|
+
- **Both READMEs describe layered updates** (`append`, `compact`, `rebase`,
|
|
57
|
+
mounting the newest layer, pins, the drift limit) and citations that
|
|
58
|
+
survive updates. The root README's opening states that a pack fixes how
|
|
59
|
+
its corpus is queried; the long Wikipedia demonstration moved to
|
|
60
|
+
`docs/wikipedia-demonstration.md`, and the abstention signals to
|
|
61
|
+
`docs/how-a-query-runs.md`. Stale claims were corrected: a "retrieval
|
|
62
|
+
agreement" signal that does not exist, MCP returning zero results under
|
|
63
|
+
`none`, and the old `PIKELET_SEARCH_EMBED_WORKERS` name.
|
|
64
|
+
|
|
11
65
|
## pikelet-wasm 0.9.1 / pikelet 0.9.1 — 2026-09-30
|
|
12
66
|
|
|
13
67
|
Fixes to the layered profile shipped in 0.9.0, headlined by a chain that
|
package/README.md
CHANGED
|
@@ -2,34 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
**Knowledge that ships as a file.**
|
|
4
4
|
|
|
5
|
-
Pikelet compiles a corpus into one self-contained, queryable artifact.
|
|
5
|
+
Pikelet compiles a corpus into one self-contained, queryable artifact. A model can interrogate a 456,153-record knowledge base whose backend is a static file.
|
|
6
6
|
|
|
7
|
-
A model
|
|
7
|
+
A `.pikelet` carries the source text, semantic and keyword indexes, the query encoder, retrieval calibration, evaluation fixtures, and integrity commitments over all of them. So it is more than stored search data: the file fixes how its corpus is queried — the model that turns a question into a vector, how candidates are ranked, and when the honest answer is "this corpus doesn't say" — and its identity is a hash that commits to all of it. **Pikelet makes retrieval semantics part of the versioned knowledge artifact.**
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Put the file on disk, S3, R2, a CDN, or any static HTTP host. A reader can mount it locally or over HTTP Range and search it without a vector database, embedding API, or retrieval server. Updates ship as small immutable layers, and an answer can name the exact version of the knowledge it came from.
|
|
10
10
|
|
|
11
11
|
The `pikelet` CLI requires Node 20+; the `pikelet-wasm` library runs on Node 18+ (CI tests 18, 20, 22), browsers, and Cloudflare Workers.
|
|
12
12
|
|
|
13
|
-
> **Upgrade to `pikelet-wasm@0.8.1` if you mount packs you did not compile.**
|
|
14
|
-
> 0.8.0 and earlier sized the inline encoder's WASM buffers from the
|
|
15
|
-
> artifact's own `maxTokens` with an upper bound only, so a pack declaring an
|
|
16
|
-
> out-of-range value could overflow them — at mount, before any query, and
|
|
17
|
-
> with every integrity check passing, because the pack's author is the one who
|
|
18
|
-
> signed it. 0.8.1 validates the bound. Packs the toolchain produces were
|
|
19
|
-
> never affected. `pikelet@0.8.1` picks the fix up through its dependency
|
|
20
|
-
> range; see the CHANGELOG for the detail.
|
|
21
|
-
|
|
22
13
|
```bash
|
|
23
14
|
npx pikelet compile --source ./docs --out docs.pikelet
|
|
24
15
|
```
|
|
25
16
|
|
|
26
|
-
Installing rather than using `npx`? Use `npm install -g pikelet
|
|
27
|
-
--omit=optional`. The optional dependency is `@xenova/transformers`, which
|
|
28
|
-
only the `create` scaffold path uses. Measured on a clean project, omitting it
|
|
29
|
-
takes the install from **82 packages / 257 MB / "6 vulnerabilities (5 high, 1
|
|
30
|
-
critical)"** to **2 packages / 1.8 MB / "found 0 vulnerabilities"** — the
|
|
31
|
-
advisories are all inside a dependency `compile` and `mcp` never load.
|
|
32
|
-
|
|
33
17
|
```text
|
|
34
18
|
Ingested 3 docs -> 3 chunks
|
|
35
19
|
Embedded 3/3 chunks with inline transformer
|
|
@@ -63,7 +47,7 @@ console.log(out.matchQuality, out.results[0]?.title);
|
|
|
63
47
|
// 'strong' 'Snapshot restore'
|
|
64
48
|
```
|
|
65
49
|
|
|
66
|
-
That's the whole loop. `compile` also takes a live URL (`--source https://docs.example.com`) instead of a directory. If you want a deployed search app — a Worker + UI, not a file — use `npx pikelet create` instead; see [`packages/pikelet/README.md`](packages/pikelet/README.md) for the full CLI reference and the tradeoffs between the two. `
|
|
50
|
+
That's the whole loop. `compile` also takes a live URL (`--source https://docs.example.com`) instead of a directory. If you want a deployed search app — a Worker + UI, not a file — use `npx pikelet create` instead; see [`packages/pikelet/README.md`](packages/pikelet/README.md) for the full CLI reference and the tradeoffs between the two. To install rather than use `npx`, run `npm install -g pikelet --omit=optional`: the optional dependency is only for `create` ([why it matters](packages/pikelet/README.md#installing)).
|
|
67
51
|
|
|
68
52
|
Under the hood, the file is one container for everything a reader needs:
|
|
69
53
|
|
|
@@ -96,93 +80,18 @@ Search is the interface. **The file is the knowledge deployment unit.**
|
|
|
96
80
|
|
|
97
81
|
## The shortest demonstration
|
|
98
82
|
|
|
99
|
-
A real
|
|
100
|
-
|
|
101
|
-
Try the live browser demo:
|
|
102
|
-
|
|
103
|
-
```text
|
|
104
|
-
https://pikelet-wiki-playground.pages.dev/
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
The page is static HTML/JS on Cloudflare Pages. It mounts the pack from R2:
|
|
108
|
-
|
|
109
|
-
```text
|
|
110
|
-
https://pub-6da2384a3bca4a44b2b2fa29a94cc811.r2.dev/wikipedia.pikelet
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
There is no `/search`, `/embed`, `/query`, or `/api` backend behind the demo.
|
|
114
|
-
The browser opens the `.pikelet` file over HTTP Range, verifies the artifact,
|
|
115
|
-
loads the embedded query encoder, and shows the byte ranges it reads.
|
|
116
|
-
|
|
117
|
-
That file was served by a deliberately dumb HTTP server whose only relevant capability was:
|
|
118
|
-
|
|
119
|
-
```text
|
|
120
|
-
fs.createReadStream + HTTP Range
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
There was no vector database, no search service, no embedding service, no application server that understood the pack, no index process on the server.
|
|
124
|
-
|
|
125
|
-
The pack was mounted by URL and exposed to a real headless Claude process through MCP. Each invocation was restricted with `--strict-mcp-config` to only:
|
|
126
|
-
|
|
127
|
-
```text
|
|
128
|
-
mcp__wiki-pack__search
|
|
129
|
-
mcp__wiki-pack__list_packs
|
|
130
|
-
mcp__wiki-pack__get_record
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
No web tool. No filesystem tool. No alternate retrieval tool.
|
|
134
|
-
|
|
135
|
-
One of the actual responses:
|
|
136
|
-
|
|
137
|
-
> **Q: What causes earthquakes?**
|
|
138
|
-
>
|
|
139
|
-
> Earthquakes are caused by the movement of tectonic plates in the Earth's crust. Stress builds up along fault boundaries where plates grind against or ride over one another; when that stress exceeds the friction holding the locked fault in place, it suddenly releases as shock waves (seismic waves) that shake the ground [record 429637].
|
|
140
|
-
>
|
|
141
|
-
> There are three main fault types that can produce quakes — normal, reverse (thrust), and strike-slip — and some quakes have less clear-cut causes, like deep shifts in ancient rock or mine-collapse "tremors" [record 429638].
|
|
142
|
-
>
|
|
143
|
-
> Two related mechanisms compound this:
|
|
144
|
-
>
|
|
145
|
-
> * Subduction, where one plate is forced under another into the mantle, produces the most powerful earthquakes and can trigger tsunamis [record 132833].
|
|
146
|
-
> * More broadly, the slow convection-driven movement of crustal plates over the hot mantle is the underlying driver of quakes, volcanoes, and mountain formation [record 132267].
|
|
147
|
-
>
|
|
148
|
-
> Volcanic eruptions can also cause earthquakes, though these are localized to areas near active volcanoes [record 429637].
|
|
149
|
-
|
|
150
|
-
The model did not just repeat the first search hit. It retrieved multiple records and synthesized them into a sourced answer.
|
|
151
|
-
|
|
152
|
-
Other runs produced:
|
|
153
|
-
|
|
154
|
-
```text
|
|
155
|
-
Who was the first person on the moon? → Neil Armstrong (records 408686, 408684)
|
|
156
|
-
How do volcanoes form? → plates + subduction + hotspots
|
|
157
|
-
(records 132770, 132765, 132852, 132853)
|
|
158
|
-
How does photosynthesis work? → two-phase reaction, cited (5 records: 114219, 114220, 114222, 114223, 269279)
|
|
159
|
-
What is the capital of France? → Paris (records 454641, 302684)
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
That is the product in one demonstration:
|
|
163
|
-
|
|
164
|
-
> **A model is interrogating a 456,153-record knowledge base whose backend is a static file.**
|
|
83
|
+
A real pack holds **456,153 Simple English Wikipedia records** in a **648.5 MiB** file. The [live browser demo](https://pikelet-wiki-playground.pages.dev/) is static HTML on Cloudflare Pages that mounts it straight from an R2 bucket — there is no `/search`, `/embed`, `/query` or `/api` behind it. The browser range-reads the file, verifies it, loads the query encoder from inside it, and shows every byte range it fetches.
|
|
165
84
|
|
|
166
|
-
|
|
85
|
+
For the agent test, the same file was served by a server whose only relevant capability was `fs.createReadStream` + HTTP Range and mounted by URL into a headless Claude restricted to the pack's three MCP tools (no web, no filesystem). The model answered questions such as "What causes earthquakes?" by searching, reading several records, and citing them.
|
|
167
86
|
|
|
168
|
-
|
|
87
|
+
| In one persistent session | Transferred |
|
|
88
|
+
| ---------------------------------------- | --------------------------: |
|
|
89
|
+
| Mount (once) | 51.7 MiB in 11 requests |
|
|
90
|
+
| Query encoder (once, with the first query) | ~25 MiB |
|
|
91
|
+
| Each fresh query after that | ~0.5–1.1 MiB |
|
|
92
|
+
| Whole session: 5 queries and a repeat | 80.8 MiB, 12.5% of the file |
|
|
169
93
|
|
|
170
|
-
|
|
171
|
-
| ------------------------------- | ----------------: | -------: |
|
|
172
|
-
| Initial mount | 51.7 MiB | 11 |
|
|
173
|
-
| Query 1 + one-time encoder load | 25.9 MiB | 77 |
|
|
174
|
-
| Query 2 | 504.4 KiB | 37 |
|
|
175
|
-
| Query 3 | 499.4 KiB | 46 |
|
|
176
|
-
| Query 4 | 968.9 KiB | 75 |
|
|
177
|
-
| Query 5 | 1.1 MiB | 116 |
|
|
178
|
-
| Repeated query 1 | 238.4 KiB | 4 |
|
|
179
|
-
| **Total** | **80.8 MiB** | **366** |
|
|
180
|
-
|
|
181
|
-
Roughly **12.5% of the 648.5 MiB artifact** crossed the wire across that whole session. Excluding the one-time ~25 MiB encoder load, fresh-query traffic ran **~0.5–1.1 MiB per query**. The complete artifact was never downloaded.
|
|
182
|
-
|
|
183
|
-
The headless-Claude test above used a fresh process per question, so each invocation repaid the ~52 MiB mount and ~25 MiB encoder cost — about 78 MiB per cold query. That's a real operational distinction: **persistent sessions amortize mount and encoder cost; independent cold processes do not.**
|
|
184
|
-
|
|
185
|
-
*(The large benchmark fixture still carries its historical `.pancake` filename from before the Pikelet rename; current artifacts use `.pikelet`.)*
|
|
94
|
+
The complete artifact is never downloaded. The full transcript, the per-query table, and what a cold process per question costs instead are in [the Wikipedia demonstration](docs/wikipedia-demonstration.md); [`benchmarks/range-proof/`](benchmarks/range-proof/) reproduces it.
|
|
186
95
|
|
|
187
96
|
---
|
|
188
97
|
|
|
@@ -198,7 +107,7 @@ npx pikelet mcp install \
|
|
|
198
107
|
|
|
199
108
|
The agent gets `search`, `get_record`, `list_packs`, `verify_pack`. A search result carries the identity of the pack and the location of the source record, so an agent can work against `product-docs.pikelet`, `rust-reference.pikelet`, `policy-2026-09.pikelet`, `customer-manual-v4.pikelet` without each publisher operating a retrieval API. The artifact can be local, private, public, behind authenticated object storage, or distributed like any other static asset.
|
|
200
109
|
|
|
201
|
-
A pack mounted with a content hash has a stable identity — `https://example.com/docs.pikelet#8d731...` — so "what body of knowledge did this agent query?" has a reproducible answer.
|
|
110
|
+
A pack mounted with a content hash has a stable identity — `https://example.com/docs.pikelet#8d731...` — so "what body of knowledge did this agent query?" has a reproducible answer. A citation is `(pack identity, record id)`, and it stays meaningful as the pack changes: a chain of layers resolves citations made against any of its earlier versions, and a pack compacted from a chain translates them forward, reporting what an old record became or that it was deleted (the old record's bytes stay in the old files). Citation translation is a library call today, `citation(identity, id)`; the MCP tools do not expose it yet.
|
|
202
111
|
|
|
203
112
|
**A mounted pack's content reaches the model as tool output.** `verify_pack` proves the bytes are intact and match their pinned identity; it does not prove the corpus itself is trustworthy. Mounting a pack from a source you don't control is the same trust decision as giving an agent any other untrusted-content tool — treat pack text the way you'd treat search results or fetched web pages, not as instructions.
|
|
204
113
|
|
|
@@ -228,9 +137,23 @@ All three packs derive from the same small synthetic Station Veyra corpus, with
|
|
|
228
137
|
|
|
229
138
|
---
|
|
230
139
|
|
|
140
|
+
## Update a pack without rebuilding it
|
|
141
|
+
|
|
142
|
+
A pack doesn't have to be recompiled when a few documents change. `append` never modifies its parent: it writes a new, small `.pikelet` — a **layer** — holding new records, deletions, or replacements, and the base plus its layers (a chain) is searched as one pack. Every published file stays byte-for-byte immutable; the newest layer defines the current state, and its identity pins the whole history.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npx pikelet append --parent docs.pikelet --source ./changed-docs --out docs.0001.pikelet
|
|
146
|
+
npx pikelet append --parent docs.0001.pikelet --remove 412 --out docs.0002.pikelet
|
|
147
|
+
npx pikelet mcp --pack docs.0002.pikelet
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Layers are small. On a 20-record test pack with a 24.6 MiB base, deleting a record took a 1.2 KiB layer and replacing one took 6.9 KiB; a layer that adds records also carries a vocabulary filter sized to its base's (about 43 KiB on a 3,255-record docs pack).
|
|
151
|
+
|
|
152
|
+
A layer records its parent's identity, and its location when the parent sits in the same directory, so mounting the newest layer finds the rest of the chain — locally or over HTTP — and verifies every link. `#<sha256>` on the newest layer pins the whole chain. Layers always inherit the base's encoder. They inherit its calibration only while the chain stays within the drift limit (by default, records added plus deleted up to 20% of the base's); past it, the chain serves `unscored` until `compact` folds it into one fresh base. `rebase` moves a layer onto a different parent. The format is specified in [`LAYERED_PROFILE.md`](LAYERED_PROFILE.md); `npx pikelet --help` lists every flag.
|
|
153
|
+
|
|
231
154
|
## Match quality and abstention
|
|
232
155
|
|
|
233
|
-
A nearest neighbour is not automatically evidence that a corpus answers a question. Pikelet can
|
|
156
|
+
A nearest neighbour is not automatically evidence that a corpus answers a question. At build time Pikelet can fit a classifier over retrieval signals — distances, and how much of the question the top passages actually contain ([details](docs/how-a-query-runs.md#how-abstention-is-decided)). When the corpus supports a reliable classifier, results carry `matchQuality: strong | weak | none`. When calibration can't separate supported from unsupported reliably — a single novel may be semantically homogeneous enough that the fit isn't trustworthy — Pikelet reports `matchQuality: unscored` and records why calibration was skipped, rather than manufacturing confidence. In the library, a `none` verdict withholds `results` by default; pass `query(text, { showAbstained: true })` to see the raw retrieval anyway — `matchQuality` and `confidence` are unaffected either way. MCP `search` does the opposite: it returns results under `none` with a note telling the model the support is indirect, because the calibrator can misjudge a paraphrase; `showAbstained: false` withholds them.
|
|
234
157
|
|
|
235
158
|
`matchQuality` is evidence about retrieval support. It is **not** a guarantee that an LLM will never hallucinate.
|
|
236
159
|
|
|
@@ -238,14 +161,15 @@ A nearest neighbour is not automatically evidence that a corpus answers a questi
|
|
|
238
161
|
|
|
239
162
|
## Deeper dives
|
|
240
163
|
|
|
241
|
-
- [
|
|
164
|
+
- [The Wikipedia demonstration](docs/wikipedia-demonstration.md) — the full agent transcript, the per-query network table, and what cold processes cost.
|
|
165
|
+
- [How a `.pikelet` query runs](docs/how-a-query-runs.md) — what is inside the file, what a query costs on the wire, remote execution, the integrity checks on the read path, and how abstention is decided.
|
|
242
166
|
- [The Veyra ablation](docs/veyra-ablation.md) — what happens to answers when the supporting record is edited or removed from the pack, with the reproduction commands.
|
|
243
167
|
- [Why make knowledge a file](docs/why-a-file.md) — the reasoning behind the single-artifact design, and what it commits to.
|
|
244
168
|
- [Architecture](docs/architecture.md) — the engine, the C ABI and the JavaScript wrapper; the artifact formats are specified in [`spec/`](spec/).
|
|
245
169
|
|
|
246
170
|
## What this is not
|
|
247
171
|
|
|
248
|
-
**Not a claim that vector databases are obsolete.** If your corpus changes continuously, needs transactional updates, serves many tenants, or already lives comfortably in a database, use a database. Pikelet targets `build → publish → query many times → replace on release
|
|
172
|
+
**Not a claim that vector databases are obsolete.** If your corpus changes continuously, needs transactional updates, serves many tenants, or already lives comfortably in a database, use a database. Pikelet targets `build → publish → query many times → replace on release`, with small layered updates in between.
|
|
249
173
|
|
|
250
174
|
**Not state-of-the-art embedding research.** The bundled model is MiniLM-L6, chosen for being small enough to live inside the artifact. ArguAna demonstrates a real quality cost from the compact encoder.
|
|
251
175
|
|
|
@@ -298,7 +222,8 @@ packages/pikelet-wasm/ The published pikelet-wasm package:
|
|
|
298
222
|
src/ Engine wrapper and artifact readers/builders
|
|
299
223
|
(the entrypoints, core/, artifact/, errors/)
|
|
300
224
|
complete/ Reader and builder for the complete
|
|
301
|
-
range-readable .pikelet artifact
|
|
225
|
+
range-readable .pikelet artifact, and the
|
|
226
|
+
layered-chain reader and producers
|
|
302
227
|
native/ N-API build of the same engine (benchmarks)
|
|
303
228
|
packages/pikelet/ The published pikelet CLI: compiler, MCP
|
|
304
229
|
server, encoder integration, Docusaurus plugin
|
|
@@ -306,6 +231,8 @@ docs/ Deeper dives (how a query runs, the Veyra
|
|
|
306
231
|
ablation, why a file), architecture notes,
|
|
307
232
|
rename history, measurement reports
|
|
308
233
|
spec/ Byte-level artifact contracts
|
|
234
|
+
LAYERED_PROFILE.md The layered profile: append, compact,
|
|
235
|
+
rebase, and how chains are read
|
|
309
236
|
benchmarks/beir/ Frozen BEIR ablation harness (encoder,
|
|
310
237
|
quantization, HNSW quality)
|
|
311
238
|
benchmarks/range-proof/ The deliberately boring static-HTTP proof:
|
|
@@ -342,6 +269,7 @@ Pikelet is early. The implementation is real; the format is not frozen. One prim
|
|
|
342
269
|
- content identity and lazy-read integrity verification
|
|
343
270
|
- calibration/abstention support
|
|
344
271
|
- MCP mounting
|
|
272
|
+
- layered updates: append, compact, rebase
|
|
345
273
|
- BEIR retrieval evaluation
|
|
346
274
|
- range-read and failure-mode tests
|
|
347
275
|
- a large 456k-record example artifact
|
|
@@ -121,6 +121,15 @@ async function walkToBase(head, options) {
|
|
|
121
121
|
throw new Error(`walking to the base exceeded the depth limit ${maxDepth} (2.7): a layer.parent cycle or an over-deep chain`);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
function memberIntegritySummary(opened) {
|
|
125
|
+
const infos = opened.filter((r) => typeof r?.info === 'function').map((r) => r.info());
|
|
126
|
+
const one = (key) => {
|
|
127
|
+
const values = [...new Set(infos.map((i) => i[key]))];
|
|
128
|
+
return values.length === 1 ? values[0] : 'mixed';
|
|
129
|
+
};
|
|
130
|
+
return { corpusIntegrity: one('corpusIntegrity'), indexRowIntegrity: one('indexRowIntegrity') };
|
|
131
|
+
}
|
|
132
|
+
|
|
124
133
|
const isHttpUrl = (loc) => /^https?:\/\//i.test(loc);
|
|
125
134
|
const describeLocation = (loc) => (typeof loc === 'string' ? loc : (loc?.url ?? loc?.location ?? '<source>'));
|
|
126
135
|
|
|
@@ -370,7 +379,24 @@ export async function openPikeletChain(members, options = {}) {
|
|
|
370
379
|
// to that member. A chain surfaces the base's, which are
|
|
371
380
|
// the ones fit against the corpus the encoder saw.
|
|
372
381
|
sampleQueries: Array.isArray(base.manifest.sampleQueries) ? base.manifest.sampleQueries : [],
|
|
373
|
-
|
|
382
|
+
// Each member's own integrity, from its reader. A
|
|
383
|
+
// tombstone-only layer is a verified shell (manifest plus
|
|
384
|
+
// tombstones), with no corpus or index to report on.
|
|
385
|
+
members: chainMembers.map((m, i) => {
|
|
386
|
+
const ri = typeof opened[i]?.info === 'function' ? opened[i].info() : null;
|
|
387
|
+
return {
|
|
388
|
+
depth: m.depth, identity: m.identity, records: m.records,
|
|
389
|
+
...(ri ? { corpusIntegrity: ri.corpusIntegrity, indexRowIntegrity: ri.indexRowIntegrity }
|
|
390
|
+
: { tombstoneOnly: true }),
|
|
391
|
+
};
|
|
392
|
+
}),
|
|
393
|
+
// The chain encodes with the base's encoder (4.5), so the
|
|
394
|
+
// base's verification is the chain's. Chain-level integrity
|
|
395
|
+
// is the members' when they agree, else 'mixed'. Without
|
|
396
|
+
// these, verify_pack on a chain reported no encoder or
|
|
397
|
+
// integrity state at all.
|
|
398
|
+
encoderVerified: opened[0].info().encoderVerified,
|
|
399
|
+
...memberIntegritySummary(opened),
|
|
374
400
|
};
|
|
375
401
|
},
|
|
376
402
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pikelet-wasm",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Vector search engine and .pikelet artifact readers/builders, in WebAssembly. Compile a corpus into one self-contained, hash-verified search file, or use the underlying HNSW engine directly. Runs in Node.js, browsers, and Cloudflare Workers with no native dependencies.",
|
|
5
5
|
"main": "src/pikelet.js",
|
|
6
6
|
"types": "src/pikelet.d.ts",
|