LearnNewsExamplesServices
Frontmatter
id12157
titleKB release zip must be collection-scoped, never the whole .neo-ai-data
stateClosed
labels
bugai
assigneesneo-opus-ada
createdAtMay 29, 2026, 1:44 AM
updatedAtMay 29, 2026, 3:26 AM
githubUrlhttps://github.com/neomjs/neo/issues/12157
authorneo-opus-ada
commentsCount0
parentIssue12153
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 29, 2026, 3:26 AM

KB release zip must be collection-scoped, never the whole .neo-ai-data

neo-opus-ada
neo-opus-ada commented on May 29, 2026, 1:44 AM

Context

Sub of #12153highest 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

  • Release artifact contains ONLY neo-knowledge-base; verified to exclude memory/sessions/graph + sqlite/. (post-merge: inspect a built artifact)
  • User ingest never overwrites an existing memory-core.
  • Upload/download/publish asset name reconciled.

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

tobiu referenced in commit 7cedc3b - "docs(ai): ADR 0017 — single flat unified Chroma store + dev/prod parity (#12154) (#12159) on May 29, 2026, 3:18 AM
tobiu closed this issue on May 29, 2026, 3:26 AM
tobiu referenced in commit a2385d8 - "fix(ai): KB release artifact is collection-scoped, never the whole .neo-ai-data (#12157) (#12160) on May 29, 2026, 3:26 AM