Repository navigation
docs(skills): the objectstack-api entry file becomes a router - #38802
Conversation
The entry keeps three first checks, one type-checked block of the three tags, the roots and the advertised function names, eight traps and a routing table. The rest is cut behind a pointer to the contract, to os validate / os build, or to the published formulas page. The ratchet row follows the measurement down: 6088 -> 2242. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
…the date wraps as code The first head's eval round lost case 10: the answers gave the right formula and then quoted the refused form. The date trap reads as it did before (wrap in date() first), the wraps and the label formula are lines of the type-checked block, and first check 2 says which tag a formula, a predicate and a seed value take. Paid inside the entry; the row follows the measurement, 2242 -> 2237. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
…t records every cut First check 1 is the version check the other router entries open with, paid inside the entry by dropping the cron grammar sentence (the contract and the validator hold it) and two parentheticals. The row follows the measurement, 2237 -> 2238. The changeset lists what the entry keeps, what left and what answers it now, and every anchor that no longer exists. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
…e is not the field A bare name in a flow condition reads the trigger record's field only where no flow variable or node id holds it, as the entry said before the cut. Paid inside the entry by five small trims; the row follows the measurement, 2238 -> 2243, and the file is 8998 bytes. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
…cates The final-head eval round showed an answer carrying the action guard over to a form-view visibleWhen, because one trap named both as client-side. The trap is about action visible / disabled alone again; the form-view fact (client-side, faults open, never access control) sits on the routing row that sends view predicates to objectstack-ui. The row follows the measurement, 2243 -> 2237; the file is 8974 bytes. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
The entry is 136 lines, and the form-view visibleWhen fact sits on the routing table beside the formula-field and view-filter facts; the changeset says so. No skill text changes. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
…-96llpb Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
…ts abort sentence Two should-fix items from the contract review of the router PR, paid inside the entry: - the checked block's transition line now carries `previous != null && `, the form trap 3 prescribes: unguarded it faults on insert, where `previous` is null, and the build does not refuse it; - trap 3's sentence on a condition that cannot evaluate names the hook again. A record-change trigger's run fails while the write lands, so "aborts the write" is a hook `condition`'s outcome, not every site's. The entry is 8999 bytes (was 8974), 135 lines; one blank line and one comma pay part of it. The CEILINGS row follows the measurement, 2237 -> 2243, zero headroom. The changeset's line count and its matching sentence are corrected. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
The entry goes from 21,359 to 8,986 bytes (438 lines to 151). It keeps four first checks, the generated routes with the metadata list's closed query set and an import mapping's applyOn, the apiMethods primitives and what derives from them, one type-checked declared endpoint, six traps and a routing table. The skill has no hand-written reference file, so nothing moved: the rest is cut behind a pointer to the contract, the publish gates or the published API pages. The changeset lists every cut and every anchor that left. The ratchet row is pinned at the measurement, 5333 to 2240 tokens, and the sum of all ceilings falls by the same 3093. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB 席位核对ACCEPT @ 2b912f1 (#34770, split PR 5: the The file surface is the three files of claim amendment 7288186602:
No new file is added under The shape, measured at this head:
What stayed is true. I checked 37 phrases of the new entry against
The new wording is the version check, "ARMED", and the scoping of trap 6. All four docs pages the routing table names exist: The eval literals, read independently. I recomputed them from
This matches the PR's table, and like the PR I count it as no stand-in for the parity rule. Gates, measured in a scratchpad worktree at this head:
Ablations, each restored after:
For the seat:
CI at this head: 25 success, 18 skipped, 2 in progress. |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Contract reviewServed-tier: PR #38802, card #34770 (PR 5 of the per-skill split, ① Derived judgments
② Semver level
Clause-②: no — on the PR body and in the changeset; correct, the diff narrows nothing an author could declare. ③ Boundary flags
④ Design judgment
(1) Truth of what remains. Verified in the cited code or page:
No false sentence found. (2) Removed rules against the pointers. Each rule an app author needs is either still inline or reachable in one hop from a named file or page (see ③ for the loud ones; the downstream-ledger recipe is in the header of (7) Old form vocabulary. The pointer to Security-touching is No must-fix, no should-fix. Nits (no effect on correctness or the contract; none needs a change on this head):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z 维护者速读
Seat opinion: land as is. 席位核对ACCEPT at head
ACCEPT → comment 7290547997 · Contract review → comment 7290718258 |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Merged by os-zhuang ( |
…n once, and its refusals stay ahead of the embed (objectstack-ai#38812) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8WwwNJsfXjR7KkaXqjQxjFx)_ Part of objectstack-ai#38676 **Update, head `a28863cef9`.** PR objectstack-ai#38809 (card objectstack-ai#38438) landed first, at 2026-12-01T03:58Z, and took the seventh and eighth `**Amended**` lines of ADR-0161. This head merges `main` into the branch (merge commit `a28863cef9`, no rebase): main's lines are kept as they are, this PR's header line follows them, and its ordinal reads "a ninth dated note". That one word is the only change to this PR's text (delta report 7300564224 on objectstack-ai#38676); the net diff against `main` is still this note alone, +17 / -0. The gate readings and the overlap paragraph further down are of the earlier head `f3cd7dba76`; the 21 derived gates were re-run at `a28863cef9`, all exit 0. This is phase 0 of the card's cause 3 and nothing else: the dated note in ADR-0161. The card stays open for phase 1, the patch round on PR objectstack-ai#38798, which waits for this note to merge. Clause-②: yes (widening) — the two optional adapter-contract members the note registers Metadata-protocol: none The two lines above are the claim's (comment `7296290387` on the card) and cover both phases. This pull request changes no contract file: the widening is what the note registers and PR objectstack-ai#38798 builds. ## 维护者速读 - 用户能看到什么变化:用户无感;只是在知识平台边界那份架构决策记录里追加一条 2026-12-01 的说明,把你当天选定的「写进约定,一次提问只转一次」和它的附带条件写成文字,不改任何代码。 - 为什么做:这是「知识检索慢」那张卡最后一项(补查时把同一个问题重复转成向量)的前置一步;平台和存储驱动之间的约定是一份封闭清单,要先在决策记录里登记这两项,已经做好的改动才能合并。 - 出错会怎样:说明里若有和你的裁决不一致的句子,接下来改代码的人会照着错的文字去做;它只是一处文档追加,可以直接撤回,不影响任何在运行的系统。 - 要你做什么:请审阅并批准这条说明;其中标了菱形记号的两处是说明自己定的写法,可以一并接受,也可以划掉。 ## 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 ninth dated note: 17 lines added, none changed and none removed (659 lines to 676 on `main` after objectstack-ai#38809). Three commits carry it, the third being the merge of `main`, `a28863cef9`: `f00518e716`, the note, and `f3cd7dba76`, a review pass over it (Acceptance notes). **Ruling.** The maintainer chose option A for cause 3 on 2026-12-01T00:22Z: ruling record [`7296268226`](objectstack-ai#38676 (comment)) on the card, given on analysis `7290428149`. He ruled by choosing an option of a decision card, and the note quotes the card's words unchanged: the option 「写进约定,一次提问只转一次」 and the condition 「附带条件:存储驱动原本会给出的拒绝提示(比如“需要重建索引”)要保持在前面,不能被转向量的报错盖掉。」 Nothing of the ruling is opened again here. Three insertions, in the form the six earlier notes of this record use. Line numbers are at head `a28863cef9`. | Lines | Where | What is added | |---|---|---| | 27 | Header, after the `**Amended**` line of the eighth note | A ninth `**Amended**` line, dated 2026-12-01: the two members, the texts the note is read with, the ruling record, the chosen option and the condition. | | 166 | K1, under the note of 2026-11-30 on rerank | A cross-reference: the "Embedding calls" row, and "compute a vector" in the second sentence of the list, are read with the new note. | | 483 to 496 | K8, under "Rules for every member" | The note itself: an opening paragraph, nine bullets and a last paragraph. | What the note decides: - **Two optional members, and the list stays closed beyond them** (K8 rules 3 and 5). `IKnowledgeAdapter.embedQuery?(query: string)`, which answers a promise of a `number[]`, and `AdapterSearchOptions.queryVector?`. No capability flag: the method's presence is the signal. - **The type of the second member.** A function of no arguments that answers a promise of a read-only `number[]`. It is not the vector itself. For one search the knowledge service makes one such function for each adapter instance that has `embedQuery`. The first call of the function calls that instance's `embedQuery`; every later call in that search answers the same promise, a rejected one too. An adapter calls it at the point of its `search` where it embeds the query today. This is the per-search memoised provider the analysis recommends, and the one choice the ruling record leaves to the note. - **The three readings that M1 of contract review [`7290045524`](objectstack-ai#38798 (comment)) left open.** 1. The adapter still embeds, with its own embedder and query prefix. The service computes no vector: it carries one back to the instance that made it, inside one search. The "Embedding calls" row of K1, the second sentence of the list under it and item 15 of K8 stand as written. 2. One vector serves every source a search binds to that adapter instance. An adapter whose query embedding depends on the source does not implement the method. 3. A handed vector is checked by its width. The model is judged on the index fingerprint, as K7 has it. - **The condition, as an outcome.** An adapter's refusals are answered as on `main`, code, status and remedy, and no question is sent to an embedding provider for a source the adapter refuses. The ruling record's case: a source that needs a rebuild behind a failing embedder answers `KNOWLEDGE_REBUILD_REQUIRED` 409 with 0 embedder calls. The function gives this by construction, because an adapter asks for the vector only after everything it decides first. - **What the members land with.** PR objectstack-ai#38798, after this note merges: both members with their first readers in one PR and one case in the contract test suite (rule 1). Each is optional (rule 2), and an adapter without `embedQuery` is searched as before. - **Not in the note.** A vector handed by a caller of the service or by a tool argument, a memo an adapter keeps past one search, a source or context argument on `embedQuery`, and a form that embeds several questions at once. No file under `packages/`, `content/`, `skills/` or `ui/` changes, and no other ADR does. The note declares; it builds nothing. ## Why K8 rule 5 of this record: "The list is closed. A member that is not in the table needs a dated note on this record first." PR objectstack-ai#38798 built the two members before the record named them, and its contract review is FAIL on that point (M1). The ruling puts the record before the code: this note first, then the patch round on objectstack-ai#38798. ## 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, at head `f3cd7dba76`: - **The premise holds.** Read on `main` at `0fc9eab900`, the commit this branch starts from. A refilled search still embeds the question twice: - `packages/services/service-knowledge/src/knowledge-service-search.ts:232` is the first `searchRound` call and `:245` is the refill's. - `:957`, inside `searchRound`, calls `adapter.search` once for each source. - `packages/plugins/knowledge-turso/src/turso-adapter.ts:741` and `packages/plugins/knowledge-pgvector/src/pgvector-adapter.ts:657` embed the query inside that call. - No line under `packages/`, `content/` or `docs/` names `embedQuery` or `queryVector` (`git grep` exit 1). - `origin/main` has since moved one commit, to `d97aaaea9a` (objectstack-ai#38802: one skill file, one ratchet script and a changeset). It changes none of the files read here, so each reading holds there too, and this branch merges with it cleanly. The branch was not merged with it. - **Quotations.** A script compared every quoted span of the added lines with its source, read over REST or from the ADR at the base. 9 spans in corner brackets: each is a verbatim substring of ruling record `7296268226`. 27 spans in double quotation marks: each is verbatim in that record, in analysis `7290428149`, in review `7290045524` or in the ADR at the base. 0 mismatches. (The nested title "What "capabilities" became" counts as two spans.) - **Bytes.** The added lines hold no raw control byte, no HTML comment and no model identifier. - **What an adapter decides ahead of its embed**, the list in the note's bullet on the condition, read in both stores on `main` at `0fc9eab900`: an empty organization set, a scope with no ids and a `topK` of zero answer no hits; the store and the embedder are present and the store is ready; the source has an active generation; that generation holds the searched fingerprint and the embedder's width, or the refusal is `KNOWLEDGE_REBUILD_REQUIRED` (409, with its remedy); the mode is one the adapter runs; and `keyword` never embeds. Each is ahead of the embed in `turso-adapter.ts` (lines 699 to 741) and in `pgvector-adapter.ts` (lines 581 to 657). - **PR objectstack-ai#38798 as it stands**, read at head `4561e81d0e`: `queryVector` is the vector itself there, a read-only `number[]`, and `embedQuery` has the signature the note writes. - **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 **The committed note took the function, not a plain array.** A plain array has to exist before `search` is called, so the service would have to embed ahead of every decision the adapter makes. A refused source would then cost an embedding call, and a failing embedder would answer in place of the adapter's own refusal. That is the shape review `7290045524` graded S2, and it cannot meet the condition. The function can, and the note names it as the means it takes. **The review pass, commit `f3cd7dba76`.** Two sentences of the note changed; nothing it decides moved. 1. The opening said that every statement without a diamond is the ruling record's, the analysis's, what follows from the means, or a reading of `main`. Some rest on review `7290045524`, on this record's own rules, on PR objectstack-ai#38798 at its head or on the body of the card. The sentence now lists them. 2. The signature of `embedQuery` is the one PR objectstack-ai#38798 declares at head `4561e81d0e`. The bullet on the two members now says so. **Two things are marked with a diamond, for the approver to accept with the note or strike.** - a. The means, and with it the member's type. Three points go with it and are the note's wording: the name `queryVector` is kept though the member is now a function; the service hands the function on every `search` call of that search and does not judge whether a call will embed; and a rejected promise is shared like a fulfilled one, so one failed embedding call refuses each source that asked for the vector in that search. - b. One sentence added to the third reading: a caller that reaches an adapter's `search` directly and hands the member answers for the function, and the adapter does not verify it. **Wording that is the note's and not a quotation**, each resting on a text named beside it: - The suite case is the one review `7290045524` asks for under S1, rewritten with the function in the vector's place. - "The condition has its own pin in each of the two stores": the ruling record says "a pin". Each store orders its own decisions ahead of its embed, so the note asks for the case in each. - The English beside the card's Chinese words is a reading aid. The Chinese is quoted unchanged. **Overlap with an open draft on this file.** `node scripts/pm/overlap-check.mjs --repo=objectstack-ai/objectstack`, run at `f3cd7dba76` against `origin/main` at `d97aaaea9a`, printed `VERDICT overlap exit 1`: `origin/main` merges cleanly, and draft objectstack-ai#38809 (the weekly ADR revisions, second part, opened 2026-12-01T00:50Z by another seat's thread) conflicts with this branch in this file. Both insert header lines after line 24, and both call their first line "a seventh dated note" (objectstack-ai#38809 adds a seventh under K7 and an eighth under Consequences). Its two notes and this one touch no common passage. Whichever lands second merges `main`, keeps both sets of header lines and corrects its ordinals. Which lands first is the seats' to settle; it is put as a question in the report on the card. **What the note asks of PR objectstack-ai#38798, none of it done here.** - `queryVector` changes type there, from the vector to the function, and the service stops calling `embedQuery` ahead of `search`. - One case in the contract test suite, and a pin in each of the two stores for the ruling record's case. - The docblocks cite the note and no longer say that the knowledge service embeds. **Text of ADR-0161 that the note is read beside. Listed for the seat, not changed.** - "What "capabilities" became" lists the methods whose absence is the capability signal (listing, dropping, status, the start and end of a build). `embedQuery` joins them by this note; the paragraph is left as written. - The K2 row for §3.4 of the protocol page says what the contract carries. Its last column gives the rewrite to "each card that adds a member", so objectstack-ai#38798 rewrites it with its code. **Not done here.** No changeset: `docs/adr/` is published by no package. The two earlier note pull requests on this record, objectstack-ai#38714 and objectstack-ai#38764, each carry the `skip-changeset` label, hung in the stroke that opened them. This one is opened with no label, as its dispatch order says, so that label is owed by the seat, and `Check Changeset` has no exemption until it is hung. ## Verification **Read first, by risk.** One file changes, so these are its three places of most risk. 1. Line 476, the bullet marked with a diamond, "The means, and with it the member's type". It is the one decision the note makes, and it sets what the patch round on PR objectstack-ai#38798 must build. 2. Line 480, the bullet "The condition, as an outcome". It states the maintainer's condition and what holds when the embedding call itself fails. 3. Line 479, the last two sentences of "The third reading": the note's own sentence on a caller that reaches an adapter directly. **Two-minute check.** One click: open the "Files changed" tab. Expected: one file, +17 −0, three hunks, every changed line an addition. **Landing.** `docs/adr/**` is a governed surface. This is opened as a draft. The hand-off 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 reading taken after it opened. **Gates, run locally on head `f3cd7dba76`.** `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: 4608 anchors across 165 records resolve — 1727 symbol (1698 declaration, 29 literal), 2829 file-level, 52 cross-repo, 6 exempt, 132 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 29077 text file(s) -- 29077 tracked, 0 untracked-not-ignored; skipped 101 binary; no raw ASCII control bytes). ✓ check-closed-ceremony-text: 6688 shipped file(s) read; none says the ownership ceremony is closed. ✓ comment-mask corpus sweep [scripts/js-comment-mask.mjs]: 24511 files, 0 disagree, 0 unparseable, 211.2s (comparator self-test: 26 cases pass). ``` </details> <details> <summary>One gate first read NOT MEASURED, then green</summary> `pnpm --filter @objectstack/lint run check:doc-formula-expressions` first answered exit 3, PREREQUISITE NOT MET: two workspace packages it imports were not built in this worktree. That is a run that measured nothing, not a red gate. The two packages were built under the shared verify lock, with the command the gate printed, and the gate was run again at the same head: ```text os-verify-lock: VERDICT command-exit 0 · held the lock 100s (1m40s) · waited 0s pnpm --filter @objectstack/lint run check:doc-formula-expressions :: 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 two member names are the ones PR objectstack-ai#38798 and the analysis use. - [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 `0fc9eab900`, one pull request for this phase. - [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 card'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 with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbXfgA45f3y5YpDPT5h <!-- signed: repo:objectstack#2 · os-warren · session_01JQwxbXfgA45f3y5YpDPT5h --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ctstack-ai#38821) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi99QsuPTPkC1uKm2mViUT3Rf)_ Part of objectstack-ai#34770 Clause-②: no Metadata-protocol: none `Part of`, not the closing form: the catalog-size line of the card's Done-when is not met by this PR. This is PR 6 of the per-skill split, under claim 7280537583 and its amendments 7280758590, 7288186602 and 7296541080. ## 维护者速读 - 用户能看到什么变化:用户无感。发给 AI 的「查询」技能说明,入口文件从约 18 KB 缩到 9 KB:入口只留开工前四项检查、一段可照抄的查询写法、七个「写得通过、跑起来却答错或变慢」的坑、全文搜索的规则、已下线写法的替代表,以及其余内容去哪里查的指路表。 - 为什么做:这是「技能目录瘦身」的第九份(界面、数据、自动化、平台、跨大版本升级、多语言翻译、表达式与公式、接口设计八份已完成)。入口文件每次都整份装进 AI 的上下文,越长越贵,也越容易漏读。 - 出错会怎样:只动教 AI 的文字,没有产品行为变化;风险是 AI 少读一段后答错。评测已在定稿上整轮跑完(十道题,每题三遍,改动前后同一时段各一轮):改动后三十次对二十六次,改动前三十次对二十九次;没有哪道题在改动后三遍全错,按既有裁决不算退步。少对的几次集中在两道题:「按关键词搜任务并显示负责人」改动后三遍对一遍、改动前三遍对两遍(这道题另各加测六遍:改动后对三遍,改动前对四遍,两边都时对时错);「按台北时区分月统计」改动后三遍对一遍,错的两遍内容是对的,只是没用题目要求的原词。可整笔撤回。 - 要你做什么:无。席位核对与合约审查都通过后,才会按治理规则请审批人批准。 ## Rulings this executes - **Card Scope** (decision record on the card, S3 = A): the entry file holds first checks, at most about 8 traps and a routing list; 6–9 KB, hard cap 500 lines; restated option lists and tables go behind a pointer; no trap is removed until a publish-time check covers it or it stays inline. - **7128031203** fork 4 = A: ratchet rows are pinned at the measurement with zero headroom, and the sum of ceilings does not rise. Here two rows fall, no row rises and none is added. - **7168461386** = A: text an eval shows the entry lost goes back into the entry, paid inside the entry. **Used once**: the first after-round showed case 4 lost (0 of 3 against 1 of 3 on `main`); three pieces of text went back and four cuts paid for them (see Eval parity). - **Ruling record 7249189592**, the parity rule: a case whose result flips between runs on both trees is unstable on both and does not block; a case that fails on every run of the head while `main` passes is a regression. Read below on full rounds of both trees in one window: no case fails on every run of the head. - **Seat order for this PR** (claim amendment 7296541080, PR 6 = `objectstack-query`): the same shape as PRs 3 to 5; no new file under `skills/` (a new file needs a new ratchet row, which stays with a human). This skill has three hand-written rules files, each with its own row, so text could have moved into them under fork 4 = A. None did: every fact that left the entry was already in a rules file, in the contract or on the published page. ## Review rounds **Second round** (contract review 7300640479 on `410a7ed7`: passed, with one should-fix), commit `25cf270b`. - **S1, fixed.** The search section said a dotted path in `searchFields` "is refused". That holds at the protocol door, which judges every name, and on an engine call only when no listed name is searchable: the engine's refusal (`refuseSearchOverrideNamingNoSearchableField`) fires on an all-unknown list, and its test keeps the tolerance for a partly-known one ("a partly-known override still narrows to its known names"). So `searchFields: ['title', 'project_id.name']` on the engine call the entry teaches is accepted and searches `title` alone: a wrong answer with no error. The bullet now reads: "a dotted path (`project_id.name`) is refused at the protocol door and when it stands alone; beside real fields the engine drops it silently." Paid inside the entry: the three schema names after the closed-set rule (first check 3 already routes to the file that holds them) and a few words of first check 4. The entry is 8,984 bytes; the row stays 2240 and the sum of ceilings does not move. - **N1, not taken.** The closed-set sentence still does not list `find`'s six driver passthrough keys. The refusal prints them, the changeset says where they are declared, and listing them costs bytes this round had to find for S1. - **N2, not taken.** Trap 5's keyset example sorts by `created_at` alone, and the warning that a repeating sort key can skip or repeat rows at a page boundary stays in `rules/pagination.md`. Every recorded run of the paging case, on both trees, opened that file. Open to the seat: it is the same class as the traps kept inline, and adding it needs a paying cut. **First round** (contract review of `b8182abb`: one should-fix and two nits), commit `d74dc1de`. - **S1, fixed.** The operator list carried `$like` / `$ilike` bare. A pattern with no wildcard is accepted and compares exactly (the contract's own description: the pattern must cover the whole value, and a pattern with no wildcards is an exact comparison, not a substring search), which is a silent wrong answer, the class this entry keeps inline. Trap 2 now ends: "`$like` / `$ilike` match the WHOLE value and you write the `%`: `{ name: { $like: 'acme' } }` is an exact match." Paid inside the entry by three cuts, each loud or already said elsewhere: the REST refusal of a search field outside the searchable set, "applied before counting or grouping" after the `count` / `aggregate` search sentence, and "Unsorted pages are not stable." - **N3, fixed.** First check 2 said a query names nothing beyond the object's declared fields, while the entry's own example uses `created_at` and `owner_id`. It now reads "the object's fields (declared or platform-injected; a query invents none)". - **N1, fixed.** The changeset pointed the six driver passthrough keys at `data/data-engine.zod.ts`, which does not hold them. It now names the driver options contract (`data/driver.zod.ts`) for the keys and says which method takes them is the engine's own list, printed by the refusal. ## What changes **The entry file becomes a router.** `skills/objectstack-query/SKILL.md`: 18,455 → 8,984 bytes, 429 → 154 lines, 4,607 → 2,240 tokens. Frontmatter (description, tags) is byte-identical. It now holds: - `## First checks`, four: the installed contract wins over the `compatibility` line; read the object's fields (declared or platform-injected), which of them are relation fields, and its `searchableFields`; read the contract and never recall a key or an operator (`references/_index.md` for the query and filter schemas, `data/data-engine.zod.ts` for each engine method's option keys); `os validate` reads no query in code, so run the query, while query metadata (a list view's filter, a dashboard dataset) is judged by it. - `## Calling convention`: one type-checked block (a `find` with `where`, `fields`, `orderBy`, `limit` and `expand`; a system read with `context: { isSystem: true }`; an `aggregate` with three measures, one carrying its own `filter`), then the closed-set rule (a key outside a method's set is refused by name with the legal list), what an `aggregate` bag does not take, what a literal carrying `object` is, and the operator names as one list with the four combination rules. - `## Traps`, seven, each accepted and answering wrong or slow with no error: a read with no `context` returns fewer rows; four string operators compare case-sensitively, and `$like` / `$ilike` match the whole value; a column with no value fails every ordering test, and `$null` misses blank text where `$empty` does not; `expand` reads the foreign key off each row, skips a key that is not a relation field, and applies only `fields`, `where` and a further `expand` of a nested value; a page needs `orderBy` and a keyset must match its direction; `where`, `having` and a measure's `filter` scope three different things, with the rule for which side buckets a date under a non-UTC `timezone`; a date computed at module load freezes, with the tokens, the week key and the now-anchored comparand. - `## Full-Text Search`: the bare-string form with `searchFields`, the matching rules, that `count` and `aggregate` take the same pair, that `search` never traverses (where a dotted path is refused and where the engine drops it silently; the stored mirror, with the `searchFields` to write), and the six knobs that validate and do nothing. - `## Removed keys`: all six rows, each with what to write. - `## Where to go`: six rows (the three rules files, the published query-syntax page, objectstack-ui, objectstack-data). **No text moved.** What left the entry was cut, each behind what now answers it. `rules/filters.md` changes two pointers that named sections the entry no longer has (the line under its operator list, and the sibling-keys note): 10,382 → 10,361 bytes. `rules/aggregation.md` and `rules/pagination.md` are untouched; their pointers to "the removal table in `SKILL.md`" and "the calling convention in `SKILL.md`" still hold. | Old entry section | Now | |:--|:--| | Calling Convention (the per-method key table, the passthrough six, the alias folding) | `## Calling convention`: the block and the closed-set rule; first check 3 names the contract file. Cut to the contract (`data/data-engine.zod.ts`): each method's key list and `top` / `filter` folding. Cut: the six driver passthrough keys and why `count` and `aggregate` refuse them; the driver options contract (`data/driver.zod.ts`) holds the keys, and which method takes them is the engine's own list. An unknown key is refused by name and the refusal prints the legal keys, the passthrough ones included. | | Which filter dialect? | The objectstack-ui routing row, which names `VIEW_FILTER_OPERATORS`. | | Execution Context (`context`) | Trap 1 and the block's system read. Cut: the `403 PERMISSION_DENIED` refusal of a context with no user, position or permission set (loud when hit), and that a write takes its context only as the trailing argument (the contract, `contracts/data-engine.ts`). | | Removed Keys → Live Replacement | `## Removed keys`, six rows. Cut: the second alternative for `array_agg` / `string_agg` (a stored roll-up field) and the sentence dating the removal; objectstack-upgrade, which the entry names, holds the register. | | Quick Reference — Detailed Rules | `## Where to go`. | | Filter Operators (six operator tables and their examples) | The operator names as one list, linked to `rules/filters.md` § Operator Reference (one example each), and traps 2 and 3; trap 2 keeps that `$like` / `$ilike` match the whole value. Cut to the contract (`data/filter.zod.ts`, each operator's `.describe()` text) and the published page: purpose, SQL equivalent, value types; the view-filter `is_empty` lowering; the refusal of `$empty` on an undeclared column. | | Filtering by a related record; Cross-field comparisons | The `query.joins` row keeps the shape `{ customer: { country: 'US' } }`; trap 7 keeps the now-anchored comparand. The rest was already whole in `rules/filters.md` § Relation Filters, § Field References and § Now-Anchored Comparands. | | Sorting | The block's two-key `orderBy` and trap 5. Cut: array order is sort priority and `order` defaults to `'asc'` (the contract); index advice is the objectstack-data routing row. | | Pagination | Trap 5 (the keyset shape, the direction rule, what an `offset` still costs) and `rules/pagination.md`, whose § Sorting with Pagination says why an unsorted page is not stable. | | Aggregation | The block's `aggregate` call, the sentence under it, and trap 6. | | Expand (Related Records) | The block's `expand` with the foreign key kept in `fields`, and trap 4. Cut: the batched-read note and the nested example. | | Full-Text Search | Kept under the same heading, shorter. Cut to the published page and objectstack-data's Search Fields reference: the expanded-filter comment block, the protocol spelling of the narrowing key, the description of the default searchable set, the REST refusal of a name outside the set (`400 INVALID_FIELD`, loud when hit). Cut to the contract's docblocks: that `count` and `aggregate` apply the pair before counting or grouping. | | Common Patterns: Cross-Object Queries | Trap 4 (display; page or sort related records by querying the related object), the search section (the stored mirror), `rules/filters.md` § Relation Filters, the objectstack-ui routing row. | | Common Patterns: Pagination Pattern for APIs; Dashboard Aggregation Pattern | `rules/pagination.md`; the block's per-measure `filter` and trap 6 ("a total and a conditional count share one call"); dashboards are the objectstack-ui routing row. | | Verify your work; References | First checks 4 and 3. | **Sizes** (bytes · lines · ratchet tokens): | | before (`main` at `13a0d3fe`, merged in) | after (head `655229c6`) | |:--|--:|--:| | `SKILL.md` (entry) | 18,455 · 429 · 4,607 | 8,984 · 154 · 2,240 | | `rules/filters.md` | 10,382 · 217 · 2,596 | 10,361 · 217 · 2,591 | | `skills/objectstack-query/**` (7 files) | 55,118 · 1,318 | 45,626 · 1,043 | | all 14 `SKILL.md` together | 152,901 · 2,769 | 143,430 · 2,494 | | whole `skills/` tree (115 files) | 1,193,953 | 1,184,461 | | whole tree without `evals/` (73 files) | 829,914 | 820,422 | | ratchet: authored tokens = sum of all ceilings | 189,821 | 187,449 | | ratchet: bundle total, tokens | 295,693 | 293,321 | The head column is measured, and so are the byte and line figures of the `main` column (the files of `main` at `13a0d3fe`). The two ratchet figures of the `main` column are the head's reading plus the fall of this skill's two rows: the entry and `rules/filters.md` are the only files under `skills/` that differ (`git diff --stat origin/main HEAD -- skills`: 2 files). `main` raised another skill's row since the last round, which is why both columns are higher than in the earlier body. **Budget reading:** the entry is 8,984 B, inside the card's 6–9 KB line, and 154 lines against the 500-line cap. The whole catalog is 9,492 bytes smaller, all of it cut. **Ratchet rows** (`scripts/check-skills-token-ratchet.mjs`), each pinned AT its measurement, zero headroom. Two rows move, both down: - `skills/objectstack-query/SKILL.md` 4607 → 2240 (−2,367): `ceil((8984 − 27) / 4) = ceil(8957 / 4) = 2240`. Why: the entry became a router. The two review rounds moved the file from 8,984 to 8,987 bytes and back to 8,984; the row did not move (2240 is the measurement of each). - `skills/objectstack-query/rules/filters.md` 2596 → 2591 (−5): `ceil(10361 / 4) = 2591`. Why: the two pointer lines are 21 bytes shorter. The rows of `rules/aggregation.md` (2346) and `rules/pagination.md` (1289) do not move. The sum of all ceilings goes 189,821 → 187,449 (−2,372). No row rises and none is added. ## Tests ### Eval parity Command, every full round: `pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-query --repeats 3 --concurrency 4 --max-utilization 0.99`, with the model and effort flags PR 3's rounds used; CLI 2.1.333, subscription login. 10 behaviour cases in `evals/filters-pagination-search.json` on both arms and 7 trigger cases in `evals/triggers.json`, both files untouched: 81 turns a round. **The reading the rule is judged on**: one full round on each tree, run back to back in one window, on the pushed head and on the `main` it merged. | case | subject | `main` at `13a0d3fe` (with-skill · no-skill) | head `655229c6` (with-skill · no-skill) | |:--|:--|--:|--:| | 1 | filters, `$in`, case-blind match, two-key sort | 3/3 · 0/3 | 3/3 · 0/3 | | 2 | keyset paging for an infinite scroll | 3/3 · 0/3 | 3/3 · 0/3 | | 3 | grouped measures with `count_distinct` | 3/3 · 0/3 | 3/3 · 0/3 | | 4 | search across a related record's title, with `expand` | 2/3 · 0/3 | 1/3 · 0/3 | | 5 | a system read in a hook | 3/3 · 0/3 | 3/3 · 0/3 | | 6 | now shifted by a field's days | 3/3 · 0/3 | 3/3 · 0/3 | | 7 | blank text with `$empty` | 3/3 · 0/3 | 3/3 · 0/3 | | 8 | a total and a conditional count in one call | 3/3 · 0/3 | 3/3 · 0/3 | | 9 | month buckets under a `timezone` | 3/3 · 0/3 | 1/3 · 0/3 | | 10 | the current-week tokens | 3/3 · 0/3 | 3/3 · 0/3 | | **all** | | **29/30 · 0/30** | **26/30 · 0/30** | | triggers | loaded when it should · left alone when it should not | 15/15 · 3/6 | 15/15 · 3/6 | | case 4 again, 6 runs an arm, right after | | 4/6 · 0/6 | 3/6 · 0/6 | Both full rounds ran 81 of 81 turns (4.2 and 4.3 minutes); the two case-4 reads ran 12 of 12 turns each. **Reading under the parity rule: no regression.** No case fails on every run of the head. The head's total is three lower than `main`'s in this window, all of it in two cases that flip on both trees: - **Case 4: head 1 of 3 and then 3 of 6; `main` 2 of 3 and then 4 of 6.** This is the case whose text the second review round changed, so it was read six more times on each tree. The head's failing answers put the keyword in a `where` `$or` with a relation condition on the project, repeat the entry's new sentence (the dotted path "is refused, or silently dropped next to real fields"), and offer the stored mirror with `searchFields: ['title', 'project_name']` as the alternative; they miss the literal `stored` (they write "store the project name on the task"). `main`'s failing answers miss the same literal, or `owner_id` and `searchFields`. Across every full or targeted read: `main` 9 of 15; the router's text between the restoration and this round 7 of 9; the text of this round 4 of 9. Unstable on both trees, and lower on this round's text than on the text before it, by a margin that nine runs cannot separate from chance. Open question for the seat (see the report): accept under the rule, or reword the bullet so the stored mirror comes before the `where` alternative. - **Case 9: head 1 of 3; `main` 3 of 3.** Both failing answers give the right table (the database buckets on PostgreSQL with `Asia/Taipei`; a fixed offset or SQLite stays in memory) and miss a literal by its form: one writes "the database does the bucketing", the other capitalises "In memory" in a table cell. The text the case draws on (trap 6) has not changed since the first router commit. Across all rounds: head 10 of 12, `main` 7 of 9. - **Case 2: 3 of 3 on both.** Its earlier failures on the router's text (a function parameter named `cursor`, which the case's forbidden literal `cursor:` catches) did not recur: 5 of 16 runs across all router rounds, 0 of 9 on `main`. - **Triggers.** Trigger 7 (a list view's filter) loads the skill on every run of both trees; trigger 6 was left alone on every run of both. The frontmatter that decides loading is byte-identical on both trees. **Earlier rounds**, kept as the record of how the text got here: | reading | tree | with-skill | no-skill | with-skill cases below 3 of 3 | |:--|:--|--:|--:|:--| | before round, 81 of 81 turns | `0fc9eab9` (the first branch point) | 26/30 | 1/30 | case 4, 1 of 3 (missed `owner_id`, `stored`); case 9, 1 of 3 (missed `in the database`, `in memory`) | | after round 1, 81 of 81 turns | local `f9ed325e`, the first router commit (`11d8ae17` on this branch) | 25/30 | 1/30 | case 1, 2 of 3 (one answer used `$ilike`); case 2, 2 of 3; **case 4, 0 of 3** | | after round 2, cases 1, 2, 4 and 5 only, 24 of 24 turns | local `a2ece3bf`, after the restoration (`0a4ed24d` on this branch) | 12/12 | 0/12 | none | | after round 3, stopped by the quota guard after 4 of 81 turns | the same skill text | case 1: 1 of 1; case 2: 0 of 1 | 0/2 | case 2 | | after round 4, stopped on the seat's order after 76 of 81 turns (all 60 behaviour turns, 16 of 21 trigger turns): the first review fix had to land first | tree `cd045f3b`, the head before the review rounds | 27/30 | 0/30 | case 2, 1 of 3; case 4, 2 of 3 | | after round 5, 81 of 81 turns, with a `main` round beside it (`00f97b30`: 28/30 · 1/30; case 4, 2 of 3; case 10, 2 of 3) | `410a7ed7`, the head after the first review round | 28/30 | 0/30 | case 2, 2 of 3; case 4, 2 of 3 | **The restoration (ruling 7168461386).** After round 1, case 4 (search tasks by keyword across the title and the parent project's name, and show the assignee) failed all three runs: the answers put a relation condition in `where` and called the field `assignee`. Three pieces went back into the entry: the search bullet now says a relation condition in `where` is a filter, not a search, and gives `searchFields: ['title', 'project_name']`; the example's comment names `owner_id` as the record owner ("assignee"); trap 2 regains `{ email: { $icontains: '@company.com' } }` (case 1). Paid inside the entry: the objectstack-ask routing row (the frontmatter description carries it), the relation-condition sentence under the operator list (its shape moved into the `query.joins` row), an inline example in trap 4, and half a sentence of trap 1. The entry went from 8,989 to 8,984 bytes. **Quota readings** (the login's seven-day window, status `allowed_warning`, reset 2026-12-06 14:00 UTC; guard `--max-utilization 0.99` by the maintainer's choice recorded in claim amendment 7296541080, never raised). Before the maintainer's reset: before round 0.96 → 0.97; after round 1 0.97 → 0.98; after round 2 0.98; after round 3 stopped at 0.99, exit 3. After the reset: after round 4 0.54 → 0.55; after round 5 0.56 → 0.57 and its `main` round 0.57; this round's head round 0.64, its `main` round 0.64 → 0.65, the two case-4 reads 0.65. One check that calls no model, beside the rounds: of the 38 `must_contain` literals of the 10 cases, `main`'s entry carries 28 and the head's entry 35. One is lost, `engine.find('account'` (case 1; the router's example object is `task`, and an answer composes the call from the prompt); 8 are gained (cases 6, 8, 9 and 10); 2 are in neither tree (`timezone: 'Asia/Taipei'`, `plan_week: '{current_iso_week}'`, both composed from the prompt). Of the `must_not_contain` literals, `main`'s entry carries two (`orderBy:` of case 3, `'project_id.name'` of case 4) and the head's entry one (`orderBy:`, in the `find` example; case 3 is an `aggregate` case and read 3 of 3 on both trees). ### Other tests On the pushed head `655229c6` (tree `e1d917f5`), under the verify lock (`VERDICT command-exit 0`): - `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 scripts/platform-catalog.test.ts scripts/skill-map-guards.test.ts scripts/query-pointer-row.test.ts` (the suite that names the ratchet script, the skill-map guards, and the test that names this skill's pointer row): `Test Files 3 passed (3)`, `Tests 61 passed (61)`. - `pnpm --filter create-objectstack exec vitest run --maxWorkers=2 src/created-summary.test.ts src/scaffold-skills-single-copy.test.ts` (the two test files there that name this skill): `Test Files 2 passed (2)`, `Tests 34 passed (34)`. Two more test files name the skill and were not run: `packages/cli/test/skills-commands.test.ts` uses the name with fixture strings, and a `driver-sql` test cites `rules/aggregation.md` in a comment; neither reads a file this PR changes. No ablation: the diff changes prose and one ledger, no tested behaviour. ## Acceptance notes Held by a gate or by another file, recorded here as it stands: - **`rules/filters.md` § Operator Reference stays where it is.** `scripts/check-skill-identifier-liveness.mjs` registers that section as exhaustive for `FILTER_OPERATORS`; the entry's operator list links to it. - **The heading `## Full-Text Search` is kept.** objectstack-ui's list-view rules send the reader to "objectstack-query → Full-Text Search" by name. - **The removed-keys table stays inline, all six rows.** Each is refused loudly, so the trap rule alone would let it go; but `rules/aggregation.md` and `rules/pagination.md` point at "the removal table in `SKILL.md`" four times, and the table is where a model that remembers an old key learns what to write. Decided here (small, no shipped behaviour), each open to reversal in review: - **"No trap is removed unless a publish-time check covers it or it stays inline" was read as: a query that is accepted and then answers wrong or slow with no error stays inline.** Inline: the seven traps and the two search bullets. Cut to a pointer, each loud when hit: the per-method key lists (an unknown key is refused by name with the legal list), a context with no identity (`403`), a relation filter past its limits (`INVALID_FILTER`), `$empty` on a column with no declaration, a search field outside the searchable set (`400`). - **Traps 3, 6 and 7 state inline what `main`'s entry left to the rules files**: the `$or` with `$null` beside an ordering test, which side buckets a date under a `timezone`, the tokens, the week key and the now-anchored comparand. Each is a silent wrong answer, and eval cases 6, 8, 9 and 10 ask for them; case 9 read 1 of 3 on `main` and 3 of 3 here. The rules files still hold the detail. - **Trap 6 is scoped to where it is true.** The database buckets a non-UTC date only on a driver that declares `supports.zonedDateBucketing` and only for an area/location zone name; a fixed offset, or any other driver, keeps the call in memory with the same buckets. The cost is speed, which is why the list's opening line says "wrong or slow". - **Trap 4 says "the engine skips any other" key**, not "returns nothing": the sentence is about the engine call the entry teaches. - **Two statements of `main`'s entry were corrected in passing, inside this file.** Its `count` row listed `context` and `where` only, and the contract also takes `search` and `searchFields` (`EngineCountOptionsSchema`). It said an `expand` key must be a `lookup` or `master_detail` field, and the engine resolves `user` and `tree` fields too. - **The example calls the assignee field `owner_id`**: objectstack-data's rule is that `owner_id` is the platform-injected record owner, also when the request says "assignee", and eval case 4 asks for the name. - **The operator names stay inline as one list** (0.3 KB): first check 3 says never recall an operator, and the list is the vocabulary to choose from before the rules file is opened. - **The docs link was checked by hand.** `check:published-readme-links` does not read `skills/` (a deliberately broken link in the entry still passed, and the file was restored), so its green says nothing about the entry's link. The page exists as `content/docs/protocol/objectql/query-syntax.mdx` and is listed in its `meta.json`. - **Section anchors of the entry changed.** The changeset lists every anchor that left `SKILL.md` (24) and the five new ones; the title's anchor and `#full-text-search` stay. No file in this repository links one of the old ones. - **Four lines in the summary above, not six**: the standing order for this card thread asks for six, and the agent file that binds the dev fixes four named lines and wins on conflict. - **Footer form**: this body ends with the single block AGENTS.md prescribes for a PR body. Noted, not changed: - Three eval cases grade a literal that a correct answer can miss or carry: case 2 forbids `cursor:` and so fails an answer whose function takes a parameter of that name; case 1 fails an answer that uses `$ilike`; case 9 requires the phrases `in the database` and `in memory` in that casing. The parity rule treats the cases as fixed, so this PR does not touch them. Carrier: none; noted for whoever owns the case file. - Trigger case 7 (a list view's filter, which should not load this skill) loads it on every run of both trees, with this bundle the only one installed in the turn. Carrier: none; the eval seat's reading. - The contract's docblock on `expand` (`data/data-engine.zod.ts`) says keys are lookup or master_detail fields and that a nested value controls sort; the engine resolves four relation types and re-keys the related rows by id, so a nested `orderBy` has no visible effect. A reading of two files, not a measured failure through a public door. Carrier: none. - `scripts/check-corpus-claim-drift.mjs` carries a self-test fixture label that cites `skills/objectstack-query/SKILL.md:154`. It is a label, not a live reference; the file is outside this claim's surface. - `main` moved during the work, five times: PR 5 of this split (objectstack-ai#38802); a release-version commit that restamped every entry's `version` line (the same byte length, so no row moved); a commit that changed a gate script; a range that raised another skill's ratchet row (objectstack-ai#38813, a different row, merged cleanly); and a range that changed a deploy workflow. Each was merged in as a plain merge commit; the textual merges were clean, the workspace was rebuilt after the last one and every gate below ran after it. ## Verification Read first, by risk: 1. `skills/objectstack-query/SKILL.md`, the whole file: is anything a model needs before opening the contract or a rules file missing? The risk hunks are `## Traps` (seven items replace most of the old file) and the one example block, which now carries the whole calling convention. 2. `.changeset/34770-query-skill-router.md`: the "what left, and what answers it now" list is the record of every cut. 3. `scripts/check-skills-token-ratchet.mjs`: the two `objectstack-query` rows. Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints `ratcheted (authored) 187449 / 187449 (+0)` and `skills/objectstack-query/SKILL.md 2240 / 2240 (+0)`; `wc -c skills/objectstack-query/SKILL.md` prints 8984. Gates, local, each exit code captured before any pipe. The whole derived list ran on the pushed head `655229c6` (tree `e1d917f5`), after the merge of `main` at `13a0d3fe` and a rebuild of the merged workspace. <details><summary>Derived families on head `655229c6`: 69 derived, 69 run green, 0 NOT MEASURED</summary> - Reconciliation: `✓ dispatch-gates --ran: 69 derived famil(ies) accounted for — 69 run, 0 NOT-MEASURED (a DERIVED zero — all 69 recorded an exit code and none of them is 3).` No STALE TREE warning against `main` at `13a0d3fe`, the ref the list was derived on. - `node scripts/check-skills-token-ratchet.mjs`: `✓ 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.` (`ratcheted (authored) 187449 / 187449 (+0)`, `bundle total 293321`); its `--self-test`: `111 cases pass`. - `pnpm check:dual-build-cjs-loads`: `127 published require entry point(s) across 75 package(s) load; 2594 emitted CommonJS file(s) parse`. It reads every package's built `dist/`; `pnpm build --concurrency=2` ran first on the merged tree under the verify lock (`VERDICT command-exit 0`, `124 successful, 124 total`). - `pnpm check:dts-closure`: `124 built package(s) swept - 326/326 declared declaration file(s) present`. - `pnpm check:skill-links`: `286 relative link(s) in 76 published skill file(s) resolve; 161 fragment(s) name a real heading under GitHub's slug rule.` - `pnpm check:skill-identifier-liveness`: `Leg 1: 494 citation(s) over 76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0 ledgered gap(s).` - `pnpm --filter @objectstack/spec run check:skill-docs`, `pnpm --filter @objectstack/lint run check:doc-formula-expressions`, `pnpm check:skill-compatibility`, `check:skill-frame-sync`, `check:role-word`, `check:corpus-claim-drift`, `check:doc-authoring`, `check:published-files`, `check:nul-bytes`, `check:cross-package-test-inputs`, `check:ratchet-remedy-authority`: exit 0. - The changeset gates (`check-changeset-no-major`, `check-empty-changeset`, `check-adr-0087-registration`, `check:changeset-gate-self-tests`): exit 0. `pnpm check:pm-dispatch-gates`: exit 0. </details> <details><summary>Beside the derived list, on head `655229c6`, all exit 0</summary> - `pnpm --filter @objectstack/spec run check:skill-examples`, under the verify lock: `341 prose examples type-check across 3 surface(s)`. The entry's one block is among them. - `pnpm --filter @objectstack/spec run check:skill-refs`: `10 generated files in sync with packages/spec`. - `pnpm --filter @objectstack/spec run check:skill-served-sections`: `24 served section(s), each heading exactly once in its file`. - `pnpm check:doc-anchors`: `1190 internal #fragment link(s) across 368 source file(s) all resolve to a real heading`. - `pnpm check:published-readme-links`: `567 outbound link(s) across 169 published markdown file(s)`. It does not read `skills/` (see Acceptance notes). - `pnpm check:skill-top-level-keys`, `pnpm check:skill-frame-freshness`, `pnpm check:dev-prereqs`: exit 0. - `pnpm --filter @objectstack/spec run check:generated`, under the verify lock, after the merge and the rebuild: `All 14 generated artifacts are up to date`. - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: `0 anchored files in the change set — nothing judged.` - `node scripts/check-nul-bytes.mjs`: exit 0; a control-byte scan of the four changed files finds none. </details> `node scripts/pm/overlap-check.mjs` before the push of `655229c6`: `VERDICT clean exit 0` (origin/main at `13a0d3fe` merges cleanly; no open PR shares a changed file). Not run locally: `test:repo` (CI's). Base: the four router commits were written on a local branch and cherry-picked onto the thread branch as `11d8ae17`, `0a4ed24d`, `5cc3f615`, `b8182abb` (local `f9ed325e`, `a2ece3bf`, `17197139`, `5b365fa9`). The first review round added `d74dc1de` between two merges of `main` (`c879b19a`, `410a7ed7`). The second added `25cf270b`, then two more merges of `main`, each a plain merge commit taken when the gate tool reported a stale tree (`d77374eb` for `6f82fd05`, `655229c6` for `13a0d3fe`). A full gate pass ran on `d77374eb` and was repeated in full on `655229c6`. `main` was still at `13a0d3fe` when the head was pushed. CI on the pushed head is the seat's reading. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS)_ <!-- signed: repo:objectstack@os-steve · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Part of #34770
Clause-②: no
Metadata-protocol: none
Part of, not the closing form: the catalog-size line of the card's Done-when is not met by this PR. This is PR 5 of the per-skill split, under claim 7280537583 and its amendments 7280758590 and 7288186602.维护者速读
Rulings this executes
mainpasses is a regression. Read below: no case is one.objectstack-api): same shape as PR 3 (docs(skills): the objectstack-i18n entry file becomes a router #38663) and PR 4 (docs(skills): the objectstack-formula entry file becomes a router #38795); no new file underskills/(a new file needs a new ratchet row, which stays with a human); the cut, not a move, lowers the catalog total.What changes
The entry file becomes a router.
skills/objectstack-api/SKILL.md: 21,359 → 8,986 bytes, 438 → 151 lines, 5,333 → 2,240 tokens. Frontmatter (description, tags) is byte-identical. It now holds:## First checks, four: the installed contract wins over thecompatibilityline, and anapis:block written before protocol 17 turns live; read the stack'sapis, itsmanifest.namespaceand the object'sapiMethods, and prefer a generated route; read the contract and never recall a key or a code; verify withos validateoros buildand read the publish rejection, which carries the fix.## Generated routes: one listing (thedataroutes, the twobatchroutes, import and export, the metadata read), the two routes that do not exist (/bulk, aGETaggregate), and the two request contracts a client gets wrong: the metadata list's closed query set with?names=, and an import mapping's entry form, the only one that carriesapplyOn.## API Methods (Operations): the six authorable primitives and what each of the eight derived operations derives from. The heading and the six names are held by a gate (see Acceptance notes).## A declared endpoint: the two servabletypevalues, one type-checked example (the path carve-out,object_operationwithobjectParams,cacheTtlSeconds), and the mapping rule (move and rename only;transformis rejected).## Traps, six: an anonymous endpoint needs an armed budget (rateLimit.enabled: true); an app never mounts onhttp.server, handler code runs in a flow, an inbound webhook is atype: 'api'flow, and three cases have no app surface;DELETEis not final (the recycle bin, the restore door, the two grants); aPATCHwith no version token skips the concurrency check; a public form answers404 FORM_NOT_FOUNDunless itssharingdeclares all three keys, strips fields outside its sections, and is withheld on a walled posture with only a warning;userMessageis the sentence for a person.## Where to go: six rows (the endpoint contract and its page, the HTTP protocol page, the error contracts and catalog, the auth contract, the forms page, the three sibling skills).No text moved. This skill has no hand-written reference file (
references/_index.mdis generated), and a new file needs a new ratchet row. So what left the entry was cut, each behind what now answers it:/meta)?names=, the two refusals. Cut to the HTTP protocol page: the one metadata type whose list refusesnames.sharingkeys, the two doors, what the declaration grants, the stripped fields and the hook to write, the walled-posture withholding. Cut to the forms page: the file-field rule (an error atos validateand at publish), theguest_portalname, the two form contracts.apis:and a code handler## A declared endpointand trap 2.manifest.namespaceis required and never derived; the path shape).authRequiredand the D6 pairingwindowMs/maxRequestsalone meter nothing, the separate metering.inputMappingon afind/get/deleteoperation, two entries writing one target path.upserthaving no route. Cut: the per-primitive route table (the routes listing carries the routes) and the size of theApiOperationvocabulary.api/dispatcher.zod.ts).references/_index.mdlists both contract files, and first check 3 sends there.AuthProviderwith its six members,LoginRequestSchema, and that an endpoint hasauthRequiredand no nestedauthblock. Cut to the contract: the login request's field list, and the flatpublic+permissionspair of the plugin route registry.advisories[]element.upsertclause, and the routes listing. Cut: the envelope shapes (the contract).Sizes (bytes · lines · ratchet tokens):
mainat2fba8349, merged in)2b912f16)SKILL.md(entry)skills/objectstack-api/**(3 files)SKILL.mdtogetherskills/tree (115 files)evals/(73 files)The head column is measured. The tree and bundle figures of the
maincolumn are the head's reading plus this entry's fall: the entry is the only file underskills/that differs (git diff --stat origin/main HEAD -- skills: 1 file). The sum of ceilings onmainis read frommain's own table (61 rows).Budget reading: the entry is 8,986 B, inside the card's 6–9 KB line, and 151 lines against the 500-line cap. The whole catalog is 12,373 bytes smaller, all of it cut.
Ratchet row (
scripts/check-skills-token-ratchet.mjs), pinned AT its measurement, zero headroom:skills/objectstack-api/SKILL.md5333 → 2240 (−3,093):ceil((8986 − 27) / 4) = ceil(8959 / 4) = 2240. It is the skill's only row. The sum of all ceilings goes 192,665 → 189,572. No row rises and none is added.Tests
Eval parity
Judged by ruling record 7249189592. No case fails on every run of the head while
mainpasses. The with-skill arm passes 10 of 24 turns on the head against 9 of 24 onmain's text. Three cases pass 3/3 on both trees, four fail 3/3 on both trees for the same reason on each, and one (case 6) goes 0/3 → 1/3.Both arms, one command line for both rounds:
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-api --repeats 3 --concurrency 4 --max-utilization 0.99, with the model and effort flags PR 3's rounds used; CLI 2.1.333, subscription login. The two rounds ran back to back in one window (2026-12-01 00:32Z to 00:38Z), each from a clean checkout of its commit. 8 behaviour cases inevals/endpoints-auth-routes.json, untouched; this skill has no trigger file, so there is no trigger reading to give.2fba8349(main's text; the entry is unchanged onmainsince)2b912f16(this head)mainGETfeedhttp.serverand sends the Stripe callback to atype: 'api'flow whose start node declares the vendor header asconfig.signature. That is what both entries and the contract say; the case requires the literalx-objectstack-signature, the platform's own header, which a Stripe answer has no reason to name. Two of three answers onmainand one of three on the head also leave outfunctions.AuthProvider,auth.zod.ts,googleandgithuband stops because the project has no files; none namesLoginRequestSchema, the fifth required literal. Both entries carry it.apiMethods,/batch, the recycle bin/bulkroute, the derivedrestoreand the recycle-bin restore route; none writes the table namesys_recycle_bin. Both entries carry it. One head answer also names the import route and not/batch(all threemainanswers name/batch).applyOnmain, where the entry form (sourceField,targetField) was not in the entry.?names=userMessageon a batch publishx-objectstack-signature,LoginRequestSchema,sys_recycle_bin,userMessage) are all carried by the head's entry, and bymain's./batch. The case fails on every run of both trees on another literal, so the rule does not read it; the head's entry names/batchin the routes listing and in theapiMethodsparagraph. It is reported as seen, one run.main. Cases 3 to 5 fail on a literal a correct answer need not write, and cases 6 and 8 mostly on the skill not being opened. The parity rule treats the cases as fixed, so this PR does not touch them (see Acceptance notes).Before the full rounds, the same check that calls no model: of the 27
must_containliterals of the 8 cases, the entry carried 24 before and after, lost 0 and gained 2 (sourceField,targetField, case 6); 1 is in neither tree (/api/v1/meta/object, which an answer composes from the route). Nomust_not_containliteral appears in either tree's entry.Round records
2fba8349: 48 of 48 turns, 2.4 min, exit 0. After round on2b912f16: 48 of 48 turns, 2.6 min, exit 0. No turn timed out.allowed_warningthroughout, no turn rejected.Other tests
On tree
d53fb207(local head57c7738b, the same tree as the pushed head2b912f16), under the verify lock (VERDICT command-exit 0each):pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 scripts/platform-catalog.test.ts scripts/skill-map-guards.test.ts(the suite that names the ratchet script, and the skill-map guards):Test Files 2 passed (2),Tests 57 passed (57).pnpm --filter create-objectstack exec vitest run --maxWorkers=2 src/created-summary.test.ts(the one test file in the tree that names this skill):Test Files 1 passed (1),Tests 12 passed (12).No ablation: the diff changes prose and one ledger, no tested behaviour.
Acceptance notes
Held by a gate, recorded here as it stands in the entry:
## API Methods (Operations)and the six primitive names stay inline.scripts/check-skill-identifier-liveness.mjsregisters that section of this file as exhaustive forApiMethodand requires every member in it. That script is outside this claim's file surface. So the section became four lines of prose under its old heading, and the route table went to the routes listing. If the section should leave too, the registration moves first, in its own change.Decided here (small, no shipped behaviour), each open to reversal in review:
authRequired: falsewithout an armed budget, and the entry carries the form to write, which is what eval case 2 asks for. Trap 5's walled-posture sentence: its check only warns at save and publish, and a warning is not a refusal, so the consequence (the form is withheld) and the declaration that resolves it stay, the standard PR 3 applied to its own warning-only rules.AuthProviderkeeps its six members inline (0.1 KB): a provider name that is not a member is an authoring mistake the entry can stop before the contract is opened, and eval case 4 asks for the names.userMessage, nevermessage" is said of a batch publish'sprobes.issues[]alone, and the flow door's order (userMessage, thendetails.innerRefusal, thenmessage) is given beside it. The locale sentence is said of platform text.apis:block does.SKILL.md(24) and the five new ones;#api-methods-operationsstays. No file in this repository links one of the old ones.Noted, not changed:
type: 'api'flow verifies only the platform's own signature header, whilemain's entry and the contract (automation/api-trigger-signature.zod.ts) also give a vendor's HMAC header declared asconfig.signature, and every answer on both trees follows the contract. Cases 4 and 5 each require one name (LoginRequestSchema,sys_recycle_bin) that a correct answer leaves out. Case 8 never opens the skill, and case 6 does in one turn of three. The parity rule treats the cases as fixed and the frontmatter is byte-identical by order, so this PR touches neither. Carrier: none; noted for whoever owns the case file and the description.mainmoved during the work: PR 4 of this split (docs(skills): the objectstack-formula entry file becomes a router #38795) and a rise of oneobjectstack-datarow merged.mainis merged in (2fba8349, a plain merge commit); the textual merge was clean and the workspace was rebuilt before any gate ran.Verification
Read first, by risk:
skills/objectstack-api/SKILL.md, the whole file: is anything a model needs before opening the contract missing? The risk hunks are## Traps(six items replace most of the old file) and trap 2, which carries the whole "no handler code" teaching..changeset/34770-api-skill-router.md: the "what left, and what answers it now" list is the record of every cut.scripts/check-skills-token-ratchet.mjs: the oneobjectstack-apirow.Two-minute check:
node scripts/check-skills-token-ratchet.mjsprintsratcheted (authored) 189572 / 189572 (+0)andskills/objectstack-api/SKILL.md 2240 / 2240 (+0);wc -c skills/objectstack-api/SKILL.mdprints 8986.Gates, local, each exit code captured before any pipe. The whole derived list ran on tree
d53fb207(local head57c7738b; the pushed head2b912f16carries the same tree,mainunmoved at2fba8349), after the merge ofmainand a full rebuild.Derived families on tree `d53fb207`: 69 derived, 69 run green, 0 NOT MEASURED
✓ dispatch-gates --ran: 69 derived famil(ies) accounted for — 69 run, 0 NOT-MEASURED (a DERIVED zero — all 69 recorded an exit code and none of them is 3).No STALE TREE warning.node scripts/check-skills-token-ratchet.mjs:✓ 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.(ratcheted (authored) 189572 / 189572 (+0),bundle total 294223); its--self-test:111 cases pass.pnpm check:dual-build-cjs-loads:126 published require entry point(s) across 74 package(s) load; 2593 emitted CommonJS file(s) parse. It reads every package's builtdist/; a fullpnpm build --concurrency=2ran first on the merged tree under the verify lock (VERDICT command-exit 0, 123 tasks).pnpm check:dts-closure:123 built package(s) swept - 324/324 declared declaration file(s) present.pnpm check:skill-links:290 relative link(s) in 76 published skill file(s) resolve; 160 fragment(s) name a real heading under GitHub's slug rule.pnpm check:skill-identifier-liveness:Leg 1: 517 citation(s) over 76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0 ledgered gap(s).pnpm --filter @objectstack/spec run check:skill-docs,pnpm --filter @objectstack/lint run check:doc-formula-expressions,pnpm check:skill-compatibility,check:skill-frame-sync,check:role-word,check:corpus-claim-drift,check:doc-authoring,check:published-files,check:nul-bytes,check:cross-package-test-inputs,check:ratchet-remedy-authority: exit 0.check-changeset-no-major,check-empty-changeset,check-adr-0087-registration,check:changeset-gate-self-tests): exit 0.pnpm check:pm-dispatch-gates: exit 0.Beside the derived list, on tree `d53fb207`, all exit 0
pnpm --filter @objectstack/spec run check:skill-examples:347 prose examples type-check across 3 surface(s). The entry's one block is among them.pnpm --filter @objectstack/spec run check:skill-refs:10 generated files in sync with packages/spec.pnpm --filter @objectstack/spec run check:skill-served-sections:24 served section(s), each heading exactly once in its file.pnpm check:doc-anchors:1186 internal #fragment link(s) across 368 source file(s) all resolve to a real heading.pnpm check:published-readme-links:566 outbound link(s) across 168 published markdown file(s),99 docs-site page(s) resolved; the four pages the entry links are among them.pnpm check:skill-top-level-keys: exit 0.pnpm --filter @objectstack/spec check:generatedafter the merge and the rebuild:All 14 generated artifacts are up to date.node scripts/check-platform-checklist.mjs --changed-from origin/main:0 anchored files in the change set — nothing judged.node scripts/check-nul-bytes.mjs: exit 0; a control-byte scan of the three changed files finds none.Not run locally:
test:repo(CI's).Base: the router commit was written on a local branch cut from
f7252bc3while PR #38795 held this branch; after #38795 landed, the thread branch tookmainat2fba8349(merge840c3aa8) and the router commit was cherry-picked onto it as2b912f16, whose tree is the gated treed53fb207.overlap-checkbefore the push: origin/main, #38797, #38790 and #38192 merge cleanly; #38497 conflicts in the ratchet file againstmainitself (another skill's row), not this branch's. CI on the head is the seat's reading.Generated by Claude Code