Context
Sub of #12153 — highest priority: latent privacy leak. uploadKnowledgeBase.mjs zips the whole .neo-ai-data (private memories, the 199 MB graph SQLite, the mailbox), and downloadKnowledgeBase.mjs extracts it over the user's .neo-ai-data (clobbers their MC). Post-unification there is no clean KB folder to zip, so the artifact MUST be collection-scoped.
The Architectural Reality
ai/scripts/maintenance/uploadKnowledgeBase.mjs:43-44,83: sourceDir='.neo-ai-data', zip -r neo-ai-data.zip .neo-ai-data. Set 2026-04-06 (commit 87069c0bd9). The shipped v12.1.0 asset is the clean 2.2 MB chroma-neo-knowledge-base.zip — the script's output name never matched the published asset (the path is effectively unreleased/broken), which is why it's latent not active.
downloadKnowledgeBase.mjs: fetches neo-ai-data.zip (404 vs the published asset) → soft-fails to local sync; the npm prepare hook runs it on every install.
buildScripts/release/publish.mjs:219 invokes uploadKnowledgeBase.
The Fix
- Export only the
neo-knowledge-base collection (daemon ETL → portable JSONL or a collection snapshot) into the release artifact — never the data dir. Defense-in-depth: assert the artifact contains no MC collections / no sqlite/.
- Download/ingest collection-scoped into the user's KB — never a dir-restore over
.neo-ai-data.
- Reconcile the asset name (one canonical name across upload/download/publish).
Contract Ledger
| Surface |
Authority |
Behavior |
Fallback |
Docs |
Evidence |
| KB release artifact |
uploadKnowledgeBase.mjs |
collection-scoped neo-knowledge-base export |
n/a |
guide |
uploadKnowledgeBase.mjs:83 |
| KB ingest (user) |
downloadKnowledgeBase.mjs |
collection-scoped import; never clobber .neo-ai-data |
local ai:sync-kb |
guide |
downloadKnowledgeBase.mjs |
Acceptance Criteria
Out of Scope
The store rename (parent sub 2) — though this lands cleaner after it.
Related
#12153 (parent), #12152.
Origin Session ID: efd8dc2e-2052-4089-814a-ab22cd8c6a62
Context
Sub of #12153 — highest priority: latent privacy leak.
uploadKnowledgeBase.mjszips the whole.neo-ai-data(private memories, the 199 MB graph SQLite, the mailbox), anddownloadKnowledgeBase.mjsextracts it over the user's.neo-ai-data(clobbers their MC). Post-unification there is no clean KB folder to zip, so the artifact MUST be collection-scoped.The Architectural Reality
ai/scripts/maintenance/uploadKnowledgeBase.mjs:43-44,83:sourceDir='.neo-ai-data',zip -r neo-ai-data.zip .neo-ai-data. Set 2026-04-06 (commit87069c0bd9). The shipped v12.1.0 asset is the clean 2.2 MBchroma-neo-knowledge-base.zip— the script's output name never matched the published asset (the path is effectively unreleased/broken), which is why it's latent not active.downloadKnowledgeBase.mjs: fetchesneo-ai-data.zip(404 vs the published asset) → soft-fails to local sync; the npmpreparehook runs it on every install.buildScripts/release/publish.mjs:219invokesuploadKnowledgeBase.The Fix
neo-knowledge-basecollection (daemon ETL → portable JSONL or a collection snapshot) into the release artifact — never the data dir. Defense-in-depth: assert the artifact contains no MC collections / nosqlite/..neo-ai-data.Contract Ledger
uploadKnowledgeBase.mjsneo-knowledge-baseexportuploadKnowledgeBase.mjs:83downloadKnowledgeBase.mjs.neo-ai-dataai:sync-kbdownloadKnowledgeBase.mjsAcceptance Criteria
neo-knowledge-base; verified to exclude memory/sessions/graph +sqlite/. (post-merge: inspect a built artifact)Out of Scope
The store rename (parent sub 2) — though this lands cleaner after it.
Related
#12153 (parent), #12152.
Origin Session ID: efd8dc2e-2052-4089-814a-ab22cd8c6a62