Repository navigation
Description
triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t
Filing gate: ② a decision only the maintainer can make · Source: maintainer. In the triage session today the maintainer asked 「平台的文档元数据本身不是最需要使用知识库搜索的吗」, then 「docs 元数据在界面上不能修改吗?管理员不能增加新的手册吗」, then 「你觉得哪个方案更简单?」 and 「立决策卡」.
维护者速读
- 问题:用户和 agent 在应用里问「这个流程怎么用、规则是什么」,答案就在应用手册里;现在的手册搜索只认原词,换个说法就搜不到,管理员新写的手册也一样。
- 选项:A 手册搜索内部改用知识检索,手册的查看权限照旧,约两个 PR;B 让知识源多一种「手册」来源,作者可以自己配,约四个 PR,要改协议;C 把手册同步成一张系统表,复用表格的检索,约三到四个 PR,权限要重新对一遍。
- 推荐 A:改动最小、不动协议,手册谁能看的规则原封不动。
- 不定会怎样:手册继续只能按原词搜,agent 答流程类问题时常常找不到手册里写好的答案。
Background (readings at origin/main 600197a, read 2026-11-28 ~14:35 UTC)
- Manual search today.
search_package_docsandread_package_doc(MCP) are served bypackages/runtime/src/domains/mcp-package-docs.ts. That file reads every page throughprotocol.getMetaItems({ type: 'doc' })and the book list the same way (~L120-121). Both pass the/meta/docdocs-audience read gate (createMetaListReadGate, ADR-0046 §6.7). Its own header: "No server-side doc search exists, so the search is the smallest honest one": a term matches by substring in a page's title, a heading or its text.- Re-check:
git show origin/main:packages/runtime/src/domains/mcp-package-docs.ts | grep -n "smallest honest\|getMetaItems"
- Re-check:
- Manuals are written at run time too. The registry row for
docreadsallowRuntimeCreate: true, supportsOverlay: false, andbookreadsallowRuntimeCreate: true, supportsOverlay: true(packages/spec/src/kernel/metadata-plugin.zod.ts~L1214, L1231). Studio lists both under 高级 → 平台 (studioMenuPlacement.ts). The doc create form writes the body on the canvas. So an admin can add pages and re-order a book, but cannot edit a page a package ships. Runtime pages are stored insys_metadata(managedBy: 'engine-owned').- Re-check:
git show origin/main:packages/spec/src/kernel/metadata-plugin.zod.ts | grep -n "type: 'doc'\|type: 'book'"
- Re-check:
- Knowledge search today.
knowledge_sourcehas one kind,object;fileandhttpare retired (packages/spec/src/ai/knowledge-source.zod.ts~L127-144).search_knowledgere-checks each hit against the caller's row-level security (packages/services/service-knowledge/src/knowledge-tools.ts~L64-69). The example app indexes one business object (examples/app-showcase/objectstack.config.ts,ShowcaseTaskNotesKnowledge). No example indexes manuals.- Re-check:
git grep -n "kind: enumWithRetiredValues" origin/main -- packages/spec/src/ai/knowledge-source.zod.ts
- Re-check:
- Two permission models. A manual is visible by its book's
audience(org,public,{ permissionSet },{ systemPermission }). A knowledge hit is visible by the source object's row-level security. Nothing maps one onto the other today.
Governing text: ADR-0161 D2 (docs/adr/0161-…): "knowledge_source becomes a governed metadata type referencing objects". ADR-0161 D1: the platform owns assembly, sync and reconcile, and adapters own embedding and retrieval. ADR-0046 §6.7: the docs-audience gate is the one visibility rule for manuals.
Protocol: option A changes no author-writable key. Option B adds a knowledge_source kind, a public-contract change that reopens ADR-0161 D2. Option C adds a system object.
The question
Should the manual search go through the knowledge service, and in which shape: an internal index behind the existing doc tools, a new knowledge-source kind authors can declare, or manuals synced into an object?
Options
| Option | What it does | What the customer sees | Effort |
|---|---|---|---|
A · internal index behind search_package_docs |
The knowledge service keeps one internal index of the doc items (getMetaItems), rebuilt at boot and package install and on a doc or book save. search_package_docs ranks from it, then applies the same docs-audience gate. No new key. Where the deployment has no embedder (the memory store), it keeps today's substring match. |
Manual questions find pages by meaning on a deployment with an embedder; nothing changes in who may see which page. | server lane · ~2 PRs (runtime doc search + reindex on doc/book save and install) · no measured precedent |
B · a doc kind of knowledge_source |
Authors declare source: { kind: 'doc', book? }. The service syncs from metadata saves as well as record changes. search_knowledge must judge a doc hit by the book audience, not by row-level security. |
Authors choose which manuals are searchable, and agents search manuals and records with one tool. | spec + server + lint + skills/docs + an ADR-0161 amendment · ~4 PRs · no measured precedent |
| C · manuals synced into a system object | Each doc page is mirrored as a row of a new system object, and an ordinary object knowledge source indexes it. Book audiences must be translated into row-level security on that object. |
The same as A once it works. A wrong translation either shows a manual to people its book excludes, or hides it from people who may read it. | server (+ spec for the object) · ~3–4 PRs · no measured precedent |
Business meaning: A is upgrading the search box of an existing help center. B is letting every app owner decide which binders go into the company search engine. C is photocopying the help center into a filing cabinet and re-doing its lock list.
Four-axis analysis
os-decision-facets
- ① Long-term soundness: A adds no special case and no contract (one search path, one visibility rule). B grows the knowledge contract back past ADR-0161 D2's one-kind shape and adds a second visibility rule inside
search_knowledge. C adds a mirror object that must stay equal to the registry, plus an audience translation that is a permanent special case. - ② Real business pull: today's pull is the maintainer's reading that manual questions are the main use of in-app search. No external user has named it. Admins do write manuals at run time (the registry row and the Studio form are shipped). Zero measured pull for author-chosen doc sources (B).
- ③ Preventing AI mistakes: A leaves nothing new for an AI to write wrong. B gives authors a new kind to mis-declare, and a doc hit judged by the wrong rule fails silently. C's translation fails silently in both directions, and that is the worst failure shape.
- ④ Startup focus: A is the smallest surface and is removable without a migration. B declares a new author-facing capability that becomes a permanent obligation. C adds an engine-owned mirror to maintain.
Prior rulings read: package doc, search_package_docs, knowledge source, doc search → 0 hits; ADR-0161 D1/D2, ADR-0046 §6.7; thread: none (the question was raised in the triage session).
Recommendation
A. The end state in two years: the help center and the record search share one retrieval engine, while each keeps its own visibility rule. That is how mainstream platforms model it (a help-center search and a record search, both on one index service, gated separately). A reaches that without a contract change. B and C each need a second visibility rule. B is not taken because it reopens ADR-0161 D2 with no author pull. C is not taken because its audience translation can leak manuals silently.
Self-check: only on ① the answer is A; does ②③④ flip it: no.
Confidence gap: not measured whether a page a package ships is also a row of sys_metadata. A does not depend on it, since it reads the registry through getMetaItems; C does. The gain of A depends on the deployment: the memory store has no embedder, so the community default keeps substring matching unless an embedder or pgvector is mounted.
After the ruling
- A: file one server-lane card under 专题:知识检索平台化(应用写一份知识源配置就有可用的检索:开源、托管、企业版都能用) #37000. Scope: the internal doc index, reindex on doc/book save and package install, substring fallback with no embedder, a pin that the audience gate still decides visibility, and the skills/docs line on
search_package_docs. Dispatch by area order. - B: an ADR-0161 amendment card first (Tier H), then spec, service, lint and skills cards.
- C: a spec card for the object and a server card for the sync and the audience translation, with a pin for each audience kind.
Related: epic #37000 (knowledge platform), ADR-0161, ADR-0046, search_package_docs (#35442).
Activity
objectstack-fleet commentedon Nov 28, 2026
triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t
Note for the decision · 2026-11-28T16:17Z: #38368 (maintainer-directed ADR-0161 dated note) rules that a mounted knowledge service is enabled only when an embedder and the store are both configured. Otherwise its sources are held and
search_knowledgeis absent. That settles a premise of option A here: on a deployment where the knowledge service is not enabled,search_package_docskeeps today's substring match, the same fallback option A already names. Option A then needs no new switch of its own: it follows the same enablement reading (ai.embedder_provider).objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8
Served-tier: CONTRACT_REVIEW_TIER
Analysed-by: an independent subagent of seat 8 (explicit fable tier), not anchored on this card's analysis
Re-analysis · 2026-11-28T23:20Z · a delta on this card's four-axis analysis. The seat could not confirm the tier of the existing analysis (filed by the triage session), so it re-ran it at contract-review tier before presenting it. Its live probes used the read-only
search_package_docstool of a connected test deployment. Posted unchanged apart from this header.Verdict: I agree with the letter A, but not with A as the card describes it. The card's A says "the knowledge service keeps one internal index of the
docitems" with no contract change, in about 2 PRs. The code has no seam for that. A is only buildable today as a docs-side search that borrows the deployment's embedder, and it needs three conditions the card does not carry (below). If the maintainer wants manuals literally inside the knowledge service, that is option B's ADR amendment, not A.维护者速读
Where I differ from the card
maintoday a deployment with no embedder gets an embedder whose every call errors; the "not enabled" state is ADR-0161 dated note: a mounted knowledge service is enabled by configuration; until then its sources are held and not served #38368/service-knowledge: a self-hosted deployment with no embedder holds its knowledge sources without serving them, and lists no search_knowledge #38369, both still open.search_package_docstakestermsand answersmatchedOn: 'title' | 'heading' | 'text'plusmatchedTerms. A meaning match fits none of these, and a vector search never answers "nothing matched", which the server's instruction relies on.Premises, re-checked
getMetaItemsand the docs-audience gatemcp-package-docs.ts:36("No server-side doc search exists, so the search is the smallest honest one"),:120-121(gate wraps both reads). Grep ofpackages/for a second doc search: none. The Console has a client-side full-text search (ui/apps/console/src/pages/docs-index.ts:21-24).docandbookregistry rowsmetadata-plugin.zod.ts:1214(doc:allowRuntimeCreate: true, supportsOverlay: false),:1231(book:supportsOverlay: true, allowRuntimeCreate: true,allowEnvironmentOverlay: false). Studio placement:studioMenuPlacement.ts:109-110, tieradvanced.:1225-1227says drag-editing a packaged book answers403 not_overridable; only a new book is editable. Unverified live.managedBy: 'engine-owned'unverified.knowledge_sourcehas one kind,objectknowledge-source.zod.ts:143.search_knowledgere-checks each hit against row-level securityknowledge-tools.ts:63-68(the card's L64-69; the file changed by 49 lines since the card's snapshot).knowledge-service.ts:3960-4030re-reads each hit bysource.source.object.examples/app-showcase/objectstack.config.ts:237,src/ai/task-notes.knowledge-source.ts:32.pm:queue) and #38369 ispm:blocked. ADR-0161 onmainhas no such note (grep for "not enabled" andembedder_provider: 0 hits). Onmain,knowledge-service-plugin.ts:1036-1073registers anUnconfiguredEmbedderwhose every use errors.ai.manifest.ts:373:embedder_providerdefault'none'.knowledge-memoryranks by token counts and reports no embedding descriptor (knowledge-memory/src/index.ts:83). The switch is the embedder setting, not the store.:159: "Ruling D2:knowledge_sourcebecomes a governed metadata type referencing objects".The four questions asked.
Is there really no server-side doc search? Yes, none. ADR-0046 lists "book-level search" as deferred phase P3d (
0046-…md:3,:535), governing text the card does not cite.Can the knowledge service index a non-object corpus without a contract change? No. There are three candidate seams:
IKnowledgeService: closed.knowledge-service.ts(contracts):165: "There is no member that pushes a document (ADR-0161 K1)".registerSourceparses with the one schema, so onlykind: 'object'registers. The hit re-read drops any hit whose source is not an object source (knowledge-service.ts:2727).KnowledgeSource, skips fingerprints, generations and purge, and runs against K9 rule 4 ("no adapter called from an agent runtime", ADR-0161:379).IEmbedder('embedder'service), called from the docs module: the only seam needing no contract change. It does not go through the knowledge service; it shares the embedder and the enablement state.Is a package-shipped page also a
sys_metadatarow? It depends on the package. A code package's page is not: "A code package's metadata is CODE — it is registered from an artifact at boot and has nosys_metadatarows at all" (packages/runtime/src/domains/packages.ts:1906-1908). A Studio-authored or runtime package's page is: "A Studio-authored package issys_metadatarows bound bypackage_id" (:3920).getMetaItemsmerges four sources (meta-overlay-cache.ts:49-57), and onlysys_metadatawrites are observable there. Read from code, not measured on a database. So C cannot mirror fromsys_metadataalone, and "reindex on save and install" has no single event to hang on.Does A's gate hold if ranking happens before the gate? Not safely. Today the gate runs at
mcp-package-docs.ts:360, matching at:365, andtruncatedis computed from gated hits at:399. Rank-then-gate adds:truncatedor a count computed before the gate reveals that hidden pages matched (K9 rule 6, ADR-0161:381, forbids returning that count for records);Gate-then-rank over the readable set, in process, has none of these. Titles do not leak in either order as long as nothing from the index is returned before the gate.
Measured on the connected HotCRM test deployment (
search_package_docs, run by me):线索/商机/审批/回款潜在客户销售机会,签批,催款签批only谁来跟进新线索prospectSo the tool-level miss is real. Whether an agent fails end to end is not measured: in the #36843 acceptance the model chose the manual's own words and passed (unverified by me beyond its transcript lines).
New fact since the card was filed: #38372 and #38374 (maintainer-directed) put help articles in a business object with an ordinary object knowledge source. Tenant-written knowledge now has a ruled home in the engine.
Governing text
:114: push calls "are refused on an object source"; with thefile/httparms gone "the two methods leaveIKnowledgeService".:204: "one strict contract (Prime Directive Add comprehensive test suite for Zod schema validation #12) leaves no room for a second, code-only source shape beside the governed one." An internal, unkeyed doc corpus inside the service is that shape.:212: the arms "return together, as a new arm with a full design (schema, loader, reader, and an answer for permissions)". This is B's route.:229: "Embedding is egress. The text of every listed field is sent to the embedder".:379,:381(quoted above). K7 and K8: an in-process index has no generation or fingerprint; K8's member list is closed (:366), and A adds no member.doc's effective audience is the union over the books that reference it."mcp-package-docs.ts:15-16: "⛔ No second rule: this module hands the gate I/O only, and every verdict is the gate's."Protocol: A changes no authorable key but changes an AI-facing tool's output shape and description. B adds a
knowledge_sourcekind and amends ADR-0161 D2. C adds a system object.Options
'embedder'service, caches by content hash in process, and ranks only pages the caller's gate already admitted. Substring hits stay first; meaning hits are added above a score floor. Substring only where knowledge is not enabled.:204refused; it becomes B without the keydocarm ofknowledge_source, with assembly from metadata, sync from metadata saves and the audience gate as its permission answer.Business meaning: A is a better search box on the product manual. B is adding the manuals to the company search engine's source list. C is photocopying the manual into a filing cabinet with a second lock list.
Four axes
os-decision-facets
mcp-package-docs.ts:15. A as carded contradicts ADR-0161:204.Prior rulings read:
search_package_docs,knowledge_source kind doc,book-level search,manual search embedder→ no prior ruling on doc search shape; ADR-0161 D1/D2/K1/K4 point 1/K5/K7/K8/K9, ADR-0046 §6.7 and P3d; thread: 1 comment (the triage note).Recommendation
A, as corrected. End state in two years: tenant knowledge lives in records and is searched by the knowledge engine; a publisher's manual stays small metadata with its own search, which borrows the embedder. That matches Salesforce and ServiceNow, where knowledge articles are records under the platform search and product help is separate.
Three conditions the ruling should carry in the same stroke:
truncatedand counts come from gated hits; pinned by a test where a hidden page is the best match and the answer equals that of a corpus without it.Self-check: on ① alone the answer is A (corrected); do ②③④ flip it: no. They move timing: after #38369.
Confidence gap
After the ruling
Blocked-by: #38369. Scope: embedder use behind the enablement state, content-hash cache, gate-then-rank, the hidden-page pin, the tool's output and description, the settings help line. No reindex hooks: each search already reads the pages live.search_knowledgeserves doc hits; then spec, service, lint, Studio and skills cards.Unverified, as marked above: live behaviour of packaged-book editing,
managedBy: 'engine-owned', thesys_metadataanswer on a running database, the #36843 transcript, and all effort figures.objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5kT5XV573hKPpRU5M1
Ruling: letter E · maintainer 「E 暂停」 · 2026-11-28T23:21Z
Maintainer ruling recorded: the manual search is paused (option E). No shape is ruled.
docmetadata) through the knowledge service: which of three shapes #38352 手册搜索走 A 还是 E(暂停)」, tapped 2026-11-28T23:20:39Z; where = this project's decision threadcmsg_01TenzsRopZj4jMbvjX8uz1XTqJCBCLSLCLPc9HzWY2VRA, decision cardcmsg_01TenzsRopZj4jMbvjX8uz1XMnZK1v8DLpzgV8x75XT83b. The option's text as he read it: 「手册搜索暂不动,仍按原词匹配;ADR-0161 dated note: a mounted knowledge service is enabled by configuration; until then its sources are held and not served #38368 关闭后由 5 号座位重新提请您裁定。」repo:objectstack#8's session and carried by its handover (record 7247291990 on Topic: knowledge splitting and retrieval for any content, phases 0–2 (no lost text, one passage per unit, passages that carry their context, hits a model can use) #38346).search_package_docskeeps today's substring match. None of A, B or C is ruled, and no implementation card is filed. Option E is not in this card's option table: it is the pause named in the handover, and the decision card offered it beside A.repo:objectstack#5brings the question back to the maintainer. The priority stays p2.Restart-when: closed #38368
Label: the seat that holds topic #37000 (
repo:objectstack#5) moves this card fromneeds-user-decisiontopm:on-hold; this thread tells the seat thread now.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5kT5XV573hKPpRU5M1
Re-presentation analysis · 2026-11-29T01:37Z · the restart condition of record 7247382346 is met: #38368 closed when PR #38401 merged (0c1b2ff). This is a delta on the card's analysis and on seat 8's re-analysis (7247373051), read against the merged ADR-0161 note and ruling record 7248214179 on #38368. Written by this project's decision thread (Fable tier); the question goes to the maintainer on a decision card in that thread.
维护者速读
What the merged note changes, option by option
A as the card words it (an index inside the knowledge service) is not buildable. The note ends: "This note adds no contract member, no settings key and no capability token: the list stays closed." The knowledge service has no member that takes a document not built from a record (7247373051, seam 1). So "A" can only mean the corrected A of 7247373051: the docs module embeds manual passages through the
'embedder'service and ranks only pages the caller's gate already admitted.Corrected A, read with the note:
mainhas no such state until service-knowledge: a self-hosted deployment with no embedder holds its knowledge sources without serving them, and lists no search_knowledge #38369 builds it. service-knowledge: a self-hosted deployment with no embedder holds its knowledge sources without serving them, and lists no search_knowledge #38369 is open. The implementation card staysBlocked-by: #38369.B. A
dockind reopens D2 and the list the note restated as closed one day ago. Under the note a doc source would be held like any source. Still 5–6 PRs and an ADR amendment, with no author asking.C. The mirror's knowledge source would be an engine write, so it installs and is held: the note does not stand in its way. Its own faults stand: a code package's pages have no
sys_metadatarows, and book audiences rewritten as row-level security are a second visibility rule.A shape outside the card: the table of contents as a fallback
7247373051 names it in its confidence gap and does not weigh it. Read on
main0c1b2ff:search_package_docsis a model over MCP. The Console has its own client-side search (ui/apps/console/src/pages/docs-index.ts).terms, and no tool lists the manuals (packages/mcp/src/mcp-http-tools.ts#registerPackageDocTools:search_package_docs,read_package_doc). A model whose words miss has nothing to pick from.read_package_doc.main:*.book.tsandsrc/**/docs/*.md*; not read from a running deployment). The list is a few kilobytes.潜在客户;销售机会,签批,催款;谁来跟进新线索;prospect) end to end, before and after.os-decision-facets
Prior rulings read: record 7247382346 (E, pause) and 7248214179 (ADR-0161 dated note: a mounted knowledge service is enabled by configuration; until then its sources are held and not served #38368, 1A 2A 3A 4A); ADR-0161 note of 2026-11-28 as merged;
search_package_docs table of contents,list manuals tool→ no prior ruling; thread: 3 comments.Recommendation
The fallback first, corrected A stays on hold. The fallback fixes the measured miss on every deployment at a third of the cost, and its probe result says whether meaning-based matching is still needed. If it is, corrected A is the shape, with the three conditions of 7247373051 and the state reading above. B and C are not recommended.
Self-check: on ① alone the answer is the fallback; do ②③④ flip it: no.
Confidence gap: the fallback's effect is unmeasured; a deployment with far larger manuals than HotCRM's would need the list cut by manual. Effort figures are estimates with no measured precedent.
After the ruling
pm:on-holdwithRestart-when: closedon that card.Blocked-by: #38369.Restart-when: closed objectstack-ai/objectstack#38369.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5kT5XV573hKPpRU5M1
Ruling: the table-of-contents fallback first, option A stays on hold (the decision card's first option; not a letter of this card's table) · maintainer 「目录兜底,A 暂停」 · 2026-11-29T02:01Z
Maintainer ruling recorded, second round. It follows record 7247382346 (E, pause), whose restart condition fired when #38368 closed.
docmetadata) through the knowledge service: which of three shapes #38352 手册搜索:目录兜底、A 修正版,还是继续暂停」, tapped 2026-11-29T02:01:06Z; where = this project's decision threadcmsg_01TenzsRopZj4jMbvjX8uz1XTqJCBCLSLCLPc9HzWY2VRA, decision cardcmsg_01TenzsRopZj4jMbvjX8uz1X3Rg7F522GtsgMPNtSdtU9x(option index 0). It is a tap on a card and not typed words: it answers what the card asked and nothing else.What is ruled
search_package_docsfinds nothing, its answer also carries the table of contents of the manuals this caller may read, read through the same docs-audience gate, gate first. A model picks a page from it and reads it withread_package_doc. No embedder, nothing sent out, no governed text, the same on every deployment.Not ruled
Next
repo:objectstack#5's knowledge area (o5-ai37000) files the fallback card under 专题:知识检索平台化(应用写一份知识源配置就有可用的检索:开源、托管、企业版都能用) #37000, then writes its number on this card asRestart-when: closed objectstack-ai/objectstack#N. That line replaces the criterion below.pm:on-holdand p2. No label is written by this thread.Restart-when: the table-of-contents fallback card filed from this ruling is closed and its probe result is recorded on this card
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb
The table-of-contents fallback card from ruling 7249168223 is filed as #38445, under #37000. This line replaces that record's criterion. The label stays
pm:on-hold. When #38445 closes, its probe result is recorded here and option A goes back to the maintainer.Restart-when: closed #38445