opencode-lossless 0.1.2 → 0.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-lossless",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Lossless Context Management for OpenCode v2: long sessions keep working past the point where the model would forget, and every verbatim message stays searchable and readable.",
5
5
  "keywords": [
6
6
  "coding-agent",
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: opencode-lossless
3
- description: "Use when an OpenCode v2 session has opencode-lossless installed: read compacted history with lcm_grep, lcm_describe, lcm_expand, or lcm_expand_query; run /lossless-status, /lossless-report, /lossless-pass, /lossless-heal, /lossless-backup, /lossless-export, /lossless-import, /lossless-diagnose, /lossless-migrate, or /lossless-gc; or tune the swap point."
3
+ description: "Use when an OpenCode v2 session has opencode-lossless installed: read compacted history with lcm_grep, lcm_describe, lcm_expand, or lcm_expand_query; run /lossless-status, /lossless-report, /lossless-pass, /lossless-heal, /lossless-backup, /lossless-export, /lossless-import, /lossless-diagnose, /lossless-migrate, /lossless-gc, or /lossless-dump; or tune the swap point."
4
4
  license: MIT
5
5
  metadata:
6
6
  type: composition
7
7
  library: "opencode-lossless"
8
- library_version: "0.1.2"
8
+ library_version: "0.1.3"
9
9
  requires:
10
10
  - lossless
11
11
  sources:
@@ -14,7 +14,7 @@ sources:
14
14
 
15
15
  # opencode-lossless
16
16
 
17
- Passive mirroring starts with zero config: every prompt, assistant reply, and tool exchange lands in a per-session SQLite sidecar. Past the swap point the DAG projection replaces aged history, and on host compaction the adapter hands over the frontier as the checkpoint instead of a summary.
17
+ Passive mirroring starts with no configuration. The adapter stores every prompt, assistant reply, and tool exchange in a per-session SQLite sidecar. Past the swap point the DAG projection replaces aged history, and on host compaction the adapter hands over the frontier as the checkpoint instead of a summary.
18
18
 
19
19
  ## Install
20
20
 
@@ -25,28 +25,31 @@ opencode plugin add opencode-lossless
25
25
  Equivalent `opencode.json` entry:
26
26
 
27
27
  ```json
28
- { "plugins": [{ "package": "opencode-lossless", "options": { "sidecarDir": "./.lossless" } }] }
28
+ { "plugins": [{ "package": "opencode-lossless" }] }
29
29
  ```
30
30
 
31
+ To keep sidecars inside the project, set `sidecarDir` to `"./.lossless"`.
32
+
31
33
  ## Commands
32
34
 
33
- - `/lossless-status` — message and compaction summary counts per live sidecar.
34
- - `/lossless-report` — this session's metrics: projection, checkpoint, pass, recall, reader.
35
- - `/lossless-pass` — run one DAG pass over the aged span now, without waiting for the swap.
36
- - `/lossless-heal` — dry-run repair of tainted summaries; `--apply` spends model calls.
37
- - `/lossless-backup` — copy this session's sidecar beside it.
38
- - `/lossless-export` — write the verbatim transcript and summaries as JSONL (mode 0600).
39
- - `/lossless-import` — restore rows from an export.
40
- - `/lossless-diagnose` — redacted, pasteable diagnostics block; `--save` writes it at mode 0600.
41
- - `/lossless-migrate` — upgrade older-schema sidecars in place (dry-run by default).
42
- - `/lossless-gc` — list old sidecars, or export and delete them (never the current session).
35
+ - `/lossless-status`, message and compaction summary counts per live sidecar.
36
+ - `/lossless-report`, this session's metrics: projection, checkpoint, pass, recall, reader.
37
+ - `/lossless-pass`, run one DAG pass over the aged span now, without waiting for the swap.
38
+ - `/lossless-heal`, dry-run repair of tainted summaries. `--apply` spends model calls.
39
+ - `/lossless-backup`, copy this session's sidecar beside it.
40
+ - `/lossless-export`, write the verbatim transcript and summaries as JSONL (mode 0600).
41
+ - `/lossless-import`, restore rows from an export.
42
+ - `/lossless-diagnose`, redacted, pasteable diagnostics block. `--save` writes it at mode 0600.
43
+ - `/lossless-migrate`, upgrade older-schema sidecars in place (dry-run by default).
44
+ - `/lossless-gc`, list old sidecars, or export and delete them (never the current session).
45
+ - `/lossless-dump`, read-only dump of the session sidecar. `--include-removed` keeps removed-branch rows, `--save` writes the output to a file at mode 0600.
43
46
 
44
47
  ## Recall tools
45
48
 
46
- - `lcm_grep` — full-text search over this session; `scope` reaches past sessions.
47
- - `lcm_describe` — inspect one summary (kind, costs, children) without expanding it.
48
- - `lcm_expand` — read the verbatim originals a summary covers.
49
- - `lcm_expand_query` — a bounded child session reads and answers, so originals never enter the parent context.
49
+ - `lcm_grep` searches full text over this session, and `scope` reaches past sessions. `role` keeps only rows stored with that role, `date_start` and `date_end` bound rows by timestamp, and `tool_name` keeps only tool-result rows for that tool.
50
+ - `lcm_describe` inspects one summary (kind, costs, children) without expanding it.
51
+ - `lcm_expand` reads the verbatim originals a summary covers, and `anchor` centers the listing on one entry.
52
+ - `lcm_expand_query` runs a bounded child session that reads and answers, so originals never enter the parent context.
50
53
 
51
54
  ## Config essentials
52
55
 
@@ -54,9 +57,11 @@ Equivalent `opencode.json` entry:
54
57
  { "enabled": true, "sidecarDir": "./.lossless", "assembly": true }
55
58
  ```
56
59
 
57
- - `sidecarDir` holds one SQLite file per session (0700 dir, 0600 files; delete one to forget that session).
58
- - `assembly: true` (default) owns the context boundary: projection swaps aged history and compaction stores the DAG frontier.
59
- - Every other key (swap thresholds, summarizer chain and budgets, heal window, reader timeout) lives on the config reference with its default: https://stainless-code.com/lossless/reference/opencode/config
60
+ The example stores sidecars in the project. Without `sidecarDir`, the plugin uses the global auto-detected path, which holds sessions from every project. The config reference lists the exact paths at https://stainless-code.com/lossless/reference/opencode/config
61
+
62
+ - `sidecarDir` holds one SQLite file per session (0700 dir, 0600 files). Delete one to forget that session. After upgrading a project that used `./.lossless`, keep `sidecarDir` set to `"./.lossless"` to keep that history: `/lossless-migrate` works in place in the configured directory only (dry run by default, moves nothing). To carry history elsewhere, `/lossless-export` each session under the old config and `/lossless-import` into an empty store under the new one, or stop the server first and copy the `.sqlite`, `-wal`, and `-shm` files across and then migrate.
63
+ - `assembly: true` (default) owns the context boundary. Projection swaps aged history and compaction stores the DAG frontier.
64
+ - The config reference documents every other key and its default: swap thresholds, summarizer chain and budgets, heal window, and reader timeout. See https://stainless-code.com/lossless/reference/opencode/config
60
65
 
61
66
  ## Verify
62
67
 
@@ -70,8 +75,8 @@ bun run opencode:compact # compaction gate, makes real model calls
70
75
 
71
76
  ## Common mistakes
72
77
 
73
- - **`assembly: false` drops `/lossless-pass` and `lcm_expand_query`** — keep the default `true` unless the host must own compaction; with `false`, compaction falls back to the host.
74
- - **`scope` equivalence** — `scope: "session"` (default) reads this session only; pass `scope: "sessions"` or `"all_sessions"` to reach past sessions.
75
- - **Reader is session-scoped** — `lcm_expand_query` returns findings only through its child session, never the raw transcript; ask a question it can answer from the sources, not for a dump.
76
- - **Forgetting is file deletion** — remove that session's sidecar file; there is no delete tool.
77
- - **Expecting host compaction to summarize** — with assembly on, the checkpoint is the DAG frontier, not a prose summary; read it with `lcm_describe`, not by asking the host.
78
+ - **`assembly: false` drops `/lossless-pass` and `lcm_expand_query`.** Keep the default `true` unless the host must own compaction. With `false`, compaction falls back to the host.
79
+ - **`scope` equivalence.** `scope: "session"` (default) reads this session only. Pass `scope: "sessions"` or `"all_sessions"` to reach past sessions.
80
+ - **Reader is session-scoped.** `lcm_expand_query` returns findings only through its child session, never the raw transcript. Ask a question it can answer from the sources, not for a dump.
81
+ - **Forgetting is file deletion.** Remove that session's sidecar file. There is no delete tool.
82
+ - **Expecting host compaction to summarize.** With assembly on, the checkpoint is the DAG frontier, not a prose summary. Read it with `lcm_describe`, not by asking the host.