Repository navigation
Commit 912076f
test(dogfood): pin the last access-security checklist clauses at the oracle's layer, slice 4 (#26941)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8YSjPf3hTSLEBa52VUBikb4)_
Fixes #26571 (slice 4 of 4, items:
access-security.parent-and-organization-write-guards,
access-security.deployment-tables-platform-only,
access-security.share-link-combined-gates)
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:access-security 区最后 3 个清单条目补上 dogfood 断言(进程内 HTTP,即这些条款 oracle
指定的层),新增 3 个隔离用例文件,共钉住 8 条此前只在引擎层或单元层的条款。3 个条目的 `automated.ref` 逐条款改写,其中
deployment-tables-platform-only 和 share-link-combined-gates 的
`automated.kind` 改为 `dogfood`;每个条目 `revision` 加一、`history` 记本卡。本片之后
#26571 无剩余条目。
- 为什么改:18.2.0 Tier 1 记录 #26468 把这 3 条判为
PARTIAL:组织字段清空拒绝、表头存在性对等、部署级表的两类人员、分享链接组合关卡,都没有走 HTTP 的断言。
- 风险与回滚:只加测试和改清单文字,不动产品代码,不加 CI 通道。回滚即 revert 本 PR。
- 先看:①
`parent-and-organization-write-guards.dogfood.test.ts`(posture-only
隔离启动下清空 organization_id 被 403,以及不可读与不存在表头返回相同 400);②
`share-link-combined-gates.dogfood.test.ts`(匿名各变体字节级相同的拒绝体,/resolve 与
/messages 配对);③ Acceptance notes 里关于 controlled_by_parent 明细返回 403 而非
400 的说明。
- 两分钟验证:`cd packages/qa/dogfood && pnpm exec vitest run
test/parent-and-organization-write-guards.dogfood.test.ts`(需先按 dogfood
惯例 build 依赖闭包),预期 `Tests 6 passed`。
- 需要你做的:无,席位落地。
## What changes
Each clause is pinned at the layer its oracle names: `api` is the
in-process HTTP stack of `@objectstack/verify`. All changes are in
`packages/qa/dogfood/**` plus the area ledger, with no product code
changes. Every new assertion was written against today's behaviour and
is green. All three files boot their own showcase (isolated), since each
writes records, mints links or creates an organization.
| item | clauses newly pinned | where |
|---|---|---|
| parent-and-organization-write-guards | acceptance[1], [2], negative[0]
| New `parent-and-organization-write-guards`. acceptance[1]: a
`multiTenant: 'posture-only'` boot (the tenancy service reports
`isolated`, the wall active and not degraded, asserted). An organization
owner who is not the platform administrator PATCHes their own
`showcase_private_note` with `organization_id: null` and gets 403
`PERMISSION_DENIED`; the row keeps its organization, and the same
caller's PATCH that leaves the column alone is admitted. Inserts sending
`organization_id` `null` and `''` are stamped with the caller's active
organization. acceptance[2] / negative[0]: a member holding a scratch
set that writes `showcase_task` and whose row policy selects no
`showcase_project` POSTs a task naming a seeded project it cannot read
(asserted) and one naming a project id that exists nowhere. Both answer
400 with `reference_not_found`, and the bodies are equal field by field
once the named id is normalised. Nothing lands, and the admin's
identical POST lands. The same parity is measured on the
`controlled_by_parent` invoice line, as described in the Acceptance
notes |
| deployment-tables-platform-only | acceptance[1], [2] | New
`deployment-tables-platform-only`. A Default Organization member's
`sys_member` role is promoted to `admin`. A guard asserts it resolves an
`organization_admin` set, holds no `manage_platform_settings`, and is
not the platform administrator. On each of the seven tables (`sys_job`,
`sys_job_queue`, `sys_job_run`, `sys_migration`,
`sys_migration_journal`, `sys_flow_dispatch`, `sys_presence`), `GET
/api/v1/data/TABLE` is 403 `PERMISSION_DENIED` for the org admin and 200
for the platform administrator. The platform administrator's URL-encoded
`organization_id` filter is 400 `INVALID_FIELD` on each |
| share-link-combined-gates | acceptance[1], [2], [3], negative[0] | New
`share-link-combined-gates`. The admin mints two links through `POST
/api/v1/share-links` on the seeded published client brief. Link A
(`signed_in` + password), resolved anonymously with no password, a wrong
one and the right one (UTF-8 header form), answers 401
`SIGN_IN_REQUIRED` with three byte-identical bodies. Link B (`email` +
password) answers 404 `INVALID_OR_EXPIRED` to five non-entitled
variants, byte-identical with an unknown token's body; the allowlisted
email with the right password resolves 200. The same eight calls are
paired with `/messages`: 404 `NOT_FOUND` wherever `/resolve` refused,
and 400 `UNSUPPORTED` on the one call it passed |
Ledger:
- Each of the three items gets a rewritten `automated.ref` that maps
clauses to cases, `revision` +1, and a `history` row citing #26571.
- deployment-tables-platform-only moves from `automated.kind` `unit` to
`dogfood`, and share-link-combined-gates moves from `conformance` to
`dogfood`, since each ref now leads with the dogfood pin.
parent-and-organization-write-guards was already `dogfood`.
Clauses left as they are, each with its reason in the item's
`automated.ref`:
- Every item's acceptance[0] is the pin run itself (`test` oracle).
- parent-and-organization-write-guards acceptance[3] was already pinned
over HTTP by `cbp-parent-attachment-comment-gates` and
`cbp-explain-master-write`.
No clause is left as a live leg.
## Tests
On head `bc2b4dce` (origin/main merged), with the closure rebuilt, the
three new files ran under `os-verify-lock`: `Test Files 3 passed (3)`,
`Tests 25 passed (25)` (`VERDICT command-exit 0`). That is 15 in
deployment-tables-platform-only, 4 in share-link-combined-gates and 6 in
parent-and-organization-write-guards. `pnpm --filter
@objectstack/dogfood typecheck`: exit 0. The final merge of main, right
before this PR, brought crud-permission-matrix's ledger row (#26923, no
overlap with these three items), app-shell fixes, docs, and two
runtime/metadata-protocol refusals that none of these doors read. The
full dogfood battery is CI's.
## Acceptance notes
- parent-and-organization-write-guards acceptance[2]: on the
`controlled_by_parent` line (`showcase_invoice_line`), a stock
contributor naming another contributor's invoice and one naming a
missing invoice both get the ADR-0055 §3 master-edit gate's 403
`PERMISSION_DENIED`. That gate runs before the reference check. The two
bodies are byte-identical, so negative[0] holds there, and the file pins
that. The 400 `reference_not_found` comparison is pinned on
`showcase_task`, a plain `master_detail` detail of `showcase_project`.
That matches `engine-unreadable-master-detail-header.test.ts`, whose
controls keep a `controlled_by_parent` detail unchanged. If the item's
clause is meant to require 400 on the `controlled_by_parent` fixture
too, that is a clause question for the seat, not a pin gap.
- parent-and-organization-write-guards acceptance[2]: every showcase
member reads projects through the stock baseline. So the scratch set
narrows `showcase_project` with a row policy that selects nothing, and a
guard asserts the member's by-id read is refused.
- The item's knownGaps about provisioning a walled `os serve` boot are
unchanged. They describe the live run's fixture. The pin uses the
in-process `posture-only` walled boot that
`no-active-organization-write-refusal` and `wall-catalog-refusal`
already use.
## Verification
Local gate subset on head `bc2b4dce` (origin/main merged): `node
scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derives 55 families. All 55 ran and exited
0, and `--ran` reconciles `55 derived famil(ies) accounted for — 55 run,
0 NOT-MEASURED`. Repository-wide scans (`pnpm lint`, the full dogfood
battery) are CI's.
`node scripts/check-platform-checklist.mjs`: `check-platform-checklist:
OK — 16 areas, 329 items (324 active, 1 planned)`.
Changeset: none. `@objectstack/dogfood` is private and `docs/qa/**`
ships in no package, so this PR carries `skip-changeset`.
Template note: `.github/PULL_REQUEST_TEMPLATE.md`'s `Why` section is
folded into 维护者速读 and What changes. Its Human Minimum items: 1 n/a (no
spec); 2 yes; 3 no formatter ran, and `pnpm lint` is left to CI; 4 yes;
5 n/a (publishes nothing); 6 n/a; 7 yes; 8 yes.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbWKBLcQCG7FBS17aMA)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent e269d3b commit 912076f
4 files changed
Lines changed: 475 additions & 8 deletions
File tree
- docs/qa/platform-checklist/areas
- packages/qa/dogfood/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4228 | 4228 | | |
4229 | 4229 | | |
4230 | 4230 | | |
4231 | | - | |
| 4231 | + | |
4232 | 4232 | | |
4233 | 4233 | | |
4234 | 4234 | | |
| |||
4286 | 4286 | | |
4287 | 4287 | | |
4288 | 4288 | | |
4289 | | - | |
| 4289 | + | |
4290 | 4290 | | |
4291 | 4291 | | |
4292 | 4292 | | |
| |||
4330 | 4330 | | |
4331 | 4331 | | |
4332 | 4332 | | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
4333 | 4339 | | |
4334 | 4340 | | |
4335 | 4341 | | |
| |||
4338 | 4344 | | |
4339 | 4345 | | |
4340 | 4346 | | |
4341 | | - | |
| 4347 | + | |
4342 | 4348 | | |
4343 | 4349 | | |
4344 | 4350 | | |
| |||
4381 | 4387 | | |
4382 | 4388 | | |
4383 | 4389 | | |
4384 | | - | |
4385 | | - | |
| 4390 | + | |
| 4391 | + | |
4386 | 4392 | | |
4387 | 4393 | | |
4388 | 4394 | | |
| |||
4407 | 4413 | | |
4408 | 4414 | | |
4409 | 4415 | | |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
4410 | 4422 | | |
4411 | 4423 | | |
4412 | 4424 | | |
| |||
4415 | 4427 | | |
4416 | 4428 | | |
4417 | 4429 | | |
4418 | | - | |
| 4430 | + | |
4419 | 4431 | | |
4420 | 4432 | | |
4421 | 4433 | | |
| |||
4464 | 4476 | | |
4465 | 4477 | | |
4466 | 4478 | | |
4467 | | - | |
4468 | | - | |
| 4479 | + | |
| 4480 | + | |
4469 | 4481 | | |
4470 | 4482 | | |
4471 | 4483 | | |
| |||
4496 | 4508 | | |
4497 | 4509 | | |
4498 | 4510 | | |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
| 4515 | + | |
| 4516 | + | |
4499 | 4517 | | |
4500 | 4518 | | |
4501 | 4519 | | |
| |||
| 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 | + | |
0 commit comments