You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f3cd7db
Browse filesBrowse the repository at this point in the historyBrowse files
docs(adr): ADR-0161 note of 2026-12-01 — name every source the unmarked statements rest on
Review pass on the seventh dated note. Two sentences change; the diff against
main stays add-only (17 lines added, none changed and none removed).
- The note's opening says what is not marked with a diamond rests on the
ruling record, the analysis, or a reading of main. It also rests on contract
review 7290045524 (the suite case, the reading that the method takes no
source), on this record's own rules, on PR #38798 at its head and on the
body of the card. The sentence now lists them.
- The signature of IKnowledgeAdapter.embedQuery is the one PR #38798 declares
at head 4561e81. The members bullet now says so, so that an approver does
not read an unmarked shape with no source.
Nothing the note decides moves: the two members, the type of the second, the
three readings, the condition and the means are as committed.
Claude-Session: https://claude.ai/code/session_01JQwxbXfgA45f3y5YpDPT5h
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -470,9 +470,9 @@ Rules for every member:
470
470
471
471
> **Cross-reference (2026-11-30, [#38760](https://github.com/objectstack-ai/objectstack/issues/38760)).** Rule 4 above, and the three sentences of the note of 2026-11-30 above that speak of rerank, are read with the dated note of 2026-11-30 on #38760 under "What follows from the two lists" in [K1](#k1--the-boundary), which is written on the maintainer's later words of that day. Whether a source's searches are reranked is declared by the knowledge source, so "rerank toggles" leaves the adapter's plugin options in rule 4. Of rerank, a switch enters the source and no model does. The sentence 「平台以后如果统一做重排,那是知识服务的配置。」 of the record of #38692 stands: the knowledge service reranks, with the reranker the deployment configures. That note adds no member: `IKnowledgeAdapter` and `AdapterSearchOptions` are unchanged, and the list stays closed (rules 3 and 5). No sentence of K8 or of the note above is changed.
472
472
473
-
> **Note (2026-12-01, [#38676](https://github.com/objectstack-ai/objectstack/issues/38676)) — two members, `IKnowledgeAdapter.embedQuery` and `AdapterSearchOptions.queryVector`: the question of a search is embedded at most once for each adapter instance, by the adapter, and the knowledge service carries the vector back to it for every call of that search; the adapter asks for it where it embeds today, so its refusals are answered as before.** Decided by the maintainer on 2026-12-01: ruling record [`7296268226`](https://github.com/objectstack-ai/objectstack/issues/38676#issuecomment-7296268226) on #38676. He ruled by choosing an option of a decision card, and the record carries the card's words, verbatim and untranslated. The card's question: 「选定知识搜索补查时重复生成问题向量的处理路线」. The option he chose, at 2026-12-01T00:22:00Z: 「写进约定,一次提问只转一次」, which the card explains as 「需要补查的搜索快约0.2秒,多知识源的应用也只转一次;先补一条架构记录再合已做好的改动,共2个PR。」 The condition that the brief he read beside the card attaches to that option: 「附带条件:存储驱动原本会给出的拒绝提示(比如“需要重建索引”)要保持在前面,不能被转向量的报错盖掉。」 In English, the question is which route to take for the question's vector being made again when a knowledge search looks a second time. The option: write it into the contract, and a question is embedded once. The card's line on it: a search that looks a second time answers about 0.2 s sooner, and an application with several knowledge sources embeds once too; an architecture record is amended first and the change already built is merged after it, two PRs in all. The condition: the refusal a store would have given by itself, such as that its index needs a rebuild, stays in front and is not covered by an error from embedding the question. The record's 「存储驱动」 is this record's adapter, its 「转」 is to embed, and its 「补查」 is the refill round of a search: the second look a search takes when its first round leaves fewer than `topK` after the permission re-check. The architecture record is this one, and this note is the amendment. The analysis he ruled on is comment `7290428149` on #38676. Its section "After the ruling" sets out what this note writes, and the ruling record repeats it. The finding this note answers is M1 of contract review [`7290045524`](https://github.com/objectstack-ai/objectstack/pull/38798#issuecomment-7290045524) on PR [#38798](https://github.com/objectstack-ai/objectstack/pull/38798): that PR built the two members on 2026-11-30, before this record named them, and rule 5 above holds it until it does. The ruling record leaves one choice to this note: "The note names the means it takes, and the member's type follows from that choice." A ◆ marks what this note decides there, and one sentence it adds to the third reading, for the approver to accept with it or strike. The other statements are the ruling record's or the analysis's, quoted where they are given, what follows from the means, or a reading of `main`.
473
+
> **Note (2026-12-01, [#38676](https://github.com/objectstack-ai/objectstack/issues/38676)) — two members, `IKnowledgeAdapter.embedQuery` and `AdapterSearchOptions.queryVector`: the question of a search is embedded at most once for each adapter instance, by the adapter, and the knowledge service carries the vector back to it for every call of that search; the adapter asks for it where it embeds today, so its refusals are answered as before.** Decided by the maintainer on 2026-12-01: ruling record [`7296268226`](https://github.com/objectstack-ai/objectstack/issues/38676#issuecomment-7296268226) on #38676. He ruled by choosing an option of a decision card, and the record carries the card's words, verbatim and untranslated. The card's question: 「选定知识搜索补查时重复生成问题向量的处理路线」. The option he chose, at 2026-12-01T00:22:00Z: 「写进约定,一次提问只转一次」, which the card explains as 「需要补查的搜索快约0.2秒,多知识源的应用也只转一次;先补一条架构记录再合已做好的改动,共2个PR。」 The condition that the brief he read beside the card attaches to that option: 「附带条件:存储驱动原本会给出的拒绝提示(比如“需要重建索引”)要保持在前面,不能被转向量的报错盖掉。」 In English, the question is which route to take for the question's vector being made again when a knowledge search looks a second time. The option: write it into the contract, and a question is embedded once. The card's line on it: a search that looks a second time answers about 0.2 s sooner, and an application with several knowledge sources embeds once too; an architecture record is amended first and the change already built is merged after it, two PRs in all. The condition: the refusal a store would have given by itself, such as that its index needs a rebuild, stays in front and is not covered by an error from embedding the question. The record's 「存储驱动」 is this record's adapter, its 「转」 is to embed, and its 「补查」 is the refill round of a search: the second look a search takes when its first round leaves fewer than `topK` after the permission re-check. The architecture record is this one, and this note is the amendment. The analysis he ruled on is comment `7290428149` on #38676. Its section "After the ruling" sets out what this note writes, and the ruling record repeats it. The finding this note answers is M1 of contract review [`7290045524`](https://github.com/objectstack-ai/objectstack/pull/38798#issuecomment-7290045524) on PR [#38798](https://github.com/objectstack-ai/objectstack/pull/38798): that PR built the two members on 2026-11-30, before this record named them, and rule 5 above holds it until it does. The ruling record leaves one choice to this note: "The note names the means it takes, and the member's type follows from that choice." A ◆ marks what this note decides there, and one sentence it adds to the third reading, for the approver to accept with it or strike. The other statements are the ruling record's, the analysis's or review `7290045524`'s, quoted or named where they are given; or what follows from the means or from the rules above; or a reading of `main`, of PR #38798 or of the body of #38676.
474
474
>
475
-
> - **The two members.** `IKnowledgeAdapter.embedQuery?(query: string): Promise<number[]>`, on `packages/spec/src/contracts/knowledge-adapter.ts#IKnowledgeAdapter`. It embeds a question as that adapter's own `search` embeds it: through the adapter's embedder and with its query-side options, a query prefix among them (item 15). It takes no source and no context. And `AdapterSearchOptions.queryVector?`, on `#AdapterSearchOptions` in the same file, whose type the next bullet fixes: what the knowledge service hands an adapter that has `embedQuery`, for the adapter to take the question's vector from. Each is optional (rule 2). An adapter without `embedQuery` is handed nothing and is searched as before: it embeds the question on every `search` call, its answer is the same, and nothing is skipped. No capability flag is added. The method's presence is the signal, as "What "capabilities" became" above says of the other optional methods: "the service asks whether the method is there". `queryVector` is a parameter of one search request, as `topK`, `scope` and `retrieval` are, and neither member carries configuration (rule 4).
475
+
> - **The two members.** `IKnowledgeAdapter.embedQuery?(query: string): Promise<number[]>`, on `packages/spec/src/contracts/knowledge-adapter.ts#IKnowledgeAdapter`, with the signature PR #38798 gives it at head `4561e81d0e`. It embeds a question as that adapter's own `search` embeds it: through the adapter's embedder and with its query-side options, a query prefix among them (item 15). It takes no source and no context. And `AdapterSearchOptions.queryVector?`, on `#AdapterSearchOptions` in the same file, whose type the next bullet fixes: what the knowledge service hands an adapter that has `embedQuery`, for the adapter to take the question's vector from. Each is optional (rule 2). An adapter without `embedQuery` is handed nothing and is searched as before: it embeds the question on every `search` call, its answer is the same, and nothing is skipped. No capability flag is added. The method's presence is the signal, as "What "capabilities" became" above says of the other optional methods: "the service asks whether the method is there". `queryVector` is a parameter of one search request, as `topK`, `scope` and `retrieval` are, and neither member carries configuration (rule 4).
476
476
> - **◆ The means, and with it the member's type.** `AdapterSearchOptions.queryVector?: () => Promise<readonly number[]>`. The member is a function that answers the question's vector, and not the vector. One search is one call of the knowledge service's search, with every round it runs. For one search the service makes at most one `embedQuery` call for each adapter instance that has the method, and it makes that call only through the function. The first time the function is called in a search, it calls that instance's `embedQuery` with the search's query. Every later call in that search, on whichever `search` call it was handed, answers the same promise, a rejected one too: a second source the search binds to that instance, the refill round and an adapter's own retry all read the one embedding call. The service hands the function on every `search` call it makes to that instance in that search, and it does not judge whether a call will embed. An adapter that is handed the member calls it at the point of its `search` where it embeds the query today, in place of that embedding call and inside the `search` call that carried it. It does not change the array it is answered, which serves the search's other calls. This is the means the analysis recommends: "the service hands the adapter a per-search memoised provider and the adapter calls it at the line where it embeds today, so every gate stays ahead of the embed". The name is the one PR #38798 gave the member and the analysis uses; the type is new. As #38798 stands (head `4561e81d0e`), the member is the vector itself, `readonly number[]`, and the service calls `embedQuery` ahead of `search`. That is the shape review `7290045524` read against K1, and it is not taken. Nor is the lesser means the analysis names: "on a failed service-side embed, call `search` without the vector; that restores the refusal but still spends an embed on a refused source." The analysis: "The member's type differs between the two, so the note names the one taken."
477
477
> - **The first reading of M1: who embeds, and who decides when.** The "Embedding calls" row of [K1](#k1--the-boundary) gives the adapter "Turning passages and queries into vectors, through the embedder the deployment configures", and says: "When to call, how to batch, and whether to call at all (an engine that embeds inside itself makes no call) are the adapter's." The second sentence of the list under that section, as the note of 2026-11-30 on #38760 left it, begins: "The service does not choose a model, compute a vector, compute a score for a candidate or parse a file." Item 15 says: "The adapter embeds, so it knows a query from a passage and applies a prefix itself". The three stand as written, and this note amends none of them. The analysis settles the reading: "the adapter still embeds, with its own embedder and prefix, and the service computes no vector, it carries one back to the instance that made it inside one search". By the means above the row holds word for word. When: the vector is made when an adapter first asks for it, at the point where that adapter embeds today. Whether: an adapter that does not reach that point never asks, so nothing is embedded for a search under `keyword`, for a search that ranks nothing, or for a source the adapter refuses. The service chooses no model and no prefix, and it does not read the vector: it holds the promise for the length of one search and answers it to the instance that made it, and to no other.
478
478
> -**The second reading: one vector for every source of an adapter instance.** The analysis: "one vector serves every source the search binds to that adapter instance, and an adapter whose query embedding depends on the source does not implement the method". `embedQuery` takes no source, so the one vector serves each source the search binds to the instance, in the first round and in the refill. An adapter that embeds a query by a model, a width or a prefix that differs from source to source does not implement the method: it keeps embedding inside `search`, where it knows the source, and is handed nothing. Two adapter instances are two functions and two embedding calls, and a vector never reaches an instance other than the one that made it. In `knowledge-turso` and `knowledge-pgvector` the embedder and the query prefix belong to the adapter instance and no source changes either, so both can implement it.
0 commit comments