lossless-core 0.1.0 → 0.1.1

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # lossless-core
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6748df1: Add the three host seams the OpenCode adapter uses: `renderableFrontier` renders a store's DAG frontier for a host checkpoint, `grepView` accepts an `expandTool` name so each adapter can name its own expansion tool, and `LcmStore.entryCountWithPrefix` counts a family of rows without a table scan.
8
+ - 6748df1: Refresh every external dependency to its newest published version: Vite+ 1.4.0 and Vitest 5.0.5, TypeScript 7.0.2, `@types/node` 26.6.5, `@changesets/cli` 3.0.3, Pi 1.4.0, OpenCode 2.1.4, Typebox 1.4.3, Blume 2.2.5, and Bun 1.4.4. Pi host packages now use the `*` peer range its package guide documents for packages the host supplies.
9
+ - 6748df1: Derive the heal source window from the summary target instead of clipping every source message at a fixed 3,000 tokens. The window is clamped to the summarizer request budget and has an explicit `healSourceTokens` override in Pi and OpenCode. A leaf that exceeds one window is mapped through up to eight exact windows and reduced once, so a large tool result can become clean without one enormous prompt. A source beyond the bounded plan is blocked without another model call, while a mechanical node gets one improvement. Heal reports now separate clean repairs from improvements and record source-blocked nodes.
10
+ - 6748df1: Add per-node summary timing, session-correlated engine rows, and adapter-routed metrics. OpenCode now writes engine and summarizer rows to its sidecar log, exposes the summarizer call and pass budgets, marks character-derived usage as estimated, and reports summary latency, cap outcomes, and abandoned rows. Add persistent summary quality: clean, clipped, mechanical, and derived. Existing stores migrate to generation 2, and a failed parent stays visible as derived. Add a bounded heal command in both adapters. It finds tainted summaries and their ancestors, re-derives them from stored source bottom-up, rejects another mechanical result, and supports a dry run. A heal owns its store connection so a plugin reload cannot finalize it, and one session allows one heal at a time. Mechanical work runs before a clipped retry, so a bounded run keeps making progress.
11
+ - 6748df1: Create store files owner-only before SQLite opens them, so the database, WAL, and shared-memory files are 0600 from the first write, and repair an existing world-readable database on open.
12
+
3
13
  ## 0.1.0
4
14
 
5
15
  First release.
package/README.md CHANGED
@@ -1,13 +1,16 @@
1
1
  # lossless-core
2
2
 
3
- The engine behind [pi-lossless](https://npmx.dev/package/pi-lossless): Lossless
3
+ The engine behind [pi-lossless](https://npmx.dev/package/pi-lossless) and
4
+ [opencode-lossless](https://npmx.dev/package/opencode-lossless): Lossless
4
5
  Context Management for a long-running agent. It stores every message verbatim,
5
6
  replaces aged context with searchable pointers, and keeps the original text
6
7
  readable by id, entry, or search. The algorithm is
7
8
  [Lossless Context Management](https://papers.voltropy.com/LCM), by Clint Ehrlich
8
9
  and Theodore Blackman (Voltropy PBC).
9
10
 
10
- It names no agent SDK. A host implements two ports, and the engine does the rest.
11
+ It has no agent SDK dependency. A host supplies two ports, and the engine does the rest.
12
+ Pi implements both; the OpenCode v2 adapter implements `ModelHost` and runs
13
+ retrieval in a host child session instead of `Reader`.
11
14
 
12
15
  ```ts
13
16
  import { LcmStore, runCompaction, runRetrieval } from "lossless-core";
@@ -23,6 +26,8 @@ import type { ModelHost, Reader } from "lossless-core";
23
26
  deleted: the store still holds the verbatim text.
24
27
  - **Retrieval.** A reader answers a question by calling `lcm_grep`,
25
28
  `lcm_describe`, and `lcm_expand`, so the answer cites what was read.
29
+ - **Repair.** `runHeal` re-derives a mechanically truncated summary and its
30
+ ancestors from the provenance rows it still points at.
26
31
  - **Redaction.** Secret-shaped text is masked on its way to a model and never
27
32
  at the door, so an export or a read can still return what was stored.
28
33
 
@@ -39,12 +44,14 @@ model's reply.
39
44
  | `Reader` | What did the reader ask for, and what did it conclude |
40
45
 
41
46
  `src/host.ts` documents both. The engine's boundary test fails any module under
42
- `src/` that names an agent SDK, a bare specifier other than `node:*` and
47
+ `src/` that imports an agent SDK, a bare specifier other than `node:*` and
43
48
  `typebox`, or a file outside the engine.
44
49
 
45
50
  ## Where the rest lives
46
51
 
47
52
  - [pi-lossless](https://npmx.dev/package/pi-lossless): the Pi adapter, and
48
53
  every user-facing command.
54
+ - [opencode-lossless](https://npmx.dev/package/opencode-lossless): the
55
+ OpenCode v2 adapter, its commands, and the live loop.
49
56
  - [The docs site](https://stainless-code.com/lossless/): how LCM behaves in a
50
57
  session, the config keys, and the limits.