Skip to content

docs(skills): the objectstack-api entry file becomes a router - #38802

Merged
os-zhuang merged 10 commits into
mainfrom
claude/project-thread-96llpb
Dec 1, 2026
Merged

os-zhuang merged 10 commits into
mainfrom
claude/project-thread-96llpb

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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.

维护者速读

  • 用户能看到什么变化:用户无感。发给 AI 的「接口设计」技能说明,入口文件从约 21 KB 缩到 9 KB:入口只留开工前四项检查、平台自动提供的接口清单、一个对象可以开放的六种操作、一段可照抄的自定义接口示例、六个「写得通过、上线后却答错或被拒」的坑,以及其余内容去哪里查的指路表。
  • 为什么做:这是「技能目录瘦身」的第八份(界面、数据、自动化、平台、跨大版本升级、多语言翻译、表达式与公式七份已完成)。入口文件每次都整份装进 AI 的上下文,越长越贵,也越容易漏读。
  • 出错会怎样:只动教 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 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. Not used: the two full rounds show no fact the entry lost (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: no case is one.
  • Seat order for this PR (claim amendment 7288186602, PR 5 = 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 under skills/ (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 the compatibility line, and an apis: block written before protocol 17 turns live; read the stack's apis, its manifest.namespace and the object's apiMethods, and prefer a generated route; read the contract and never recall a key or a code; verify with os validate or os build and read the publish rejection, which carries the fix.
  • ## Generated routes: one listing (the data routes, the two batch routes, import and export, the metadata read), the two routes that do not exist (/bulk, a GET aggregate), 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 carries applyOn.
  • ## 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 servable type values, one type-checked example (the path carve-out, object_operation with objectParams, cacheTtlSeconds), and the mapping rule (move and rename only; transform is rejected).
  • ## Traps, six: an anonymous endpoint needs an armed budget (rateLimit.enabled: true); an app never mounts on http.server, handler code runs in a flow, an inbound webhook is a type: 'api' flow, and three cases have no app surface; DELETE is not final (the recycle bin, the restore door, the two grants); a PATCH with no version token skips the concurrency check; a public form answers 404 FORM_NOT_FOUND unless its sharing declares all three keys, strips fields outside its sections, and is withheld on a walled posture with only a warning; userMessage is 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.md is generated), and a new file needs a new ratchet row. So what left the entry was cut, each behind what now answers it:

Old entry section Now
Skill Boundaries The frontmatter description and the last routing row.
Auto-Generated APIs The routes listing, with the two absent routes.
Metadata API (/meta) The first note under the listing: the closed query set, ?names=, the two refusals. Cut to the HTTP protocol page: the one metadata type whose list refuses names.
Public (anonymous) Form Endpoints Trap 5: the three sharing keys, 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 at os validate and at publish), the guest_portal name, the two form contracts.
Declarative Endpoints; Choosing between apis: and a code handler ## A declared endpoint and trap 2.
The path carve-out The example's two comments (manifest.namespace is required and never derived; the path shape).
Five publish gates, each with a prescription First check 4 (read the rejection, it carries the fix) and routing row 1. The entry no longer counts the gates.
authRequired and the D6 pairing Trap 1, whole: the default, the armed budget, why windowMs / maxRequests alone meter nothing, the separate metering.
Mapping keys: projection only One sentence under the example. Cut, each a publish refusal that names the key: inputMapping on a find / get / delete operation, two entries writing one target path.
Upgrading a pre-17 stack First check 1 names the upgrade guide's entry; the steps are there.
Endpoint Naming Conventions Cut. Its two patterns are not paths an app can declare (see Acceptance notes).
API Methods (Operations) Kept under the same heading, as prose: the six primitives, the eight derived operations and their sources, upsert having no route. Cut: the per-primitive route table (the routes listing carries the routes) and the size of the ApiOperation vocabulary.
Discovery & Health Cut: discovery to the HTTP protocol page; the health routes are not a thing a stack declares.
Dispatcher Error Codes Routing row 3 (api/dispatcher.zod.ts).
Realtime Subscriptions Cut: references/_index.md lists both contract files, and first check 3 sends there.
Authentication & Authorization Routing row 4: AuthProvider with its six members, LoginRequestSchema, and that an endpoint has authRequired and no nested auth block. Cut to the contract: the login request's field list, and the flat public + permissions pair of the plugin route registry.
Error Envelopes & the Code Ledger Routing row 3 (a code in no ledger fails CI) and trap 6. Cut to the contract and the error catalog: the two envelope shapes, the two-tier vocabulary, the downstream-ledger recipe, the locale ladder's subtag steps, the advisories[] element.
Best Practices First check 2 (prefer a generated route), the upsert clause, and the routes listing. Cut: the envelope shapes (the contract).
Common Pitfalls Traps 4 and 3. Cut to the two protocol pages, each loud when hit: the quoted-empty entity tag, the four restore refusals, the list / purge / empty doors.
Verify your work; References First checks 4 and 3.

Sizes (bytes · lines · ratchet tokens):

before (main at 2fba8349, merged in) after (head 2b912f16)
SKILL.md (entry) 21,359 · 438 · 5,333 8,986 · 151 · 2,240
skills/objectstack-api/** (3 files) 33,220 · 569 20,847 · 282
all 14 SKILL.md together 165,278 · 3,056 152,905 · 2,769
whole skills/ tree (115 files) 1,200,447 1,188,074
whole tree without evals/ (73 files) 841,293 828,920
ratchet: authored tokens = sum of all ceilings 192,665 189,572
ratchet: bundle total, tokens 297,316 294,223

The head column is measured. The tree and bundle figures of the main column are the head's reading plus this entry's fall: the entry is the only file under skills/ that differs (git diff --stat origin/main HEAD -- skills: 1 file). The sum of ceilings on main is read from main'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.md 5333 → 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 main passes. The with-skill arm passes 10 of 24 turns on the head against 9 of 24 on main'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 in evals/endpoints-auth-routes.json, untouched; this skill has no trigger file, so there is no trigger reading to give.

reading tree with-skill no-skill with-skill cases below 3/3
before round 2fba8349 (main's text; the entry is unchanged on main since) 9/24 0/24 3 (0/3) · 4 (0/3) · 5 (0/3) · 6 (0/3) · 8 (0/3)
after round 2b912f16 (this head) 10/24 0/24 3 (0/3) · 4 (0/3) · 5 (0/3) · 6 (1/3) · 8 (0/3)
case subject main head what the failing answers have in common, on both trees
1 a declared GET feed 3/3 3/3
2 an anonymous endpoint's budget 3/3 3/3
3 a signed inbound webhook 0/3 0/3 Every answer refuses to mount on http.server and sends the Stripe callback to a type: 'api' flow whose start node declares the vendor header as config.signature. That is what both entries and the contract say; the case requires the literal x-objectstack-signature, the platform's own header, which a Stripe answer has no reason to name. Two of three answers on main and one of three on the head also leave out functions.
4 sign-in providers 0/3 0/3 Every answer names AuthProvider, auth.zod.ts, google and github and stops because the project has no files; none names LoginRequestSchema, the fifth required literal. Both entries carry it.
5 apiMethods, /batch, the recycle bin 0/3 0/3 Every answer gives the primitives, the absent /bulk route, the derived restore and the recycle-bin restore route; none writes the table name sys_recycle_bin. Both entries carry it. One head answer also names the import route and not /batch (all three main answers name /batch).
6 an import mapping's applyOn 0/3 1/3 Two of three turns on each tree answer without opening the skill, and fail. The one turn that opens it passes on the head and fails on main, where the entry form (sourceField, targetField) was not in the entry.
7 the metadata list's ?names= 3/3 3/3
8 userMessage on a batch publish 0/3 0/3 No turn on either tree opens the skill; every answer builds the per-code translation table the case forbids. The description that decides whether the skill is opened is the frontmatter, byte-identical in this PR.
  • No restoration under ruling 7168461386: no failing answer on the head traces to a sentence the cut removed. The literals the failing answers miss (x-objectstack-signature, LoginRequestSchema, sys_recycle_bin, userMessage) are all carried by the head's entry, and by main's.
  • Case 5, one observation that is not a regression under the rule: one of the three head answers does not name /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 /batch in the routes listing and in the apiMethods paragraph. It is reported as seen, one run.
  • Cases 3, 4, 5 and 8 cannot show a regression as they stand: they fail on every run of 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).
  • No extra repeats were run: no case flips in the direction the rule reads, and the window is short.

Before the full rounds, the same check that calls no model: of the 27 must_contain literals 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). No must_not_contain literal appears in either tree's entry.

Round records
  • Before round on 2fba8349: 48 of 48 turns, 2.4 min, exit 0. After round on 2b912f16: 48 of 48 turns, 2.6 min, exit 0. No turn timed out.
  • Quota: the runner's guard was raised from its default 0.9 to 0.99 for these two rounds, on the maintainer's answer in the project chat (2026-12-01 00:30Z, option B of the three put to him: run now past the 0.9 line). Seven-day window as each turn reported it: 0.95 on every turn of the before round; 0.95 rising to 0.96 during the after round; status allowed_warning throughout, no turn rejected.
  • The first attempt, on 2026-11-30, was stopped by the guard at its default after 4 of 48 turns on each tree (utilization 0.90 and 0.91; cases 1 and 2 passed once each on both trees). Those stopped rounds ran on CLI 2.1.332 and are not counted in the table above.

Other tests

On tree d53fb207 (local head 57c7738b, the same tree as the pushed head 2b912f16), under the verify lock (VERDICT command-exit 0 each):

  • 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:

  • The heading ## API Methods (Operations) and the six primitive names stay inline. scripts/check-skill-identifier-liveness.mjs registers that section of this file as exhaustive for ApiMethod and 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:

  • "No trap is removed unless a publish-time check covers it or it stays inline" was read as: a declaration or a call that passes and then answers wrong at run time stays inline. Inline: the six traps and the two request contracts under the routes listing. Cut to a pointer, each loud when hit: a wrong endpoint key (the strict shape refuses it and names the key to write), the publish gates one by one, the two further mapping refusals, the restore refusals, the quoted-empty entity tag.
  • Two traps stay inline although a check exists. Trap 1: the gate refuses authRequired: false without 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.
  • The endpoint naming table is cut, not moved. Its two patterns (an object-scoped action path and a domain action path) are not paths an app can declare: a declared path lives under the app's own carve-out, and the endpoint matcher has no path-template syntax. The table taught a form the publish gate rejects.
  • AuthProvider keeps 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.
  • The health routes are cut with no pointer. Nothing in a stack declares them, and the HTTP protocol page has no health section, so a pointer there would be untrue.
  • The entry no longer counts the publish gates. The published pages count them differently (four on one, five on another, for the same checks); the entry says the rejection arrives one gate at a time and carries its fix.
  • Trap 6 is scoped to the sites where it is true: "show userMessage, never message" is said of a batch publish's probes.issues[] alone, and the flow door's order (userMessage, then details.innerRefusal, then message) is given beside it. The locale sentence is said of platform text.
  • A version check opens the first checks, as in the other router entries; here it also carries the one upgrade fact that changes what an old apis: block does.
  • Section anchors of the entry changed. The changeset lists every anchor that left SKILL.md (24) and the five new ones; #api-methods-operations stays. 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:

  • Four eval cases fail on every run of both trees (Eval parity). Case 3's expected answer says an inbound type: 'api' flow verifies only the platform's own signature header, while main's entry and the contract (automation/api-trigger-signature.zod.ts) also give a vendor's HMAC header declared as config.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.
  • main moved during the work: PR 4 of this split (docs(skills): the objectstack-formula entry file becomes a router #38795) and a rise of one objectstack-data row merged. main is 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:

  1. 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.
  2. .changeset/34770-api-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 one objectstack-api row.

Two-minute check: node scripts/check-skills-token-ratchet.mjs prints ratcheted (authored) 189572 / 189572 (+0) and skills/objectstack-api/SKILL.md 2240 / 2240 (+0); wc -c skills/objectstack-api/SKILL.md prints 8986.

Gates, local, each exit code captured before any pipe. The whole derived list ran on tree d53fb207 (local head 57c7738b; the pushed head 2b912f16 carries the same tree, main unmoved at 2fba8349), after the merge of main and a full rebuild.

Derived families on tree `d53fb207`: 69 derived, 69 run green, 0 NOT MEASURED
  • 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.
  • 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 built dist/; a full pnpm build --concurrency=2 ran 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.
  • 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.
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:generated 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 three changed files finds none.

Not run locally: test:repo (CI's).

Base: the router commit was written on a local branch cut from f7252bc3 while PR #38795 held this branch; after #38795 landed, the thread branch took main at 2fba8349 (merge 840c3aa8) and the router commit was cherry-picked onto it as 2b912f16, whose tree is the gated tree d53fb207. overlap-check before the push: origin/main, #38797, #38790 and #38192 merge cleanly; #38497 conflicts in the ratchet file against main itself (another skill's row), not this branch's. CI on the head is the seat's reading.


Generated by Claude Code

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>
…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>
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>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB
L1-b, the seat's L1 thread · 2026-11-30T20:11Z · first review

席位核对

ACCEPT @ 2b912f1 (#34770, split PR 5: the objectstack-api entry becomes a router). This covers the text, the ledger row and the gates. It does not cover eval parity. That reading is NOT MEASURED (both rounds were stopped by the runner's quota guard after 4 of 48 turns), and ruling 7249189592 still has to be read on full before and after rounds. The seat schedules the re-run, and the PR should not be handed over before it. The PR is Tier H: it stays a draft.

The file surface is the three files of claim amendment 7288186602:

  • skills/objectstack-api/SKILL.md;
  • the objectstack-api row of the ratchet;
  • .changeset/34770-api-skill-router.md (@objectstack/skills patch).

No new file is added under skills/, and against main 2fba8349 this entry is the only file under skills/ that differs. It has the same shape as #38795.

The shape, measured at this head:

  • 8986 bytes and 151 lines;
  • six traps, four first checks, one checked endpoint and a six-row routing table;
  • the description and tags unchanged.

What stayed is true. I checked 37 phrases of the new entry against main's entry. Every fact the router keeps was there, including:

  • the derived verb "stripped at parse";
  • upsert with no route;
  • script / proxy not executing;
  • the probes.issues[] reader split with Accept-Language alone;
  • the x-objectstack-signature and config.signature pair;
  • the recycle-bin grants;
  • public-form-intake-unavailable.

The new wording is the version check, "ARMED", and the scoping of trap 6. All four docs pages the routing table names exist: api/declarative-endpoints, protocol/kernel/http-protocol, api/error-catalog and ui/forms.

The eval literals, read independently. I recomputed them from evals/endpoints-auth-routes.json against both entries:

  • 8 cases and 27 must_contain literals;
  • 0 lost and 2 gained;
  • no must_not_contain literal appears in the new entry.

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:

  • check-skills-token-ratchet: 61 within ceilings, the row 2240 pinned.
  • check-skill-links: 290 resolve.
  • check:skill-docs exit 0, and check:skill-served-sections exit 0.
  • check:skill-examples: 347 type-check.
  • check-skill-identifier-liveness: OK, Leg 2 with 11 exhaustive sections.
  • spec platform-catalog and skill-map-guards: 57/57.

Ablations, each restored after:

  • bulk dropped from ## API Methods (Operations): check-skill-identifier-liveness goes red with [leg2-missing-row] … does not document bulk. That is the gate the PR names as the reason the section stays inline, and the spec guards stay green on this edit, so this script alone holds the section.
  • The base row (5333) restored: the ratchet goes red, "above the measurement by 3093".
  • transform: 'x' added to the checked endpoint: check:skill-examples goes red at SKILL.md:91, so the example really is checked against ApiEndpoint.

For the seat:

  • The eval re-run, under the quota window that resets 2026-12-06 14:00 UTC by the PR's reading.
  • The judgment calls the PR lists: the naming table cut as a form the publish gate rejects, the health routes cut with no pointer, and the publish gates no longer counted.
  • Case 3's expected answer is narrower than the contract on config.signature. The PR notes it and does not carry it.

CI at this head: 25 success, 18 skipped, 2 in progress.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 2b912f163ec8f9e4b5363f0f8d78d7d46a840620
Local-runs: none
Scope: skills/objectstack-api/SKILL.md + scripts/check-skills-token-ratchet.mjs
Security-touching: yes
Rule-change-verified: none

PR #38802, card #34770 (PR 5 of the per-skill split, objectstack-api). Read: the card body and its 62 comments (rulings 7128031203, 7168461386, 7176941587, 7249189592; claim 7280537583 with amendments 7280758590 and 7288186602; pause note 7288982585; os-dev report 7290333206), the PR body, the three-file diff against main at 2fba83493b (the merge base and origin/main at reading), and the check-runs on the head. The cited code was read on the main tree; nothing was built or run. Rule-change-verified: none: no path of the diff is under .claude/.

① Derived judgments

  • No accept-set changes. The diff holds no schema, no validator and no runtime code. Nothing an author may declare, and nothing a door answers, moves. Right.
  • Published surface: the text of @objectstack/skills. The entry goes 21,359 → 8,986 bytes and 438 → 151 lines (measured from the two blobs). 24 heading anchors leave the file and five arrive; #api-methods-operations stays. No file in the tree links an objectstack-api anchor, and this skill has no row in packages/spec/scripts/skill-served-sections.json, so no hosted section is orphaned. Right.
  • Frontmatter is byte-identical (lines 1 to 20 of both blobs compared), so the generated skill catalog (skills/README.md, content/docs/ai/skills-reference.mdx) does not drift. Right.
  • The exhaustive-section binding holds. scripts/check-skill-identifier-liveness.mjs binds ## API Methods (Operations) of this file to ApiMethod; the heading is unchanged and the section names all six members (get, list, create, update, delete, bulk). Right.
  • Ratchet (implementing file). One CEILINGS row moves: skills/objectstack-api/SKILL.md 5333 → 2240. Recomputed: the file is 8,986 bytes, its frontmatter version: line is 27 bytes, ceil(8959 / 4) = 2240, zero headroom. The table has 61 rows on both trees; the sum of ceilings is 192,665 on main and 189,572 on the head (parsed from each blob), a fall of 3,093, equal to the row's fall. No row rises and none is added, so ruling 7128031203 ④ is not engaged (it covers raised rows; this is a lowering). The comment carries the arithmetic. Right.
  • Eval literals, static check. The 8 cases of evals/endpoints-auth-routes.json (untouched) carry 27 must_contain literals. Counted against the two blobs: 24 present before, 26 after; all 24 carried, 0 lost, 2 gained (sourceField, targetField, case 6), 1 in neither (/api/v1/meta/object, case 7). No must_not_contain literal is in either blob. The report's count is right. This is not a parity reading.
  • Check-runs on the head (read 2026-11-30T20:17Z, 47 runs, all completed): 29 success, 18 skipped, 0 failed. Green among them: every Lint · family (the token ratchet, skill links, skill examples and identifier liveness ride these), every Type Check · family, Test Core and its shards, Check Changeset, Governed Surface Queue Guard, PR-body guards.

② Semver level

.changeset/34770-api-skill-router.md declares '@objectstack/skills': patch. The diff publishes skill prose only: no rule's teaching changes and no key, route or code is added or withdrawn. patch matches, and it is the level the four earlier 34770-* changesets on main carry. Check Changeset is success.

Clause-②: no — on the PR body and in the changeset; correct, the diff narrows nothing an author could declare.

③ Boundary flags

  • Eval parity is NOT MEASURED, and landing waits on it. Ruling 7249189592 judges a router PR by before and after rounds; both rounds here stopped at the runner's quota guard after 4 of 48 turns (cases 1 and 2 only, one run each). This record judges the text alone. It does not stand in for the parity round: the PR stays unlanded until both full rounds are read under that ruling, and any loss they show goes back into the entry under ruling 7168461386, which moves the head and ends this record's cover.
  • Report open question 1 (review now, or after the push): answered by this record, rendered on the pushed head.
  • Report open question 2 (how the two rounds are completed): option A (wait for the window reset) needs no decision. Option B (raise the utilization guard) spends shared quota past a guard, and option C needs a second environment: neither is the dev's or this reviewer's call. Escalated to the seat, and to the maintainer if B is wanted.
  • Report open question 3 (four summary lines against the six the order asks for): PR-body form, outside this face; the seat's.
  • Pause 7288982585: the card stops after this PR. Nothing in the diff starts PR 6.
  • Dev flag, "no trap is removed until a publish-time check covers it" read as "a declaration or call that passes and then answers wrong at run time stays inline". Accepted: it is the card Scope's own definition of a trap. The cut items were checked to be loud on main: the restore refusals (409, http-protocol page), the names refusal on the package list (400, same page), the empty entity-tag (400, wire-format page), the further mapping refusals and the gates one by one (publish and os validate, declarative-endpoints page), the file-field rule (an error at os validate, forms page).
  • Dev flag, the endpoint naming table is cut, not moved. Accepted: its two patterns sit outside /api/v1/apps/NAMESPACE/, which the old entry itself said publish rejects.
  • Dev flag, health routes cut with no pointer; the gate count dropped. Accepted: neither is something a stack declares, and the two published pages count the same gates as four and as five (an out-of-diff wording finding, no carrier; the seat's to file or drop).
  • Out-of-diff finding, eval case 3. Its expected_output says an inbound type: 'api' flow checks only x-objectstack-signature; the entry (before and after) and automation/api-trigger-signature.zod.ts on main also give a vendor HMAC-SHA256 header declared as config.signature, Stripe-style named. The case file is outside this PR and the parity rule treats cases as fixed. It has no carrier; under the standing no-new-cards order the seat decides whether to file it. It may show as a case 3 miss on both trees in the parity round.
  • SQL push-down: no query, no id materialisation and no join in the diff. Nothing to find.

④ Design judgment

skills/objectstack-api/SKILL.md — every remaining sentence was read against main; the cut was read against the pointers.

(1) Truth of what remains. Verified in the cited code or page:

  • First checks: api/endpoint.zod.ts exists and is the endpoint contract; the declarative-apis-endpoints-live entry exists (migrations/entries/semantic/17.declarative-apis-endpoints-live.ts) and carries both upgrade steps; os validate and os build run the publish gates and each rejection names endpoint, key and fix (declarative-endpoints page).
  • Generated routes: each listed route is registered on main, GET …/export and POST …/import included; the closed query set and the ?names= contract match the http-protocol page word for word; FieldMappingEntry carries sourceField, targetField and applyOn with default 'always' (api/export.zod.ts).
  • API Methods: the six-member ApiMethod, "unset is all, [] none", the strip-with-warning, and each of the eight derivations match data/object.zod.ts and data/api-derivation.ts. "upsert … with no route" holds: there is no upsert route, and the batch door's own upsert forks on the record id, not on an external id, so the query-then-write recipe is the right one.
  • A declared endpoint: type executes object_operation and flow only, script and proxy are rejected at publish, authRequired defaults to true, cacheTtlSeconds is GET-only, transform is refused. The example differs from main's by the dropped optional summary key and two comments; Type Check · consumer gates and Lint · docs & code guards are green on it.
  • Traps 1 to 6: RateLimitConfigSchema.enabled defaults to false (shared/http.zod.ts); the PATCH handler takes the body's expectedVersion before If-Match; the four recycle-bin doors and their grants match the http-protocol table (listing does need manageRecycleBin); the three sharing keys, the two form doors, the create-and-read-back grant, the stripped fields and the walled-posture warning match ui/sharing.zod.ts and the forms page; RuntimeBuildIssueSchema (api/protocol.zod.ts) and FlowFailureDetailsSchema with innerRefusal (api/automation-api.zod.ts) exist as named.
  • Where to go: all four pages exist under content/docs/ and say what is left to them; all five contract files exist; AuthProvider has exactly the six members listed.

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 api/error-code-ledger.zod.ts, which names api/contract.zod.ts; both realtime contracts are in references/_index.md; the guest_portal name and the form contracts are on the forms page).

(7) Old form vocabulary. The pointer to ui/view.zod.ts (FormViewSchema) and ui/sharing.zod.ts at the former lines 102 to 105 is dropped, neither kept nor fixed. Trap 5 now says "a public form" and "its sharing", which reads true for a form view and for the form metadata item alike (FormSchema reuses FormViewSchema's shape by reference), and the row points to the forms page. The entry no longer carries the old term; the changeset's cut list still names FormViewSchema as where the contract lives, which is true on main.

Security-touching is yes. Remaining sentences that teach security behaviour: trap 1 (an anonymous endpoint and its armed rate budget), trap 2 (a code-mounted route gets no caller identity, auth gate or rate limit; signature verification of an inbound webhook), trap 3 (allowRestoreOwnDeleted, manageRecycleBin), trap 5 (the form doors bypass auth, what the declaration grants, the hook that deletes privileged keys, the tenancy declaration), the apiMethods whitelist, first check 1 (an old apis: block becomes an execution entry point), and the auth row (AuthProvider, LoginRequestSchema, authRequired). Removed sentences that taught it: the guest_portal name, the flat public + permissions pair, the login request's fields, "a mapping can never buy a caller past authRequired", and the upgrade's "security review, not a rename". The teaching that remains is unchanged in substance from main.

No must-fix, no should-fix.

Nits (no effect on correctness or the contract; none needs a change on this head):

  • N1 — the flat public + permissions pair of RestApiEndpointSchema is cut "to the contract", but api/plugin-rest-api.zod.ts is named by neither the auth row nor references/_index.md, while the unchanged description still triggers on "extending the REST generator". It is the platform plugins' registry, not something an app declares, so the grade is a nit; follow-up: have the reference generator list the file. The entry sits 14 bytes under the 9 KB line, so it is not paid inline.
  • N2 — the changeset names four answer targets the entry does not route to (docs/api/wire-format, data/object.zod.ts, api/contract.zod.ts, objectstack-i18n). Each is reached through a refusal that names itself or through a file the entry does name; accepted deviation.
  • N3 — the row "A generated route's request and answer" points to the http-protocol page, which has no import, export or search section; the entry names api/export.zod.ts inline for the import mapping. Accepted deviation.

scripts/check-skills-token-ratchet.mjs (implementing file): the row and its comment agree with the measured file sentence by sentence; see ①. The comment's "8986 (8959 priced) → 2240" and "the sum of all ceilings falls by the same 3093" both check.

Implemented-by: claude/project-thread-96llpb
Reviewed-by: session_01ADHkmSAjFEZHRpRq3WCj6z

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

维护者速读

  • 用户能看到什么变化: 只改技能文字。objectstack-api 技能的入口从 21,359 字节削到 8,986 字节,改成「路由」:只留作者做决定要用的规则和陷阱,其余指向契约文件和公开的 API 文档页。没有新文件,frontmatter 不变。
  • 为什么做: 卡 skills: SKILL.md becomes a router with a size budget, and points to the contract instead of restating it #34770 第 5 个 PR(技能瘦身,一次一个技能)。评测(按你选的 B,配额线放到 0.99 跑满两轮):main 9/24,这个 head 10/24,没有「main 过、本 head 每遍都挂」的题。
  • 出错会怎样: 不改代码行为,最坏是 AI 写 API 相关内容时少了某条提示。撤销合并即可恢复。
  • 要你做什么: 动了 skills/**,属于受管路径,按 Tier H 需要你批准。不走低风险技能通道:有 security 标签(入口讲匿名端点限流、入站 webhook 签名、回收站权限),还改了 scripts/ 的 ratchet 行。批准后由席位落地。

Seat opinion: land as is.

席位核对

ACCEPT at head 2b912f163ec8f9e4b5363f0f8d78d7d46a840620 · Tier H (governed skills/**; low-risk skills arm refused: security label, scripts/ path) · Part of #34770

  1. Shape: three files: skills/objectstack-api/SKILL.md cut to a router (21,359 → 8,986 bytes, 438 → 151 lines, 2240 tokens), its CEILINGS row in scripts/check-skills-token-ratchet.mjs lowered 5333 → 2240 with zero headroom (ceiling sum 192,665 → 189,572 against main; no row rises or is added), and the changeset .changeset/34770-api-skill-router.md (@objectstack/skills patch).
  2. Premise: every sentence left is true on main; frontmatter is byte-identical, the ## API Methods (Operations) section still names all six ApiMethod members, and no file links a removed anchor (L2 7290718258 ①–③). The security teaching that remains is unchanged in substance from main.
  3. Gates: on this head 30 success, 24 skipped, 0 failed; mergeable clean. Clause-②: no, Metadata-protocol: none.
  4. Eval parity (ruling 7249189592), read by the seat: both full rounds ran back to back on 2026-12-01 (48/48 turns each, guard 0.99 on the maintainer's choice, no turn rejected). With-skill main 9/24 → head 10/24; no-skill 0/24 on both. Cases 1, 2, 7 pass 3/3 on both trees; cases 3, 4, 5, 8 fail 3/3 on both for the same reason on each; case 6 goes 0/3 → 1/3. No case fails every run of the head while main passes, so nothing is restored under ruling 7168461386 and the head did not move. This is the condition L2 7290718258 left open; it is now met on the same head.
  5. Accepted deviations: N1 (the flat public + permissions pair is cut to a contract the references index does not list; nit), N2 (the changeset names four answer targets the entry reaches indirectly), N3 (one routing row points to a page without an import section; the entry names api/export.zod.ts inline). Out of scope and where it went: eval cases 3, 4 and 5 require a literal a correct answer need not write, and cases 6 and 8 mostly fail on the skill not being opened. Named in the records, left uncarded under the maintainer's no-new-cards order.
  6. Landing: L1-b ACCEPT 7290547997 and L2 PASS 7290718258 on this head; eval delta report 7296633502. Lands after os-zhuang approves.

ACCEPT → comment 7290547997 · Contract review → comment 7290718258

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 1, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 1, 2026 00:47
@os-zhuang
os-zhuang marked this pull request as ready for review December 1, 2026 00:47
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit d97aaae Dec 1, 2026
65 of 66 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-96llpb branch December 1, 2026 01:08
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Merged by os-zhuang (d97aaaea9a); pm:awaiting-merge removed. #34770 stays open for split PRs 6–8.

@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 1, 2026
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation security size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants