Repository navigation
feat(spec): a batch dataset-query request and answer beside the single dataset door, each query answered or refused on its own - #32251
Conversation
…dataset door DatasetQueryBatchRequestSchema, DatasetQueryBatchEntrySchema and DatasetQueryBatchResponseSchema, the DATASET_QUERY_BATCH_MAX_QUERIES bound, their types, pins, regenerated baselines and reference docs, and a changeset. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhNnuQDu2LvsL54Xmn
… lowercase code literal Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhNnuQDu2LvsL54Xmn
gen:schema (via spec build), gen:api-surface, gen:export-origins, gen:declaration-map, gen:docs, gen:strictness-ledger; the hand-kept dropped-refinements header re-counted to its entries (263 / 1050), since both sides' identical 259->261 edit merged as one. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhNnuQDu2LvsL54Xmn
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 5 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 171 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 e046c6ab8bc7e2cf5c30a6fb1913e66d29b9b2c8 && git checkout e046c6ab8bc7e2cf5c30a6fb1913e66d29b9b2c8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d391babc3c2e741b222439180e4b9e49e6b533ee c043839cf9b3014db959cd51a9f1d9c12888fecc && git checkout -B drift-repro d391babc3c2e741b222439180e4b9e49e6b533ee && git merge --no-ff c043839cf9b3014db959cd51a9f1d9c12888fecc
node scripts/docs-audit/affected-docs.mjs --json d391babc3c2e741b222439180e4b9e49e6b533ee
|
|
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX Contract reviewServed-tier: Read for this record: card #32203 (body and its 4 comments: the claim, amendments 1 and 2, the dev report 6770143037), PR #32251 (body, 12-file list), the net diff ① Derived judgments
② Semver levelClause-②: yes (widening)
③ Boundary flags
④ Design judgment
What holds:
Findings:
Check-runs on
The gates that decide the generated baselines (the schema build that enforces the dropped-refinements ledger, the spec tests, the type checks) had not reported. This verdict is on the design and the committed tree; it does not stand in for those runs, and the seat reads them before the PR moves. No must-fix. Findings 1 and 2 are should-fix and each earns a delta review of its fix; both fixes are in Implemented-by: VERDICT: PASS |
…tatus as the authority over error.httpStatus Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhNnuQDu2LvsL54Xmn
|
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX Delta reviewServed-tier: Read for this record: the one commit Should-fix 1 (the "same code, message and details" claim): closed
Should-fix 2 (
|
|
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX Delta review — merge of mainHead-sha:
|
|
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX 席位核对 — ACCEPT · domain:spec#3 · head
|
|
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX
State: ready + auto-merge. On MERGED the seat posts the landing note on #32203 and removes |
objectstack-ai#35928) (objectstack-ai#36316) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XTRdLmK9YYgMSCJ7NH2PuUY)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jVTYADzVWfarACx5j3 Fixes objectstack-ai#35928 Clause-②: yes (widening: one new public read, `POST /api/v1/automation/_record-starts`, and the UI exports that read it) Metadata-protocol: added Skills-docs: none — no skill under `skills/**` teaches the console's stage confirms; `content/docs/automation/flows.mdx` and `content/docs/frontend/plugins/plugin-grid.mdx` document the read and the list in this change. Ruling-ref: 7073655354 ## 维护者速读 - 用户在列表单元格或记录页改阶段时,确认框在原来那句话下面列出这次改动会启动的流程名称(按用户语言显示),带审批的流程标「发起审批」;以前只写「可能触发相关自动化」。 - 属于行内编辑专题,按维护者的裁定「能改这条记录的人都看到流程名称」,让用户确认前就知道保存后会发生什么。 - 出错时最多是清单少列或不显示,确认框退回今天那句话,保存本身不受影响;整个改动可以直接撤回。 - 无。 ## What changes **Server (one new read).** - `@objectstack/spec/api`: `RecordUpdateStartsRequestSchema` (`{ object, recordId, changes }`, strict), `RecordUpdateStartSchema` (`{ name, label, startsApproval }`), `RecordUpdateStartsResponseSchema`, and the contract entry `listRecordUpdateStarts` (`POST /api/v1/automation/_record-starts`). `_record-starts` joins the `/automation` domain's reserved position literals (underscore-led, so the package-namespace install gate is not narrowed). - `@objectstack/spec/contracts`: `RecordUpdateStartsInput` and the optional `IAutomationService.listRecordUpdateStarts`. - `@objectstack/spec/automation`: `recordChangeTriggerHookEvents` / `recordChangeTriggerFiresOnUpdate`, the record-change token grammar MOVED out of `@objectstack/trigger-record-change` (whose `triggerTypeToHookEvents` now delegates to it), so the trigger and the preview read one rule. - `@objectstack/service-automation`: `AutomationEngine.listRecordUpdateStarts` (`record-update-starts.ts`). A flow is asked only when it is enabled and armed on a `record_change` trigger for this object whose token binds an update; whether it starts is `startConditionHolds`, the one start-condition gate every run attempt passes, over the variables `seedRunVariables` seeds (`record`, its flattened fields, `previous`). The approval mark is the presence of an `APPROVAL_NODE_TYPE` node (ADR-0019). A condition that throws is not listed. Hooks are never listed (ADR-0077 §2). - `@objectstack/runtime`: the `/automation` domain's `_record-starts` door, mounted in the dispatcher plugin and recorded in the route ledger. Order: query parameters refused `400 VALIDATION_ERROR`; body parsed through the request schema (`400 VALIDATION_FAILED`); `501` when the engine has no preview; the record read AS THE CALLER through the `/data` door's own `get` (`callData`), so an unreadable record answers `404 RECORD_NOT_FOUND` exactly like an absent one and the engine is never asked; a read that answers no record is refused the same `404`; every `changes` key must be a declared field of the object (else `400 VALIDATION_FAILED` on `changes.KEY`, the engine never asked); then the engine is handed `previous` = the record read, `record` = that record with `changes` applied, and the caller's `userId` / `tenantId`. Anonymous `401`. - `@objectstack/client`: `client.automation.listRecordUpdateStarts(request)`. **UI (two confirms, one reader).** - `@object-ui/plugin-detail`: `stageChangeStarts.tsx` — `useRecordUpdateStarts(ask)` (asks the route once per pending move through the host's `apiFetch`, parses the answer through `RecordUpdateStartsResponseSchema`, answers `[]` while in flight, refused, failing, malformed or empty) and `StageChangeStarts` (the list under the sentence: each flow by its label translated through `activeFlowsBundle` + the spec's `translateFlow`, the flow runner's reading; an approval flow marked). Exported for the grid. - Record page: `recordPathStageChange.tsx` draws it in both confirmations (the path's `AlertDialog` and the header stage menu's `RequiredFieldsDialog`, via a new optional `notice` slot in `@object-ui/fields`). - List cell: `ObjectGrid`'s state-machine confirm draws it; `StateChangeConfirm` gains an optional `ask` (the row's record id and the move). - `@object-ui/i18n`: `activeFlowsBundle` moves here from `@object-ui/app-shell`'s module-internal `utils/flowsBundle` (its three app-shell importers repointed), since the confirms' packages do not depend on the console; two keys in all eleven packs: `detail.stageChangeStartsHeading`, `detail.stageChangeStartsApproval`. - The confirm's sentence is never replaced (not this card: objectstack-ai#35685 S3). A move that starts nothing, and a failed read, leave the confirm exactly as today. Docs: `content/docs/automation/flows.mdx` (§ Which flows a record update would start), `content/docs/frontend/plugins/plugin-grid.mdx` (the confirm now names the flows). Changesets: `35928-record-update-starts-read.md`, `35928-stage-confirm-names-flows.md`, both carrying the Clause-② and Metadata-protocol lines. ## Tests - Engine `record-update-starts.test.ts` (8): condition holds / does not hold; approval mark CONTROL (an approval flow and a plain flow side by side); no condition; create / delete / other object / obsolete never named while `record-before-write` is; an unevaluable condition not named; an unarmed engine answers nothing; `current_user` evaluated as the writer named. - Door `automation-record-update-starts.test.ts` (13): a member is answered (body parsed through the response schema) and the engine is handed exactly the record read as the caller; empty list; unreadable record `404 RECORD_NOT_FOUND` with the engine never asked; unreadable and absent answer alike; anonymous `401` before any read; malformed body `400 VALIDATION_FAILED`; query parameter `400 VALIDATION_ERROR`; `501` without the preview; a GET of the literal is not this door.; a change key that is not a field `400 VALIDATION_FAILED` on that key (an undeclared key, a key off the field-name grammar, an inherited member name), the engine never asked; a change on an object the registry does not declare refused alike; a read that answers no record `404 RECORD_NOT_FOUND`, never previewed; and the ledger row names `RecordUpdateStartsRequestSchema` / `RecordUpdateStartsResponseSchema`, as the clone and publish-drafts suites pin theirs. - Spec `automation-api.zod.test.ts`: contract count and the new entry's method/path; request strictness; a leaked `condition` / `nodes` dropped by the response parse. Each `changes` key is held to the field-name grammar (refused: a dotted, an upper-case, a digit-initial, a spaced and an empty key). - List cell, in its confirm's harness `ObjectGrid.autosave-35685.test.tsx` (new top-level describe, 3): list (request body pinned, labels, approval mark under the unchanged sentence), empty, failure (and Change still saves the move). - Record page, in each confirm's harness (new top-level describe in each, 3 + 3): `record-path.stageChange-28199.test.tsx` (the path's confirmation) and `RecordStageMenu-35891.test.tsx` (the header stage menu's dialog): list, empty, failure (a refused read, a network error and a malformed envelope each draw no list). - `stageChangeStarts-label-35928.test.tsx` (2): a flow named by its translation where the app's `flows` bundle has one, by its authored label where not; nothing drawn for no flows. - Ablation (one-shot under the verify lock, restored by trap, `git diff HEAD` on both sources empty): removing the `StageChangeStarts` render from `ObjectGrid.tsx` and from both confirmations in `recordPathStageChange.tsx` turns exactly the three `list:` pins red (`Tests 3 failed | 6 passed`); empty and failure pins stay green, as they should. ## Acceptance notes - Card acceptance: "Changing a stage that starts a flow shows that flow by name in both confirms" — pinned in both confirms (list cell, and both record-page confirmations) and measured live (below); "a stage with nothing attached shows no list" — the empty pins; "a read failure falls back to the generic sentence" — the failure pins. - Residual, stated in the contract docblocks and `flows.mdx`: the preview binds the caller's user id and tenant only, not their positions, request params or expand as a live run does, so for a condition reading those the preview can differ from the save in either direction (it can miss a flow, or list one a negated test of the writer would stop); the seat files the follow-up for positions. - Residual (not widened here): conditions are judged on the record as the CALLER reads it (field-level security applied), so a condition that reads a field the caller cannot see is judged on what they see, and one that throws on a missing field is not listed. The preview can therefore under-list for a caller with masked fields; it never reveals a masked value. Documented in `flows.mdx`. - Residual: the header stage menu's dialog asks with the stage alone; values typed into that dialog for required fields are not part of the preview's `changes`. - Two existing confirm suites (`RecordStageMenu-35891`, `record-path.stageChange-28199`) now stub `fetch` with a `501` answer in `beforeEach`, so the new read does not leave for the network under test; no existing assertion changed. Across the touched UI packages the run shows 0 `ECONNREFUSED`. - The approval mark is the ruling's test, "the flow contains an approval node". Measured live, showcase's `showcase_project_closure` reaches its sign-off approval through a `subflow` node (the approval node lives in `showcase_closure_signoff`), so the preview lists it with `startsApproval: false`. Following subflow references for the mark is a reading beyond the ruling: filed objectstack-ai#36322. - Overlap (`overlap-check.mjs` at the head below, exit 1, reported and not merged around): objectstack-ai#36296 and objectstack-ai#36236 have landed and are merged in. objectstack-ai#36335 (part of objectstack-ai#35979) moves `activeFlowsBundle` into `@object-ui/i18n` too and conflicts in `ui/packages/i18n/src/flowsBundle.ts`, `ui/packages/i18n/src/index.ts` and `ui/packages/app-shell/src/views/metadata-admin/previews/flow-label-translations.tsx`; it lands after this PR and drops its copy of the move. Every other open PR that shares a file merges cleanly. - Declaration correction: the claim and ruling 7073655354 read `Metadata-protocol: none`, but the three new `@objectstack/spec/api` schemas enter the `api` authorable-surface shard (10 keys), which `Check Changeset` reads as `added` (`none-baseline-moved`). The line is `added` and `@objectstack/spec` is graded `minor`, as objectstack-ai#32251, objectstack-ai#35789 and objectstack-ai#31883 were for new api request/response schemas. No flow or other metadata key is added, so the ruling's "no new authorable key" still holds. ## Verification - Read first: `packages/runtime/src/domains/automation.ts` `respondToRecordUpdateStarts` (the order of refusals and the caller-scoped read that admits the engine), then `packages/services/service-automation/src/record-update-starts.ts` (which flows are asked and the one gate they pass). - Live, on a fresh showcase (`pnpm dev -- --fresh`), as a member created by the admin (`role: user`, not an admin): - `Website Relaunch` `status: active → completed`: `200 {"flows":[{"name":"showcase_project_closure","label":"Project Closure with Sign-off (nested pause)","startsApproval":false}]}` - same record `→ on_hold` (CONTROL): `200 {"flows":[]}` - same record `budget 150000 → 250000`: `200 {"flows":[{"name":"showcase_budget_approval","label":"Project Budget Approval","startsApproval":true}]}` - an absent record: `404 RECORD_NOT_FOUND`; anonymous: `401 UNAUTHENTICATED`; a body without `changes`: `400 VALIDATION_FAILED` naming `changes`. - Zone 2 premise, measured before any code: the same kind of member reads `GET /api/v1/meta/flow` (200, 33 flows with labels, the admin's set) and `GET /api/v1/meta/flow/showcase_closure_signoff` (200, its nodes). - The console itself was not driven in a browser (its dist is not built in this container); both confirms are pinned through the real components above. - Local, all under `scripts/pm/os-verify-lock.sh` (shared box): - touched UI packages (`plugin-detail`, `plugin-grid`, `fields`, `i18n`): `Test Files 1131 passed | 2 skipped` · `Tests 13186 passed | 38 skipped`; after folding the pins into their harness files the three files plus the label file: `Tests 77 passed (77)`. - type-check: `tsc --noEmit` (src and test projects) for `i18n`, `fields`, `plugin-detail`, `plugin-grid`, and src for `app-shell`; `service-automation`, `runtime`, `client` exit 0. - server: engine 8/8, door 9/9, `route-ledger.conformance` + `automation-api-contract-mounts` + `http-dispatcher` green, client conformance 11, spec `automation-api.zod` + `address-grammar` 87, `trigger-record-change` 122. - `dispatch-gates.mjs --commands` (129 families) run and reconciled with `--ran`: `129 run, 0 NOT-MEASURED`. First pass reds were all this diff's own owed artefacts, fixed and re-run green: spec `gen:api-surface` / `gen:docs` / `gen:export-origins` / `gen:declaration-map` / `gen:strictness-ledger` (api count 533 → 536: the three new schemas), the route-ledger census sentence (149 → 150), and `check:test-source-alias` (a spec/automation alias in the trigger package's vitest config; the door test pays `@objectstack/metadata` at collection). - Re-verified after the hand-over (seat 7), main `b3bcfefc` merged in at `472457d9`, the generated surfaces regenerated at `6bd111ff` (`gen:schema` → spec build → `gen:api-surface` → `gen:export-origins` → `gen:declaration-map` → `gen:docs` → `gen:strictness-ledger`; `check-regen-pending` clear), the changeset correction at `99bfd857`. Under the verify lock at `6bd111ff`: - type-check exit 0: `@object-ui/i18n`, `fields`, `plugin-detail` (src and test; the hand-over's stale-dist red is gone after the closure build), `plugin-grid`, `app-shell`; `@objectstack/spec`, `runtime` (src and test layer, after building `@objectstack/driver-turso`), `service-automation`, `client`, `trigger-record-change`. - tests: `runtime` Tests 11745 passed | 25 skipped; `service-automation` 4224 passed; `client` 820 passed; `trigger-record-change` 122 passed; spec `automation-api.zod` + `address-grammar` 87 passed; `plugin-detail` + `plugin-grid` + `fields` + `i18n` Test Files 1135 passed | 2 skipped, Tests 13300 passed | 38 skipped. - `dispatch-gates.mjs --commands` (129 families): run at `99bfd857` (the six that started before that commit re-run on it) and reconciled with `--ran`: `129 derived, 128 run, 1 NOT-MEASURED, 0 UNRUN`. The one NOT-MEASURED is `check:dual-build-cjs-loads` (exit 3, PREREQUISITE NOT MET: it needs every package's dist, which this container does not build); CI runs it in its Lint jobs, green at this head. - CI at `99bfd857`: every check-run green or skipped by design. Check Changeset shows two runs: the `synchronize` run (09:07Z, before the body said `added`) red, the `edited` run (09:08Z) green. - Contract review rework (L2 at `99bfd857`), at `3ba211dc` and `d2279e6c` (head): - the door refuses a change key that is not a declared field of the object and a read that answers no record; the request schema holds each change key to the field-name grammar; the ledger row is pinned; the preview's caller binding is stated in the contract docblocks and `flows.mdx`; `_record-starts` joins the address module's literal list. - ablation, one-shot under the verify lock (`ablation-replace.mjs`, restored by trap, blob == HEAD and `git diff HEAD` empty after each): the declared-field refusal disabled → `Tests 2 failed | 11 passed` (the two refusal pins); the no-record refusal disabled → `Tests 1 failed | 12 passed` (its pin). - local: `runtime` Test Files 637 passed, Tests 11749 passed | 25 skipped; door suite 13/13 at the head; spec `automation-api.zod` + `address-grammar` 88 passed; type-check exit 0 for `spec`, `runtime` (src and test layer, at `d2279e6c`), `service-automation`, `client`, `plugin-detail`. - `dispatch-gates.mjs --commands` at `3ba211dc`: `129 derived, 129 run, 0 NOT-MEASURED, 0 UNRUN`; the 37 families that read test files re-run at `d2279e6c` (a one-line test-type fix), all exit 0. - CI at `d2279e6c`: 70 check-runs, 61 success and 9 skipped by design, Check Changeset green. - Delta round (L1-d 7078831268, L2 nit N3 from 7078841748), at `41487226` (head): the 401 and 501 pins assert `body.error.code` (`UNAUTHENTICATED`, `NOT_IMPLEMENTED`) beside the status; the spec changeset names the undeclared-change-key `400 VALIDATION_FAILED` and the no-record `404` among the door's refusals; the caller-binding limit reads "can differ from the save in either direction" in the request schema's docblock, `RecordUpdateStartsInput` and `flows.mdx`. Door suite 13/13; type-check exit 0 for `spec` and `runtime` (src and test layer); `dispatch-gates.mjs --commands` at `41487226`: `129 derived, 129 run, 0 NOT-MEASURED, 0 UNRUN`; CI at `41487226`: 70 check-runs, 61 success and 9 skipped by design. https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jVTYADzVWfarACx5j3 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
domain:spec#3 · os-support-ai · session_01WGufzh7cM8EmUX4T2CBNHX
Requested by Yibo Wang · project thread
Fixes #32203
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none in this change —
content/docs/data-modeling/analytics.mdx("How it runs", hand-written) documents the single dataset door; the batch sentence is owed when the server mounts the batch door, so it is a follow-up carried by #32200, not written here (the door does not exist yet). No page underskills/**documents the dataset query door (git grep "dataset/query" -- skills: zero hits).Prior rulings read: dataset,batch,analytics,datasetselection → 26 hits; ADR-0021 D1, ADR-0149 D6, ADR-0021 D2, ADR-0021 D3, ADR-0033 Decision §7, ADR-0034 Decision §4, ADR-0035 Decision §5, ADR-0045 Decision §1, ADR-0045 Decision §4, ADR-0054 Decision §3; thread: none; repo: objectstack-ai/objectstack. None rules on a batch of dataset queries: ADR-0021 D1–D3 fix the dataset as the one analytical source and the selection-by-name shape, which the batch reuses unchanged; the
batchhits are record-write batches (ADR-0033/0034/0035/0045).Carried: #32200 (
domain:server, the batch door: mount it, enforceDATASET_QUERY_BATCH_MAX_QUERIES, run each query through the single door's parse and reads, answer throughsendOk/sendError, plus the@objectstack/clientmethod) and #32165 (domain:ui, the console half: one batched request per dashboard render, after #32200).维护者速读
packages/spec/src/api/analytics.zod.ts新增“批量数据集查询”的请求与应答格式:一次请求最多带 50 个单个查询的请求体,应答按顺序每项给出结果或该项自己的拒绝。POST /analytics/dataset/query(Chart Gallery 18 次);服务端批量门(analytics: one request answers every dataset query of a dashboard render, so a dashboard stops sending one POST per widget #32200)和界面(Dashboards issue one analytics query per widget (18 on Chart Gallery), and KPI cards repeat their title and truncate large values #32165)需要先有一份共同的契约。analytics.zod.ts新增的DatasetQueryBatchRequestSchema文档注释(何时整批拒绝、为何不在批量层解析查询内容);DatasetQueryBatchEntrySchema的两个分支;analytics-dataset-batch.test.ts。pnpm --filter @objectstack/spec exec vitest run src/api/analytics-dataset-batch.test.ts,预期 15 个测试全绿。What changes
DATASET_QUERY_BATCH_MAX_QUERIES = 50, exported for the server that enforces it and the client that splits by it. Why 50: the batch serves one dashboard render (9 queries on Delivery Operations and 18 on Chart Gallery, QA QA run · all (64/355) · ff04ad81 · 2026-11-10 · 13 PASS / 49 PARTIAL / 1 FAIL / 1 BLOCKED / 291 NOT-RUN #32135), so 50 holds the largest measured dashboard with room to spare, and it is the bound the record-page payload already puts on the lists one request may name (RECORD_PAGE_MAX_RELATED). An unbounded list would be unbounded executor work behind one request and one timeout; a render with more queries sends consecutive batches.DatasetQueryBatchRequestSchema—{ queries: [...] }, strict, one to 50 entries. Each entry is one single-door body ({ dataset | datasetName, selection, previewDrafts? }), declared as a JSON object whose members the batch does not parse: the server judges each with the single door's own outer-body check, selection parse, dataset resolution and permission / row-level / field-level reads, as the same caller (analytics: one request answers every dataset query of a dashboard render, so a dashboard stops sending one POST per widget #32200: "no second parse; reuse the single door's parse per entry"). A second parse at the batch level would refuse a whole batch for one malformed query and could disagree with the single door.results[i]answersqueries[i]; the caller already holds the order it sent. An id would be a second identity to keep unique, and uniqueness by a member is a rule the published JSON Schema cannot state (uniqueItemsjudges whole items), so it would add a dropped refinement and one more whole-batch refusal.DatasetQueryBatchEntrySchema— exactly one of{ data }(the single door's 200 answer,AnalyticsResultResponseSchema.shape.datataken by reference) or{ status, error }(the single door's HTTP status, 400–599, and its refusal in the house error envelopeApiErrorSchema, closedcodevocabulary). Both arms strict, so a refused query cannot read as an empty result.DatasetQueryBatchResponseSchema—BaseResponseSchema.extend({ data: { results } }), the sibling pattern. One refused query never fails the others;successistruewhenever the batch was accepted. A whole-batch refusal is the error envelope with nodata:400 { success: false, error: { code: 'VALIDATION_FAILED', message } }for an empty or over-long list, a missingqueries, an undeclared key beside it, or an entry that is not an object. Refusals that depend on no query (not authenticated, no analytics service) answer the whole request with the single door's status.z.input+Parsedfor the request, entry and response, exported the way the siblings are.api-surface/api.json,export-origins/api.json,declaration-map/api.json,json-schema.manifest/api.json,authorable-surface/api.json(5 new keys, henceMetadata-protocol: added), the reference pagecontent/docs/references/api/analytics.mdx+ index, the strictness-ledger counts, and twodropped-refinements.baseline.jsonrows (measured counts 259→261 / 1046→1048). Those two rows are not a new rule: they are the existingdrillScopes.valueType.lazysite ofapi/AnalyticsResultResponse, inherited because the answer entry reuses thatdatamember.@objectstack/specminor.Out of scope, untouched: the server door (#32200), the console client (#32165),
packages/rest,packages/services/**, and the single door's request and answer.Tests
packages/spec/src/api/analytics-dataset-batch.test.ts(15 tests): a valid batch parses and keeps order; exactly 50 parses; empty (too_small), 51 (too_big), a non-object entry and a missingqueries(invalid_type), and a key besidequeries(unrecognized_keys) are refused; a selection the single door refuses does not refuse the batch; an answer mixing a success and a refusal parses in order; an answered entry is the single answer member for member; a refused entry takes the house envelope and an unregistered code is refused; an entry with both arms, neither, or onlyerroris refused; a refused status of 200 is refused and 503 accepted; the single door's fault body relayed as is ({ code: 'ANALYTICS_QUERY_FAILED', error }) is refused as an entry while the mapped refusal parses, as does a 422 carrying adeclaredCode(added by the review's should-fix commit2d073d9a). Key-set pins onDatasetSelectionSchema,AnalyticsResultResponseSchema, itsdataand itsfields[]element, measured atorigin/main3ca6108 before the batch was written.Ablation (one, through
scripts/ablation-replace.mjs, tests readsrcso no build leg): drop the bound,.min(1).max(DATASET_QUERY_BATCH_MAX_QUERIES)→.min(1): anchor 1→0, blobaaf92bfeffd2→3a661b07025d;analytics-dataset-batch.test.ts1 failed | 13 passed (refuses one query over the bound); restored, blob == HEADaaf92bfeffd2,git diff HEADempty. (analytics.zod.tsblob is the same at the pushed head.)All readings at head
d5c08423bd(merge baseorigin/main3ca6108), on a shared box.Spec suite, typecheck, changeset level axis
pnpm --filter @objectstack/spec test(os-verify-lock, VERDICT command-exit 0): Test Files 833 passed | 1 skipped (834); Tests 26568 passed | 1 skipped | 1 todo. Read atc6c65001; the only later change is one assertion inanalytics-dataset-batch.test.ts, re-run alone: 14 passed (14). After the review's should-fix commit2d073d9athe dev reports 15 passed (15); CI on that head is the reading of record.pnpm --filter @objectstack/spec typecheck(os-verify-lock,--max-old-space-size=8192, sincecheck:test-typecheckran out of heap at 4096): VERDICT command-exit 0,tsc --noEmit,check:scripts-typecheckandcheck:test-typecheckgreen.GITHUB_EVENT_NAME=pull_request node scripts/check-changeset-no-major.mjs --base origin/main --event(this body): exit 0, "declares clause-②yes (widening)and metadata-protocoladded, and no package … is gradedpatch". Control withMetadata-protocol: none: exit 1, "moves a metadata-protocol baseline the ratchets record".Dispatch gates (106 derived, 0 NOT-MEASURED)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 107 commands; each run, exit code captured before any pipe; record/mnt/project-files/issue-32203/gates-ran.list.d5c08423bd. A first pass atc6c65001hadcheck:error-code-casingexit 1 on a lowercase'answered'literal in the new test (fixed ind5c08423bd) and five exit-3 prerequisite refusals (unbuiltlint/formula/client-react/objectql, stale spec dist, shallow clone), cleared by building andgit fetch --unshallowbefore the second pass.dispatch-gates --ran: "106 derived famil(ies) accounted for — 106 run, 0 NOT-MEASURED".Acceptance notes
AnalyticsResult(analytics-routes.tsendsres.json(result);client.analytics.queryDatasetreadsres.json()), notAnalyticsResultResponseSchema's envelope — so an answered entry carries that schema'sdatamember, not the envelope; (2) the single door's outer body (dataset/datasetName/previewDrafts/selection) has no spec schema — it is judged byDATASET_QUERY_BODY_KEYSinpackages/rest/src/analytics-dataset-body-door.ts;DatasetSelectionSchemacovers onlyselection. The batch therefore reuses the single door's judgement per entry instead of declaring a second copy of that body.detail(singular), a keyApiErrorSchemadoes not declare; an entry carrying it parses (the envelope is not strict) and the key is stripped by a parse. Observation only; noted for analytics: one request answers every dataset query of a dashboard render, so a dashboard stops sending one POST per widget #32200, which relays that body.