@dikolab/kbdb 0.5.0 → 0.6.0
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/CLA.md +68 -0
- package/LICENSE +676 -12
- package/LICENSING.md +58 -0
- package/README.md +47 -24
- package/README.md.bak +320 -0
- package/dist/README.md +320 -0
- package/dist/{chunk-BJXEVALU.mjs → chunk-QLJ33C74.mjs} +44 -44
- package/dist/chunk-QLJ33C74.mjs.map +7 -0
- package/dist/cli.cjs +550 -232
- package/dist/cli.cjs.map +4 -4
- package/dist/cli.d.ts +0 -8
- package/dist/cli.mjs +483 -154
- package/dist/cli.mjs.map +4 -4
- package/dist/kbdb-worker.cjs +36 -5
- package/dist/kbdb-worker.cjs.map +3 -3
- package/dist/mod.cjs +89 -30
- package/dist/mod.cjs.map +4 -4
- package/dist/mod.mjs +88 -30
- package/dist/mod.mjs.map +4 -4
- package/dist/src/cli.d.ts +0 -8
- package/dist/src/shared/cli/constants/defaults.constant.d.ts +1 -1
- package/dist/src/shared/cli/constants/recfile-command-field-map.constant.d.ts +8 -0
- package/dist/src/shared/cli/constants/recfile-field-maps.constant.d.ts +21 -0
- package/dist/src/shared/cli/functions/compute-directory-level.function.d.ts +14 -0
- package/dist/src/shared/cli/functions/dispatch-command.function.d.ts +2 -28
- package/dist/src/shared/cli/functions/format-command-output.function.d.ts +14 -0
- package/dist/src/shared/cli/functions/format-db-not-found.function.d.ts +20 -0
- package/dist/src/shared/cli/functions/format-output.function.d.ts +1 -0
- package/dist/src/shared/cli/functions/format-recfile-output.function.d.ts +11 -0
- package/dist/src/shared/cli/functions/render-recfile-value.function.d.ts +11 -0
- package/dist/src/shared/cli/functions/resolve-db-dir.function.d.ts +24 -0
- package/dist/src/shared/cli/functions/resolve-recfile-key.function.d.ts +9 -0
- package/dist/src/shared/cli/functions/run-db-path.function.d.ts +10 -0
- package/dist/src/shared/cli/functions/run-export.function.d.ts +8 -4
- package/dist/src/shared/cli/functions/run-import.function.d.ts +4 -0
- package/dist/src/shared/cli/functions/run-learn.function.d.ts +12 -0
- package/dist/src/shared/cli/index.d.ts +4 -1
- package/dist/src/shared/cli/typings/cli-options.interface.d.ts +9 -2
- package/dist/src/shared/cli/typings/db-resolution.interface.d.ts +9 -0
- package/dist/src/shared/cli/typings/recfile-field-map.type.d.ts +10 -0
- package/dist/src/shared/version/constants/version.constant.d.ts +1 -1
- package/dist/src/shared/wasm-codec/functions/decode-option-u8.function.d.ts +9 -0
- package/dist/src/shared/wasm-codec/functions/decode-section-records.function.d.ts +4 -0
- package/dist/src/shared/wasm-codec/functions/encode-add-section-params.function.d.ts +2 -45
- package/dist/src/shared/wasm-codec/functions/encode-update-section-params.function.d.ts +10 -1
- package/dist/src/shared/wasm-codec/index.d.ts +1 -1
- package/dist/src/shared/wasm-codec/typings/add-section-input.model.d.ts +6 -0
- package/dist/src/shared/wasm-codec/typings/section-record-trailing.model.d.ts +5 -0
- package/dist/src/shared/wasm-codec/typings/section-record.model.d.ts +5 -0
- package/dist/src/shared/worker-client/functions/build-deno-permissions.function.d.ts +11 -0
- package/dist/src/shared/worker-client/functions/read-crash-reason.function.d.ts +9 -0
- package/dist/src/shared/worker-client/functions/resolve-spawn-script.function.d.ts +6 -0
- package/dist/src/shared/worker-client/functions/spawn-daemon.function.d.ts +1 -1
- package/dist/src/shared/worker-client/typings/section.model.d.ts +5 -0
- package/dist/src/shared/worker-client/typings/worker-client-options.interface.d.ts +0 -6
- package/dist/src/shared/worker-daemon/functions/count-files.function.d.ts +12 -0
- package/dist/src/shared/worker-daemon/functions/handle-import.function.d.ts +2 -0
- package/dist/src/shared/worker-daemon/functions/handle-read-ops.function.d.ts +8 -0
- package/dist/src/shared/worker-daemon/functions/validate-daemon-path.function.d.ts +15 -0
- package/dist/src/worker.d.ts +0 -7
- package/dist/wasm/default-embedding/kbdb_default_embedding_bg.wasm +0 -0
- package/dist/wasm/default-embedding/package.json +1 -1
- package/dist/wasm/fs-database/kbdb_fs_database_bg.wasm +0 -0
- package/dist/wasm/fs-database/package.json +1 -1
- package/dist/wasm/fs-migration/package.json +1 -1
- package/dist/wasm/kb-worker/kbdb_worker_bg.wasm +0 -0
- package/dist/wasm/kb-worker/package.json +1 -1
- package/dist/wasm/query-parser/kbdb_query_parser_bg.wasm +0 -0
- package/dist/wasm/query-parser/package.json +1 -1
- package/dist/worker.d.ts +0 -7
- package/dist/worker.mjs +37 -6
- package/dist/worker.mjs.map +3 -3
- package/package.json +10 -9
- package/dist/chunk-BJXEVALU.mjs.map +0 -7
- package/dist/src/shared/cli/functions/resolve-raw-db-path.function.d.ts +0 -10
- package/docs/details/README.md +0 -30
- package/docs/details/agent-tooling.md +0 -132
- package/docs/details/cli.md +0 -777
- package/docs/details/knowledge-base.md +0 -180
- package/docs/details/library-api.md +0 -495
- package/docs/details/mcp-server.md +0 -482
- package/docs/details/search-and-ranking.md +0 -575
- package/docs/details/storage.md +0 -531
- package/docs/goals/agents.md +0 -751
- package/docs/goals/architecture.svg +0 -198
- package/docs/goals/auto-capture.md +0 -378
- package/docs/goals/benchmarking.md +0 -296
- package/docs/goals/cli.md +0 -2654
- package/docs/goals/concurrency.md +0 -259
- package/docs/goals/content-composer.md +0 -609
- package/docs/goals/content-parser.md +0 -279
- package/docs/goals/database.md +0 -1679
- package/docs/goals/document.md +0 -368
- package/docs/goals/hybrid-search.md +0 -465
- package/docs/goals/mcp.md +0 -1541
- package/docs/goals/overview.md +0 -124
- package/docs/goals/query-parser.md +0 -373
- package/docs/goals/query-result.md +0 -860
- package/docs/goals/semantic-dedup.md +0 -233
- package/docs/goals/skills.md +0 -810
- package/docs/goals/sync.md +0 -217
- package/docs/goals/worker-client.md +0 -1005
- package/docs/goals/worker-daemon.md +0 -1547
- package/docs/modules/overview.md +0 -319
- package/docs/modules/rust/embedding/module.md +0 -91
- package/docs/modules/rust/fs-database/functions/document.md +0 -48
- package/docs/modules/rust/fs-database/functions/integrity.md +0 -79
- package/docs/modules/rust/fs-database/functions/io.md +0 -87
- package/docs/modules/rust/fs-database/functions/module.md +0 -22
- package/docs/modules/rust/fs-database/functions/query-exec.md +0 -44
- package/docs/modules/rust/fs-database/functions/section.md +0 -76
- package/docs/modules/rust/fs-database/indexes/btree.md +0 -35
- package/docs/modules/rust/fs-database/indexes/corpus.md +0 -61
- package/docs/modules/rust/fs-database/indexes/inverted.md +0 -60
- package/docs/modules/rust/fs-database/indexes/module.md +0 -64
- package/docs/modules/rust/fs-database/indexes/positional.md +0 -39
- package/docs/modules/rust/fs-database/indexes/vectors.md +0 -110
- package/docs/modules/rust/fs-database/module.md +0 -150
- package/docs/modules/rust/fs-database/types/catalog.md +0 -53
- package/docs/modules/rust/fs-database/types/module.md +0 -12
- package/docs/modules/rust/fs-database/types/section.md +0 -127
- package/docs/modules/rust/kb-worker/functions/compose.md +0 -57
- package/docs/modules/rust/kb-worker/functions/module.md +0 -20
- package/docs/modules/rust/kb-worker/functions/retrieve.md +0 -194
- package/docs/modules/rust/kb-worker/functions/search.md +0 -173
- package/docs/modules/rust/kb-worker/functions/write.md +0 -172
- package/docs/modules/rust/kb-worker/module.md +0 -171
- package/docs/modules/rust/kb-worker/types/cache.md +0 -90
- package/docs/modules/rust/kb-worker/types/context.md +0 -26
- package/docs/modules/rust/kb-worker/types/module.md +0 -16
- package/docs/modules/rust/kb-worker/types/status.md +0 -29
- package/docs/modules/rust/kb-worker/types/token.md +0 -50
- package/docs/modules/rust/overview.md +0 -531
- package/docs/modules/rust/query-parser/functions/extract.md +0 -56
- package/docs/modules/rust/query-parser/functions/module.md +0 -18
- package/docs/modules/rust/query-parser/functions/parse.md +0 -33
- package/docs/modules/rust/query-parser/functions/pipeline.md +0 -9
- package/docs/modules/rust/query-parser/functions/rank.md +0 -85
- package/docs/modules/rust/query-parser/module.md +0 -131
- package/docs/modules/rust/query-parser/types/cache.md +0 -39
- package/docs/modules/rust/query-parser/types/keyphrase.md +0 -71
- package/docs/modules/rust/query-parser/types/module.md +0 -18
- package/docs/modules/rust/query-parser/types/token.md +0 -46
- package/docs/modules/rust/shared/content-composer/functions.md +0 -114
- package/docs/modules/rust/shared/content-composer/module.md +0 -147
- package/docs/modules/rust/shared/content-composer/types.md +0 -93
- package/docs/modules/rust/shared/content-parser/functions.md +0 -72
- package/docs/modules/rust/shared/content-parser/module.md +0 -99
- package/docs/modules/rust/shared/content-parser/types.md +0 -71
- package/docs/modules/rust/shared/corpus/module.md +0 -24
- package/docs/modules/rust/shared/corpus/types.md +0 -141
- package/docs/modules/rust/shared/document/module.md +0 -25
- package/docs/modules/rust/shared/document/types.md +0 -154
- package/docs/modules/rust/shared/encode/module.md +0 -22
- package/docs/modules/rust/shared/encode/traits.md +0 -304
- package/docs/modules/rust/shared/error/module.md +0 -28
- package/docs/modules/rust/shared/error/types.md +0 -302
- package/docs/modules/rust/shared/kbid/module.md +0 -24
- package/docs/modules/rust/shared/kbid/types.md +0 -147
- package/docs/modules/rust/shared/memory/functions.md +0 -209
- package/docs/modules/rust/shared/memory/module.md +0 -24
- package/docs/modules/rust/shared/module.md +0 -196
- package/docs/modules/rust/shared/pipeline/functions.md +0 -141
- package/docs/modules/rust/shared/pipeline/module.md +0 -62
- package/docs/modules/rust/shared/pipeline/types.md +0 -43
- package/docs/modules/rust/shared/query/module.md +0 -27
- package/docs/modules/rust/shared/query/types.md +0 -236
- package/docs/modules/rust/shared/section/module.md +0 -25
- package/docs/modules/rust/shared/section/types.md +0 -294
- package/docs/modules/rust/shared/term/module.md +0 -25
- package/docs/modules/rust/shared/term/types.md +0 -139
- package/docs/modules/typescript/cli.md +0 -131
- package/docs/modules/typescript/kbdb-worker.md +0 -150
- package/docs/modules/typescript/overview.md +0 -400
- package/docs/modules/typescript/shared/auto-capture/module.md +0 -73
- package/docs/modules/typescript/shared/cli/constants.md +0 -23
- package/docs/modules/typescript/shared/cli/functions.md +0 -809
- package/docs/modules/typescript/shared/cli/module.md +0 -138
- package/docs/modules/typescript/shared/cli/typings.md +0 -197
- package/docs/modules/typescript/shared/embedding/functions.md +0 -200
- package/docs/modules/typescript/shared/embedding/module.md +0 -77
- package/docs/modules/typescript/shared/embedding/typings.md +0 -124
- package/docs/modules/typescript/shared/hash/functions.md +0 -20
- package/docs/modules/typescript/shared/hash/module.md +0 -21
- package/docs/modules/typescript/shared/log/constants.md +0 -82
- package/docs/modules/typescript/shared/log/functions.md +0 -131
- package/docs/modules/typescript/shared/log/module.md +0 -153
- package/docs/modules/typescript/shared/log/typings.md +0 -82
- package/docs/modules/typescript/shared/mcp/classes.md +0 -179
- package/docs/modules/typescript/shared/mcp/functions.md +0 -386
- package/docs/modules/typescript/shared/mcp/module.md +0 -160
- package/docs/modules/typescript/shared/mcp/typings.md +0 -529
- package/docs/modules/typescript/shared/module.md +0 -110
- package/docs/modules/typescript/shared/platform/functions.md +0 -42
- package/docs/modules/typescript/shared/platform/module.md +0 -25
- package/docs/modules/typescript/shared/runtime/functions.md +0 -26
- package/docs/modules/typescript/shared/runtime/module.md +0 -27
- package/docs/modules/typescript/shared/runtime/typings.md +0 -13
- package/docs/modules/typescript/shared/version/module.md +0 -27
- package/docs/modules/typescript/shared/wasm-codec/functions.md +0 -391
- package/docs/modules/typescript/shared/wasm-codec/module.md +0 -98
- package/docs/modules/typescript/shared/worker-client/classes.md +0 -264
- package/docs/modules/typescript/shared/worker-client/functions.md +0 -175
- package/docs/modules/typescript/shared/worker-client/module.md +0 -92
- package/docs/modules/typescript/shared/worker-client/typings.md +0 -511
- package/docs/modules/typescript/shared/worker-daemon/classes.md +0 -239
- package/docs/modules/typescript/shared/worker-daemon/constants.md +0 -37
- package/docs/modules/typescript/shared/worker-daemon/functions.md +0 -234
- package/docs/modules/typescript/shared/worker-daemon/module.md +0 -118
- package/docs/modules/typescript/shared/worker-daemon/typings.md +0 -132
- package/docs/overview.md +0 -191
- package/docs/release-notes/0.1.0.md +0 -189
- package/docs/release-notes/0.1.1.md +0 -46
- package/docs/release-notes/0.1.2.md +0 -38
- package/docs/release-notes/0.1.3.md +0 -42
- package/docs/release-notes/0.2.0.md +0 -147
- package/docs/release-notes/0.3.0.md +0 -89
- package/docs/release-notes/0.3.1.md +0 -121
- package/docs/release-notes/0.3.2.md +0 -64
- package/docs/release-notes/0.4.0.md +0 -80
- package/docs/release-notes/0.4.1.md +0 -149
- package/docs/release-notes/0.4.3.md +0 -60
- package/docs/release-notes/0.5.0.md +0 -41
- package/docs/release-notes/README.md +0 -16
package/docs/goals/sync.md
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
# Sync -- Cross-Machine Synchronization
|
|
2
|
-
|
|
3
|
-
*Export the database as a git-friendly directory, move
|
|
4
|
-
it with any transport, import on the other side.*
|
|
5
|
-
|
|
6
|
-
## Goal
|
|
7
|
-
|
|
8
|
-
kbdb is currently single-machine -- "persists across
|
|
9
|
-
sessions" means across sessions on the same box. For
|
|
10
|
-
teams, multi-device use, or backup, the database needs
|
|
11
|
-
a sync story.
|
|
12
|
-
|
|
13
|
-
The design uses export/import as the primitive, with
|
|
14
|
-
git as the recommended transport. Sync is manual and
|
|
15
|
-
explicit. There is no background replication.
|
|
16
|
-
|
|
17
|
-
This goal addresses gap #5 from
|
|
18
|
-
[Opus 4.8 Second Brain Review](../issues/2026-06-23-opus-48-second-brain-review.md):
|
|
19
|
-
"No sync/remote story unless you build one on top,
|
|
20
|
-
which limits 'persists across sessions' to 'across
|
|
21
|
-
sessions on this box.'"
|
|
22
|
-
|
|
23
|
-
## Sync Primitives
|
|
24
|
-
|
|
25
|
-
Two operations form the sync foundation.
|
|
26
|
-
|
|
27
|
-
### Export
|
|
28
|
-
|
|
29
|
-
Serialize the database into a portable, git-friendly
|
|
30
|
-
directory:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
kbdb export --format git --db .kbdb --out ./kbdb-sync/
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
The exported directory mirrors `.kbdb/` minus indexes:
|
|
37
|
-
|
|
38
|
-
- `catalog.toml` -- database table of contents
|
|
39
|
-
- `sections/**/*.section` -- all section files
|
|
40
|
-
- `documents/**/*.toml` -- all document manifests
|
|
41
|
-
|
|
42
|
-
Excluded:
|
|
43
|
-
|
|
44
|
-
- `indexes/` -- derived data, rebuildable
|
|
45
|
-
- Vector indexes (`vectors.idx`, `vectors-meta.toml`)
|
|
46
|
-
- PID files and lock files
|
|
47
|
-
|
|
48
|
-
The exported directory is a valid git subtree. It
|
|
49
|
-
contains no binary blobs except section content
|
|
50
|
-
(image sections, which are stored as base64 text).
|
|
51
|
-
Every file is human-readable and git-diffable.
|
|
52
|
-
|
|
53
|
-
### Import
|
|
54
|
-
|
|
55
|
-
Restore a database from an exported directory:
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
kbdb import --from ./kbdb-sync/ --db .kbdb
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Import reads the exported directory and writes sections
|
|
62
|
-
and documents into the target database. After import,
|
|
63
|
-
run `rebuild` to regenerate all indexes (lexical and
|
|
64
|
-
vector, if configured).
|
|
65
|
-
|
|
66
|
-
Import is **additive** -- existing sections with
|
|
67
|
-
different kbids are preserved. Only the conflict
|
|
68
|
-
resolution rules below can cause existing sections to
|
|
69
|
-
be superseded.
|
|
70
|
-
|
|
71
|
-
## Conflict Resolution
|
|
72
|
-
|
|
73
|
-
When importing sections that conflict with existing
|
|
74
|
-
ones, the following rules apply in priority order:
|
|
75
|
-
|
|
76
|
-
| Condition | Action |
|
|
77
|
-
|-----------|--------|
|
|
78
|
-
| Same kbid | Skip -- identical content already exists |
|
|
79
|
-
| Same `source_key`, imported `created_at` is newer | Supersede -- imported section replaces local one |
|
|
80
|
-
| Same `source_key`, local `created_at` is newer or equal | Keep -- local version is retained |
|
|
81
|
-
| No `source_key` match | Add as new section |
|
|
82
|
-
|
|
83
|
-
This leverages the existing supersession mechanism
|
|
84
|
-
documented in [Database](database.md). The content
|
|
85
|
-
hash (kbid) remains the primary identity. The source
|
|
86
|
-
key is the logical identity used for supersession
|
|
87
|
-
matching across machines.
|
|
88
|
-
|
|
89
|
-
## Git-Based Workflow
|
|
90
|
-
|
|
91
|
-
Recommended workflow for teams:
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
Machine A Git repo Machine B
|
|
95
|
-
───────── ──────── ─────────
|
|
96
|
-
kbdb export --format git ──→ git push ──→ git pull ──→ kbdb import
|
|
97
|
-
kbdb rebuild
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Steps:
|
|
101
|
-
|
|
102
|
-
1. Machine A exports to a directory within a git repo.
|
|
103
|
-
2. Machine A commits and pushes.
|
|
104
|
-
3. Machine B pulls and imports.
|
|
105
|
-
4. Machine B rebuilds indexes.
|
|
106
|
-
|
|
107
|
-
This is a manual, explicit sync -- not automatic
|
|
108
|
-
real-time replication. Any transport that moves the
|
|
109
|
-
exported directory works: git, rsync, scp, a shared
|
|
110
|
-
drive, an archive file. Git is recommended because the
|
|
111
|
-
export format is designed to be git-diffable.
|
|
112
|
-
|
|
113
|
-
## Vector Index Handling
|
|
114
|
-
|
|
115
|
-
Vector indexes (`vectors.idx`, `vectors-meta.toml`)
|
|
116
|
-
are excluded from export -- they are derived data, the
|
|
117
|
-
same as lexical indexes.
|
|
118
|
-
|
|
119
|
-
After import:
|
|
120
|
-
|
|
121
|
-
- If an embedding provider is configured, `rebuild`
|
|
122
|
-
regenerates vectors using the local model.
|
|
123
|
-
- If the importing machine uses a different embedding
|
|
124
|
-
model than the exporting machine, vectors are
|
|
125
|
-
computed fresh with the local model. No action is
|
|
126
|
-
required to handle this case -- vectors are always
|
|
127
|
-
rebuilt from content, never transferred.
|
|
128
|
-
|
|
129
|
-
## Export Formats
|
|
130
|
-
|
|
131
|
-
| Format | Description | Use Case |
|
|
132
|
-
|--------|-------------|----------|
|
|
133
|
-
| `git` | Flat directory, text-friendly | Git-based sync |
|
|
134
|
-
| `archive` | Single tarball (`.tar.gz`) | Backup, transfer |
|
|
135
|
-
|
|
136
|
-
The default format is `git` (the directory format).
|
|
137
|
-
|
|
138
|
-
## CLI Surface
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
kbdb export [--format git|archive] [--out <path>]
|
|
142
|
-
kbdb import --from <path> [--dry-run]
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
- `kbdb export` -- exports the database to the
|
|
146
|
-
specified output path. Defaults to `--format git`.
|
|
147
|
-
The `--out` path is created if it does not exist.
|
|
148
|
-
- `kbdb import` -- imports from an exported directory
|
|
149
|
-
or archive. Runs conflict resolution for each
|
|
150
|
-
incoming section and document.
|
|
151
|
-
- `--dry-run` on import -- shows what would change
|
|
152
|
-
(sections added, superseded, skipped) without
|
|
153
|
-
writing anything.
|
|
154
|
-
|
|
155
|
-
## Import Report
|
|
156
|
-
|
|
157
|
-
Import returns a structured report:
|
|
158
|
-
|
|
159
|
-
```json
|
|
160
|
-
{
|
|
161
|
-
"sections_added": 42,
|
|
162
|
-
"sections_skipped": 3,
|
|
163
|
-
"sections_superseded": 5,
|
|
164
|
-
"documents_added": 2,
|
|
165
|
-
"documents_skipped": 1,
|
|
166
|
-
"rebuild_required": true
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
`rebuild_required` is always `true` after a successful
|
|
171
|
-
import that adds or supersedes any sections, because
|
|
172
|
-
the lexical index is out of date. The caller is
|
|
173
|
-
responsible for running `rebuild` after import.
|
|
174
|
-
|
|
175
|
-
## Why Not CRDTs
|
|
176
|
-
|
|
177
|
-
CRDTs (Conflict-free Replicated Data Types) would
|
|
178
|
-
enable automatic, real-time sync without conflicts.
|
|
179
|
-
The design chooses export/import instead for three
|
|
180
|
-
reasons:
|
|
181
|
-
|
|
182
|
-
1. **Identity conflict** -- The kbid is a content
|
|
183
|
-
hash. Content changes create new identities rather
|
|
184
|
-
than updating existing ones. This conflicts with
|
|
185
|
-
CRDT merge semantics, which assume stable object
|
|
186
|
-
identity across mutations.
|
|
187
|
-
|
|
188
|
-
2. **Complexity** -- CRDT support at the current user
|
|
189
|
-
scale is speculative complexity (YAGNI). The
|
|
190
|
-
export/import model covers the primary use cases
|
|
191
|
-
(backup, team sharing, multi-device) with familiar
|
|
192
|
-
tooling and no new dependencies.
|
|
193
|
-
|
|
194
|
-
3. **Existing supersession** -- The source key
|
|
195
|
-
mechanism already provides a logical identity layer
|
|
196
|
-
above content addressing. Conflict resolution at
|
|
197
|
-
import time uses the same supersession logic that
|
|
198
|
-
`kbdb learn --replace` uses. No new primitives are
|
|
199
|
-
required.
|
|
200
|
-
|
|
201
|
-
CRDT support may be revisited in a future version if
|
|
202
|
-
demand warrants it.
|
|
203
|
-
|
|
204
|
-
## Design Constraints
|
|
205
|
-
|
|
206
|
-
- Sync is manual and explicit -- no background
|
|
207
|
-
replication.
|
|
208
|
-
- Export excludes all derived data (indexes, vectors).
|
|
209
|
-
- Import respects the existing supersession model
|
|
210
|
-
from [Database](database.md).
|
|
211
|
-
- No new dependencies -- uses existing file I/O.
|
|
212
|
-
- Git is recommended but not required -- any transport
|
|
213
|
-
that moves the exported directory works.
|
|
214
|
-
- The single-machine write lock documented in
|
|
215
|
-
[Concurrent Write Safety](concurrency.md) is not
|
|
216
|
-
relevant to sync. Import is a local write operation
|
|
217
|
-
and acquires the lock normally.
|