Skip to content

knowledge_source: adapter becomes optional (the deployment's store), and a knowledge_source item mounts the knowledge service #37306

Description

@objectstack-fleet

repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U

Filing gate: ③ maintainer-directed (topic child). Source: topic #37000; maintainer 2026-11-25 「现在拆阶段三」 (decision card in the project thread) and 「#4 只负责在手任务,你接手专题剩余任务」. Reviewed by an independent Fable pass before filing.
Grading: area:ai · Feature · p2 (topic) · reach: every deployment that holds a knowledge source — os dev, self-hosted, hosted · evidence: read.

维护者速读

  • 做什么:知识源里可以不写用哪个向量存储,默认用部署自带的那个(PostgreSQL 用 pgvector,其他用 turso);应用里只要有一份知识源,平台就自动挂上检索服务,不用再在应用里声明。
  • 谁受益:同一份知识源在本地开发、自建部署、托管云上都能直接用,这是专题「写一份配置,到处能检索」的终点线。
  • 要知道的:这一步只放宽写法,不会让已有的知识源失效。
  • 需要你做的:无。

What

Carries ADR-0161 (docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md) K4 ◆ ("adapter becomes optional in row 3"), K8 item 11, and K8 item 12 ("From row 3 a knowledge_source item mounts it too").

Departure from the ADR's one-PR wording, stated. K6 lists "adapter becomes optional (K4 ◆)" among the changes that ride row 3's PR. Row 3 is split: row 3a carries the type, the loader and every narrowing; this card carries the widening, because it needs #37102's runtime mount. K6 notes the change "widens what an author may write, so it needs no ADR-0087 disposition": this PR declares Metadata-protocol: added.

  1. adapter optional (K4 ◆, K8 item 11). KnowledgeSourceSchema.adapter (packages/spec/src/ai/knowledge-source.zod.ts:135) becomes optional. An omitted adapter means the deployment's adapter: the store the runtime mounted for the knowledge capability, or the only adapter registered. With several registered and none the deployment's, the source is refused at registration and the refusal names the choices. A named adapter that is not mounted stays Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102's error.
  2. The deployment's-store mark (K4). The runtime that mounts a store for the knowledge capability (Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102: packages/cli/src/commands/serve.ts, packages/core/src/capability-providers.ts, @objectstack/verify's boot) marks it the deployment's when it mounts it; an adapter application code registers is never the deployment's by that act alone. State the mechanism (an option to registerAdapter, or a mark the provider passes) in the PR; it is a service option, not a contract member (K8 "What counts as a member").
  3. An item mounts the service (K8 item 12). Beside requires: ['knowledge'], the presence of a knowledge_source item in the stack mounts KnowledgeServicePlugin and the store, through the same provider entry (PLATFORM_CAPABILITY_PROVIDERS, packages/spec/src/kernel/platform-capabilities.ts). A host that mounts the service itself keeps its own (Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102 item 4).
  4. The first item saved at runtime. State, and pin, what happens when the first knowledge_source is saved at runtime on a deployment that mounted no knowledge service at boot: mounted without a restart, or served after the next boot with a stated message at save. Row 3a's boot line ("an item but no knowledge service") changes to match.
  5. Docs. content/docs/ai/knowledge-rag.mdx and content/docs/protocol/knowledge.mdx: a source needs no adapter and no requires entry.

Rulings carried (ADR-0161 K10): a key change lands with its reader (the resolution in the service); no contract member is added.

