Repository navigation
docs(knowledge): search_knowledge says what a score means; the AI skill lists source.retrieval.mode - #38732
Conversation
…ts (wip) Claude-Session: https://claude.ai/code/session_01JQwxbZLuMpo8YX4ACmyoNd Co-authored-by: Claude <noreply@anthropic.com>
…gate Claude-Session: https://claude.ai/code/session_01JQwxbZLuMpo8YX4ACmyoNd Co-authored-by: Claude <noreply@anthropic.com>
…s can read Claude-Session: https://claude.ai/code/session_01JQwxbZLuMpo8YX4ACmyoNd Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZLuMpo8YX4ACmyoNd Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZLuMpo8YX4ACmyoNd Co-authored-by: Claude <noreply@anthropic.com>
…evel headers Claude-Session: https://claude.ai/code/session_01JQwxbZLuMpo8YX4ACmyoNd Co-authored-by: Claude <noreply@anthropic.com>
…o on its facet body Claude-Session: https://claude.ai/code/session_01JQwxbZLuMpo8YX4ACmyoNd Co-authored-by: Claude <noreply@anthropic.com>
…ies at their modules Claude-Session: https://claude.ai/code/session_01JQwxbZLuMpo8YX4ACmyoNd Co-authored-by: Claude <noreply@anthropic.com>
…AdapterSearchOptions.retrieval (wip)
…or leg by a passage's own text
…to claude/project-thread-vj79kz-service
… mode its store does not run The effective mode is the source's `source.retrieval.mode`, else the store's `capabilities.retrieval.default`; every search hands it to the store as `AdapterSearchOptions.retrieval` and logs it at debug with its origin, never in the caller's answer. A declared mode the store does not list is refused at the save (400 VALIDATION_ERROR, listing the store's modes), at registration when the store already resolves, once after boot at error (`reportUnsupportedRetrieval`), and on every search (`refused`, SERVICE_UNAVAILABLE); such a source still indexes. `index_status` carries each source's retrieval reading and each store's modes. The liveness row flips to live. Claude-Session: https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf Co-authored-by: Claude <noreply@anthropic.com>
…ectstack-ai/objectstack into claude/project-thread-vj79kz-service
…e its per-search refusal code ADR-0161's K2 row on the adapter surface no longer says "no hybrid toggle": the contract carries the modes an adapter runs and the mode a search runs in, which a source declares. Protocol doc 7.1 says the same. The contract doc of AdapterSearchOptions.retrieval names the refusal of a mode the adapter does not list: SERVICE_UNAVAILABLE in a search's refused, VALIDATION_ERROR at save and registration. Claude-Session: https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf Co-authored-by: Claude <noreply@anthropic.com>
…ectstack-ai/objectstack into claude/project-thread-vj79kz-service
…ames none binds to Claude-Session: https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf Co-authored-by: Claude <noreply@anthropic.com>
…-vj79kz-service # Conflicts: # packages/services/service-knowledge/src/knowledge-service-admission.ts # packages/services/service-knowledge/src/knowledge-service-search.ts # packages/services/service-knowledge/src/knowledge-service-sources.ts # packages/services/service-knowledge/src/knowledge-service-top-level.ts # packages/services/service-knowledge/src/knowledge-service.ts
…ll lists source.retrieval.mode Claude-Session: https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 5 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 854500d2848cb1c19bab7cce2155d50ad02c6192 && git checkout 854500d2848cb1c19bab7cce2155d50ad02c6192
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8a7e65b43800b06ccf16d1541b21776ffb80299a de3d7e42c8415dad71ee28bd6399db2be4516481 && git checkout -B drift-repro 8a7e65b43800b06ccf16d1541b21776ffb80299a && git merge --no-ff de3d7e42c8415dad71ee28bd6399db2be4516481
node scripts/docs-audit/affected-docs.mjs --json 8a7e65b43800b06ccf16d1541b21776ffb80299a |
…e; count the new isomorphic pin The knowledge source form's Search group and its Retrieval mode select get their translation bundle entries, translated in the ten locales, and the ADR-0122 pin count moves 880 -> 881 for KnowledgeRetrievalModeSchema. Claude-Session: https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu Contract-review-claim: session_01JQwxbXyLoBzNYY1U8SNPFu · head ff557c4 · 2026-11-30T14:39Z |
|
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu Contract reviewServed-tier: PR #38732 on card #38692, phase 1a item 5 of ruling record
① Derived judgments
② Semver level
③ Boundary flagsSQL push-down. No query, no id materialisation and no join is added. Nothing to judge. Author. The PR's Dev flags. Report 7272829384 carries no Landing order. Comment 7275014909 orders this PR after #38721 and #38745. That condition is met on For the lane seat, outside ④ (prose face, not graded here). ④ Design judgment
The new row, clause by clause:
The three sentences shortened to pay for the row:
Tried to break it:
No must-fix. One should-fix, S1, open on this head. Implemented-by: VERDICT: PASS |
…fused The skill row said an unsupported retrieval mode is refused at save. That holds for a run-time save only: a shipped source installs, and its every search answers 503. The row now says both, inside the file's existing ceiling (re-banked at 7247). The changeset names @objectstack/skills, which ships the SKILL.md. The guide now says scores of two sources are not comparable (the service does sort them together), and the score jsdoc says the store's ranking rather than higher first. Claude-Session: https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu Contract-review-claim: session_01JQwxbXyLoBzNYY1U8SNPFu · head de3d7e4 · 2026-11-30T15:18Z |
|
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu Contract reviewServed-tier: Delta round on PR #38732 (card #38692), after record 7282643883 on head ① Derived judgments
② Semver level
③ Boundary flagsSQL push-down. Nothing added. The lane-seat note of the first record. ④ Design judgment
S1: closed No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu 维护者速读
席位核对ACCEPT · L1 · area o2-A · Head-sha
|
|
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu 2026-11-30T15:51Z · L1 ACCEPT and hand-off · #38692 phase 1a, part 6 (the
|
|
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu 2026-11-30T17:00Z · Landed. Merged at 2026-11-30T16:27Z (09eea10); |
…the knowledge service reranks after the permission re-check (objectstack-ai#38764) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9DAwBxBGNv4CexdUyBYJXSw)_ Fixes objectstack-ai#38760 Refs objectstack-ai#38750 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感;知识平台边界那份架构决策记录里追加一条 2026-11-30 的说明,写明知识源可以声明自己的检索结果要重排、用哪个重排模型由部署方配置、由知识服务在权限复核之后统一重排,不改任何代码。 - 为什么做:这是知识检索重排专题的第一步,把你当天说的「有就用」和「开了开关,一律重排」写进决策记录,后面几步的实现才有依据。 - 出错会怎样:说明里若有和你的裁决不一致的句子,后面做实现的人会照着错的文字去做;它只是一处文档追加,可以直接撤回,不影响任何在运行的系统。 - 要你做什么:请你审阅并批准这条说明;它改的是受管的决策记录,你批准它,由知识服务在权限复核之后重排这一条就算正式记下,不再另开决策卡。 ## What changes One file, add-only. `docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md` gains its sixth dated note: 28 lines added, none changed and none removed (614 lines to 642). The note records the maintainer's rulings of 2026-11-30 on the epic for knowledge retrieval rerank. A knowledge source may declare that its searches are reranked. The deployment configures the reranker, and no source names a model. The knowledge service reranks, after the permission re-check and before the cut to `topK`. The adapter contract does not change. Five insertions, in the form the five earlier notes of this record use. Line numbers are at head `6552e290`. | Lines | Where | What is added | |---|---|---| | 24 | Header, after the `**Amended**` line of the fifth note | A sixth `**Amended**` line, dated 2026-11-30. It names what the note amends, the maintainer's words with their times, and ruling record `7276086125`. | | 142 to 161 | K1, under "What follows from the two lists" | The note itself: an opening paragraph, 16 bullets and a last paragraph. | | 186 | K2, under "The rule for all of them" | A cross-reference. Three rows of the table name rerank and are read with the note. | | 281 | K4, in the cross-reference block that is already there | A cross-reference. One more source key is declared, `source.retrieval.rerank`. | | 468 | K8, under the note of 2026-11-30 | A cross-reference. Rule 4 and three sentences of that note are read with the note. | ### Each amended place No existing line is edited. This record's convention is add-only, so the note quotes the old sentence and states how it reads from the merge. The two sentences marked "new sentence" are the note's own wording. Every other entry in the third column is the note's reading of a text it leaves as written. In the last column, "body 1" to "body 3" are items 1 to 3 under "Rulings" in the body of the epic, which record the maintainer's 「有就用」 (10:13Z) and 「所以还是应该按照主流系统的做法,开了开关,一律重排」 (10:37Z). "D1" to "D4" are the first four of the six decisions of the epic that he answered with 「全部同意」 (10:47Z), as ruling record `7276086125` on the epic records them. | Place, with its line on `main` at `acf3b33e` | Old sentence | New sentence or reading | Ruling | |---|---|---|---| | K1, the "Rerank" row of the adapter's table (104) | "Whether a second model reorders candidates, and which." | Reading: neither is the adapter's. Whether: a knowledge source declares it. Which: the deployment configures the reranker, and no source names a model. The knowledge service reranks, after the permission re-check and before the cut to `topK`. The row keeps the adapter's own search. | body 1, D1 | | K1, the second sentence of the list (112), as the note of 2026-11-29 left it (119) | "The service does not choose a model, compute a vector, compute a score for a candidate, rerank or parse a file. It may re-order the hits it is about to answer by the ordering their source declares against a fact about the caller that the platform resolves, by position alone, and it changes the order the adapters answered in no other way." | New sentence: "The service does not choose a model, compute a vector, compute a score for a candidate or parse a file. It may re-order the hits it is about to answer in two ways, and it changes the order the adapters answered in no other way: by the ordering their source declares against a fact about the caller that the platform resolves, by position alone; and by reranking them, where their source declares it and the deployment has configured a reranker, after the permission re-check and before the cut to `topK`." | D1, body 1 and 3 | | The note of 2026-11-29, one sentence (119) | "This is not rerank, which stays the adapter's in the table above: the service reads no passage text and calls no model to do it." | Reading: the re-order by a declared ordering is still not rerank, and the service still reads no passage text and calls no model to do it. Rerank no longer "stays the adapter's". To rerank, the service hands the question and passage text to a model. | D1 | | The title (1), the D1 key-words line (9) and TL;DR item 1 (41) | Each says that adapters own rerank. | Reading: the word "no longer covers whether the hits of a search are reranked, by which model, or by whom, and it covers only what an adapter does inside its own search". | body 1, D1 | | K2, three rows (149, 153, 157) | "Engines are integrated for embedding, hybrid retrieval, rerank and file parsing."; the "no rerank" of the §3.4 row; "Embedding calls, vector storage, hybrid retrieval and rerank stay the adapter's." | Reading: the first stays true as a sentence, because a reranker is an engine the deployment brings, and it is the knowledge service that calls it. The §3.4 row keeps its "no rerank", because the adapter contract carries none. Of the third, the first three stay the adapter's and reranking is the service's. Each text is rewritten by the PR whose code makes the new sentence true. | D1 | | K8, rule 4 (417), as the note of 2026-11-30 left it (422) | "Which provider, which key, how to batch, rerank toggles and parser options stay in the adapter's own plugin options. Hybrid weights are declared by the knowledge source. A parameter of one search request is not configuration." | New sentence: "Which provider, which key, how to batch and parser options stay in the adapter's own plugin options. Hybrid weights are declared by the knowledge source, and so is whether its searches are reranked. The reranker is the deployment's configuration, and no source names a model. A parameter of one search request is not configuration." | body 1 | | The note of 2026-11-30 under K8, three sentences (422, 438) | 「K8 第 4 条:「hybrid weights」改划给知识源声明;rerank toggles、parser options 照旧留在驱动。」; under 「永远不进知识源协议」, 「融合算法及其常数、重排、分数阈值、分词器。平台以后如果统一做重排,那是知识服务的配置。」; "Rerank, a score threshold, a tokenizer and the fusion algorithm with its constant never enter the source (section 六, above)." | Reading: "Of rerank, a switch enters the source and nothing else does: no source names a reranker or a model. That switch is not an adapter's option. The fusion algorithm with its constant, a score threshold and a tokenizer still never enter the source, and parser options stay the adapter's." The sentence 「平台以后如果统一做重排,那是知识服务的配置。」 stands. | body 1; these words are later than the rulings that note records (06:00Z to 07:57Z) | ### What the note states beside the amended readings Each is quoted in the note from the words named here. - **The source key.** `source.retrieval.rerank`, an optional boolean, in the `source.retrieval` group the fifth note declares (body 1). - **No reranker is configured.** The search runs normally, the report marks the source with the reason `no_reranker` in `notReranked`, and saving or publishing the source shows a notice. It is never a refusal and never fewer hits (body 2; the two names are the ruling record's). - **A reranker is configured and the source declares it.** Every search is reranked. Only 0 or 1 candidate makes no call and sets no marker. At most 50 passages are sent per search (body 3). - **A configured reranker fails or times out.** The adapter order is kept, the source is marked `failed`, there is one attempt under a limit of 3 s, and it is not a coded refusal (D2). - **One model and one wire format for v1** (D3). The note names neither. - **A hosted deployment.** Hosted reranking comes after row 6 of the epic shows a gain, or a hosted customer asks. Until then a hosted source that declares rerank is searched normally and marked (D4). Left to the rows of the epic by name, under "Not in this note": the hosted recipient and its charging (D5, which is not decided); how a deployment states its reranker and what the knowledge service calls it through (rows 2 and 3); how many candidates are reranked under the ceiling of 50; how a rerank and a declared `affinity` follow one another; how the hits of several sources stand against each other; what `notReranked` looks like on the report and in the answer of `search_knowledge`; how the notice is shown; a per-search argument on the tool. No file under `packages/`, `content/`, `skills/` or `ui/` changes, and no other ADR does. The note declares; it builds nothing. ## Why The epic puts the record before the code. Its row 1 is this note, and the first decision of ruling record `7276086125` says of it: "Accepting row 1's ADR-0161 note records it; no separate decision card." Until this note merges, the ADR gives rerank to the adapter in every place the table above lists, and rule 4 of K8 keeps "rerank toggles" in the adapter's plugin options. Row 2 of the epic brings the key with its reader, and it needs the record to say so first. ## Tests The diff touches no package, so there is no build closure to make and no package test or type-check owed. What was measured on the text itself, at head `6552e290`: - **Quotations.** A script compared every quoted span of the 28 added lines with its source, read over REST or from the ADR at the base. The added text holds 16 spans in corner brackets: each is a verbatim substring of the body of the epic, of ruling record `7276086125` or `7276461244`, or of the ADR at the base where it already quotes the record of the fifth note. 0 mismatches. It holds 50 spans in double quotation marks: 48 are verbatim in one of those sources, and 2 are the note's own wording, which are the two "new sentence" entries of the table above. - **Bytes.** The added lines hold no raw control byte, no HTML comment and no model identifier. - **The reading of `main` the last paragraph of the note cites**, taken at `acf3b33e31`. `packages/services/service-knowledge/src/knowledge-service-search.ts#searchByKey` re-checks the hits as the caller (`applyPermissionFilter`), orders them by a declared `affinity` (`affinityOrderFor`) and cuts them to `topK`, with no rerank between. Tests aside, in `packages/services/service-knowledge/src` and the `src` of `knowledge-memory`, `knowledge-pgvector` and `knowledge-turso`, the word `rerank` is on one line, which is the class note K2 lists. The control word `embed` is on 412 lines, so the search reads those directories. - **Anchors.** Every code citation in the note is a path with a symbol, never a line number, and `check:adr-symbol-anchors` reads all of them (its verdict line is below). No ablation: the diff changes no behaviour a test pins. ## Acceptance notes **Against the card's acceptance lines.** 1. "Every amended sentence agrees with the design on objectstack-ai#38750 (option B) and with rulings D1 to D4." The table above gives each amended place with the ruling it rests on. 2. "No sentence promises row 2 behaviour that the epic does not rule." The note states no pool size, no widening factor, no order between rerank and `affinity`, no settings key name and no shape for the reranker contract. Each of these is named under "Not in this note" and left to its row. 3. "The `Amended` line is dated." Line 24, dated 2026-11-30. 4. "The note does not change any other ADR. It adds no code." One file changes. **Five things for the approver to weigh.** The note marks no ◆, because each of these rests on a text this record or the epic already has. They are the places where the wording is the note's and not a quotation. - a. **What the "Rerank" row keeps.** The note says the row keeps "the adapter's own search", and rests that on two sentences this record already has: "how candidates are found" (the "Hybrid retrieval" row) and "Changing the adapter changes how candidates are found and ranked" (Consequences). - b. **"The declaration is not silent (ADR-0078)".** A source that declares rerank where no reranker is configured is accepted and its search is answered. The note reads body 2 against ADR-0078: each such search says that its source was not reranked, and the author is told on save and on publish. - c. **Nothing is registered in K8.** The note says that the reranker's contract, client and settings (rows 2 and 3 of the epic) are not members of the adapter contract. It rests that on K8's own definition, under "What counts as a member": a member is what an adapter author must read, and no adapter reads these. - d. **A cross-reference under K4.** The card's list of places does not name K4. This record gives every new source key a cross-reference there, as the fifth note did for `source.retrieval`, so one was added. It changes no sentence of K4. - e. **The K2 rows are read through a cross-reference and are not edited.** Draft objectstack-ai#38720 edits the K2 row at line 153 in place, with the code that makes its new sentence true. This note's sentence about that row, that it keeps its "no rerank", holds for the row as it is on `main` and as objectstack-ai#38720 leaves it. **The names D1 to D6.** This record already writes "ruling D1", "ruling D2" and "ruling D5" for rulings of its own. The note therefore writes the six decisions of the epic as `objectstack-ai#38750 D1` to `objectstack-ai#38750 D6`, and says in its opening paragraph that none of them is a ruling of this record. It writes `row N of objectstack-ai#38750` for the same reason. **The card's line numbers, read on `main` at `acf3b33e`.** All twelve lines the card names (1, 9, 41, 104, 112, 119, 149, 153, 157, 417, 422, 438) exist and carry the text the card expects. Two labels are exchanged: the card gives 422 for rule 4 of K8 and 417 for the note of 2026-11-30. On `main`, rule 4 is line 417, and line 422 is that note's bullet "Rule 4, amended", which carries 「永远不进知识源协议」. Line 438 is that note's bullet "Not in this note". No line moved. **Overlap with the open drafts on this file.** `node scripts/pm/overlap-check.mjs --repo=objectstack-ai/objectstack`, run at `6552e2905b` before the push, printed `VERDICT clean exit 0`. It read `origin/main` at `acf3b33e31` and the six open heads that change this file (objectstack-ai#38745, objectstack-ai#38732, objectstack-ai#38730, objectstack-ai#38722, objectstack-ai#38721 and objectstack-ai#38720), and each merges cleanly with this branch. The order expected exit 1 against objectstack-ai#38720. It is clean because the note is add-only and inserts at none of the lines objectstack-ai#38720 changes. It was run again before this pull request opened, with `origin/main` at `8426fa0c89` (one commit later, which does not change this file): the same six heads, each merging cleanly, `VERDICT clean exit 0`. The landing order is the card's: after objectstack-ai#38720. **Not done here.** `content/docs/protocol/knowledge.mdx` and the class note of `KnowledgeService` are rewritten by the rows whose code makes their new sentences true. There is no changeset: `docs/adr/` is published by no package, and the PR carries `skip-changeset`. ## Verification **Read first, by risk.** One file changes, so these are its three hunks of most risk. 1. Line 146, the bullet "The sentence of the list, amended again". It is the one sentence that gives the knowledge service a second way to re-order hits. 2. Line 156, the bullet "Rule 4 of K8, amended again". The new rule 4 is composed by this note from body 1. 3. Line 150, the bullet "No reranker is configured". It holds the reading against ADR-0078 (item b above). **Two-minute check.** One click: open the "Files changed" tab. Expected: one file, +28 −0, five hunks, every changed line an addition. **Landing.** `docs/adr/**` is a governed surface. This is opened as a draft. The hand-off to the maintainer is the seat's, and the approval is the maintainer's. Nothing here requests a reviewer, marks it ready or arms auto-merge. **CI.** NOT MEASURED: the check-runs of this pull request, reason: it did not exist when this body was written. The report on the card carries the one reading taken after it opened. **Gates, run locally on head `6552e290`.** `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 21 commands from the diff. All 21 ran in the foreground, each exit code was captured before any pipe, and all 21 are exit 0. The reconciliation: ```text Run reconciliation — 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN. ✓ dispatch-gates --ran: 21 derived famil(ies) accounted for — 21 run, 0 NOT-MEASURED (a DERIVED zero — all 21 recorded an exit code and none of them is 3). ``` <details> <summary>The 21 commands and their exit codes</summary> ```text node scripts/check-adr-links.mjs :: exit 0 node scripts/check-adr-links.mjs --self-test :: exit 0 node scripts/check-closing-keyword-parity.mjs :: exit 0 node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0 node scripts/check-comment-mask-corpus.mjs :: exit 0 node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0 pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0 pnpm check:adr-anchors :: exit 0 pnpm check:adr-index :: exit 0 pnpm check:adr-symbol-anchors :: exit 0 pnpm check:ci-filter-parity :: exit 0 pnpm check:closed-ceremony-text :: exit 0 pnpm check:cross-package-test-inputs :: exit 0 pnpm check:doc-authoring :: exit 0 pnpm check:driver-memory-census :: exit 0 pnpm check:gitlink-declared :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:pm-governed-merges :: exit 0 pnpm check:pm-prior-rulings :: exit 0 pnpm check:refd-timer-probe :: exit 0 pnpm check:watch-hint-literal :: exit 0 ``` </details> <details> <summary>Verdict lines of the gates that read the ADR</summary> ```text ✅ check-adr-links: 1284 relative link destination(s) under docs/adr/ resolve ✅ check-adr-symbol-anchors: 4574 anchors across 165 records resolve — 1704 symbol (1675 declaration, 29 literal), 2818 file-level, 52 cross-repo, 6 exempt, 128 continuation. [cut here: the rest of the line is a note on what the count is not] adr-index --report: OK — docs/adr/README.md is current, every record parsed, self-test 60 assertions green. Report-only: this line never reds the step. check-nul-bytes: OK (scanned 29002 text file(s) -- 29002 tracked, 0 untracked-not-ignored; skipped 101 binary; no raw ASCII control bytes). ✓ doc authoring guard: 24253 customer-facing string(s) across 1963 spec sources clean — no internal issue-id references (message 3603 · strictObject 5655 · tombstone 1510 · describe 12078 · functionBuilt 529 · functionDeclared 878). ``` </details> <details> <summary>One gate first read NOT MEASURED, then green</summary> At the first head, `151609a7`, `pnpm --filter @objectstack/lint run check:doc-formula-expressions` answered exit 3, PREREQUISITE NOT MET: two workspace packages it imports were not built in the fresh worktree. That is a run that measured nothing, not a red gate. The two packages were built under the shared verify lock, and the gate was run again (the lock's verdict line is cut after the wait): ```text VERDICT command-exit 0 · held the lock 23s · waited 167s (2m47s) pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0 ``` At the final head it ran with the other 20 and answered exit 0. </details> **Left to CI, not run locally.** The repo-wide lint, the type-check lanes, the test shards, and the families `dispatch-gates` prints outside the derived list. The commit trailer gate ran in the pre-push hook on the pushed range and is green. ## Human Minimum - [x] 1. No schema and no code changes. - [x] 2. No new name is declared in code. The names the note writes are the rulings'. - [x] 3. No formatter ran. `pnpm lint` is NOT MEASURED locally: the repo-wide scan is CI's, and the diff is one Markdown file. - [x] 4. One card, one branch off `main` at `acf3b33e31`, one pull request. - [x] 5. Nothing publishes, so no changeset; both declaration lines are filled in above. - [x] 6. `packages/spec` is not touched. - [x] 7. No edit to `content/docs/references/`, to a `CHANGELOG.md` or to `content/docs/releases/`. - [x] 8. Title, body and comments are in English. The maintainer's Chinese words are quoted unchanged, and the 维护者速读 section is in Chinese as the fleet's rule asks. - [x] The *Before Submitting* list is done for what a docs-only diff reaches; `pnpm lint` is as item 3 says. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v)_ <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…r reports the modes it runs (objectstack-ai#38720) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8QCBjsNDZa4iwo35VN5fKKg)_ Part of objectstack-ai#38692 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up objectstack-ai#38732 (the `source.retrieval.mode` row of the objectstack-ai skill lands there; `skills/` is a governed path and takes its own PR) ## 维护者速读 - 知识源作者可以选择检索方式(按意思、按字词、两者结合),不选则沿用存储默认;本单只定义写法与驱动上报,用户暂无可见变化。 - 属于知识管理专题「一期 a:检索方式」,解决条款类问答被语义检索漏掉的问题。 - 出错只会是新写法被误拒或误收;未写此项的知识源行为不变,可直接撤回。 - 无。 ## Stack Base: `main`. First of the phase-1a series; the adapter PRs and the service PR build on it. The ruling it builds on is on `main`: ADR-0161, the dated note of 2026-11-30 under K8 (phase 0, merged as 95ffacc); this branch has `main` merged in. **Lands together with objectstack-ai#38722, right after it.** This PR adds the key and both contract members with their suite cases, but no reader: the service's reader is objectstack-ai#38722, and the two adapters that declare `implements.retrieval` are objectstack-ai#38721 and objectstack-ai#38745. That splits K8 rule 1 and K4 ("lands with its first reader, in the same PR") across stacked PRs, because the stack bases force it. Until objectstack-ai#38722 lands, a declared mode is carried and ignored, and the `planned` liveness row warns an author so (`authorWarn` and `authorHint`; objectstack-ai#38722 drops both when it flips the row to `live`). So objectstack-ai#38720 is not merged or released without objectstack-ai#38722, which merges right after it. ## What changes - `knowledge_source.source.retrieval?: { mode?: 'vector' | 'keyword' | 'hybrid' }`, strict from birth; `retrieval: {}` is accepted and declares nothing. Not part of the index fingerprint or the recipe hash. - `IKnowledgeAdapter.capabilities.retrieval?: { modes, default }` (`AdapterRetrievalCapability`) and `AdapterSearchOptions.retrieval?: { mode }`, optional as every search member is (K8 rule 2); omitted means the adapter's default. - Contract suite (`runKnowledgeAdapterContract`): `implements.retrieval`; a declared report must be valid, and one seeded fixture is searched under each listed mode (`vector` leaves the keyword-only clause out, `keyword` answers it alone, the default handed explicitly equals no member). - ADR-0161 K2 row and protocol doc §7.1 rewritten (see Acceptance notes); the contract doc names the refusal code. - Studio form row for the mode (static three options; PR 4 of the series makes it list the store's modes), liveness row `planned` (flipped to `live` by the service PR), protocol doc §3.4, generated baselines. ## Tests - `packages/spec`: new knowledge-source cases (three modes parse, `{}` accepted, an invalid mode's message, `vectorWeight`/`keywordWeight`/`fusion` refused as unknown keys, JSON Schema enum + `additionalProperties: false`). - `service-knowledge`: index-fingerprint test pins that neither hash moves for `{}` or any mode. - Contract suite exercised by the turso and live-pgvector adapter PRs. ## Acceptance notes - `AdapterSearchOptions.retrieval` is optional, as built (`retrieval?`, omitted means the adapter's default, as K8 rule 2 has every search member): the maintainer ruled it on objectstack-ai#38692 (comment 7272337479, 2026-11-30 07:57Z), the question the phase-0 contract review (7271729439) escalated. - Per-search refusal code (point 4), proposed: `SERVICE_UNAVAILABLE` (503), reused rather than added. It is an ADR-0112 standard catalog code (`packages/spec/src/api/error-code-ledger.zod.ts`, the standard map), so no new ledger entry; it is the code a source whose adapter is not mounted already carries in `refused`, since in both cases the deployment cannot serve the source as written. It is objectstack-ai#38722's to write and the maintainer's to confirm (open question C): the contract doc of `AdapterSearchOptions.retrieval` here names no code. The save refuses with `VALIDATION_ERROR` (400), as the ruling fixes. - ADR-0161's K2 row (adapter surface) is rewritten as the row asks of each PR that adds a member: it no longer says "no hybrid toggle"; protocol doc §7.1 likewise. This makes the PR Tier H (an ADR file is touched). - Phase 1b (`vectorWeight`) is not built; the strict shape refuses it today. ## Verification - Two-minute check: `pnpm --filter @objectstack/spec exec vitest run src/ai/knowledge-source.test.ts` → all pass, including the retrieval describe. - Local gates from `dispatch-gates.mjs --commands`: all measured gates green (`check:spec-parsed-alias` found a missing isomorphism pin, fixed in e805371); not measured in this container (exit 3 or unbuilt closure, no verdict): `check-plugin-teardown-shape --self-test` (shallow clone), `check:skill-examples`, `check:dual-build-cjs-loads`, `check:i18n`, `check:dts-closure`. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [ ] 4. One issue, one branch off an up-to-date `main`, one pull request. (Stacked: see "Stack" above.) - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf <!-- signed: repo:objectstack#2 · os-warren · session_01JQwxbaASqBozmmj1n5tbUf --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…s five records) (objectstack-ai#38774) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBHuLciv5hYVYUu4pypDP48J)_ Part of objectstack-ai#38438 Clause-②: no Metadata-protocol: none This pull request carries seven of the card's nine rows. The two ADR-0161 rows stay on the card; see "Rows not carried". ## 维护者速读 - 用户能看到什么变化:用户无感;只在五份设计记录里补了七条带日期的说明,写明主线现在实际怎么做,原有的决定文字一个字没动。 - 为什么做:属于「每周设计记录修订」滚动清单(11 月 29 日这一周);清单每一行指出一处「记录写的和主线不一致」或「记录留给某项工作回答、那项工作已经做完」,这次把代码已在主线的七行一并补齐。 - 出错会怎样:最坏是某条说明写得不准,照着设计记录干活的人会被带偏;纯文档、只增不删,可以直接撤回,不影响任何功能。 - 要你做什么:请审这七条说明并批准一次(设计记录须由你本人批)。 ## What changes Five ADR files gain seven notes dated 2026-11-30. Every diff line is an addition: 62 lines added, 0 removed. No original decision text is rewritten, and no decision changes. Each note follows the note convention its own record already uses, and each says that the passage it is read with is left as written. Each row's "what is true now" was read against the code on `main` before its note was written. Where a row's wording did not match the tree, the note says what `main` does; the last column says so and the list under the table gives the detail. | ADR · section | Was (the record's words) | Now (what the note records) | Source PR | Row on the card · result | |:---|:---|:---|:---|:---| | ADR-0084 · amendment of 2026-11-28, item (3) | "one landing for every door is not ruled"; the command palette's package entries, an app's design-in-Studio entry, the empty menu's entry and Setup's doors "still open the object list" | One landing is ruled: ruling record 7247357556 on objectstack-ai#37958, the maintainer's 「OK」, quoted with its question. Every door lands on the package's overview, `/studio/PACKAGE/overview`. `/studio/PACKAGE/data` stays a working address for the object list. The review-changes deep link still opens the Changes drawer over the object list and is read as no door, by a seat reading and not by a ruling | objectstack-ai#38501 | Card body row and 7252442785 · **written, corrected to the tree** (two labels, the date) | | ADR-0084 · the note of 2026-11-29 on the `form` row (near line 219) | "The same change takes the type off the directory's hidden types and brings its designer" | True of card objectstack-ai#37087, loose for the change: objectstack-ai#38484 brought the designer, and objectstack-ai#38619, which wrote the row, lists the type (off the hidden types, a place in the menu) | objectstack-ai#38484, objectstack-ai#38619 | 7258423977 · **written as an added note** (the row says "Reword") | | ADR-0037 · TL;DR item 2 and the "What already exists" table | "the streaming build tree (`data-build-progress` parts)", and a table row that marks "`data-build-progress` stream parts" shipped | The build-progress stream frame is retired. Its reader left with the build chat frontend, its producer with the cloud build loop, and its declaration left `@objectstack/spec/ai`. The upgrade guidance is the migration entry `ai-build-progress-frame-retired` | objectstack-ai#38398 (reader: objectstack-ai#37720) | 7250363289 · **written** (one sentence beyond the row) | | ADR-0150 · the note of 2026-11-26, bullet "Reads stay the missing name" | "Three reads at `_env` still answer `409` at this head (`?state=draft`, `?preview=draft`, `?layers=true`), and card objectstack-ai#34261 carries their move to `404`." | The move has landed. For a name only disabled packages hold, each of the three answers its own `404` and names no package, on both transports. An enabled package's stored draft that the plain read does not see keeps the `409` for the two draft reads | objectstack-ai#38633 | 7259890438 · **written, corrected to the tree** (codes and callers made exact) | | ADR-0150 · D4, the engine's flow-map row | The table keys the engine's flow map by `(package, name)` and says nothing of the status rows read from it | Each status row carries the `packageId` of the engine slot it reads, so `(packageId, name)` names one row. The toggle door reads back the row of the slot it switched, and echoes the request only where the reading cannot name that flow | objectstack-ai#38652 | 7266385586 · **written** | | ADR-0085 · the note of 2026-11-27 | "Neither key is in the spec yet: `ObjectSchema` is strict and refuses both until objectstack-ai#37792 lands `pinOverview` and objectstack-ai#37802 lands `fieldTabs`." | `pinOverview` is in the spec, an optional boolean on `ObjectSchema`; `false` means the desktop full record page never pins. An object extension does not carry the key. `fieldTabs` is still refused | objectstack-ai#38679 | 7271302663 · **written**, no `fieldTabs` line | | ADR-0146 · the note of 2026-11-24 (near line 908) | "A `.custom` package that is not the object's pair is not applied, and the boot log names it." | Maintainer ruling 7268226134 on objectstack-ai#36548, item 5, arm (c), verbatim 「保存和安装都拒绝」. A non-pair `.custom` package that writes `fieldGroups`, `relatedLists` or `actionLayout` on an object extension is refused at the save, the restore, the draft promotion, a package duplicate and marketplace install. Where no door can read the installed packages, the sentence stands | objectstack-ai#38706 | 7272564306 · **written, corrected to the tree** (statuses; the duplicate's answer corrected in patch round 1) | ### Rows not carried - **ADR-0161, two rows** (Consequences, "The service keeps none of its own"; K7 components table, "Split algorithm version"). The claim for this pull request leaves that file out, because pull request objectstack-ai#38764 was open on the same record when the claim was written. objectstack-ai#38764 merged at 2026-11-30T13:15:16Z, while this branch was being verified, and the prerequisites both rows name (objectstack-ai#38307, objectstack-ai#38401, objectstack-ai#38375, objectstack-ai#38452) are merged. Pull requests objectstack-ai#38730 and objectstack-ai#38732 (card objectstack-ai#38692) are still open and both write ADR-0161, so that record still has other writers. By the seat's call on the card (comment 7280598106) the two rows stay on objectstack-ai#38438 behind them, and this pull request is `Part of objectstack-ai#38438`. - **ADR-0085, a `fieldTabs` line.** Its pull request, objectstack-ai#38742, was open and a draft when this was opened (read at 2026-11-30, head `59220bf331`). The card says that line follows when it merges. Every prerequisite of the seven rows is merged on `main`: objectstack-ai#38398, objectstack-ai#38501, objectstack-ai#38484, objectstack-ai#38619, objectstack-ai#38633, objectstack-ai#38652, objectstack-ai#38679 and objectstack-ai#38706. The newest comment on the card when this was opened is the claim, 7279134045; a row added after it is not in this pull request. ### Where a note differs from its row - **ADR-0084, item (3).** The row names Setup's doors "Open in Studio" and "Customize in Studio". The labels on `main` are "Open in App Studio" and "Customize in App Studio", and the note uses them. The proposed text was dated 2026-11-29; the note is dated 2026-11-30, the day it was written into the record. The note names the three Setup doors one by one and says of the review-changes deep link what the row says: no door, by a seat reading, not by a ruling. - **ADR-0084, the `form` row.** The row says "Reword". The card's rule is that a row lands as an added dated note, so the 2026-11-29 note stays as written and a note under it says which pull request did which half. - **ADR-0037.** One sentence goes beyond the row: Phase 2's first invalidation source, the `buildProgress.items` diffs, was the same signal as the chat held it, and no code under `ui/` holds it any more. Cut it if the note should carry the row alone. The note also names the producer's retirement in the cloud repository and what a host does that still streams a progress part of its own. - **ADR-0150, the reads.** The row's proposed sentence gives `404` for `?preview=draft` and `?layers=true`. The note gives the code the tree answers, `404 RESOURCE_NOT_FOUND`, says that these are the answers to a caller admitted to the switch, and that a caller who is not admitted gets the plain read's `404`. It adds two facts from the tree: a package-less draft is withheld while a disabled package holds the name, and the layered view answers `404` under the leak guard. - **ADR-0150, D4.** The note spells out the three cases where the toggle door still echoes the request. The row's proposed sentence leaves them out. - **ADR-0085.** The row offers a "Built by" line in the style of an earlier note. The note carries it and also restates what `false` does and why an object extension does not carry the key, both from the row's own "what is true now". - **ADR-0146.** The row gives one code for every door. The tree answers `VALIDATION_ERROR` with status 400 at the save, the restore and the draft promotion, and with status 422 at marketplace install, with nothing installed. A package duplicate saves each copied row through the save door and lists a refused row in its own `failed[]`, with the save door's sentence and no code, storing nothing for that row. The note says all three, and that no error code is minted. ## Patch round 1 (head `04cc5911`) The contract review at `947b7e64` (comment 7280965486) passed with one should-fix: the ADR-0146 note put `VALIDATION_ERROR` / 400 on the package duplicate. Commit `04cc5911` corrects this branch's own 2026-11-30 note to the tree (`duplicatePackage` reports the refused row in `failed[]`) and adds one sentence from item 3 of ruling 7268226134 (a target whose owner the door does not know is not judged by role). Only that note moves: +9 / -3 inside it, and the branch is still +62 / -0 against `main`. Dev report: card comment 7281379369. Sections below that name `947b7e64` record the first round. ## Tests Docs only. No package source is touched, so no package test and no type check is owed for the change. No tested behaviour changed, so there is no ablation. Checked on the committed text at `947b7e64`: - Each phrase a note quotes from its ADR is in that file as it stands on `main`. A script compared them. One quotation, in the ADR-0085 note, reads as the sentence renders: the record links its two card references and the quotation does not. - Each verbatim maintainer quotation was compared with its record on GitHub (7247357556 and 7268226134). - Each path a note cites exists on the tree. The one exception is deliberate: the ADR-0037 note names `packages/spec/src/ai/build-progress.zod.ts` to say that the module is gone. - Each test title a note quotes is in the test file the note names. - A probe on the spec source: `ObjectSchema` accepts `pinOverview: false`, refuses `pinOverview: "no"`, and refuses `fieldTabs` as an unrecognised key; `ObjectExtensionSchema` refuses `pinOverview` as an unrecognised key, with its guidance. - Upstream moved four commits while this was written. The branch merges `main` at `f576dee5`; none of the four touches one of the five files or a path a note cites. `overlap-check` answers `VERDICT clean exit 0` against that `main`, and no open pull request shares a file with this branch. Two tests read these records from disk. Both were run on `947b7e64` under the verify lock, after building what each needs: - `ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts` reads ADR-0084's type table: `Test Files 1 passed (1)`, `Tests 21 passed (21)`. - `packages/qa/scenarios/test/score/entry.test.ts` reads ADR-0150's D1 table: `Test Files 1 passed (1)`, `Tests 14 passed (14)`. Its first run answered `Failed to resolve entry for package "@objectstack/types"`, a missing build in the fresh worktree and no verdict on this change; it passed once that package's build closure was built. The local gate set is the `dispatch-gates --commands` derivation for this change set, 21 commands, run on commit `947b7e64` (patch round 1 ran the same 21 on `04cc5911`, all exit 0). Each exit code was captured before any pipe. Reconciliation: `Run reconciliation — 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN`. The same 21 were derived and run on the commit before the merge, with the same result. <details><summary>ADR gates on 947b7e6 (all exit 0)</summary> | Command | Exit | Verdict line | |:---|:---|:---| | `pnpm check:adr-symbol-anchors` | 0 | `check-adr-symbol-anchors: 4597 anchors across 165 records resolve`, 0 line anchors survive. On the base commit the gate read 4570, and 4593 with this change alone; the other four come with `main`. | | `node scripts/check-adr-links.mjs` | 0 | `check-adr-links: 1284 relative link destination(s) under docs/adr/ resolve` | | `node scripts/check-adr-links.mjs --self-test` | 0 | | | `pnpm check:adr-anchors` | 0 | `check-adr-anchors: OK (135 anchored file(s), every governing ADR still referenced` | | `pnpm check:adr-index` | 0 | `adr-index --report: OK — docs/adr/README.md is current, every record parsed` | | `pnpm check:doc-authoring` | 0 | | | `pnpm check:nul-bytes` | 0 | `check-nul-bytes: OK (scanned 29015 text file(s)`, no raw control bytes | | `pnpm check:closed-ceremony-text` | 0 | | | `pnpm check:pm-governed-merges` | 0 | | | `pnpm --filter @objectstack/lint run check:doc-formula-expressions` | 0 | run after building `@objectstack/spec`, `@objectstack/formula` and `@objectstack/lint` under the verify lock | </details> <details><summary>The other derived families on 947b7e6 (all exit 0)</summary> `node scripts/check-closing-keyword-parity.mjs` and its `--self-test`, `node scripts/check-comment-mask-corpus.mjs`, `node scripts/ci/plan-test-core-shards.mjs --self-test`, `pnpm check:ci-filter-parity`, `pnpm check:cross-package-test-inputs`, `pnpm check:driver-memory-census`, `pnpm check:gitlink-declared`, `pnpm check:pm-prior-rulings`, `pnpm check:refd-timer-probe`, `pnpm check:watch-hint-literal`. Before the last push: `node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD` exit 0, two commit messages (three after patch round 1, also exit 0), no card relation and no model identifier in the trailer pair. </details> <details><summary>A local-only reading that is red for a reason outside this change</summary> `pnpm check:dev-prereqs` exits 1 in this worktree: "The workspace is not built", 105 of 110 workspace packages have no build output. It judges the machine and not the diff, CI does not run its scan, and a fresh worktree that builds only what a docs change needs reads this way. It is not in the derived list. </details> Not run locally: the repository test project behind `test:repo`, and every package suite. CI runs them on the pull request and on the merge group. Every other family CI runs is read from this pull request's check runs, not re-run here. ## Acceptance notes - **Changeset.** None, and the pull request carries `skip-changeset`. `docs/adr/**` ships in no package. - **Governed surface.** `docs/adr/**` lands on the maintainer's approval. This pull request stays a draft; the seat arranges the review at the tier this surface owes and hands it over. - **Why "Part of".** The card says it ends when its pull request merges. Two of its rows are not here, so merging this one must leave the card open. - **Seen and left alone.** These are outside the seven rows and are not changed here. - ADR-0037's Status line says all four phases are implemented. On this tree the console's canvas-invalidate signal has a subscriber and no publisher: nothing calls the bus function that emits it. It is a candidate row for the card of this name. - ADR-0150's D4 note of 2026-11-10 gives its own end condition, an earlier card landing. That card ended on 2026-11-12, and the record carries no line that says so. A possible row; not judged here. - Comments in the chat plugin still name the retired build-progress part, and one test fixture uses the name as an open `data-` part. Not a record, so not a row. ## Verification ### Read first 1. `docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md`, the note of 2026-11-30 under the note of 2026-11-24. The highest-risk hunk: it quotes a maintainer ruling, and it draws the line between the doors that refuse and the places where the old sentence still stands. Check the two statuses and the list of places with no door. 2. `docs/adr/0084-application-builder-information-architecture.md`, the amendment of 2026-11-30 under the amendment of 2026-11-28. It quotes a maintainer ruling and lists every door; check the list, and the sentence on the review-changes deep link, which records a seat reading and says so. 3. `docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`, the first amendment note of 2026-11-30. Check the three answers, who gets which, and the leak-guard paragraph against the tests it names. ### Two-minute check Run `git diff --numstat origin/main...HEAD` on this branch. Expect five rows under `docs/adr/`, each with `0` in the removed column, and 62 added lines in total (2, 4, 18, 28 and 10). Then run `pnpm check:adr-symbol-anchors` and expect exit 0 with a line that contains `anchors across 165 records resolve`. --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzhPdWmTd47Fi2bKYZS)_ <!-- signed: repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ut a code is refused, never answered as no hits (objectstack-ai#38761) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9DAwBxBGNv4CexdUyBYJXSw)_ Fixes objectstack-ai#38728 repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v Clause-②: no (narrowing) Metadata-protocol: none ## 维护者速读 - 变化:知识库检索时,某个来源的检索服务出错(如向量服务连不上)不再显示成「什么都没搜到」,而是列为「该来源未能检索」。 - 谁会碰到:只在某来源检索抛出无错误码的异常时出现;若它是本次唯一被检索的来源,整次检索改为报「服务不可用」(503),其他来源照常返回结果。 - 出错会怎样:最坏是把出错来源误报为不可用;改动集中在一处,可直接撤回。 - 要你做什么:无。 ## BREAKING **BREAKING** for a caller of a knowledge search (the `search_knowledge` tool, its MCP HTTP and stdio faces, and in-process `KnowledgeService.search` / `searchWithRefusals`) when a source's adapter throws from `search` with an error that does not carry both an ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store). The search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller; the operator's `error` log line keeps it. Sources that answer are still served beside the refusal. A source that matches nothing is unchanged, and so is a coded refusal's own `refused` entry; a whole rejection that also names an uncoded throw may take that throw's top-level code (cell 2 below). Declared as a narrowing per L1 REWORK 7279138481; registered in the ADR-0087 ledger as semantic entry `knowledge-search-uncoded-adapter-throw-refused` (`packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts`, a new file; the registry is generated, no existing spec file edited), added to the file surface by claim amendment 2 (comment 7279244160). FROM → TO: - No searched source answers and at least one threw without a code — two cells: 1. Every searched source throws without a code (one source, or several failing on the same embedder outage). FROM: the search succeeded with `{ hits: [] }`. TO: rejected `SERVICE_UNAVAILABLE` / 503 with `refused` naming each source (the `search_knowledge` executor and in-process `search` reject with `refused`; MCP answers an error result whose envelope is `code`, `message` and `status`, the sources named in the message). 2. A source throws without a code beside a source refused with a code, none answering. FROM: rejected with the coded source's `code` / `status` and `refused` naming it alone. TO: `refused` names both, and the rejection's top-level `code` / `status` are the first refusal's in source order, so a 409 `KNOWLEDGE_REBUILD_REQUIRED` rejection may now read 503 `SERVICE_UNAVAILABLE`. - A refill fails without a code. FROM: the source's round-one survivors were served. TO: they are dropped and the source is refused for the whole search, as a coded refusal of the refill already was. Fix for each reader: a caller reads `refused` and the 503 instead of treating an empty answer as no match; an operator repairs the adapter or embedder the `error` line names. ## What changes `searchRound` (`packages/services/service-knowledge/src/knowledge-service-search.ts`) catches an adapter's throw from `search`. A coded refusal (ADR-0112 `code` + `status`) was already pushed to `refused`; any other throw was only logged at `error`, so the source read as zero hits. Now an uncoded throw is pushed to `refused` as `{ sourceId, code: 'SERVICE_UNAVAILABLE', status: 503, message }`, where `message` is a platform sentence naming the source and its adapter id (never the thrown text, which can carry hosts, SQL or keys). The operator `error` line is unchanged and still carries the thrown message. The docblock states the new outcome. Code choice: the existing `SERVICE_UNAVAILABLE` (503), the code this package already answers for an adapter that cannot serve (`UNMOUNTED_ADAPTER_CODE`, `knowledge-service-top-level.ts`). No new code is minted, so no ledger or `StandardErrorCode` change. The literal is written in the catch (not the constant imported) to stay inside the claimed hunk. Consequences that follow from the existing refusal machinery, unchanged by this diff: - When no searched source answers (`first.size === 0 && refused.length > 0`), the search is refused whole (`wholeRefusal`), so a search whose only source's embedder is down now rejects with `SERVICE_UNAVAILABLE` / 503 and `refused`, instead of resolving `[]`. - Refill: a source refilled is one that answered round one, so it is never refused twice in one search. A source that fails the refill uncoded is now refused for the whole search and its round-one hits dropped, as a coded refusal of the refill already was (`refusedInRefill`). ## Public doors Measured on `origin/main` acf3b33 plus this branch; there is no REST knowledge search route (a grep of `packages/rest/src` and `packages/runtime/src` for a knowledge search route finds none; the same grep finds the `search_knowledge` registrations below). - `search_knowledge` executor, `packages/services/service-knowledge/src/knowledge-tools.ts:662-671`: with other sources answering, the tool output now carries `refused: [{ sourceId, code: 'SERVICE_UNAVAILABLE', message }]` beside their hits (before: no `refused`, the source silent). When it is the only searched source, the executor rejects with the whole refusal (`wholeRefusal`, thrown at `knowledge-service-search.ts:231`, or `:258` on a refill): `code: 'SERVICE_UNAVAILABLE'`, `status: 503`, `refused` naming the source (before: `{ hits: [] }`). - MCP `search_knowledge`, `packages/mcp/src/mcp-http-tools.ts:3824-3826` (registered for HTTP at `mcp-http-tools.ts:3428` via `packages/runtime/src/domains/mcp.ts:1786`, and for stdio at `packages/mcp/src/plugin.ts:1068` via `stdio-data-bridge.ts:1998`): the partial case returns the text result with `refused`; the only-source case returns `errorResultWithCode` (`mcp-http-tools.ts:1636`), an error result with the ADR-0112 envelope `SERVICE_UNAVAILABLE` / 503 (before: a text result with no hits). - In-process `KnowledgeService.search` / `searchWithRefusals` callers (no other non-test caller in this repo): same as the executor. ## Tests New `src/__tests__/search-uncoded-throw-38728.test.ts` (5 cases): plain `Error` gives one `refused` entry naming the source (code + status asserted, thrown text absent from the caller's message, present in the `error` line), other sources' hits still served; only source throwing uncoded refuses the search whole (503); coded refusal unchanged; source matching nothing answers no hits and no refusal; refill failure refused once, round-one hits dropped. Flipped pins of the old "logged, zero hits" outcome (each now asserts the refusal's sourceId/code/status): - `knowledge-service.test.ts` "a refill the adapter fails keeps the source's round-one survivors" -> refused as a coded refill refusal is. - `knowledge-tools.test.ts` "control: a failure without a code is logged and skipped as before" -> refused `SERVICE_UNAVAILABLE`, text withheld. - `knowledge-settings-contribution.test.ts`: "no settings: ... search answer an error", "the API key is in no log line and no error", "a plugin a host mounts itself, no embedder" -> search rejects `SERVICE_UNAVAILABLE` / 503 naming `docs`. - `packages/plugins/knowledge-pgvector/bench/instrument.test.mjs` "a failed embed is counted, and the search answers no hit with the service's "search failed" line" (`s.ok` true, `s.hits` 0) -> "a failed embed is counted, and the search is refused SERVICE_UNAVAILABLE naming the source, with the service's "search failed" line": `s.ok` false, `s.errorCode` `SERVICE_UNAVAILABLE`, the thrown refusal `SERVICE_UNAVAILABLE` / 503 with `refused` naming `clauses`; `embedFailures` 1, `calls.ranking` 0 and the one "search failed" operator line kept. This sixth pin was added to the file surface by claim amendment 1 (comment 7278305559). Files changed (8): - `packages/services/service-knowledge/src/knowledge-service-search.ts` - `packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts` - `packages/services/service-knowledge/src/__tests__/knowledge-service.test.ts` - `packages/services/service-knowledge/src/__tests__/knowledge-settings-contribution.test.ts` - `packages/services/service-knowledge/src/__tests__/knowledge-tools.test.ts` - `packages/plugins/knowledge-pgvector/bench/instrument.test.mjs` - `.changeset/38728-uncoded-search-throw.md` (`@objectstack/service-knowledge` and `@objectstack/spec` patch, `fix(service-knowledge)!:`, `Clause-②: no (narrowing)`, the ADR-0087 `registered` marker) - `packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts` (new; claim amendment 2, comment 7279244160) <details><summary>Readings (tests at 43def1f; e52b762 adds only the changeset sentence)</summary> - `pnpm --filter @objectstack/service-knowledge test`: Test Files 26 passed (26), Tests 841 passed (841). - `pnpm --filter @objectstack/service-knowledge typecheck` (tsc over `src`, tests included, plus `check:test-typecheck`): exit 0. - Ablation: catch reverted to `acf3b33e` on disk, new file run: 3 failed / 2 passed (the three uncoded pins red; coded and no-match pins green). Fix restored. - Local derived gates: 40 of 69 run, all exit 0 except `check-plugin-teardown-shape --self-test` (exit 3, shallow-clone prerequisite, NOT MEASURED) and `check:type-check-debt` (local 100 s timeout, NOT MEASURED). The other 29 are left to CI. - `overlap-check.mjs`: VERDICT clean exit 0 (merges cleanly with main, objectstack-ai#38722, objectstack-ai#38730, objectstack-ai#38732). - Round 2 (6348efa): `bench/instrument.test.mjs` alone 8 passed (8); `pnpm --filter @objectstack/knowledge-pgvector test` 46 passed, 95 skipped (live-postgres); knowledge-turso 301 passed; knowledge-memory 66 passed; overlap-check VERDICT clean exit 0 (also objectstack-ai#38758). </details> ## Acceptance notes - Read first: the catch block in `searchRound` (the only runtime hunk); then the refill pin flip in `knowledge-service.test.ts`, which is the one behaviour change beyond the card's literal Ask (a refill failure now drops round-one survivors instead of keeping them, to match the coded path). - The stand-in embedder's "No embedder is configured ... restart" text is uncoded, so the caller now reads the generic platform sentence and the remedy stays on the operator line. Coding that error at its producer would let the caller read the remedy; noted, not filed. - `content/docs/protocol/knowledge.mdx` not edited (open PRs edit it; skipped per dispatch). ## Verification Two-minute check: `pnpm --filter @objectstack/service-knowledge exec vitest run src/__tests__/search-uncoded-throw-38728.test.ts` -> 5 passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ce's state; the embedder help text says what saving a provider sends (objectstack-ai#38786) Part of objectstack-ai#38369 (PR 3a of the card's part 3: the CLI's reading of a held knowledge service and the embedder help text. The server half, the `index_status` answer and the `rebuild` refusal, is PR 3b and follows after the open retrieval-mode PRs land. Item 6, the skill, is its own PR.) Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:管理员在命令行查看知识库状态时,如果服务器报告知识服务未启用,第一行会写明未启用、有几个知识源被挂起以及原因和补救办法;设置页「AI 与嵌入模型」里嵌入模型一节的说明多了一句:保存提供商并重启后,每个知识源列出的内容字段会发给该提供商并由其计费(所有界面语言)。 - 为什么做:知识服务「挂载不等于启用」那张卡的第三部分的前一半,让管理员看得见服务没启用、保存嵌入模型会发出什么数据。 - 出错会怎样:只影响命令行状态输出的第一行和设置页一句说明文字;服务器还没发送这个状态时命令行输出和今天完全一样。撤回这次合并即可恢复。 - 要你做什么:无。 ## What changes - **`os knowledge status`** reads an optional `enablement` field of the `index_status` answer (`KnowledgeEnablementView` in `packages/cli/src/utils/knowledge-actions.ts`). When it is present, the command prints `knowledge service: not enabled — N source(s) held, none built, synced or searched` and the reason with its remedy, before the sources. **The server does not send this field yet**: PR 3b adds it to the `index_status` answer. That is harmless: the field is optional and only read, and an answer without it prints exactly as today (pinned line by line). - **`os knowledge rebuild`**: docblock only. On `main` a held service's rebuild already answers the service's own sentence (`Rebuild of source 'X' was not started: [knowledge] the knowledge service is not enabled ... To enable it, save an embedder provider, then restart.`), and the command already exits 1 with it. A new test pins that the command prints that sentence and exits 1, whether the server answers it as `ok` with no build or as a refusal (the shape PR 3b gives it). - **Settings → AI, Embedder section** (`aiEmbedderSettingsSpecifiers` in `ai.manifest.ts`): the help text says that once a provider is saved and the server restarted, the content fields each knowledge source lists are sent to that provider for every row the source matches, and the provider bills for them. The sentence is in the English copy and in all 10 other shipped locales. - **Docs**: one sentence in `content/docs/ai/knowledge-rag.mdx` (the `os knowledge` section) on what the two commands do while the service is held. `content/docs/protocol/knowledge.mdx` is left untouched: a sentence there conflicted textually with the open PR objectstack-ai#38730. ## Tests - `packages/cli/src/commands/knowledge/knowledge.test.ts`: (1) an answer with `enablement` prints the not-enabled line and the reason first, then the sources; (2) an answer without it prints exactly the lines it printed before; (3) the existing full status case asserts no `knowledge service:` line; (4) a held rebuild exits 1 with the server's sentence, in both answer shapes. - `packages/services/service-settings/src/manifests/ai.manifest.test.ts` (new top-level `describe`): the section declaration and the English copy carry the sentence; every shipped locale's copy names the restart and the bill. ## Acceptance notes - What the server answers is unchanged here; `Clause-②: yes (widening)` stays with PR 3b, which adds `enablement` to `index_status`. - A measurement for the seat, not acted on here: on `main`, with the service held and its store mounted (the no-embedder case), each `index_status` read calls the store adapter's `indexStatus` once per source (`knowledge-build-actions.ts:335` → `KnowledgeService.readIndexState`, `knowledge-service.ts:584` → `readIndexStateOf`, `knowledge-service-indexing.ts:712`), and the reading can say `due: true ... it is built anew` while nothing will build it. ## Verification <details><summary>Local runs at b4b6e97</summary> - `pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 src/commands/knowledge/knowledge.test.ts`: 15 passed (12 before, plus 3 new). `pnpm --filter @objectstack/cli typecheck`: exit 0. The typecheck runs `check:test-typecheck`, so it covers the test file too. - `pnpm --filter @objectstack/service-settings exec vitest run --maxWorkers=2 src/manifests/ai.manifest.test.ts src/translations/settings-translation-coverage.test.ts`: 2 files, 204 passed. `pnpm --filter @objectstack/service-settings typecheck`: exit 0. - Ablation: with `status.ts` restored to `main`, the new held-status pin fails (1 failed, 14 passed); restored afterwards, tree clean. - `dispatch-gates --ran`: 104 derived, 101 exit 0, 3 NOT MEASURED, all for a prerequisite these paths do not touch: `check:skill-examples` (client-react dist), `check:dual-build-cjs-loads` (scenarios/studio dist) and `check:i18n-coverage` (the app-showcase config needs the service-print dist). `check:i18n`, `check:i18n-walk-parity` and `check:nul-bytes` passed with exit 0. - eslint over the changed `.ts` files: exit 0. `overlap-check`: clean against `origin/main` and objectstack-ai#38732. </details> Two-minute check: `pnpm --filter @objectstack/cli exec vitest run src/commands/knowledge/knowledge.test.ts -t "held"` should report 2 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… views: as lists only (objectstack-ai#38790) Fixes objectstack-ai#37105 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:让 AI 助手照着平台技能包搭应用的人,以后得到的表单只有一种写法(表单单独登记,公开表单或由按钮打开),不再被教把表单写进列表视图里;平台本身的行为没有变。 - 为什么做:属于「表单独立成一种元数据」专题的教学收口,让技能包教的写法和平台现在实际收的写法一致。 - 出错会怎样:最坏是技能包里的说明写错,AI 照着写出不对的表单定义;这次只改说明文字和评测题,可以直接撤回。 - 要你做什么:看一眼「旧写法」那一句。卡上允许写成「旧写法已被拒绝,用迁移命令搬走」,但主干上旧写法目前仍被接受、迁移也还没有,所以这一句只写了「不要这样写,见到就搬到表单登记处」。 ## What changes The published `objectstack-ui` skill now teaches one way to declare a form and no other (ADR-0159 D1 and D5, as shipped on `main`). - `skills/objectstack-ui/rules/list-views.md`: the section *Form Views* is now *Forms*. - A form is a `form` item in the stack's `forms:`, written with `defineForm` in a `*.form.ts`: `name` (`OBJECT.KEY`, the prefix equal to `object`), `object`, and the body at the top level. `views:` holds lists only. - What is `form` content: a public form (it declares `sharing.publicLink`) or one an action of `type: 'form'` opens by its `target`. With neither, `os validate` warns `form-consumer-less`. - What is not: the record's New and Edit forms. They are the object's `fieldGroups` and are never a `form` item. - The two refusals: `viewKind`, `config` and `data` are refused on a `form` item (a form is bound with `object`); a form left open on a public address another form holds is refused, naming both (`form-public-address-taken` from `os validate`, `409 FORM_ADDRESS_TAKEN` from a save), and a switched-off form that keeps its `publicLink` still holds the address. - Translations: under `forms.NAME` (`.label`, `.title`, `.description`, `.submitBehavior.*`, `.sections.SECTION.*`); a section with no key there reads `objects.OBJECT._sections.SECTION`. - One type-checked `defineForm` example. The `defineView` container example lists `list` and `listViews` only; no example authors a form inside a view. - `skills/objectstack-ui/SKILL.md`: Trap 1, the routing table's form row (`*.form.ts`) and the Action Types `form` row name the `form` item. - `skills/objectstack-ui/evals/views-apps-actions-pages.json`: case 25 now expects a `form` item an action opens (with its sections' `columns`); new case 28 expects a public `form` item on an address a switched-off form still holds. Cases 1, 6 and 19 keep their prompts and no longer name a form authored inside a view. - `scripts/check-skills-token-ratchet.mjs`: three `objectstack-ui` CEILINGS rows follow their files down to the measurement (numbers below). - `.changeset/37105-skills-teach-forms.md`: `@objectstack/skills` patch. The one migration sentence, the only thing the card's grep returns (`rules/list-views.md`, the last bullet of *Forms*): > ⛔ Never author a form inside a view (a container's `form:` or `formViews`, a `viewKind: 'form'` item). Move one an action opens, or with a `publicLink` or `overrides`, to `forms:`; delete only the rest: New and Edit never loaded it. Round 2 (head `5a3a19bd`, L2 S1 of 7285578664): the bullet now moves only a form an action opens or one with a `publicLink`, and deletes any other, as ADR-0159 ("Internal record forms are not moved", ruling item 3) rules. The clause is paid for by nine word trims inside the same *Forms* section; `rules/list-views.md` is 18035 bytes, 4509 tokens, so its CEILINGS row stays at 4509 (headroom 0). Cases 25 and 28 were rerun at `5a3a19bd`: with-skill 2/2, no-skill 0/2. The changeset's sentence about the bullet follows. Round 3 (head `8cd68a8e`, L2 delta M1 of 7287432289): a form whose item or container declares `overrides` moves too, whatever its body and slot (ADR-0159 D7-b: nothing prescribes deleting it, since an override with no link is what keeps a base form's public address closed); only the rest is deleted. N4 ("the object's fields"), N5 ("a rarely filled section") and N6 (the CEILINGS row comment's arithmetic, now `ceil(18035 / 4)`) are fixed in the same commit; `rules/list-views.md` stays 18035 bytes, 4509 tokens, row unmoved. Evals at `8cd68a8e`: cases 19 and 25 with-skill 1/1, no-skill 0/1; case 28 not measured (the runner's rate-limit guard stopped the round), its sentences byte-equal to `5a3a19bd`, where it passed. `overlap-check` exits 1 only against draft PR objectstack-ai#38497, on two files this branch does not change (the same at `5a3a19bd`); pushed on the zone's ruling. Dev reports 7288496594 and 7288555864. **Read first** 1. `skills/objectstack-ui/rules/list-views.md`, the hunk that replaces *Form Views* with *Forms*: every sentence there is a claim about what `main` does (the refusals, the lint rule names, the `409`, the translation keys). 2. `skills/objectstack-ui/evals/views-apps-actions-pages.json`, cases 25 and 28: the grader is literal, so a wrong `must_contain` token passes or fails for the wrong reason. 3. `scripts/check-skills-token-ratchet.mjs`, the three lowered rows: a row above or below its measurement is red. ## Tests All readings below are at head `b3d7dc22` unless a line says otherwise; rounds 2 (`5a3a19bd`) and 3 (`8cd68a8e`) changed only `rules/list-views.md`, the changeset and (round 3) one ratchet row comment; their readings are in the paragraphs above and in the grep and size rows, which show `8cd68a8e`. **Every `form` example parses with `FormSchema`** (built `packages/spec/dist` of this tree; the fenced block is run with `defineForm` swapped for a recorder, the two eval answers are parsed as written): ``` PARSES rules/list-views.md (fenced block) "crm_lead.web_to_lead" PARSES evals/views-apps-actions-pages.json case 25 (expected_output) "crm_account.intake" PARSES evals/views-apps-actions-pages.json case 28 (expected_output) "crm_lead.contact_us" 3 form example(s), 0 refused ``` Negative controls on the same schema: a `form` item carrying `data`, one carrying `viewKind` with `config`, one whose name prefix differs from `object`, and one carrying `isDefault` are each refused. **The card's grep** ``` $ git grep -nE "formViews|viewKind: 'form'" -- skills skills/objectstack-ui/rules/list-views.md:376:- ⛔ Never author a form inside a view (a container's `form:` or `formViews`, skills/objectstack-ui/rules/list-views.md:377: a `viewKind: 'form'` item). Move one an action opens, or with a `publicLink` ``` **The two size readings** (tokens are the ratchet's count, `ceil(utf8 bytes / 4)`; `SKILL.md` is priced without its stamp line) | file | lines before → after | bytes before → after | tokens before → after | |:--|--:|--:|--:| | `skills/objectstack-ui/SKILL.md` | 164 → 164 | 8937 → 8933 | 2228 → 2227 | | `skills/objectstack-ui/rules/list-views.md` | 414 → 407 | 18039 → 18035 | 4510 → 4509 | | `skills/objectstack-ui/rules/navigation.md` | 192 → 192 | 10235 → 10222 | 2559 → 2556 | | `skills/objectstack-ui/evals/views-apps-actions-pages.json` (measured, not ratcheted) | 275 → 287 | 29995 → 32080 | 7499 → 8020 | | `skills/objectstack-ui/evals/README.md` (measured, not ratcheted) | 56 → 57 | 2729 → 2809 | 683 → 703 | | whole pack | before → after | |:--|--:| | all 14 `SKILL.md`, lines | 3406 → 3406 | | all 14 `SKILL.md`, bytes | 180659 → 180655 | | ratcheted authored files, tokens | 196276 → 196271 (−5) | | eval fixtures, tokens (measured, not ratcheted) | 89819 → 90360 (+541) | | whole shipped tree, tokens | 300941 → 301477 (+536) | Growth is paid by deletion in the same file. Cut from `rules/list-views.md`: the *Field Conditional Rules in Forms* section (now one clause that points at objectstack-data's Conditional Field Rules), the third copy of the `defineView` scaffold (the `userActions: { search: false }` example, now its one key inline), and a sentence of Master-Detail item 1 that `SKILL.md` Trap 2 states word for word. No ceiling is raised; the three rows are lowered because a row above its measurement is red: `SKILL.md` 2228 → 2227, `rules/list-views.md` 4510 → 4509, `rules/navigation.md` 2559 → 2556. **Skill evals** (the runner, `pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-ui`, live, on the container's subscription login; no key was needed and none was written anywhere) - The two form cases: case 25 (a `form` item an action opens) and case 28 (a public `form` item) pass with the skill in two rounds each and fail without it in both. - The whole bundle, one sample per case: 37 of 44 behaviour cases pass with the skill (views 23 of 28, analytics 8 of 9, record-page 5 of 6, report-period-export 1 of 1); triggers 7 of 8. - The seven with-skill failures and the one trigger failure are not form cases. Six of the seven and the trigger failure fail the same way with the base tree's `skills/objectstack-ui` restored in place; the seventh (views case 7) passed 4 of 4 on a four-sample rerun at head. By the parity ruling (record 7249189592 on objectstack-ai#34770) a case flipping on both trees, or within one tree, does not block. <details> <summary>Per-case readings of the failing cases, head and base</summary> ``` case head (with-skill) base tree (with-skill) views case 6 fail: missing master_detail fail: missing master_detail views case 7 fail 1 of 1 (forbidden orderBy: 'stage'), then 4/4 pass 1 of 1 views case 8 fail: forbidden ${record.name} fail: forbidden ${record.name} views case 15 fail: forbidden type: 'grid' fail: forbidden type: 'grid' views case 23 fail: missing perRecord, bulkActions: [, ctx.record; forbidden { succeeded fail: forbidden { succeeded analytics-inline-vs-dataset 2 fail: forbidden dateGranularity fail: forbidden dateGranularity record-page 2 fail: forbidden mode: 'split' fail: forbidden mode: 'split' triggers 6 (should not load) loaded (read-only) loaded (read-only) ``` Driver line of every round: `claude-code-cli 2.1.332, login oauth_token, no API key`. The base-tree round restored only `skills/objectstack-ui` from the merge base `f576dee5` in the working tree and was reverted afterwards (`git status` clean); its runner line therefore still prints `b3d7dc22`. The first round of cases 25 and 28 ran at `b2fbb50b`, the second at `b3d7dc22`; the skill files are byte-identical between the two commits. </details> **Gates** `node scripts/pm/dispatch-gates.mjs --commands` derives 70 commands for this diff; all 70 were run at `b3d7dc22`, each exit code recorded before any pipe, and reconciled: ``` ✓ dispatch-gates --ran: 70 derived famil(ies) accounted for — 69 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3). ``` 69 exit 0. NOT MEASURED: `pnpm check:dual-build-cjs-loads` (exit 3, PREREQUISITE NOT MET: it needs a whole-repo build), left to CI. <details> <summary>The 70 commands and the verdict lines of the gates this diff is about</summary> ``` ✓ check-skills-token-ratchet: 61 authored bundle file(s) within their ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured, not ratcheted. ✓ check-skills-token-ratchet self-test: 111 cases pass. ✓ check-skill-links: 289 relative link(s) in 76 published skill file(s) resolve; 160 fragment(s) name a real heading under GitHub's slug rule. ✓ check-skill-served-sections: 24 served section(s), each heading exactly once in its file (6 json, 2 json+ts, 16 neutral); 10 JSON fence(s) parse and pass their spec validators. ✅ 351 prose examples type-check across 3 surface(s) (check:skill-examples, outside the derived list, run under the verify lock: VERDICT command-exit 0) ✅ check-scripts-symbol-anchors: 4719 anchors across 311 scripts check-nul-bytes: OK (scanned 29016 text file(s); no raw ASCII control bytes) ✓ dispatch-gates self-test (fast tier): 2904 cases pass; 9 slow section(s) deferred. ``` Exit 0 at `b3d7dc22`: `check-adr-0087-registration` (and self-test), `check-changeset-no-major`, `check-closing-keyword-parity` (and self-test), `check-comment-mask-corpus`, `check-declaration-mirrors` (and self-test), `check-doc-route-spelling` (advisory and self-test), `check-dts-emitted` self-test, `check-empty-changeset` (and self-test), `check-self-test-wired` (and self-test), `check-self-test-workflow-commands` (and self-test), `check-skills-token-ratchet` (and self-test), `check-temporal-live-filter` (and self-test), `check-whole-set-label-write` (and self-test), the self-tests of `ci/assert-turbo-remote-cache`, `ci/plan-test-core-shards`, `ci/prune-turbo-cache`, `ci/snapshot-next`, `pm/bare-root-worklist`, `pm/check-governed-queue-guard`, `pm/release-rehearsal-clone` and `release-pending-publish`, `@objectstack/lint check:doc-formula-expressions`, `@objectstack/spec check:skill-docs` and `check:skill-served-sections`, and `pnpm check:` `adr-anchors`, `agent-test-spelling`, `bash32-floor`, `changeset-gate-self-tests`, `ci-filter-parity`, `cli-command-ids`, `closed-ceremony-text`, `corpus-claim-drift`, `cross-package-test-inputs`, `doc-authoring`, `driver-memory-census`, `dts-closure`, `entry-guard`, `gitlink-declared`, `lean-entry-closure`, `merge-driver`, `nul-bytes`, `parse-guard`, `pm-dispatch-gates`, `pm-expected-skips`, `pm-governed-merges`, `pm-skill-id-lint`, `pnpm-filter-targets`, `pnpm-flag-spellings`, `published-files`, `ratchet-remedy-authority`, `refd-timer-probe`, `role-word`, `scripts-symbol-anchors`, `skill-compatibility`, `skill-frame-sync`, `skill-identifier-liveness`, `skill-links`, `sourcemap-no-sources-content`, `watch-hint-literal`. Exit 3 (NOT MEASURED): `pnpm check:dual-build-cjs-loads`. </details> The changeset gate went the publishing way: `skills/**` ships in `@objectstack/skills`, so the diff carries a patch changeset and no `skip-changeset` label (`check-empty-changeset` and `check-changeset-no-major` exit 0; `Metadata-protocol: none` reads as patch). The repo-wide `pnpm lint` and the package test suites are CI's runs; no package source is touched. `node scripts/pm/overlap-check.mjs` before each push and again at `b3d7dc22` against `origin/main` `c4472c86`: exit 0, merges cleanly with `main` and with the two open pulls that share a file (objectstack-ai#38732 shares the ratchet script, objectstack-ai#38192 shares `skills/objectstack-ui/SKILL.md`). ## Acceptance notes - **The migration sentence does not say "refused" and does not name `os migrate meta`.** The card allows one sentence that says so, and the dispatch says to teach only what the code does on `main`. Measured on `main`: a view container with `formViews` still parses and is still projected, and `packages/spec/src/conversions/entries/19` holds no forms conversion; the ADR's execution plan puts the tombstone and the conversion in a later card that waits on this one. The sentence is therefore an authoring prohibition that is true before and after that card. When the tombstone lands, the sentence wants its second half; that card's surface does not include `skills/**`, so this needs a carrier. - **Two files beyond the three the claim names**, both under `skills/objectstack-ui/**`: `rules/navigation.md` linked the heading this diff renames (`check:skill-links` is red without the edit) and said "form view" of the same thing; `evals/README.md` describes the eval file's cases. Three CEILINGS rows moved, not one: each of the three ratcheted files measured below its row. - **Renamed anchors**: `rules/list-views.md#form-views` is `#forms`; `#field-conditional-rules-in-forms` is gone. No file in the repo links either (the one hit is a past CHANGELOG entry). - **Not edited, by the card's fence**, and still using the old vocabulary: the `SKILL.md` frontmatter description ("list / form / kanban / calendar views"; changing it regenerates `skills/README.md` and `content/docs/ai/skills-reference.mdx`), `skills/README.md` ("named form view"), `skills/objectstack-automation/references/examples-flows.md`, `skills/objectstack-api/SKILL.md` (a `FormViewSchema` pointer), `skills/objectstack-i18n/SKILL.md` and its eval file (`_views` keys as a form's heading), `skills/objectstack-data/rules/validation.md` ("named and public forms"). `ui/skills/` does not exist in this checkout. - **Eval grader observations, not acted on**: views case 6 requires the token `master_detail`, which `skills/objectstack-ui` teaches nowhere on either tree; several `must_not_contain` tokens fire on a correct answer that quotes the token inside a prohibition (views cases 7, 8, 15, analytics case 2, record-page case 2). - **Stray file**: a mistyped shell line in this run wrote a 10-byte file `g16.exit` at the container's filesystem root (outside the repo and the worktree). Removing it was refused by the tool's safety check and was not retried another way. ## Verification Two-minute check: run `git grep -nE "formViews|viewKind: 'form'" -- skills` on this branch. Expected: exactly the two lines of `skills/objectstack-ui/rules/list-views.md` quoted above (376 and 377), the one sentence (it ends on 378). Second look, if wanted: `node scripts/check-skills-token-ratchet.mjs` prints `61 authored bundle file(s) within their ceilings`. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No spec file is touched.) - [x] 2. Every name I added uses the casing for its kind. - [ ] 3. No formatter ran; `pnpm lint` passes. (No formatter ran. The repo-wide lint is CI's run and was not run locally.) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. (Branched at `f576dee5`; `main` has moved 10 commits since, none touching these files.) - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (Not touched.) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done, with item 3's reading as above. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v)_ <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Warren · project thread
Part of #38692
Clause-②: no
Metadata-protocol: none
维护者速读
Stack
Base:
main. Stacked on the service PR #38722 (and through it #38720); until those merge, this diff carries their commits. Lands after both and after the phase-0 ADR note (#38714).What changes
search_knowledgedescription: one sentence, the ruling's 「分数只表示同一知识源内的先后,不表示相关程度」: "A hit'sscoresays only its order among the hits of its own source, not how relevant it is." Thescoremember's doc says the same, with the one-leg rule (first hit scores 1).skills/objectstack-ai/SKILL.md: asource.retrieval.moderow in the knowledge source key table; paid for in the same file (theadapterrow's save refusal shortened, the one-slot sentence dropped, the closing rerank line made one clause and no longer says "hybrid weighting"). The row says an unsupported mode fails a run-time save and, for a shipped source, every search (503). Ratchet row lowered 7248 → 7247.content/docs/ai/knowledge-rag.mdx: the "0.5 for one first in only one" paragraph now says a source can run one leg alone, its first hit then scores 1, and scores order one source's hits only.@objectstack/service-knowledgeand@objectstack/skills(which ships the SKILL.md).Tests
service-knowledge: 860 passed (no test pins the description text).Acceptance notes
Skill readings (
skills/**touched):skills/objectstack-ai/SKILL.mdlinesskills/objectstack-ai/SKILL.mdbytes / tokensskills/*/SKILL.mdlinesskills/*/SKILL.mdbytesNet growth zero: the new row is paid by deletion in the same file.
Verification
node scripts/check-skills-token-ratchet.mjs→ green,objectstack-ai/SKILL.md7241 / 7241.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request. (Stacked: see "Stack" above.)packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbaASqBozmmj1n5tbUf