Repository navigation
Commit e78d705
test(dogfood): pin five more records-forms checklist items at the REST door (slice 3) (#26865)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8EZuqRp2sWT5mEbwB3fUdmh)_
Refs #26573 (slice 3, items: `field-type-matrix`,
`field-unique-enforcement`, `import-wizard-encoding-and-hints`,
`master-detail-atomic-save`, `object-hook-lifecycle`)
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:records-forms 区按卡片顺序的下 5 个清单项,新增 6 个 dogfood
测试文件(object-hook-lifecycle 分 showcase 与 scratch 两个),在真实启动的栈上经 REST
门(以及服务端日志)断言它们的 api/log 条款,5 项 `automated.ref` 指向新钉测,revision 各加
1,history 引本卡。
- 为什么改:18.2.0 Tier 1 扫描把这些条款判为 PARTIAL 或无钉测;钉在 oracle 层之后每次发版可直接复跑。
- 风险与回滚:只加测试和清单文字,不动产品代码、不加 CI 车道;新文件落在 dogfood 现有的 isolated 项目。回滚即
revert 本 PR。
- 先看:`field-unique-rest-refusal.dogfood.test.ts`(实测:global 单列索引时面向用户的
`error` 用 API 键名 gsku,developerMessage 用标签,见 Acceptance
notes);`object-hook-lifecycle-*.dogfood.test.ts`(日志经 stdout/stderr
截取读回)。
- 两分钟验证:先建依赖闭包,再 `pnpm --filter @objectstack/dogfood exec vitest run
--maxWorkers=2 test/field-type-matrix-server-refusals.dogfood.test.ts
test/field-unique-rest-refusal.dogfood.test.ts
test/import-lands-readable-rows.dogfood.test.ts
test/master-detail-batch-atomic.dogfood.test.ts
test/object-hook-lifecycle-showcase.dogfood.test.ts
test/object-hook-lifecycle-scratch.dogfood.test.ts`,预期 6 个文件 23
个用例全绿;`node scripts/check-platform-checklist.mjs` 预期 OK。
- 需要你做的:无,席位落地。
## What changes
Six new dogfood files drive the REST doors of a booted stack (the
showcase as shipped, or a scratch app where the item prescribes one),
and two read the server log off stdout/stderr for the item's `log`
oracles:
| Item (rev → new) | Clauses now pinned | Pin |
|---|---|---|
| `field-type-matrix` (6 → 7) | acceptance[2], acceptance[5] refusal
half, acceptance[6], negative[0]–[1] |
`field-type-matrix-server-refusals.dogfood.test.ts`: zoo refusals
(invalid_option, required, reference_not_found on f_lookup /
f_master_detail / f_tree) with the row count read back; invoice totals
vs their lines; EXP-2001's two roll-ups |
| `field-unique-enforcement` (10 → 11, kind unit → dogfood) |
acceptance[0]–[3], negative[0]–[2] |
`field-unique-rest-refusal.dogfood.test.ts`: the item's scratch object
on the SQL family |
| `import-wizard-encoding-and-hints` (7 → 8) | acceptance[3] server
half, negative[1] | `import-lands-readable-rows.dogfood.test.ts`: `POST
/data/showcase_contact/import`, created count vs a filtered GET, CJK
values byte-identical |
| `master-detail-atomic-save` (8 → 9) | acceptance[1], [2], [3],
acceptance[5] persisted half, negative[0] |
`master-detail-batch-atomic.dogfood.test.ts`: the cross-object `POST
/batch` with `{$ref: 0}` children, server amount and total roll-up
across add/delete, the whole-batch abort |
| `object-hook-lifecycle` (10 → 11) | acceptance[0]–[9], negative[0]–[4]
| `object-hook-lifecycle-showcase.dogfood.test.ts` (the seeded hooks:
stamp, trim, transition audit, over-budget warn) +
`object-hook-lifecycle-scratch.dogfood.test.ts` (abort, async log,
fail-closed condition, priority order) |
Each item's `automated.ref` keeps the pins it already named (as evidence
of their own layer where they sit below the oracle) and adds the new
ones with what they score. One history row per item, citing #26573. No
clause text, fixture, step or `knownGaps` line was edited (the claim's
file surface).
**Skipped, by the slice-3 order:**
- `record-discussion-mentions`: waits on #26625.
- `form-dirty-guard`: next in card order, but its only api clause
(acceptance[1]) reads the row after a browser exit (discard or save
through the guard), so every clause needs a browser.
- Not taken yet, in card order: `related-list-server-pagination`,
`v18-semantic-defaults`, `view-type-gallery`. `v18-semantic-defaults`
has browser clauses only (a1–a3 dom/screenshot, a0 the spec pins).
- Browser legs inside the five items, left unpinned: `field-type-matrix`
acceptance[1]; `import-wizard-encoding-and-hints` the wizard's
decode/preview (negative[0]); `master-detail-atomic-save` acceptance[0],
[4], negative[1] and acceptance[5]'s live recompute.
`field-unique-enforcement` acceptance[4]–[5] and negative[3] stay the
driver pins', as the item says.
## Why
The 18.2.0 release-candidate Tier 1 run scored these clauses PARTIAL
(pins below the oracle layer: driver-level, in-process engine, or
objectui unit) or unpinned. The triage ruling allows ~5-item slices and
no new CI lane; the new files fall under the dogfood package's existing
`isolated` vitest project and run where the dogfood legs run today.
## Tests
Measured answers the pins now hold (all first read live, then pinned
exactly):
- zoo: out-of-set `f_select` → `400 VALIDATION_FAILED` `[[f_select,
invalid_option]]`; no `name` → `[[name, required]]`; a fabricated id in
each relational field → `[[<field>, reference_not_found]]`; row count
unchanged each time.
- unique, bare `unique: true` (tenant-scoped, composite index) → `409
{error: 'A record with this value already exists', code:
UNIQUE_VIOLATION, developerMessage: "Duplicate record refused on 'Unique
Item': a unique constraint already holds these values. No record was
written.", object}`; `unique: 'global'` (single column) → `error: 'A
record with this gsku already exists'`, `field: 'gsku'`, and the
developerMessage names `'Global SKU'`. No `[driver-`, no `UNIQUE
constraint failed`, no bound value.
- unique, atomic `updateMany` stamping one sku on two rows → `200
{success: false, total: 2, succeeded: 0, failed: 2}`, results
`ROLLED_BACK` then `UNIQUE_VIOLATION`; both rows re-read unchanged.
- import: 3 CJK rows → `{total: 3, ok: 3, errors: 0, created: 3}`; the
filtered GET finds those 3, values identical.
- batch: invoice + 2 lines → `200`; a client-sent `amount: 1` stores as
`2 × 29.99`; total tracks the line sum after create, add and delete. A
line with no product → `400 VALIDATION_FAILED [[product, required]]`,
and neither the invoice nor the valid sibling exists.
- hooks: the showcase logs `task completed: <title>` once per transition
and `project over budget: <name> (1100 / 1000)` on the spent-only PATCH.
Scratch: abort → `400` with the hook's sentence; async throw → PATCH
kept plus `[hook] handler failed (onError=log; suppressing)` naming the
hook; `int(record.name) > 0` on a non-numeric name → `400
VALIDATION_ERROR` "Hook 'ohl_unevaluable_guard' could not evaluate its
condition … operation aborted", no source echoed, no `[REST] Unhandled
error`; priority 10 logs before 90 although declared after it.
<details><summary>Runs</summary>
- Dependency closure on `3c2187f4` (the restarted branch) under
`os-verify-lock.sh`, then the six files: `Tests 21 passed | 2 failed
(23)`, both in the unique file. The global index's `error` names the
field (`A record with this gsku already exists`), and the atomic
`updateMany` answers `200` with a per-row refusal report, not a 4xx.
Both re-pinned to the measured bodies. Then the six files → `Test Files
6 passed (6)`, `Tests 23 passed (23)`, plus the dogfood typecheck,
VERDICT command-exit 0.
- Final head `ea357b54` (after merging `origin/main` `e9e344a9`, which
brought an objectql engine refactor and metadata-protocol changes): the
closure rebuilt (`Tasks: 67 successful, 67 total`), then the six files →
`Test Files 6 passed (6)`, `Tests 23 passed (23)`, then `pnpm typecheck`
in `packages/qa/dogfood`, one locked command, VERDICT command-exit 0.
</details>
No ablation was run: this diff adds tests and changes no behaviour they
pin. Each refusal assertion has a same-door admitted control beside it,
and the two ordering/transition log pins are built so the wrong
semantics would fail them (the priority hooks are declared in the
opposite order; a bare state condition would log a second audit line).
## Acceptance notes
- `field-unique-enforcement` acceptance[0] says the user-facing `error`
"stays generic". On the tenant-scoped (composite) index it does; on the
single-column global index the wire `error` names the field by its API
key (`A record with this gsku already exists`) while `developerMessage`
names it by its label (`'Global SKU'`). The pin holds both bodies as
measured. That is the opposite split from the engine envelope's own rule
(labels in the user-facing message, API names for diagnostics, #24951),
so it is noted here as a possible finding, not filed and not changed:
product code is outside this card.
- `field-unique-enforcement` acceptance[3]: REST has no predicate-update
door. The REST door that stamps one value onto two rows in one request
is `POST /data/:object/updateMany` with `options.atomic`, so the pin
drives that, and the engine's predicate `updateMany` stays the memory
driver pin's (named in the ref).
- `master-detail-atomic-save` acceptance[1]: the product pick's
auto-fill is client-side (the grid copies `description` / `unit_price`
from the chosen product). The pin sends the catalog values and asserts
they persist; the copy itself stays a browser leg.
- `import-wizard-encoding-and-hints` acceptance[3]: the console decodes
the file and posts JSON rows to `/data/:object/import`; the pin sends
the decoded strings, so it scores the server half only.
## Verification
- `node scripts/check-platform-checklist.mjs` → exit 0, `OK — 16 areas,
329 items (324 active, 1 planned)`, on the commit `e945fc15` and on the
final head.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` → 55 commands on `e945fc15`, each run and
reconciled with `--ran`: `55 derived famil(ies) accounted for — 55 run,
0 NOT-MEASURED`, all exit 0.
- CI families are read from this PR's check-runs, not re-run locally.
`Dogfood Regression Gate` does not run on pull_request, so the local
runs above are this PR's evidence for the new pins.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (CI-owned run)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset — nothing publishes
here (`@objectstack/dogfood` is private; `docs/qa/**` ships in no
package), so `skip-changeset`; both declaration lines are filled in
above.
- [x] 6. `packages/spec` not touched.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English (the maintainer brief
above is Chinese by the repo's communication rule).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbZ3oTCkvGGTMNd5XYU)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1a8b7eb commit e78d705
7 files changed
Lines changed: 836 additions & 11 deletions
File tree
- docs/qa/platform-checklist/areas
- packages/qa/dogfood/test
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
0 commit comments