Skip to content

Commit 56f3dc5

Browse files
committed
fix(settings): the Turso test-connection hint names the package this platform now ships
Claude-Session: https://claude.ai/code/session_01JQwxbaMuehXzctoWq7iRsV Co-authored-by: Claude <noreply@anthropic.com>
1 parent 84fc26e commit 56f3dc5

3 files changed

Lines changed: 27 additions & 33 deletions

File tree

‎.changeset/37107-knowledge-turso.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
'@objectstack/knowledge-turso': patch
33
'@objectstack/spec': patch
4+
'@objectstack/service-settings': patch
45
---
56

67
feat(knowledge): the libSQL vector store moves into the open framework, with generations, listing and the adapter contract suite
@@ -15,4 +16,5 @@ ADR-0161 Execution row 7; cloud ADR-0119 D5 (#37107).
1516
- **Generations under the index fingerprint (ADR-0161 K7; K8, item 8).** A generation table `knowledge_generation` and one passage table per source and generation, `knowledge_<source>_g<n>`. A write or a search under another fingerprint is refused `409 KNOWLEDGE_REBUILD_REQUIRED` (registered in the error-code ledger for this package). `beginBuild` under a new fingerprint opens a generation beside the active one, which keeps answering its own fingerprint; `completeBuild` switches to it, records the recipe hash and drops the old table; `indexStatus` answers the fingerprint, the recipe hash and whether a build is under way. One builder per source, held by a unique index on the generation table. A table of the cloud-repo releases (`knowledge_<source>`) is never served: a search answers `KNOWLEDGE_REBUILD_REQUIRED`, and the table is dropped when the first complete reindex finishes.
1617
- **Listing, hashes, organizations.** `listDocuments` pages the generation the writes go to, each document's `docHash` as stored; hits carry `docHash` and the passage's `headingPath`; the organization filter and the metadata `filter` run in SQL before ranking, by an exact cosine scan (no DiskANN index, which ranks before it filters). A passage whose text is unchanged is not embedded again.
1718
- **When it cannot run**, because the database cannot be opened or `@libsql/client` has no native build for the platform (Windows on ARM), the plugin still registers and boot goes on; `healthCheck` answers `ok: false` and every call answers `503 SERVICE_UNAVAILABLE`, its reason in the error's `remedy`.
19+
- **Settings → Knowledge, "Test connection" on Turso** no longer says the package ships from another repository, or that a store with no URL reuses the platform's database: it names `@objectstack/knowledge-turso`, registered beside the knowledge service, and its default file.
1820
- The package runs `runKnowledgeAdapterContract` with every member declared, on `:memory:` and on a `file:` URL, in its own unit tests.

‎packages/services/service-settings/src/manifests/knowledge.manifest.test.ts‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ describe('knowledgeTestActionHandler', () => {
9797
expect(r.severity).toBe('warning');
9898
});
9999

100-
it('accepts turso with no URL (will reuse tenant connection)', async () => {
100+
it('accepts turso with no URL (the plugin defaults to its own file)', async () => {
101101
const r = await knowledgeTestActionHandler({ values: { adapter: 'turso' } } as any);
102102
expect(r.ok).toBe(true);
103103
expect(r.severity).toBe('info');
104-
expect(r.message).toMatch(/reuse the tenant/);
104+
// The plugin opens a file of its own, never the platform's database (#37107).
105+
expect(r.message).toMatch(/knowledge\.db/);
106+
expect(r.message).not.toMatch(/reuse the tenant/);
105107
});
106108

107109
it('accepts turso with local file URL', async () => {
@@ -130,20 +132,19 @@ describe('knowledgeTestActionHandler', () => {
130132
expect(r.ok).toBe(true);
131133
});
132134

133-
// The turso adapter's plugin package is NOT built in this repo, so the live-call
134-
// hint an operator reads in Settings -> AI & Embedder cannot be a bare "Mount
135-
// @objectstack/knowledge-turso": that instruction was un-followable — it named a
136-
// package with no directory here and no statement of where it comes from. Pinned
137-
// as a property (names the package AND where it ships), not as a literal, so the
138-
// wording can be improved without the guard going stale.
139-
it('turso live-call hint says where the out-of-repo package comes from', async () => {
135+
// The turso adapter's plugin package is built in this repo since #37107. The
136+
// live-call hint names the package and how a deployment registers it, and no
137+
// longer says it ships elsewhere. Pinned as a property, not as a literal, so
138+
// the wording can be improved without the guard going stale.
139+
it('turso live-call hint names the package and how it is registered, not an outside origin', async () => {
140140
const r = await knowledgeTestActionHandler({
141141
values: { adapter: 'turso', turso_url: 'file:./knowledge.db' },
142142
} as any);
143143
expect(r.ok).toBe(true);
144144
const message = String(r.message);
145145
expect(message).toContain('@objectstack/knowledge-turso');
146-
expect(message).toMatch(/ObjectOS Cloud monorepo/);
146+
expect(message).toMatch(/registered beside the knowledge service/);
147+
expect(message).not.toMatch(/ObjectOS Cloud monorepo|does not ship/);
147148
// the un-followable form this card retired: named, with no origin stated
148149
expect(message).not.toMatch(/Mount @objectstack\/knowledge-turso to exercise live calls/);
149150
});

‎packages/services/service-settings/src/manifests/knowledge.manifest.ts‎

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,17 @@ import type { SettingsActionHandler } from '../settings-service.types.js';
1010
* knowledge sources and any future agent that needs to embed ad-hoc
1111
* inputs.
1212
*
13-
* Adapter list — two of these plugin packages are built in this repo and one
14-
* is not, which is the difference that matters to an operator told to mount
15-
* one of them:
16-
* - memory @objectstack/knowledge-memory built here (dev / test ref)
17-
* - ragflow @objectstack/knowledge-ragflow built here (external RAGFlow)
18-
* - turso @objectstack/knowledge-turso NOT built here — libSQL native
19-
* F32_BLOB, works for cloud
20-
* Turso AND local file mode
13+
* Adapter list — every one of these plugin packages is built in this repo:
14+
* - memory @objectstack/knowledge-memory (dev / test ref)
15+
* - ragflow @objectstack/knowledge-ragflow (external RAGFlow)
16+
* - turso @objectstack/knowledge-turso libSQL native vectors, in a
17+
* file of its own or on Turso;
18+
* built here since #37107 (its
19+
* 6.x releases came from the
20+
* ObjectOS Cloud monorepo)
2121
*
22-
* Spelled out for `turso` because the undated claim that used to stand here —
23-
* "mirrors the plugin packages currently published" — stopped being true and
24-
* nothing caught it. The package IS published on the public npm registry, but
25-
* on its own version track: `latest` was 6.9.0 (published 2026-05-27) while
26-
* this repo shipped 17.2.0, and 6.9.0 exact-pins `@objectstack/spec@6.9.0`, so
27-
* mounting it into an app on this platform version resolves a SECOND spec
28-
* rather than reusing this one. Its source lives in the ObjectOS Cloud
29-
* monorepo (see this repo's README). Measured against the registry on
30-
* 2026-08-23 with `@objectstack/spec` + `@objectstack/cli` as positive
31-
* controls; re-measure before treating those numbers as current.
22+
* None of them reads this namespace yet: a deployment registers the plugin
23+
* beside the knowledge service itself.
3224
*
3325
* As with the AI manifest, the real adapter wiring happens in the
3426
* knowledge plugins; this manifest is the canonical settings surface
@@ -187,7 +179,8 @@ export const knowledgeTestActionHandler: SettingsActionHandler = async ({ values
187179
ok: true,
188180
severity: 'info',
189181
message:
190-
'No URL configured — adapter will reuse the tenant\'s primary libSQL connection at runtime. ' +
182+
'No URL configured — the @objectstack/knowledge-turso plugin defaults to its own file, ' +
183+
'knowledge.db under .objectstack/data/, never the platform database. ' +
191184
FORM_CHECK_ONLY,
192185
};
193186
}
@@ -203,10 +196,8 @@ export const knowledgeTestActionHandler: SettingsActionHandler = async ({ values
203196
ok: true,
204197
severity: 'info',
205198
message:
206-
`Turso adapter configured (${u}). ${FORM_CHECK_ONLY} Live calls need @objectstack/knowledge-turso, ` +
207-
'which this platform does not ship: it is built in the ObjectOS Cloud monorepo ' +
208-
'and published on its own version track, so check that it offers a release ' +
209-
'compatible with your platform version before mounting it.',
199+
`Turso adapter configured (${u}). ${FORM_CHECK_ONLY} Live calls need the ` +
200+
'@objectstack/knowledge-turso plugin registered beside the knowledge service, with this URL.',
210201
};
211202
}
212203

0 commit comments

Comments
 (0)