Acceptance

  • The epic's finish line (a): a source written as metadata, with no adapter and no requires: ['knowledge'], builds and searches Chinese text on os dev (turso on the local libSQL file).
  • The same source on PostgreSQL (CI image from CI: the PostgreSQL job runs on an image with the pgvector extension #37095) binds to knowledge-pgvector.
  • Two adapters registered by application code and none the deployment's: the source is refused naming both.
  • A host mounting the service by hand (BrightRule's shape) is unchanged.
  • The first item saved at runtime on a deployment with no service behaves as item 4 states, pinned.
  • Container run per AGENTS.md.

Out of scope

Blocked-by: #37304 (row 3a), #37102.
Parent: #37000. Reader: domain:server lane (packages/services/service-knowledge, packages/cli, packages/core; the one spec line per spec.md).
Dedupe: knowledge_source 4 (open: #37000, #37102 — which keeps adapter required and names this as row 3's) · requires knowledge capability 112 (open: #37102, #37189 — record-context token, #37098, seat posts; none mounts on an item) · KnowledgeServicePlugin 12 (open: #37102, #37094, #37000, a seat post) · knowledge adapter optional 59 (open: #37102, #37098, #32062 — none makes it optional).

Activity

  1. added
    priority:p2
    pm:blocked
    area:ai
    domain:server
    on Nov 25, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    First touch 2026-11-25T14:33Z. Confirmed as filed: Feature · area:ai · domain:server · p2, pm:blocked on #37304 and #37102 (row 3b). It is a row of topic #37000, so it routes to repo:objectstack#1 (maintainer 13:49Z 「继续专题 开发 37000」). The body's Blocked-by: line already reads in line form.

  3. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

    Claim: PM loop round 4 · area o1-C (epic #37000 phase 3, hand-off 7206523866; #37304 closed by PR #37676) · 2026-11-27T10:51Z
    Session: session_016WV4cwPhGV4g9p1BGQaZbP
    Account: os-elon-musk
    Branch: claude/area-o1C-37306
    Worktree: objectstack-issue-37306
    Domain: domain:server
    Area: o1-C
    Seat: repo:objectstack#1
    File surface: packages/spec/src/ai/knowledge-source.zod.ts (the adapter line only, + generated baselines/docs the gates owe), packages/spec/src/kernel/platform-capabilities.ts (the knowledge provider entry: an item mounts it), packages/core/src/capability-providers.ts, packages/cli/src/commands/serve.ts (the store choice), @objectstack/verify's boot, packages/services/service-knowledge/src/knowledge-service.ts (registerAdapter and the adapter resolution), packages/objectql/src/knowledge-source-unserved.ts (+ its test: row 3a's boot line), tests, content/docs/ai/knowledge-rag.mdx, content/docs/protocol/knowledge.mdx, a changeset. ⛔ No contract member added (ADR-0161 K8 "What counts as a member"): the deployment's-store mark is a service option.
    Container & model: L, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: high (reason: L, cross-package — spec, core, cli, verify, service — with a new deployment's-store mark and a runtime first-item behaviour to pin)
    Clause-②: yes (widening) — KnowledgeSourceSchema.adapter becomes optional, so authors may omit it; owes the lane seat's review of record and the contract-tier review of the published schema
    Metadata-protocol: added
    Responsibility: objectstack's own code, packages/spec/src/ai/knowledge-source.zod.ts | adapter is required (:251) and only requires: ['knowledge'] mounts the service | every deployment holding a knowledge source; the epic's finish line (a)
    Thread-read: 7165465106
    Premise: holds, read not yet measured — on origin/main 0a3ea67 adapter: z.string() is required at knowledge-source.zod.ts:251 (moved from :135 by #37676); PLATFORM_CAPABILITY_PROVIDERS (platform-capabilities.ts:185, knowledge token :86, provider :241) has no item-triggered mount; registerAdapter(id, adapter) (knowledge-service.ts:207) takes no option and no deployment's-store mark exists; row 3a's boot line lives in packages/objectql/src/knowledge-source-unserved.ts:5,60; knowledge-rag.mdx:33,57 still write adapter: 'turso'.
    Serial constraints cleared: overlap-check --branch=probe against origin/main 0a3ea67: VERDICT clean exit 0; #37902 (this area, in the merge queue) shares content/docs/ai/knowledge-rag.mdx and merges cleanly. #37479 (same knowledge-service.ts) is held serial behind this card; #37309 and #37310 are Blocked-by this card. The dev re-runs overlap-check before every push.
    Pre-claim lane: packages/services/**, packages/core/**, packages/cli/** ⇒ domain:server, with the one spec line per spec.md; built in o1-C, L1-read and contract-reviewed by L1-a.
    Pre-claim deps: Blocked-by #37304 (closed, PR #37676 merged) and #37102 (closed); pm:blocked → pm:dispatched in this stroke.
    Prior rulings read: check-prior-rulings.mjs --card 37306: 0 ruling hits in the card thread; governing text ADR-0161 K4 ◆, K6, K8 items 11-12, K10 (a key change lands with its reader; no contract member added).
    Fold-or-serial: not folded — #37479 shares knowledge-service.ts but is a different mechanism (unmounted-adapter reporting) and runs after; #37307 and #37732 share no file.

  4. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpm:dispatchedpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions