Repository navigation
Description
maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby
Filing gate: ③ maintainer-directed (topic child). Source: topic #37000 (phase 2, row 7 moved up from phase 3); maintainer 2026-11-24 「现在就调整」, with 「用fable评审,并分拆第二阶段的任务」; boundary cloud ADR-0119 D5 (objectstack-ai/cloud#4968: 「都放开源」). The phase-2 batch was reviewed by an independent Fable pass before filing.
Grading: area:ai · Feature · p2 (topic) · reach: every deployment not on PostgreSQL, including os dev · evidence: read.
维护者速读
- 做什么:把 cloud 仓库里的 libSQL 向量存储
knowledge-turso搬进 objectstack 开源,改用平台的嵌入器和切分器,补上「列出文档」和换模型时的新一代索引,跑和 pgvector 同一套契约测试。 - 谁受益:本地开发(
os dev默认 SQLite)也能用中文向量检索,存在本地一个 libSQL 文件里;PostgreSQL 部署用 pgvector。托管云以后也用它(托管接入在阶段三第 14 行)。 - 需要你做的:无。从 cloud 仓库删掉旧包是另一张 cloud 卡,这张落地后由维护者会话处理。
What
Source: cloud packages/knowledge-turso (origin/main): libSQL native vectors (F32_BLOB + DiskANN libsql_vector_idx); URL libsql://, file: or :memory:, or a client passed in; its own OpenAIEmbeddingProvider (src/embedding.ts); one table per source, knowledge_`` <source.id>ˋ ``, with chunk_id TEXT PRIMARY KEY (${documentId}#${idx}), document_id, source_record_id, content, title, metadata, embedding F32_BLOB(); its own chunker (chunkTarget`, 800).
-
packages/plugins/knowledge-turso(new in objectstack).LICENSEis Apache-2.0 text (today the cloud package'sLICENSEholds BSL 1.1 text whilepackage.jsonand headers say Apache-2.0; ADR-0119 D5 settles it). Same package name@objectstack/knowledge-turso; the next version is published from objectstack. - Embedder: drop
src/embedding.ts; useEMBEDDER_SERVICE(Open edition: register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37094 registers it in the open edition) or a constructorembedder: IEmbedder. - Chunks: drop its own chunker; take the service's chunks (service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098) and declare that it accepts them.
- Layout changes the contract needs (today's layout has no hash, organization or generation):
- One table per source and generation,
knowledge_``` <source.id> ```_g<n>(the vector column's dimension is fixed per table, so a model with another dimension needs a new table anyway), plus a generation table:source_id,generation,fingerprint,dim,model,state,created_at. - Columns added:
doc_hash(forlistDocuments, service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096),chunk_hash(unchanged text is not re-embedded),organization_id(filtered before ranking fromorganizationIds, service-knowledge: documents carry their organization, and search hands the caller's organizations to the adapter #37097). - Chunk ids stay
${documentId}#${idx}, unique inside a generation table; they are not citation anchors. - A legacy `knowledge_
<source.id>ˋtable (no generation) is treated as stale: search answers "reindex needed"; it is dropped after the first new generation is active.
- One table per source and generation,
- Fingerprint: the one ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;
knowledge_sourcebecomes a governed type #37001 defines, handed in by the service (same member knowledge-pgvector: an open vector store on PostgreSQL — tables, exact search, listing, chunks #37100 reads). Mismatch → "reindex needed", as in knowledge-pgvector: an open vector store on PostgreSQL — tables, exact search, listing, chunks #37100. A build (service-knowledge: a source that was never built gets built, and an operator can start a rebuild #37099's trigger) writes a new generation table; when the walk ends, service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096's purge reconciles, the generation becomes active, the old table is dropped. One builder per source (a lock row in the generation table, since libSQL has no advisory locks). - Implements
listDocuments(service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096). Runs the service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096 contract suite in CI onfile:and:memory:libSQL (no special image); the PR confirms@libsql/clientvector functions (vector32,vector_top_k) work on the CI runner. - Default local location when the runtime mounts it (Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102): a libSQL file beside the dev database under
.objectstack/data/, configurable. - Docs:
content/docs/protocol/knowledge.mdxadapter section,content/docs/ai/knowledge-rag.mdx.
Acceptance
- The service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096 suite passes on
file:and:memory:. - Chinese text indexed and found with a fixed fake embedder.
- Same content re-indexed → no embed call.
- Model changed (same and different dimension) → new generation table, old one not served, then dropped.
- Two organizations never see each other's hits.
- A legacy table → "reindex needed", then replaced.
- Container run per AGENTS.md.
Out of scope
- Removing the package from the cloud repo (a cloud card, filed and done by the maintainer's session after this lands).
- Hosted kernel registration (row 14, phase 3).
- Typed filters (row 11).
- Changing
os dev's default database (Evaluate: canos dev's default database move from SQLite (better-sqlite3) to a local libSQL file (driver-turso)? #37106 evaluates it; this store runs on its own libSQL file either way).
Blocked-by: #37001, #37096, #37098, #37097 (organization member).
Parent: #37000. Reader: domain:server lane (packages/plugins/knowledge-*).
Dedupe: knowledge-turso 70 (open 12: this batch, #37000, #37001, #37106 — an evaluation of the dev default database, related, not a duplicate; none moves the package) · libsql vector 10 (open 5: #37106, #37001, seat posts).
Activity
os-bob commentedon Nov 24, 2026
maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby
Input from the #37106 evaluation (PR #37120, measured 2026-11-24). It binds this card and #37102:
count(*) = 0for a 200-row table, andintegrity_checkandVACUUMfailed. Two engines writing one file in one process lost a row silently (WAL), or failed the commit withSQLITE_IOERR_DELETE_NOENT(delete mode). The turso store therefore opens its own libSQL file, never.objectstack/data/objectstack.db. Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102 must name a separate path.file:URL with neither set lost 292 and 204 of 300 writes from a second process. It wrote about 10× slower than better-sqlite3, and about 4× slower once WAL was set.@libsql/win32-arm64-msvcdoes not exist on npm. On that platform the store must degrade with a clear error, like an unmounted adapter in Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102, not crash the boot.Generated by Claude Code
objectstack-fleet commentedon Nov 24, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: first touch 2026-11-24T20:39Z
pm:blockedanddomain:serveradded. The card has no state yet, and itsBlocked-by:cards (ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;knowledge_sourcebecomes a governed type #37001, service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096, service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098, service-knowledge: documents carry their organization, and search hands the caller's organizations to the adapter #37097) are still open.knowledge_sourcebecomes a governed type #37001). Triage's unlock scan moves the card when every blocker closes.objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: unblocked 2026-11-25T17:37Z
pm:blocked→pm:queue. Its blockers ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;knowledge_sourcebecomes a governed type #37001, service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096, service-knowledge: documents carry their organization, and search hands the caller's organizations to the adapter #37097 and service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098 are all closed.objectstack-fleet commentedon Nov 25, 2026
repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U
Claim: PM loop round 2 (epic #37000 owner seat, card thread)
Session:
session_01JQwxbW5anP6GDaVi5LKi2UThread session:
session_01JQwxbaMuehXzctoWq7iRsVAccount:
os-warrenBranch:
claude/project-thread-463817Worktree:
objectstack(the card thread's own checkout)Domain:
domain:serverSeat:
repo:cloud#1File surface:
packages/plugins/knowledge-turso/**(new),content/docs/protocol/knowledge.mdxandcontent/docs/ai/knowledge-rag.mdx(the adapter sections),.changeset/, plus workspace wiring a new package needs (lockfile, the generated package lists a gate demands), and the gate-forced provenance row'@objectstack/knowledge-turso': ['KNOWLEDGE_REBUILD_REQUIRED']inpackages/spec/src/api/error-code-ledger.zod.tswith its generated mirrorcontent/docs/references/api/error-code-ledger.mdx(one row only, as #37100 did; amended 23:3xZ), andpackages/services/service-settings/src/manifests/knowledge.manifest.tswith its test (the turso Test-connection hint and header list only, which this change makes false; amended 23:4xZ). CI wiring for the libSQL suite only if no existing step runs it; a.github/workflows/**edit makes the PR Tier H and is stated in the report (stop on breach; explain in the report)Container & model:
L,mode:thread,model: default (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable),effort: highClause-②: yes
Metadata-protocol: none
Responsibility:
n/a — not a defect cardThread-read: 7169771840
Premise: holds (Blocked-by #37001, #37096, #37098, #37097 all closed; held for #37100, which merged as 9981f27 with the K8 item 8 members this card reads)
Serial constraints cleared:
#37308 (this seat, PR #37342, rebasing on main) adds AdapterSearchOptions.scope and implements.scope to the contract suite; whichever of the two lands second owes the other's suite cases. Mirror knowledge-pgvector's shape (generation table, fingerprint and recipe hash, coded refusals with remedy, docHash and headingPath on hits). Removing the package from the cloud repo is a cloud card after this lands (out of scope).Ownership: maintainer 2026-11-25 13:49Z, 「#4 只负责在手任务,你接手专题剩余任务」; unlocked when #37100 merged 23:25Z. Clause-② yes: a new published adapter package widens the public surface and owes a contract review at the ceiling tier before the queue.
objectstack-fleet commentedon Nov 26, 2026
repo:cloud#1 · os-warren · session_01JQwxbaMuehXzctoWq7iRsV
os-dev-report
{ "issue": 37107, "status": "done", "branch": "claude/project-thread-463817", "pr": "https://github.com/objectstack-ai/objectstack/pull/37388", "session": "session_01JQwxbaMuehXzctoWq7iRsV", "premise_still_valid": true, "summary": "@objectstack/knowledge-turso moves into packages/plugins/knowledge-turso (Apache-2.0, same name, fixed version group). It keeps passages and vectors in a libSQL database of its own (default file .objectstack/data/knowledge.db; a URL naming the platform's database file is refused), embeds with the kernel embedder, declares capabilities.chunks, and implements listDocuments, indexStatus, beginBuild/completeBuild with a generation table and one passage table per source and generation (knowledge_SOURCE_gN), refusing KNOWLEDGE_REBUILD_REQUIRED under another fingerprint; a cloud-release table is never served and is dropped by the first complete reindex. Search is an exact cosine scan with the organization and metadata filters before ranking (no DiskANN). A failed @libsql/client load or unopenable file registers an unavailable adapter (503) and boot continues. Claim amendments used: error-code ledger row, and the Turso Test-connection hint in knowledge.manifest.ts made true.", "tests": "pnpm --filter @objectstack/knowledge-turso test under the verify lock: Test Files 3 passed (3), Tests 103 passed (103) — contract suite with every implements member incl. generations on :memory: and file: (72/72), acceptance 24, plugin 7. service-settings knowledge.manifest.test.ts 25/25. typecheck (incl. check:test-typecheck) and build (check-dts-emitted 2/2) exit 0.", "gates": "node scripts/pm/dispatch-gates.mjs --ran at 56f3dc5e: 134 derived, 134 run, 0 UNRUN; 130 green. check:llms-txt red at 77, green at 78 after the llms.txt commit. NOT MEASURED (exit 3, prerequisite not met): check:dual-build-cjs-loads, check:published-readme-exports (need every workspace package built), check:skill-examples (needs client-react built), check-plugin-teardown-shape --self-test (needs unshallow clone; its scan passed). CI check-runs on PR #37388 pending at report time.", "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm", "mcp_calls": "read-only: mcp__github__issue_read (card, comments)", "api_writes": "1 — fleet-write relay pr_create (PR #37388, assignee os-warren); this comment via post-stamped", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: cloud · packages/knowledge-turso in the cloud repo is now a duplicate; its removal is the cloud card #37107 names · noted, not filed", "carrier: #37102 · the runtime mount names the store path; defaultStoreUrl and PLATFORM_DATABASE_FILES are exported for it", "carrier: #37104 · the knowledge settings namespace (turso_url, turso_auth_token) is still read by no plugin; #37104 rewrites the manifest · noted, not filed", "carrier: #37308 · PR #37342 adds implements.scope; whichever lands second owes the other's suite cases" ] }Generated by Claude Code
objectstack-fleet commentedon Nov 26, 2026
repo:cloud#1 · os-warren · session_01JQwxbaMuehXzctoWq7iRsV
os-dev-report
{ "issue": 37107, "status": "done", "branch": "claude/project-thread-463817", "pr": "https://github.com/objectstack-ai/objectstack/pull/37388", "session": "session_01JQwxbaMuehXzctoWq7iRsV", "premise_still_valid": true, "summary": "Rework round 1 at f073750a, on top of the merge of main (68654e1d, brings #37342) and the record scope (9c469ddf, mirrors knowledge-pgvector: terms ORed in the org-filtered WHERE, ids and field names bound, empty scope answers [] first; implements.scope true). M1: a table of the cloud releases is recognised by exactly its seven columns and an F32_BLOB vector; the generation table and any table the store did not make are never refused as legacy nor dropped; openGeneration remakes only a passage-shaped table and refuses any other under that name. S1: requestTimeoutMs bounds one turn of the per-client queue (default 10000 on a remote URL), 503 past it. S2: first generation made afresh and listDocuments-without-embedder 503 pinned. S3: builder-lock and install prose corrected; PR body re-pinned. Nits: platform-file refusal decodes and lower-cases, reads a bare-path OS_DATABASE_URL; source ids follow the spec pattern with no length cap, refusal coded VALIDATION_ERROR 400; search retry bounded; write recheck and scope scalar guard pinned. Nit 7 (exponent-form numbers in scope) left: fails closed, noted in the PR body.", "tests": "pnpm --filter @objectstack/knowledge-turso test under the verify lock at f073750a: Test Files 3 passed (3), Tests 135 passed (135), VERDICT command-exit 0 (contract 92 incl. scope on :memory: and file:, acceptance 36, plugin 7). typecheck, check:test-typecheck, build exit 0. Ablations, each restored: old legacy rule 4 red; openGeneration remaking a foreign table 2 red; fresh-table DROP 2 red; listDocuments compare-before-embedder 1 red; request bound 1 red; write-time recheck 2 red; scope scalar guard 2 red; scope WHERE 12 red.", "gates": "dispatch-gates --ran with exit codes at f073750a: 134 derived, 133 run exit 0, 1 NOT-MEASURED (check-plugin-teardown-shape --self-test, exit 3, shallow clone). CI check-runs at f073750a: 62 success, 9 skipped, 0 failed.", "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm", "mcp_calls": "read-only: mcp__github__issue_read (card, comments)", "api_writes": "relay: pr_create #37388; issue_patch #37388 body (re-pinned to f073750a); this comment and the first report via post-stamped", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: cloud · packages/knowledge-turso in the cloud repo is now a duplicate; its removal is the cloud card #37107 names · noted, not filed", "carrier: #37102 · the runtime mount names the store path; defaultStoreUrl and PLATFORM_DATABASE_FILES are exported for it", "carrier: #37104 · the knowledge settings namespace (turso_url, turso_auth_token) is still read by no plugin; #37104 rewrites the manifest · noted, not filed" ] }Generated by Claude Code
objectstack-fleet commentedon Nov 26, 2026
repo:cloud#1 · os-warren · session_01JQwxbaMuehXzctoWq7iRsV
os-dev-report
{ "issue": 37107, "status": "done", "branch": "claude/project-thread-463817", "pr": "https://github.com/objectstack-ai/objectstack/pull/37388", "session": "session_01JQwxbaMuehXzctoWq7iRsV", "premise_still_valid": true, "summary": "Rework round 2 at 796b204c (on f073750a). S4: requestTimeoutMs now bounds each request on its own through a bounded view of the client (statement, batch, opening a transaction, commit, rollback), not a whole queue turn; the queue stays keyed by the client as given. A write sends each document's statements as one tx.batch, so a 100-document page is ~100 requests. A request timing out inside a write is followed by a rollback, never a commit; only a commit that itself times out may land, and its remedy says so. The remedy names requestTimeoutMs. Nits: search's retry count moved to a private method; a foreign table under a generation name answers 503 with the table in remedy; the platform-file refusal compares the realpath and reads -wal/-shm/-journal as their database; pinned the vector-type half, the VALIDATION_ERROR code, the search retry bound and the remote default (requestBoundFor). Not done: the malformed file URL that ends the process inside the native client (steps not in hand; pre-existing), scope number reading (fails closed).", "tests": "pnpm --filter @objectstack/knowledge-turso test under the verify lock at 796b204c: Test Files 3 passed (3), Tests 143 passed (143), VERDICT command-exit 0. typecheck, check:test-typecheck, build exit 0. Ablations at this head, each restored: the f073750a whole-turn bound with the new tests, both request-bound cases red; commit instead of rollback after a timeout 1 red; vector-type half 2 red; VALIDATION_ERROR code 2 red; search retry bound 2 red; remote default 1 red; side-file reading 1 red.", "gates": "dispatch-gates --ran with exit codes at 796b204c: 134 derived, 133 run exit 0, 1 NOT-MEASURED (check-plugin-teardown-shape --self-test, exit 3, shallow clone). CI check-runs at 796b204c: 62 success, 9 skipped, 0 failed.", "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm", "mcp_calls": "read-only: mcp__github__issue_read (card, comments)", "api_writes": "relay: pr_create #37388; issue_patch #37388 body (three times, last re-pinned to 796b204c); three report comments via post-stamped", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: cloud · packages/knowledge-turso in the cloud repo is now a duplicate; its removal is the cloud card #37107 names · noted, not filed", "carrier: #37102 · the runtime mount names the store path; defaultStoreUrl and PLATFORM_DATABASE_FILES are exported for it", "carrier: #37104 · the knowledge settings namespace (turso_url, turso_auth_token) is still read by no plugin; #37104 rewrites the manifest · noted, not filed" ] }Generated by Claude Code
objectstack-fleet commentedon Nov 26, 2026
repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U
ACCEPT → PR #37388 comment 7181689233 (round 3: L1 ACCEPT + contract review PASS at head 796b204; rounds 1 and 2 REWORK 7179839476, 7180860083). Not governed; 2922 changed lines; CI all green at that head; readied and auto-merge armed.
Carried, not in this PR:
requestTimeoutMsand resolves late is closed when it arrives (record 7181689233, point 6).packages/knowledge-tursois removed, or made private, before any cloud release, so npmlatestdoes not move back to a 6.x build; the maintainer's session files that cloud card after this lands (card Out of scope).