dsh-plugin-sessiongraph-service 0.1.11 → 0.1.13

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/lib/schema.d.ts CHANGED
@@ -8,8 +8,14 @@
8
8
  * silently empty result that looks like "no match".
9
9
  * @module dsh-plugin-sessiongraph-service/schema
10
10
  */
11
- /** Current on-disk schema version. Bump on any change to {@link SCHEMA_STATEMENTS}. */
12
- export declare const SCHEMA_VERSION = 1;
11
+ /**
12
+ * Current on-disk schema version. Bump on any change to {@link SCHEMA_STATEMENTS}.
13
+ *
14
+ * v2 stores the FTS index contentless (`content=''`): FTS5's default build keeps a copy of every
15
+ * indexed column in a `_content` shadow table, which on a real corpus was 67MB of a 174MB file
16
+ * holding a token stream that can always be recomputed from `entry.text`.
17
+ */
18
+ export declare const SCHEMA_VERSION = 2;
13
19
  /** Relative path of the index file inside an index root. */
14
20
  export declare const INDEX_RELATIVE_PATH = "index.db";
15
21
  /** One session, keyed by its harness session id. */
@@ -21,9 +27,14 @@ export declare const ENTRY_FTS_TABLE = "entry_fts";
21
27
  /**
22
28
  * Every statement needed to create an index from nothing, in dependency order.
23
29
  *
24
- * `entry_fts` is an external-content-free FTS5 table: it stores only the bigram token stream and
25
- * keys rows by `entry.id`, so the entry text is never duplicated into the index. `content=''` would
26
- * also work, but the plain form keeps `delete`/`insert` symmetrical with one rowid.
30
+ * `entry_fts` is a **contentless** FTS5 table (`content=''`): it stores only the inverted index for
31
+ * the bigram token stream, keyed by `entry.id`. The default build keeps a `_content` shadow table
32
+ * holding a second copy of that stream — 67MB of a 174MB file on a real corpus, for data that can
33
+ * always be recomputed from `entry.text`.
34
+ *
35
+ * `contentless_delete=1` (SQLite 3.43+) is what makes that affordable: without it a contentless
36
+ * table cannot be maintained with plain `DELETE FROM`, and every removed session would need the old
37
+ * token values fed back through FTS5's `delete` command.
27
38
  */
28
39
  export declare const SCHEMA_STATEMENTS: readonly string[];
29
40
  /** `meta` keys the store and the indexer exchange through the file. */
package/lib/schema.js CHANGED
@@ -8,8 +8,14 @@
8
8
  * silently empty result that looks like "no match".
9
9
  * @module dsh-plugin-sessiongraph-service/schema
10
10
  */
11
- /** Current on-disk schema version. Bump on any change to {@link SCHEMA_STATEMENTS}. */
12
- export const SCHEMA_VERSION = 1;
11
+ /**
12
+ * Current on-disk schema version. Bump on any change to {@link SCHEMA_STATEMENTS}.
13
+ *
14
+ * v2 stores the FTS index contentless (`content=''`): FTS5's default build keeps a copy of every
15
+ * indexed column in a `_content` shadow table, which on a real corpus was 67MB of a 174MB file
16
+ * holding a token stream that can always be recomputed from `entry.text`.
17
+ */
18
+ export const SCHEMA_VERSION = 2;
13
19
  /** Relative path of the index file inside an index root. */
14
20
  export const INDEX_RELATIVE_PATH = 'index.db';
15
21
  /** One session, keyed by its harness session id. */
@@ -21,9 +27,14 @@ export const ENTRY_FTS_TABLE = 'entry_fts';
21
27
  /**
22
28
  * Every statement needed to create an index from nothing, in dependency order.
23
29
  *
24
- * `entry_fts` is an external-content-free FTS5 table: it stores only the bigram token stream and
25
- * keys rows by `entry.id`, so the entry text is never duplicated into the index. `content=''` would
26
- * also work, but the plain form keeps `delete`/`insert` symmetrical with one rowid.
30
+ * `entry_fts` is a **contentless** FTS5 table (`content=''`): it stores only the inverted index for
31
+ * the bigram token stream, keyed by `entry.id`. The default build keeps a `_content` shadow table
32
+ * holding a second copy of that stream — 67MB of a 174MB file on a real corpus, for data that can
33
+ * always be recomputed from `entry.text`.
34
+ *
35
+ * `contentless_delete=1` (SQLite 3.43+) is what makes that affordable: without it a contentless
36
+ * table cannot be maintained with plain `DELETE FROM`, and every removed session would need the old
37
+ * token values fed back through FTS5's `delete` command.
27
38
  */
28
39
  export const SCHEMA_STATEMENTS = [
29
40
  `CREATE TABLE IF NOT EXISTS meta (
@@ -60,6 +71,8 @@ export const SCHEMA_STATEMENTS = [
60
71
  `CREATE INDEX IF NOT EXISTS idx_session_workspace ON ${SESSION_TABLE} (workspace, last_at DESC)`,
61
72
  `CREATE VIRTUAL TABLE IF NOT EXISTS ${ENTRY_FTS_TABLE} USING fts5(
62
73
  tokens,
74
+ content = '',
75
+ contentless_delete = 1,
63
76
  tokenize = 'unicode61 remove_diacritics 0'
64
77
  )`,
65
78
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-sessiongraph-service",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Service definition for the DeepSeek Harness session-graph seam (ctx.sessiongraph) — a store-provider and indexer-provider registry over local conversation history, plus the normalized query vocabulary the model-facing tool speaks",
5
5
  "keywords": [
6
6
  "dsh",