Repository navigation
docs(adr): ADR-0160 amended a fifth and a sixth time; the Data API sort door reads the sortability projection's computed-type predicate - #37785
Conversation
…ection's computed-type predicate The Data API's sort door (assertSortFieldsExist, third verdict) judged "computed on read, no column to order by" from a local set, formula alone. The served sortability projection judges the same fact by @objectstack/spec/data's isVirtualSearchField. The door now reads that predicate, as its filter and search checks already do, and the local set is retired. Both sets held formula only, so no sort is answered differently. A new test holds the door to the projection for every FieldType member, and tells the door's computed-type verdict from its sortable:false verdict by the fields each refusal names. Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
…hor defect, the input row's aliases, and three review nits D1's list of author defects gains an orderBy field the child does not offer as a sort, with its rule id (ai-context-sort-field-unsortable) and what the tool does; point 20 carries the settlement. D4's input row lists every alias the schema names and says none is accepted, and states outlineFrom's range. The outlineFrom refusal's reasons in D3 "Outline pages" gain a body field that is not a long-text field. Point 24 names the heading too long to list. The amendment log records all four. Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
…definition is asked once The sentence "Nothing of the child is read, its definition included." is replaced by the text the PR that builds the related-object fix proposed: the child's published definition is asked once, for whether the stack defines the object at all, so a related object the stack does not define states nothing. The amendment log says where the sentence was read: that PR's head, not main. Kept as its own commit so it can land with, or wait for, that PR. Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
…blished definition is asked once" This reverts commit 88fa54a. The sentence is not a wording fix: it changes what D3 guarantees about a child the caller is not served, so it waits for a maintainer ruling and does not ride this amendment. D3's "Nothing of the child is read, its definition included." stands as it was, and the amendment log no longer lists the entry. Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
…oad at collection `./protocol.js` reaches `@objectstack/lint` only through a dynamic import, and this file did not load it at module scope, so the first case past the source's own gates would transform that dependency's module graph inside a clocked window. `pnpm check:test-source-alias` named the file; the module-top side-effect import is the convention its siblings in this package follow. No case changes: Tests 99 passed (99) before and after. Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9d2081b6a924cc54d02e25e23b2b0336a18207fb && git checkout 9d2081b6a924cc54d02e25e23b2b0336a18207fb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6e8f663710ccfe069138d0fe8ba1ccbd98111ed3 06b567e5469baa3479f470cad205ab4830fe4439 && git checkout -B drift-repro 6e8f663710ccfe069138d0fe8ba1ccbd98111ed3 && git merge --no-ff 06b567e5469baa3479f470cad205ab4830fe4439
node scripts/docs-audit/affected-docs.mjs --json 6e8f663710ccfe069138d0fe8ba1ccbd98111ed3 |
…ed definition is asked once, and what the statement then signals By the maintainer's ruling (option B of the decision analysis on the related-object card): D3 "Object level" no longer says that nothing of a left-out child is read, its definition included. The published definition is asked one question, whether the stack defines the object at all, so a related object the stack does not define states nothing, as D1 says of an author defect. The sentence also names the signal in plain words: the statement now means that something the stack defines is hidden from this caller, so a caller who knows the pack's names can infer that such an object exists. That is the trade the field-level rule already makes for fields. The amendment log gains a sixth entry that quotes the ruled option, names the PR that builds it and its head, and says that the text comes before the code. The fifth entry and every other sentence stand as they were. Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie Final head for review: |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · head 06b567e · 2026-11-27T04:13Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: PR #37785 for card #37386, with one ADR sentence for card #37486 (
① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Does the sentence state what PR #37751 does? Yes, on each count. Read against step 4a of
Does it name the signal plainly, as the ruling requires? Yes. Execution item 1 of 7208943876 asks for "a note now means something the stack defines is hidden from this caller, so a caller who knows the pack's names can infer such an object exists — the trade D3 already makes for fields". D3 carries that almost word for word, in the bullet itself and not only in the log, and the log repeats it under "What the statement signals". The sentence states the signal at its strongest. In fact the one statement is shared with hidden fields, so a caller can pin it on a particular object only after ruling the pack's other names out. Stating the wider inference is the safe direction for a disclosure. Is every other D3 sentence still consistent? Yes.
Tried to break it: an undefined object refused by an earlier gate (the tests show both doors pass it to the served read); a caller-dependent published read (none); a second ask through the plan (stopped by The same file, fifth amendment. D1, point 20, the D4 input row, the D3 404 list and point 24 each match
Nits. None affects correctness or the contract on this head.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT at head 席位核对Shape and gates. Contract review. PASS at The ruling is carried out. Ruling B on #37486 (7208943876) asks for the ADR text first, naming the signal, then #37751. The new D3 sentence states what #37751's step 4a does: the published definition is asked once, an undefined name states nothing for every caller, and a defined but unserved child keeps the note. It names in plain words that a note tells a caller who knows the pack's names that such an object exists. The record checked it against the Context quotation of The sort door, read. The area's question: Changeset (TIER_DEFAULT remainder), sentence by sentence. A Landing: Tier H. ACCEPT plus the same-head PASS are both on record. This goes to seat 1 for handoff ①–④. This thread does not land it. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie Review follow-up filed · 2026-11-27T04:25Z · area o1-B: contract record 7209730357 nits N3 and N4 (accepted in ACCEPT 7209761400) → filed #37810 (the engine door |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Seat record · 2026-11-27T04:27Z · PR #37785 (Fixes #37386, Refs #37486) · head 维护者速读
Seat opinion: land. 席位核对 — ACCEPT · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Approval request · Tier H · PR #37785 (Fixes #37386, Refs #37486) · head @os-zhuang — governed |
Brings in the ADR-0160 sixth amendment (PR #37785) that this branch implements. Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
…ne states nothing (objectstack-ai#37751) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DLCo5F2y7fgbM8tstGoyyUn)_ Fixes objectstack-ai#37486 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:资料包里关联了一个系统中根本不存在的对象(作者写错名字)时,AI 工具不再对任何人说「部分资料对你不可见」,只是不给这一节;真有权限限制的对象照旧提示。 - 为什么做:属于「记录范围的 AI 问询」这一组后续,让工具行为与设计一致:作者写错由校验报给作者,不伪装成权限问题。 - 出错会怎样:最坏是某个确实存在、只是此人看不到的对象漏了「不可见」提示;两种情况都有真实内核测试守着,可直接撤回此改动。 - 要你做的:无。设计文档里对应的那一句已先行合入(随另一项设计文档修订),本改动不再欠设计文档。 ## What changes `executeGetRecordContext` step 4a (`packages/services/service-record-context/src/record-context-tools.ts`): a `related` child that passes the read guard and API exposure and that this caller is not served is still left out and never read again. The `not_visible` statement now fires only when the door's **published** definition of the object exists (`door.publishedObjectDefinitionOf`). A name the published definitions lack is an author defect (ADR-0160 D1, `os validate` reports it as `ai-context-object-unknown`) and states nothing (D3: "A name the published definition lacks is an author defect ([D1](#d1)) and fires nothing."). Why this fact: it is the same for every caller. Both door implementations were read on `origin/main` 579b857: - HTTP (`packages/runtime/src/domains/mcp.ts`, `publishedObjectDefinitionOf` → `readServedObject`): the protocol's merged `getMetaItems({ type: 'object' })` listing, with no caller argument, or the metadata service's `getObject`. No masker. An absent name answers `undefined` → `null`, no throw. - stdio (`packages/mcp/src/stdio-data-bridge.ts`, `readObjectDeclaration`): `getMetaItemForExecution` / `getMetaItem` by name, falling back to the metadata service's copy; no principal. An absent name answers `undefined` → `null`. Its one rethrow is `OBJECT_PACKAGE_DISABLED`, which API exposure has already refused one step earlier. - `assertApiExposed` on the HTTP door is `refuseUnexposedDataAction(..., 'refuse')`: on no declaration it falls open to schema defaults (`apiEnabled` true), so an undefined object reaches step 4a's served read on both doors, as the card said. A throw from the new read is judged the way every other step-4a read is: a coded refusal refuses the call unnamed, any other throw fails it `INTERNAL_ERROR` 500 naming nothing (`refusedOrFailed`). The definition is used as a boolean only; nothing of it is carried. Comments in the same file that said a left-out child's definition is never read are corrected to say what the code now does. ## ADR-0160 amendment The ADR text this change implements has landed first, as ruling B on this card ordered (record 7208943876): PR objectstack-ai#37785 (merge commit `031a19dc`) amended ADR-0160 a sixth time. D3 "Object level", the bullet "A `related` child that this caller is not served is left out.", now reads: > Nothing of the child is read except its published definition, which is asked once, for whether the stack defines the object at all (sixth amendment, 2026-11-27): a name the published definitions lack is an author defect ([D1](#d1)), left out with no statement for every caller. The published definition is the same for every caller, so whether the statement fires depends on this caller's served schema alone, and nothing of the definition is carried. That is the replacement this PR had proposed, with the amendment's date added. The amendment record names this PR and says `main` reads nothing of such a child until it merges. `docs/adr/**` is not touched here; this branch carries the amended text by merging `origin/main` at `29804839` (merge commit `3e30d721`). ## Tests <details><summary>Measured first: the real-kernel case red on main (both doors agree, both carry the note)</summary> `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/mcp-record-context-tools-bridge.test.ts` at 7adbe2d (tests only, `src/` = main 579b857): ``` × [ADR-0160 D1/D3] a related entry naming an object the stack does not define leaves its section out and states nothing: the same bytes for both callers, on both doors AssertionError: expected [ { kind: 'not_visible', …(1) } ] to deeply equal [] + "kind": "not_visible", + "text": "Some of the material this pack covers is not visible to you, so it is not given. Do not treat it as empty or absent, and do not guess it.", Tests 1 failed | 29 passed (30) ``` The `/mcp`-vs-stdio byte equality held before the note assertion, so the defect was on both doors. The two-caller defined-but-unserved case passed on main, as it should. </details> <details><summary>Green after the fix, and the ablation</summary> - `@objectstack/runtime` `src/mcp-record-context-tools-bridge.test.ts`: Tests 30 passed (30). - `@objectstack/service-record-context` `pnpm test`: Test Files 3 passed (3), Tests 180 passed (180). - Ablation (`scripts/ablation-replace.mjs`, fix committed first): `if (published) hidden = true;` → `hidden = Boolean('ABLATION_37486');`; `ablation-dist-preflight` found the marker in 2 built files; the runtime case and the new unit case each went red (1 failed | 29 passed; 1 failed | 132 passed); restore leg: marker absent from all 6 built files, working tree clean against HEAD. A first attempt used a comment marker, which the build strips: its dist reading failed, so that attempt counts for nothing. </details> <details><summary>Merge round: re-measured on head 3e30d72 (origin/main 2980483 merged, no conflict)</summary> - The merge brought no change to this PR's four files: `git diff --stat cb1a47e..3e30d72` over them is empty, and the branch delta against `origin/main` is still the same four files (+130 / -11). The two door implementations read above (`packages/runtime/src/domains/mcp.ts`, `packages/mcp/src/stdio-data-bridge.ts`) are unchanged between 579b857 and 2980483. - `@objectstack/service-record-context` `pnpm test`: Test Files 3 passed (3), Tests 180 passed (180); `typecheck`: exit 0 (test layer 0 errors). - `@objectstack/runtime` `src/mcp-record-context-tools-bridge.test.ts`: Tests 30 passed (30); `typecheck`: exit 0 (test layer at its ledger: 27 files / 183 errors / 66 pinned signatures). - `dispatch-gates --commands` for this head: 66 of 67 derived families exit 0; `check:dual-build-cjs-loads` not measured locally (it reads every package's `dist/`, and only the closure was built); CI's `Lint & Repo Gates` carries it. - `overlap-check`: merges cleanly with `origin/main` 2980483; no open PR shares a file. </details> New cases: - Real kernel, both doors, `packages/runtime/src/mcp-record-context-tools-bridge.test.ts` (shared harness extended with object `rc_partner`, served to `usr_member` through `rc_unmasker` and not to `usr_plain`, and packs `rc_misspelt_child` / `rc_role_child`): - an undefined `related` object (`rc_ghost`): no section, `notes` `[]`, the name nowhere, for `usr_member` and `usr_plain`, and the two callers' answers byte-identical; - a defined child served to one caller and not the other: its section for `usr_member` with no note; for `usr_plain` no section, one `not_visible` note, `rc_partner` named nowhere. - Unit, `src/__tests__/record-context-tools.test.ts`: the undefined child states nothing while a hidden field or an unserved defined child beside it still states; a left-out child's published read that throws refuses unnamed (coded) or fails `INTERNAL_ERROR` (uncoded). Two pins that said a left-out child's published definition is never asked now pin the new order: guard, exposure, served read, published read, then nothing. ## Acceptance notes - The card's Acceptance asks to state the `Clause-②` line because the tool's answer changes; the claim binds `Clause-②: no`, which is what this PR and its changeset carry. Flagged in the report, not re-ruled here. - The card cites ADR-0160 point 20 (fields); the governing text for an unknown object is D1 and D3. ## Verification Read first (by risk): 1. `packages/services/service-record-context/src/record-context-tools.ts`, the `if (!served)` hunk of step 4a. 2. `packages/runtime/src/mcp-record-context-tools-bridge.test.ts`, the two new cases and the fixture's `rc_partner` permissions. 3. `packages/services/service-record-context/src/__tests__/record-context-tools.test.ts`, the two re-pinned order assertions. Two-minute check: `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/mcp-record-context-tools-bridge.test.ts` after building the closure: expect 30 passed, including "a related entry naming an object the stack does not define …". --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie)_ <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie --> --------- Co-authored-by: Claude <noreply@anthropic.com>
objectstack-ai#37812) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DG44bgtJm8kWx4oK68re6GX)_ Fixes objectstack-ai#37733 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感;查阅决策记录目录的人会看到「就记录问 AI」那条记录的状态说明换成了最新写法,写明它修订过不止一次(目录每格有长度上限,后半句照旧截断)。 - 为什么做:这条记录本周又修订了一次,目录由记录自动生成,却没有跟着重新生成;替查阅决策记录的人和读取目录的工具消除目录与记录的不一致。 - 出错会怎样:最多是目录里这一行文字不对,任何功能都不受影响;撤回这一次改动即恢复原样。 - 要你做什么:合入或批准这一次改动(决策记录目录属于须经你手的范围)。 ## What changes `docs/adr/README.md`, the generated ADR index, is regenerated with `node scripts/adr-index.mjs`. One row moves: the status cell of ADR-0160. | | ADR-0160 status cell | |:---|:---| | before | `Accepted — merged 2026-11-24 (PR objectstack#37115); amended 2026-11-25 (s…` | | after | `Accepted — merged 2026-11-24 (PR objectstack#37115); amended 2026-11-25, 2…` | - Cause: the `**Status**:` line of ADR-0160 was rewritten twice without an index regeneration: by commit eec1040 (PR objectstack-ai#37573, `amended 2026-11-25 and 2026-11-26`) and then by commit 031a19d (PR objectstack-ai#37785, which added the fifth and sixth amendments, `amended 2026-11-25, 2026-11-26 and 2026-11-27`). Both touched the record only. The index projects that line clipped to the cell width, so the visible change is the clipped tail. - Diff: 1 file, +1 / −1 (line 230). No ADR body, no script, no other index row. - The file is generator output. Nothing in it is hand-edited or hand-trimmed. - No changeset: `docs/adr/**` ships in no released package, so this pull request carries `skip-changeset`, declared on the create. ## Tests No package is touched, so there is no build closure to make and no package test or typecheck to run. The generator's own self-test ran inside `pnpm check:adr-index`: 60 assertions, green. ## Acceptance notes - Card acceptance, "`adr:index` regenerated on main; its check passes with no other index change": `node scripts/adr-index.mjs --check` exits 1 (stale) on `main` and exits 0 on this branch at its head 4976072 (the area's re-run after objectstack-ai#37785 landed), and the net diff against `main` is the ADR-0160 row alone. "No other index change" is a measured reading here, not an assumption. - Idempotent: a second `node scripts/adr-index.mjs` on the regenerated tree prints `unchanged` and leaves the same blob (ef06360 at 4976072; 803949a was the first head's). - The row does not show the new date itself. The generator clips the status cell at a fixed width and the clip lands inside `, 2026-11-26 and 2026-11-27`. - `main` moved while this was in flight. The branch carries one merge commit, 0315963 (`main` at c826e8a, which brought in objectstack-ai#37785), and the index was regenerated on top of it in 4976072. `main` has since moved four more commits to 9b50fed (objectstack-ai#37798, objectstack-ai#37783, objectstack-ai#37821, objectstack-ai#37826); none of them touches `docs/adr/`, `ui/docs/adr/` or the generator, so the index stays current against today's `main`. - Governed surface: `docs/adr/**` is Tier H. This pull request is opened as a draft and is left as one; landing it is the maintainer's act. - Noted, not filed: the index went stale with nothing red because its check is report-only by ruling. The last index regeneration on `main`, commit 972114d, did not carry the new ADR-0160 status text, so that index was generated on a tree without eec1040 and the file then text-merged. That is the expected cost of a report-only check, not a defect. ## Verification Read first, one file: 1. `docs/adr/README.md`, line 230, the only hunk of the net diff. The risk to check is that the row is exactly what the generator prints for the current `**Status**:` line of ADR-0160, and that nothing else moved. Two-minute check: on this branch run `node scripts/adr-index.mjs --check`. Expected: the line `adr-index: OK — docs/adr/README.md is current and every record parsed.` and exit 0. On `main` the same command prints `docs/adr/README.md is stale` and exits 1. <details> <summary>Premise on main (objectstack cac93cc, first head)</summary> ```text $ node scripts/adr-index.mjs --check adr-index: ✗ docs/adr/README.md is stale — run `node scripts/adr-index.mjs` (pnpm adr:index) and commit the result. exit 1 ``` </details> <details> <summary>Regeneration and its check (objectstack b234dce, first head; re-run at 4976072 after the merge of main)</summary> ```text $ node scripts/adr-index.mjs adr-index: wrote docs/adr/README.md (251 lines). exit 0 $ git diff --numstat 1 1 docs/adr/README.md $ node scripts/adr-index.mjs --check adr-index: OK — docs/adr/README.md is current and every record parsed. exit 0 $ node scripts/adr-index.mjs adr-index: unchanged docs/adr/README.md (251 lines). exit 0 $ node scripts/pm/overlap-check.mjs overlap-check: claude/area-o1C-37733 (b234dce) changes 1 file(s); against origin/main (44ccf94) and 0 PR head(s) ✓ origin/main: merges cleanly VERDICT clean exit 0 ``` </details> <details> <summary>Local gates on objectstack b234dce (first head): the 21 commands that dispatch-gates derives for this diff. The head 4976072 is judged by its check-runs: 25 success, 19 skipped, 0 failed</summary> Each exit code was captured before any pipe. `node scripts/pm/dispatch-gates.mjs --ran` answers: `21 derived famil(ies) accounted for — 21 run, 0 NOT-MEASURED`, exit 0. ```text exit 0 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 ``` `pnpm check:adr-index` printed: `adr-index --report: OK — docs/adr/README.md is current, every record parsed, self-test 60 assertions green.` The `check:doc-formula-expressions` line is its second run. The first exited 3, PREREQUISITE NOT MET, because `@objectstack/formula` and `@objectstack/lint` were not built in this worktree. Both were then built under the shared verify lock (`VERDICT command-exit 0`) and the gate was run again. Every other family is left to CI on this pull request. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Fixes #37386
Refs #37486
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Four files, +170 / −48, in three parts: two under this card, and one sentence for the card the
Refsline names.1. ADR-0160, fifth amendment —
docs/adr/0160-record-scoped-ai-inquiry.md(+12 / −6 of the file's +17 / −7). The amendment writes down whatmaindoes in the places the card lists, and says in words that it rests on no ruling of its own. Every sentence was read against the tree onmainat7e638ba7. The behaviours marked measured were run through the executor and the input schema in a throwaway probe that was deleted and never committed.Amendedlist gains a fifth entry that names this card, PR feat(ai): a context pack's related list takes where / orderBy / limit (ADR-0160 row 11) #37354 (which built row 11) and the review record of the fourth amendment's PR (7194836142, nits N1–N3), then the four things recorded.orderBythat names a field the child has and does not offer as a sort is an author defect. It names the projection that answers the question (resolveObjectSortability), what that is onmaintoday (aformulafield, or a field whose author declaredsortable: false), the rule idai-context-sort-field-unsortablewith its symbol anchor, and why the tool judges the field before the query: both MCP doors refuse an order by such a field withINVALID_SORT, which would refuse the whole call.objectandtableforobjectName;idandrecord_idforrecordId;packandcontextNameforcontext;sectionforanchor). The row now also says what an alias is: it is not accepted. The input is strict, so a call that uses one is refused at parse like any unknown key, and the refusal names the declared key (measured for each of the seven).outlineFromis stated as an integer, 0 or more (measured:-1and1.5refused at parse,0accepted).RESOURCE_NOT_FOUNDgain: a pack whosebodynames a field that is not a long-text field, or that the root does not have (measured: both get the same 404 as a position past the end).Nothing else in the record changes under the fifth amendment.
2. The Data API's sort door reads the projection's predicate (card item 2, N7) —
packages/metadata-protocol/src/protocol-query-validation.ts(+21 / −41), one new test file (+118), one changeset (+14).assertSortFieldsExist(a real field whose type has no column to order by) judged the type by a module-local set,UNMATERIALIZED_SORT_TYPES,formulaalone. It now callsisVirtualSearchFieldfrom@objectstack/spec/data: the predicateresolveObjectSortabilityreads forreason: 'virtual-type', and the one this file's filter and search axes already read. The local set and its docblock are removed; a comment at the call site says where the one source is and why it is the storage fact and not the write contract (COMPUTED_VALUE_TYPES).packages/spec/src/**is edited. Nothing changes for a caller today: both sets heldformulaand nothing else.SEARCH_VIRTUAL_TYPES, and the door, the projection, the list header and the Sort picker follow together.protocol.sort-door-projection-agreement-37386.test.tscopies no verdict table. For every member of the spec'sFieldTypeit asks the projection and holds the door to that answer (99 cases).37386-sort-door-reads-projection-predicate.md:@objectstack/metadata-protocolpatch.3. ADR-0160, sixth amendment — the same file (+5 / −1, commit
06b567e5). It rests on the maintainer's ruling recorded in comment 7208943876 on the card theRefsline names (option B of decision analysis 7207825366), and it comes before the code: the PR that builds it stays a draft atcb1a47e9until this text is accepted.D3 "Object level", the bullet "A
relatedchild that this caller is not served is left out." The sentence "Nothing of the child is read, its definition included." is replaced by:The first two sentences are the draft in os-dev report 7207298690. The last two name the signal in plain words, as execution item 1 of the ruling asks.
Amendment log. A sixth
Amendedentry quotes the ruled option verbatim, names the building PR and its head, says that the text comes before the code and whatmaindoes until then, and records the two things above. It also says the record tools are not changed: a name the caller typed is still answered alike whether the object is hidden or does not exist.The fifth entry still says it rests on no ruling of its own; that stays true of the fifth. Every other sentence of the record stands.
Tests
Head
06b567e5. Its one commit after40e60883edits the ADR alone, so the package's source and tests are byte-identical to40e60883, where the commands below ran. Every heavy command ran under the shared verify lock; the result quoted is the lock's ownVERDICT command-exitline.pnpm --workspace-concurrency=2 --filter '@objectstack/metadata-protocol^...' build→VERDICT command-exit 0.40e60883:pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol.sort-door-projection-agreement-37386.test.ts→Test Files 1 passed (1),Tests 99 passed (99),VERDICT command-exit 0.40e60883:pnpm --filter @objectstack/metadata-protocol test→Test Files 372 passed | 9 skipped (381),Tests 23549 passed | 45 skipped (23594),VERDICT command-exit 0.pnpm --filter @objectstack/metadata-protocol typecheck, on40e60883→VERDICT command-exit 0. The package'stsc --noEmit --listFileslists the new test file, so the typecheck covers it.Ablation (the fix committed first;
scripts/ablation-replace.mjs; each restore proved by blob equal toHEADand an emptygit diff HEAD). Both were taken on the door at70e73548; the commits after it leave the door byte-identical and add one side-effect import and no case to the test file.formula,summaryand a marker) →Tests 2 failed | 97 passed (99): bothsummaryrows. The grid would offer that sort and the Data API would refuse it.formula) →Tests 1 failed | 98 passed (99): theformularow of the second table. The solo row stays green there, because the door's fourth verdict still refuses the sort with the same code and status; only the fields the refusal names tell the two verdicts apart. That is why the second table sorts by the field under test and by a companion that declaressortable: false.Acceptance notes
Amendedentry.isVirtualSearchFieldis that source for the Data API door and the projection; the test above pins it for everyFieldType. The card namesprotocol-data-crud.tsas the door's file; the claim corrects that toprotocol-query-validation.ts, which is where the set was.main. N1–N3 of record 7194836142 are closed in the same ADR-0160 text." The D4 row, the D3 list and point 24, as above.strictObject'saliasesare spellings it refuses by name. The row says so, since "with the record tools' aliases" read as if a caller could write them.bodyfield with a non-body type. Abodynaming a field the root does not have takes the same branch and gets the same answer, so the clause names both.88fa54aeadded the draft sentence the dispatch order first carried; the PM withdrew it before this PR opened, because it waited for a maintainer ruling, ande2e6a626reverts it. The ruling came (comment 7208943876, option B), and06b567e5adds the sentence again, now with the two sentences that name the signal and with a sixth amendment-log entry of its own. The sentence describes behaviour that is not onmainyet; the log entry says so.judgeRelatedListsdocblock ("nothing about a refused object is read, its definition included"): that is the record tools' order, which the ruling leaves alone. Context, "What a refusal names", is unchanged for the same reason.pnpm check:test-source-aliasnamed the new test file: it reaches@objectstack/lintthrough a dynamic import and did not load it at module scope.40e60883adds the module-top side-effect import its siblings in the package carry. No case changes.carrier: none):assertOrderByIsMaterializableinpackages/objectql, still spells the literalformula. The card names the HTTP door and the projection; a third reader is outside the claimed file surface.UNMATERIALIZED_SORT_TYPES(two inpackages/drivers/driver-sql, two inpackages/lint, two inui/packages/plugin-listtests). The door's new comment keeps the retired name so a search for it lands on the call site.fieldHasColumnanswers "has a column" for amultipleformula. Onmainthat helper readsisMultiValueField, which is false forformula, so that paragraph was already stale and is not carried over.typeis not a string but stringifies toformulawas refused by the oldString(...)comparison and is not byisVirtualSearchField. No schema-valid definition holds such a field.docs/adr/**is governed, so the whole PR is Tier H and stays a draft. TheRule-change:line is left out: the diff does not touch.claude/**.Verification
Read first (by risk):
docs/adr/0160-record-scoped-ai-inquiry.md, D3 "Object level": the replaced sentence moves a visibility boundary by a maintainer ruling, and its last two sentences state what a caller can now infer.packages/metadata-protocol/src/protocol-query-validation.ts, the one-line filter inassertSortFieldsExist.Two-minute verification:
pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol.sort-door-projection-agreement-37386.test.ts— expectedTests 99 passed (99).Gates, patch round (
06b567e5). The commit edits one file, so the families rerun are the ones that read it:node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack docs/adr/0160-record-scoped-ai-inquiry.md→ 21 commands, all exit 0 on06b567e5, each exit code captured before any pipe. This is a declared narrowing: the other 52 families of the full list read files that are byte-identical to40e60883, and CI runs the whole farm on the new head.--ranreconciliation against that derivation:✓ 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).pnpm check:issue-citations(outside that derivation; the new entry cites a card): exit 0.dispatch-gates --tier: changed lines 218 (+170 / −48) against the human-merge threshold 3000: under.overlap-check --branch=claude/area-o1B-37386before the push:VERDICT clean exit 0at06b567e546againstorigin/mainat6e8f663710and 0 PR heads.origin/mainwas not merged in: no conflict.origin/main, and 2 files the derivation reads changed in that range.Patch-round gates (21 commands on 06b567e, exit code beside each)
Gates, full union (
40e60883). The list isnode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon40e60883(no paths; the script takes the change set from the merge base): 73 commands. Each ran on40e60883with its exit code captured before any pipe.node scripts/check-plugin-teardown-shape.mjs --self-test, PREREQUISITE NOT MET, so NOT MEASURED. Its positive control is pinned to a commit a shallow clone cannot read, and the remedy it names is to unshallow the clone every worktree in this container shares, which was not done; CI runs it on a full checkout.e2e6a626: one red,pnpm check:test-source-alias, naming the new test file (repaired by40e60883, above); and two more exit-3 refusals for built output not on disk (check:dual-build-cjs-loads,check:lean-entry-closure). Both measured green on40e60883, aftercheck:type-check-debtin the same list had built the packages under the verify lock.--ranreconciliation on40e60883:✓ dispatch-gates --ran: 73 derived famil(ies) accounted for — 72 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).dispatch-gates --tierat40e60883:docs/adr/**is the mandatory contract tier; changed lines 212 (+165 / −47) against the human-merge threshold 3000: under.overlap-check --branch=claude/area-o1B-37386before each push:VERDICT clean exit 0, the last one at40e60883againstorigin/mainat8b9b9d2355and 0 PR heads.Test Core, the changeset check, the always-runs tail) are this PR's check-runs; they had not reported when this body was written.Not measured locally (1), each with its own refusal text
Local gates (73 commands on 40e6088, exit code beside each)
Generated by Claude Code