Repository navigation
Commit 8b27638
test(dogfood): pin five records-forms checklist items at the REST door (slice 1) (#26788)
<!-- 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 1 of about 5 items:
`predicate-relationship-traversal`,
`write-answer-advisories-rollback-and-tree-delete`,
`comment-reactions-and-edit-stamps`, `encrypted-field-behavior`,
`write-time-option-and-element-shape-judgement`)
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:records-forms 区 5 个清单项的 api 条款原先只有引擎层/进程内的钉测,现在新增 5 个 dogfood
测试文件,在真实启动的栈上经 REST 门断言这些条款,并把 5 项的 `automated.ref` 改为指向新钉测(revision 各加
1,history 引本卡)。
- 为什么改:18.2.0 Tier 1 扫描把这些条款判为 PARTIAL(钉测低于条款 oracle
的层);按维护者「同意」的分卡,每次发版都要补跑活腿,钉在 oracle 层之后就是常驻可复跑的证据。
- 风险与回滚:只加测试和清单文字,不动产品代码、不加 CI 车道;新文件跑在现有 dogfood 腿里(isolated 项目)。回滚即
revert 本 PR。
-
先看:`packages/qa/dogfood/test/encrypted-field-behavior.dogfood.test.ts`(无加密提供者的
fail-closed 腿是启动后把引擎的 provider
置空,看这个建模是否可接受);`packages/qa/dogfood/test/comment-reactions-and-edit-stamps.dogfood.test.ts`(实测码
405 / 403);`docs/qa/platform-checklist/areas/records-forms.json` 的 5 处
`automated` 与 history。
- 两分钟验证:`pnpm --filter @objectstack/dogfood exec vitest run
--maxWorkers=2 test/predicate-relationship-traversal.dogfood.test.ts
test/write-answer-warnings-rest.dogfood.test.ts
test/comment-reactions-and-edit-stamps.dogfood.test.ts
test/encrypted-field-behavior.dogfood.test.ts
test/write-time-option-and-element-shape.dogfood.test.ts`(先建依赖闭包),预期 5
个文件 22 个用例全绿;`node scripts/check-platform-checklist.mjs` 预期 OK。
- 需要你做的:无,席位落地。
## What changes
Five new dogfood files, each booting a real stack through
`@objectstack/verify` and driving the REST doors (`/data/:object`,
`/data/:object/query`, `/data/:object/import`), so these api clauses are
pinned at the layer their oracle names:
| Item (rev → new) | Clauses now pinned over REST | Pin |
|---|---|---|
| `predicate-relationship-traversal` (4 → 5) | acceptance[0]–[3],
negative[0]–[2] | `predicate-relationship-traversal.dogfood.test.ts` —
the showcase invoice rule as shipped, plus the scratch pair
`fixtures.knownGaps` describes for a member with no parent grant |
| `write-answer-advisories-rollback-and-tree-delete` (2 → 3) |
acceptance[1]; acceptance[2] and negative[0] |
`write-answer-warnings-rest.dogfood.test.ts` (new) reads the PATCH
body's `warnings[]`; the existing
`hook-after-abort-rollback.dogfood.test.ts` already refused the aborting
create over REST and read the store back, and is now named |
| `comment-reactions-and-edit-stamps` (3 → 4) | acceptance[1]–[3] |
`comment-reactions-and-edit-stamps.dogfood.test.ts` — org-bound comments
fixture + plugin-audit, the member armed (`assertArmed`) as `org_member`
|
| `encrypted-field-behavior` (5 → 6) | acceptance[2]–[4],
negative[1]–[3] | `encrypted-field-behavior.dogfood.test.ts` — showcase
field zoo for the echoed mask and the aggregate refusal; a scratch
object on an engine left with no crypto provider for fail-closed |
| `write-time-option-and-element-shape-judgement` (1 → 2) |
acceptance[1]–[4] |
`write-time-option-and-element-shape.dogfood.test.ts` — scratch app:
faulting option gate, kept-option import, matched-row dry run,
multi-lookup element shape |
Each item's `automated.ref` names the new pin and what it scores; the
existing engine/unit pins stay named as acceptance[0]'s pins and as
evidence of their own layer (RUNNER rule 6). One history row per item,
citing #26573. No clause text, fixture, step or `knownGaps` line was
edited (the claim's file surface).
Left out of this slice: `record-discussion-mentions` a9 (needs the
#26625 walled two-organization recipe) and the browser/dom-oracle items,
which need Playwright or live-boot specs.
## Why
The 18.2.0 release-candidate Tier 1 run scored these clauses PARTIAL:
every pin was green, but each asserted the clause below its oracle's
layer (in-process protocol calls, ObjectQL directly, or an ObjectKernel
with no HTTP adapter). A pin at the oracle's layer turns a release-sweep
live leg into a standing, re-runnable proof. 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):
- reaction PATCH → `405 OBJECT_API_METHOD_NOT_ALLOWED` (the object's
`apiMethods` offers no update); foreign reaction DELETE → `403
PERMISSION_DENIED` with the member holding the object delete bit, so the
refusal is the own-record floor; own DELETE is the 2xx control.
- the warning-rule PATCH → `200` with `warnings: [{ rule:
project_health_progression, severity: warning, field: health, code:
invalid_transition, message }]`; one-step change and the create answer
carry no `warnings` key.
- faulting option → `400 VALIDATION_FAILED`, `tier` / `rule_violation`,
`constraint.rule: visibleWhen`, `constraint.reason: unevaluable`.
- multi-lookup elements `{id}`, `false`, `42` → `400` `refs` /
`invalid_type`, `constraint.detail` starting `at index 1:`.
- credential group-by / MIN / MAX over `POST
/data/showcase_field_zoo/query` → `400 INVALID_FIELD`; a group-by on
`name` is the `200` control.
- fail-closed secret POST → `500 INTERNAL_ERROR` and no row stored; a
password write on the same engine → `201`, masked on read.
<details><summary>Runs</summary>
- Dependency closure: `pnpm exec turbo run build
--filter='@objectstack/dogfood^...' --concurrency=2` under
`os-verify-lock.sh` → `Tasks: 67 successful, 67 total`, VERDICT
command-exit 0.
- First run (pre-merge head): `pnpm --filter @objectstack/dogfood exec
vitest run --maxWorkers=2` over the five files → `Test Files 5 passed
(5)`, `Tests 22 passed (22)`.
- After merging `origin/main` (head `8919aecc`, which brought a
driver-sql refactor): `pnpm --filter @objectstack/driver-sql build`,
then the five files plus `hook-after-abort-rollback.dogfood.test.ts` →
`Test Files 6 passed (6)`, `Tests 28 passed (28)`, VERDICT command-exit
0.
- `pnpm --filter @objectstack/dogfood typecheck` (`tsc --noEmit`) →
VERDICT command-exit 0.
- Final head `5db5a474` (after merging `origin/main` with #26337): the
dependency closure rebuilt (`Tasks: 67 successful, 67 total`), then the
five files plus `hook-after-abort-rollback.dogfood.test.ts` → `Test
Files 6 passed (6)`, `Tests 28 passed (28)`, then `pnpm --filter
@objectstack/dogfood typecheck`, one locked command, VERDICT
command-exit 0.
</details>
No ablation was run: this diff adds tests and changes no behaviour they
pin (os-dev: ablation only where the diff changes a pinned behaviour).
Each refusal assertion has a same-door admitted control beside it, so
none passes on a door that refuses everything.
## Acceptance notes
- `encrypted-field-behavior` acceptance[3]: `bootStack` always wires a
crypto provider, so the fail-closed leg unsets it once after bootstrap
(`engine.setCryptoProvider(undefined)`), before any request. That is the
engine state of a boot that never wired one; no stock composition boots
that way, so on a live stock boot the clause stays blocked(fixture).
`fixtures.knownGaps[1]` still says the path has "NO live leg"; it is
still true of a live boot, and its rewording is left to an item-text
pass since this slice's surface is `automated.ref` / `revision` /
`history` only. The refusal arrives as the sanitised `500
INTERNAL_ERROR`, because the engine throws a plain `Error`: noted, not
filed, since an unwired provider is a host composition fault, not an
author error.
- `predicate-relationship-traversal` acceptance[3]: now scored live on
the scratch substitute the item's `fixtures.knownGaps` already
prescribes, rather than only from the engine pin.
- `write-answer-advisories…` acceptance[2] / negative[0] were already
pinned over REST by `hook-after-abort-rollback.dogfood.test.ts` (it
reads the store back through the engine rather than a list count);
revision 2 did not name it.
## Verification
- `node scripts/check-platform-checklist.mjs` → exit 0, `OK — 16 areas,
329 items (324 active, 1 planned)`.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` → 55 commands on head `8919aecc`, each run
and reconciled with `--ran`: `55 derived famil(ies) accounted for — 54
run, 1 NOT-MEASURED`. The NOT-MEASURED one is `pnpm
check:dual-build-cjs-loads` (exit 3, PREREQUISITE NOT MET: it reads
every package's `dist/` and this worktree built only the dogfood
closure); CI runs it. `check-plugin-teardown-shape --self-test` first
exited 3 on the shallow clone and is exit 0 after `git fetch
--unshallow`.
- After merging `origin/main` again (it brought #26337, which touches
`coverage.json` and `packages/qa/dogfood/test`):
`check-platform-checklist` exit 0 on the new head; the five files are
re-run there (see Runs).
- CI families are read from this PR's check-runs, not re-run locally.
## 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 f7c95cd commit 8b27638
6 files changed
Lines changed: 880 additions & 11 deletions
File tree
- docs/qa/platform-checklist/areas
- packages/qa/dogfood/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4182 | 4182 | | |
4183 | 4183 | | |
4184 | 4184 | | |
4185 | | - | |
| 4185 | + | |
4186 | 4186 | | |
4187 | 4187 | | |
4188 | 4188 | | |
| |||
4254 | 4254 | | |
4255 | 4255 | | |
4256 | 4256 | | |
4257 | | - | |
| 4257 | + | |
4258 | 4258 | | |
4259 | 4259 | | |
4260 | 4260 | | |
| |||
4294 | 4294 | | |
4295 | 4295 | | |
4296 | 4296 | | |
| 4297 | + | |
| 4298 | + | |
| 4299 | + | |
| 4300 | + | |
| 4301 | + | |
| 4302 | + | |
4297 | 4303 | | |
4298 | 4304 | | |
4299 | 4305 | | |
| |||
5029 | 5035 | | |
5030 | 5036 | | |
5031 | 5037 | | |
5032 | | - | |
| 5038 | + | |
5033 | 5039 | | |
5034 | 5040 | | |
5035 | 5041 | | |
| |||
5088 | 5094 | | |
5089 | 5095 | | |
5090 | 5096 | | |
5091 | | - | |
5092 | | - | |
| 5097 | + | |
| 5098 | + | |
5093 | 5099 | | |
5094 | 5100 | | |
5095 | 5101 | | |
| |||
5120 | 5126 | | |
5121 | 5127 | | |
5122 | 5128 | | |
| 5129 | + | |
| 5130 | + | |
| 5131 | + | |
| 5132 | + | |
| 5133 | + | |
| 5134 | + | |
5123 | 5135 | | |
5124 | 5136 | | |
5125 | 5137 | | |
| |||
5355 | 5367 | | |
5356 | 5368 | | |
5357 | 5369 | | |
5358 | | - | |
| 5370 | + | |
5359 | 5371 | | |
5360 | 5372 | | |
5361 | 5373 | | |
| |||
5412 | 5424 | | |
5413 | 5425 | | |
5414 | 5426 | | |
5415 | | - | |
| 5427 | + | |
5416 | 5428 | | |
5417 | 5429 | | |
5418 | 5430 | | |
| |||
5426 | 5438 | | |
5427 | 5439 | | |
5428 | 5440 | | |
| 5441 | + | |
| 5442 | + | |
| 5443 | + | |
| 5444 | + | |
| 5445 | + | |
| 5446 | + | |
5429 | 5447 | | |
5430 | 5448 | | |
5431 | 5449 | | |
| |||
5434 | 5452 | | |
5435 | 5453 | | |
5436 | 5454 | | |
5437 | | - | |
| 5455 | + | |
5438 | 5456 | | |
5439 | 5457 | | |
5440 | 5458 | | |
| |||
5485 | 5503 | | |
5486 | 5504 | | |
5487 | 5505 | | |
5488 | | - | |
| 5506 | + | |
5489 | 5507 | | |
5490 | 5508 | | |
5491 | 5509 | | |
| |||
5504 | 5522 | | |
5505 | 5523 | | |
5506 | 5524 | | |
| 5525 | + | |
| 5526 | + | |
| 5527 | + | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
5507 | 5531 | | |
5508 | 5532 | | |
5509 | 5533 | | |
| |||
5512 | 5536 | | |
5513 | 5537 | | |
5514 | 5538 | | |
5515 | | - | |
| 5539 | + | |
5516 | 5540 | | |
5517 | 5541 | | |
5518 | 5542 | | |
| |||
5565 | 5589 | | |
5566 | 5590 | | |
5567 | 5591 | | |
5568 | | - | |
| 5592 | + | |
5569 | 5593 | | |
5570 | 5594 | | |
5571 | 5595 | | |
| |||
5590 | 5614 | | |
5591 | 5615 | | |
5592 | 5616 | | |
| 5617 | + | |
| 5618 | + | |
| 5619 | + | |
| 5620 | + | |
| 5621 | + | |
| 5622 | + | |
5593 | 5623 | | |
5594 | 5624 | | |
5595 | 5625 | | |
| |||
0 commit comments