Repository navigation
Commit 5cba8fc
test(dogfood): packaged-action-disabled-dispatch-live picks a not-done task and reads its own ledger row (#27066)
Fixes #26952
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:只改一个 dogfood 测试文件,让「禁用打包动作」测试挑一个确定未完成的任务,并让 acceptance[5]
自己读取账本行。
- 为什么改:原来不加过滤和排序地取第一条任务,种子数据里有已完成的任务,取到它时 acceptance[0] 失败并连带
acceptance[5],main 已连续变红六次。
- 风险与回滚:纯测试改动,不动产品代码,产品断言(409 `ACTION_DISABLED`、零写入)原样保留;回滚即 revert 本
PR。
-
先看:`packages/qa/dogfood/test/packaged-action-disabled-dispatch-live.dogfood.test.ts`
的 `beforeAll` 取任务一段和 acceptance[5] 开头。
- 两分钟验证:`pnpm --filter @objectstack/dogfood exec vitest run
test/packaged-action-disabled-dispatch-live.dogfood.test.ts`,预期 8/8 通过。
- 需要你做的:无,席位落地。
## What changes
`packages/qa/dogfood/test/packaged-action-disabled-dispatch-live.dogfood.test.ts`,
test-only:
1. **A provably not-done pick.** `beforeAll` took `GET
/data/showcase_task?$top=1` with no filter and no order. The showcase
seed carries `done: true` tasks
(`examples/app-showcase/src/data/seed/index.ts`, the first seeded task
is one), so the first row could already be done. It now reads
`$filter={"done":false}&$orderby=id&$top=1`. That is the JSON `$filter`
and `$orderby` spelling other dogfood files already use against this
data door, for example `activity-withheld-update.dogfood.test.ts`. The
setup then asserts `done === false` on the picked row before any switch
flips, so a bad pick fails `beforeAll` with the sentence `setup: task ID
was picked as not done`, not as acceptance[0].
2. **acceptance[5] no longer depends on acceptance[0]'s variable.** The
file-level `markDoneRowId` is gone. acceptance[5] reads the
`showcase_mark_done` ledger row itself before the reboot, asserting it
exists with the message `acceptance[0] disables showcase_mark_done; this
clause re-reads the ledger row it wrote`, and then pins that the same
row id survives the cold boot and the re-enable. acceptance[0] still
asserts that exactly one ledger row exists.
Unchanged: both 409 `ACTION_DISABLED` answers, the engine sentence, the
`{done, progress, updated_at}` before/after equality, and `after.done
=== false`. No skip, no retry, no quarantine.
## Why
Six main push reds since 21:56Z on `Dogfood Regression Gate (3/3)` were
this file, with the same two clauses each time: acceptance[0] `expected
true to be false` and the acceptance[5] cascade `expected '…' to be
undefined`.
## Acceptance notes
**Siblings that take `?$top=1` from a seeded object** (read on
`origin/main` `cb8988ee14`). None asserts on the picked row's state, so
none has this defect, and none is changed:
- `api-key-owner-revoke`: `/data/showcase_task?$top=1` is an auth probe.
Only the status (200, or 403 `API_KEY_REVOKED`) is read.
- `bearer-lane-password-change`: two auth probes (403
`PASSWORD_RESET_REQUIRED`, then 200). Status only.
- `data-request-shape-live`: the row is a handle. It PATCHes `title` and
reads `updated_at` as a version token. The task's only validation is the
`status` state machine, which a title PATCH never touches, so a done row
behaves the same.
- `identity-admin-fields-org-peer`: no `$top=1`. The seat's grep matched
`$top=100`.
- `internal-field-data-door-positions`: an api-key auth probe. Status
200 only.
- `permission-set-assignment-window`: `door()` returns the status only.
- `rest-config-contract-live`: the row id is a mount probe handle.
`expectMounted` reads the routing answer, not the row.
- Also matched by the substring grep, all harmless:
`comment-thread-parent-pair` and `activity-withheld-row-predicate` read
`.total` under a filter. `activity-withheld-update` pages with a filter
and `$orderby=timestamp asc`. `master-detail-batch-atomic` and
`related-list-server-paging-and-gate` use `$top=10` or more.
**skip-changeset:** `@objectstack/dogfood`
(`packages/qa/dogfood/package.json`) is `"private": true` and declares
no `files[]`. There is no `packages/qa/package.json`. Nothing under
`dogfood/test/**` ships.
**CI note:** `dispatch-gates` reports that `Dogfood Regression Gate`
does not run on `pull_request` or `merge_group`. Its first CI run on
this change is the main push battery after the merge, so the local runs
below are this PR's evidence for the file.
## Verification
Head `aaaa7f96`, built with `pnpm turbo run build
--filter=@objectstack/dogfood` (exit 0). Each run used the dogfood
package's own vitest config (`|isolated|` project), the same config CI's
shard uses, as a single file.
<details><summary>Reproduction on the ORIGINAL file: done-first state
forced, acceptance[0] and [5] fail exactly as on main</summary>
A scratch copy, not committed, of the `origin/main` file PATCHes the
unordered `?$top=1` task to `{ done: true, progress: 100 }` right after
sign-in:
```
SCRATCH done-first row G2I6Iw9nF_S2Pdv5 true
× acceptance[0]: the REST door answers 409 ACTION_DISABLED with the engine's sentence and writes nothing 112ms
× acceptance[5] / [2]: after a cold boot the switch holds; re-enabling updates the same row and re-arms dispatch 1911ms
AssertionError: expected true to be false // Object.is equality
❯ test/zz-scratch-26952.dogfood.test.ts:158:24
AssertionError: expected 'K_wXNbQ0V8WU76yh' to be undefined // Object.is equality
❯ test/zz-scratch-26952.dogfood.test.ts:249:29
Tests 2 failed | 6 passed (8)
os-verify-lock: VERDICT command-exit 1
```
</details>
<details><summary>The FIXED file against the same done-first state:
green</summary>
The same injection applied to this PR's file:
```
SCRATCH done-first row 4wyelL2XgkXDo2eH true
Test Files 1 passed (1)
Tests 8 passed (8)
os-verify-lock: VERDICT command-exit 0
```
The filter is really applied: a second variant forces the **id-ordered**
first task (`$orderby=id&$top=1`, unfiltered) to done. The fixed pick
still skips it and stays green:
```
SCRATCH done-first row -Pm8fzBxJ3PIse1h true
Tests 8 passed (8)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>The committed file, 3 consecutive runs</summary>
```
Test Files 1 passed (1)
Tests 8 passed (8)
Test Files 1 passed (1)
Tests 8 passed (8)
Test Files 1 passed (1)
Tests 8 passed (8)
```
</details>
<details><summary>Typecheck, lint, derived gates</summary>
- `pnpm --filter @objectstack/dogfood typecheck`: exit 0. The tsconfig
`include: ["test/**/*"]` covers the file.
- `eslint --no-inline-config` on the file: exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands`: 51 commands derived
and 51 run. 49 exited 0 and 2 exited 3 (PREREQUISITE NOT MET, so NOT
MEASURED):
- `check-plugin-teardown-shape --self-test` needs an unshallow clone for
its pinned positive control, and grades only the checker.
- `check:dual-build-cjs-loads` needs dist for packages outside the
dogfood closure.
- `--ran` reconciliation: `51 derived famil(ies) accounted for — 49 run,
2 NOT-MEASURED (2 DERIVED from a recorded exit 3)`.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYnxoqB6x8ynuZJhzXk)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent f708cf2 commit 5cba8fc
1 file changed
Lines changed: 19 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
68 | | - | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
| |||
152 | 160 | | |
153 | 161 | | |
154 | 162 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 163 | + | |
158 | 164 | | |
159 | 165 | | |
160 | 166 | | |
| |||
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
236 | 248 | | |
237 | 249 | | |
238 | 250 | | |
| |||
0 commit comments