Repository navigation
test(scenarios): walk the working-day calendar once in the run-date oracle - #34104
Merged
Merged
Conversation
…racle The rebase oracle stepped through the calendar a day at a time for every date of every card on every run date, so the 2028 run dates (hundreds of working days from the cards' today) took 5-7 s on CI against vitest's 5 s default. The same day-by-day walk now runs once over 1960-2040 into a numbered table that walkShift, walkCount, onOrBefore and onOrAfter read, and leaves the implementation's arithmetic out of it as before. The stepping walkers stay, and a new case checks the table against them across the epoch week, a year end and a leap day. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRWUrXgua6hAwuKweu
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
domain:devx#2 · os-steve · session_01ADHkmQTVjryTSkqydKVS6z 席位核对 · ACCEPT · head
|
This was referenced Nov 15, 2026
This was referenced Nov 15, 2026
feat(spec)!: the AI-door confirmation rule binds every AI door, the in-app assistant included
#34001
Merged
This was referenced Nov 15, 2026
scbdzhwl
pushed a commit
to scbdzhwl/objectstack-analysis
that referenced
this pull request
Nov 16, 2026
…s hold refuses as the plain read does, naming the holders as details.candidates (ADR-0150 D3/D5) (objectstack-ai#33885) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbNTugWasvhTMrtCZiFGrZYK)_ Fixes objectstack-ai#32622 Fixes objectstack-ai#32914 Clause-②: no (narrowing) — narrowed: a layered read naming no package, of a name two or more served packages register in code, no longer serves the holder that registered first. The REST `/layers` door on a host that wires no engine for its door chain goes from 200 to 409 naming the holders, and the in-process `getMetaItemLayered` goes from resolving to throwing `PackageScopedNameRefusedError`. The REST `/published` door on a host with no `objectQLProvider` goes to 409 without `details.candidates`. Before, it served the name's package-unbound active row (200) when one stands, and otherwise its published exit (the metadata service's `getPublished` answer, or 501 when the host resolves none). The dispatcher's `/published` swallows the refusal. With no such row it serves its snapshot as before; with one, it moves from that row to the code snapshot (read from the tree). A name one package holds, and every read naming the package, answer as before. Metadata-protocol: none Skills-docs: none — no skill under `skills/` names the layered or published door, and the docs that do (`content/docs/ui/apps.mdx`, `content/docs/references/api/rest-server.mdx`, `content/docs/concepts/metadata-lifecycle.mdx`, `content/docs/plugins/adding-a-metadata-type.mdx`) name the routes without teaching how a name two packages hold is answered there, so no sentence there turns false; the generated `content/docs/references/api/protocol.mdx` describes `packageId` as scoping a same-name collision, which still holds. ## 维护者速读 - 改了什么:按名字读元数据的分层视图(`GET /meta/TYPE/NAME/layers`,以及进程内的 `getMetaItemLayered`),遇到两个包都持有同名项、又没指定包时,现在和普通读一样答 409,并在 `details.candidates` 里列出两个包;以前 REST 在某些部署形态下、以及进程内调用,会悄悄返回先注册的那个包。 - 为什么改:同一个名字,普通读答 409 点名两包,分层读却按注册顺序挑一个(或只给一句话不给结构化候选),调用方无法知道该选哪个包,违反 ADR-0150 D3/D5“歧义要报告、不许猜、要列候选”。 - 风险与回滚:这是收窄(BREAKING):没给 door chain 接引擎的部署上,两包同名、不指定包的 `/layers` 由 200(先注册包的分层)变为 409;进程内 `getMetaItemLayered` 由返回先注册包变为抛 `PackageScopedNameRefusedError`,调用方需改为指定包。只影响“两个包同名且没指定包”的分层读;单一持有者、带 `?package=` 的读、存储行持有者在禁用包旁的进程内读都不变;第一方触达 0。回滚即 revert 本 PR。 - 先看:`packages/metadata-protocol/src/protocol-meta-layered-reads.ts`(`getMetaItemLayered` 新增的 `resolveItem` 判定,和 `withPackageCandidates`);`packages/rest/src/meta-item-read-routes.ts`(`/layers` 路由 catch 加 `packageScopedCandidates`);`packages/rest/src/meta-layers-ambiguous-package.test.ts` 新增的 describe。 - 两分钟验证:`pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/meta-layers-ambiguous-package.test.ts`,预期 12 个用例全绿(两包同名的 `/layers` 两种写法答 409 带 `details.candidates`,进程内读抛同样的拒绝,单持有者照常返回)。 - 需要你做的:无,席位落地。 ## What changes **BREAKING** (`Clause-②: no (narrowing)`, patch level, `Metadata-protocol: none`): three answers move, the three bold rows of the table below. FROM 200 with the first-registered holder's layers TO 409 `RESOURCE_CONFLICT` with `details.candidates`, on REST `/layers` where no engine is wired for the door chain; FROM resolving the first-registered holder TO throwing `PackageScopedNameRefusedError`, in process; FROM the package-unbound active row (200) or the published exit TO 409 without `details.candidates`, on REST `/published` where no `objectQLProvider` is wired (review-b F1 and review#2 S3, measured below). The fix for a caller: name the package. The changeset carries the banner and `adr-0087: not-required (no-migration-prescription)`: no key, stored row, layer or export changes shape. Measured first on `main` `a557fa38` (real `RestServer`, real protocol, real `SchemaRegistry`; two packages registering the dashboard `sales`, no stored row): | door | before | after | |---|---|---| | plain `GET /meta/dashboard/sales` | 409 `RESOURCE_CONFLICT` with `details.candidates` | unchanged | | REST `/layers`, engine wired for the door chain | 409, sentence only (no `details`) | 409 with `details.candidates` | | REST `/layers`, no engine wired (no service copy, or a service copy of one holder) | **200, the first-registered holder's layers** | 409 with `details.candidates` | | in process `getMetaItemLayered({ type, name })` | **resolves, the first-registered holder's layers** | throws `PackageScopedNameRefusedError` (409, `refusal.candidates` naming both) | | REST `/published`, no `objectQLProvider` | **the published exit: the metadata service's `getPublished` answer, or 501 `NOT_IMPLEMENTED` when the host resolves no metadata service** | 409 `RESOURCE_CONFLICT`, no `details` | | REST `/published`, no `objectQLProvider`, the name also has a package-unbound active row | **200, that row** | 409 `RESOURCE_CONFLICT`, no `details` | | REST `/published`, engine wired | 409 `RESOURCE_CONFLICT`, no `details` | unchanged | | dispatcher `/published`, engine registry not reachable, no package-unbound row | the snapshot (the throw is swallowed) | unchanged (not pinned) | | dispatcher `/published`, the same, with a package-unbound active row | **that row** (read from the tree) | the code snapshot: the throw is swallowed (read from the tree, not pinned) | | `?package=` of either holder, and a name one package holds | served | unchanged | - **`getMetaItemLayered` (objectstack-ai#32914, and the REST pick folded into objectstack-ai#32622 from objectstack-ai#32624).** Naming no package, a type addressed by package is judged by the registry's package-scoped resolver (`registry.resolveItem(type, name, null, member)`), as `getMetaItem` judges it (`packagelessScopedRead`), before any layer is read and whatever the metadata service holds. Only the judgment is taken; a name one holder holds keeps the layers it had. Stored-row holders are not this judgment's: the door refuses them in step 1c, as contract review S1 on objectstack-ai#33130 settled, and the in-process read in that state still resolves (the `[objectstack-ai#32354]` pin is unchanged and green). - **REST `/layers` catch (objectstack-ai#32622).** `handleRouteError(res, error, undefined, { packageScopedCandidates: true })`, as the plain read's catch (objectstack-ai#32201). The deprecated `?layers=true` spelling already answered through that catch. The dispatcher already carried the candidates (`errorFromThrown`). - **Step 1c's refusal (objectstack-ai#32622).** The package-less writes' refusal the layered door answers for a name whose active rows two packages hold (objectstack-ai#28337) keeps its sentence, code, status and `?package=` remedy, and now carries its holders as a package-scoped refusal by shape (`refusal.status: 'refused'`, `candidates` in the `/actions` shape), so both transports answer `details.candidates`. The save and delete doors do not move. This is the item the objectstack-ai#32607 seat re-ruling left to this card ("Carrying `details.candidates` on `/layers` remains objectstack-ai#32622's job", 6820653691). - `protocol.ts`: docblock only (9 lines, under the seat's 14:45Z rule change). `packagelessLayeredReadRefusal`'s docblock now says the refusal carries its holders as `refusal.candidates`, and that `getMetaItemLayered`'s in-process readers meet the registry's refusal of a name two packages register in code. The emitted `dist/index.js` and `dist/index.cjs` differ from `HEAD~1`'s in those comment lines alone (two builds, raw diff). A later commit adds the `@throws` for the two-holder refusal to `getMetaItemLayered`'s docblock (review-b N2, 4 lines). ## Tests - `packages/rest/src/meta-layers-ambiguous-package.test.ts`, new describe `[objectstack-ai#32622, objectstack-ai#32914] a name two packages register, read naming no package`: 3 compositions (engine wired; no engine wired; no engine wired with a metadata-service copy of the first holder) x 2 registration orders, both spellings answer 409 `RESOURCE_CONFLICT` with both holders as `details.candidates` and serve neither holder; in process the layered read refuses (`code` + `status` + `refusal.candidates`) in every composition and each `packageId` read still serves its holder; CONTROL: a name one package registers is served in process and on both spellings, and `?package=` serves its holder. - `[objectstack-ai#28337]` pins on both transports (`rest/.../meta-layers-ambiguous-package.test.ts`, `runtime/.../meta-layers-ambiguous-package.test.ts`, RestServer and hono): the envelope is now the writes' envelope plus `details`, with both holders as `details.candidates`; the writes' answer is asserted to carry no `details`. - `[objectstack-ai#32354]` ruling-Q2 pins (`rest/.../meta-disabled-package-doors.test.ts`, `runtime/.../meta-disabled-holder-served-stack.test.ts`): `/layers` now asserts `details.candidates` naming only the served holders. - `metadata-protocol/.../protocol.packageless-layered-read-refusal.test.ts`: the step-1c refusal carries `refusal.candidates`; the save's refusal carries none. - `rest/.../meta-qualified-item-route.test.ts`, new top-level describe `objectstack-ai#32622 — the other /layers refusal exits carry details.candidates` (review#2 S1). It covers two exits. The bare action read with the platform's item beside A's answers `[A, platform]`. `/layers?package=` of a package holding none answers `[A]`. Each is asserted equal to the item read's candidates. The stale `objectstack-ai#32365` comment there is corrected: `/layers` carries the candidates, `/published` its text. S1 ablation (the `/layers` catch without `packageScopedCandidates`, rest source): both new cases red (`AssertionError: {"error":"The action \"approve\" is held by 2 holders …` and `… is not held by package \"com.acme.gamma\" …`), 2 failed of 325; restored with blob equal to HEAD and `git diff HEAD` empty; baseline 325/325. <details><summary>Ablations (each leg restored; blob == HEAD proven by ablation-replace)</summary> HEAD `6e50dbd5c7`. Baseline green: rest 62/62, metadata-protocol 3/3, runtime 367/367 (the three files above per package). - **A2, the `/layers` catch without `packageScopedCandidates`** (rest source, read from `src`): 9 red, e.g. `/layers: expected [] to deeply equal [ 'package:app.alpha_demo', …(1) ]` and the ruling-Q2 pin `expected [] to deeply equal [ Array(2) ]`; the in-process and CONTROL cases stay green, as expected. - **A1, `getMetaItemLayered` without the resolver judgment** (metadata-protocol rebuilt, marker `ABLATED_32914` present in 2 built files): 6 red, the no-engine cases `/layers: … "label":"app.alpha_demo code" …: expected [ 200, … ] to deeply equal [ 409, 'RESOURCE_CONFLICT' ]` and the in-process cases `expected [ undefined, undefined ] to deeply equal [ 'RESOURCE_CONFLICT', 409 ]`; the engine-wired cases stay green (the door's owner step refuses there), as expected. - **A3, step 1c's refusal without its candidates** (metadata-protocol rebuilt, marker `ABLATED_32622` present): metadata-protocol `expected undefined to be 'refused'`; rest `expected [ 'code', 'error' ] to deeply equal [ 'code', 'details', 'error' ]`; runtime RestServer and hono twins red the same way (hono: `[ 'code', 'httpStatus', 'message' ]`). A first A3 attempt was refused by `ablation-replace` (its replacement contained the anchor, so the anchor count did not drop) and restored at once; its green readings were a no-op and are discarded. - Restore leg: metadata-protocol rebuilt, both markers absent from all 24 built files, working tree clean. </details> ## Acceptance notes - review-b F1 is closed on the prose faces: the `/published` rows are in the changeset banner, the `Clause-②` line and the table. Its follow-up card objectstack-ai#34101 was filed, then closed as not planned by triage under the p3 standard. So the REST and dispatcher `/published` answers stay different (REST 409 without `details.candidates`; the dispatcher swallows the throw and serves the snapshot), and neither is pinned. Recorded here as accepted. - review-b N1 / review#2 N1: `echoSecurityCatalogMutation` recovers from the refusal only when the event names no address. At a package-unbound address of a `permission` name two packages register, the echo now throws where it used to read and skip; the projector runner and the boot pass catch it and warn. No grant, lock or served answer changes (read). Its carrier objectstack-ai#34101 is closed, so it is recorded here as accepted. - review#2 S1 is folded (Tests above). review#2 S3 is folded: the stored-row FROM and the dispatcher row are in the changeset, the `Clause-②` line and the table. REST was measured (see the S3 block under Verification); the dispatcher rows are read from the tree. - review#2 S2 (read, not measured): "Step 1c's `details.candidates` are the packages the active rows are bound to (`packagelessAddress().candidates`), not the holders the plain read judges." Where a package's row stands beside its own customization pair's row (the objectstack-ai#32662 scope-note (b) state), the plain read serves that package's row, while bare `/layers` answers 409 and now names the pair as `{ kind: 'package' }`; a row the reads decline is named the same way. Not folded and no card, under the p3 standard. - review#2 S4 (read, not measured): "The layered read takes the resolver's judgment and not its answer." For a name that an overridable baseline and one other package both hold (`email_template`, baseline `com.objectstack.service.email`), the plain read serves the other package. With no metadata-service copy, the layered read's code layer is still the artifact lookup's first composite, by registration order. Not introduced by this diff. Not folded and no card, under the p3 standard. - review#2 N2 (pin breadth: candidates compared sorted, `dashboard` only, no bundle member, no dispatcher pin on a boot with no service copy) is recorded as accepted. N3 (body staleness) is fixed in this body. - Declaration re-read after the diff, on the area seat's order: the claim declared `Clause-②: no`; measured, two answers move (the bold rows above), so the PR body and the changeset now declare `Clause-②: no (narrowing)` with the BREAKING banner, the `!` title and the ADR-0087 marker, after the objectstack-ai#33646 precedent. On the composition that wires the engine (the default `RestServer` host) the door already answered 409. No gate reads the claim comment's line (the queue and level gates read this body and the changesets), so the claim comments were not amended. - The in-process readers already handle the refusal: the packaged-permission-set lock gate and the security catalog echo catch a 409 naming package candidates and read each holder at its package (ADR-0150 D4, objectstack-ai#31698). - `git merge-tree --write-tree --name-only` of this head against the open PRs sharing a file and `origin/main`: objectstack-ai#33898 (`64c5d88452`, shares `protocol.ts` and `meta-qualified-item-read.test.ts`), objectstack-ai#33889 (`bdb3a20a71`, shares `meta-disabled-holder-served-stack.test.ts`) and `origin/main` (`895783a1e8`) each exit 0, no conflicted path. objectstack-ai#33898's `protocol.ts` hunks sit near lines 322 and 7089; the docblock here is near line 4205. ## Verification <details><summary>REST /published FROM and TO (review-b F1), measured at e516f35</summary> A throwaway probe beside the REST pins, not committed. It used the same real protocol and real `SchemaRegistry`, with two packages registering the dashboard `sales`, `GET /meta/dashboard/sales/published` naming no package, both registration orders. TO is the head as built. FROM is the head with `getMetaItemLayered`'s resolver call ablated (`ablation-replace` landed, the marker present in 2 built files, then restored: blob equal to HEAD, marker absent from all 24 built files). | composition | FROM | TO | |---|---|---| | engine wired (`objectQLProvider`) | 409 `RESOURCE_CONFLICT`, `details` null | 409 `RESOURCE_CONFLICT`, `details` null | | no `objectQLProvider`, no metadata service | 501 `NOT_IMPLEMENTED` ("Nothing is runtime-published for this item, and this kernel has no code/package store …") | 409 `RESOURCE_CONFLICT`, `details` null | | no `objectQLProvider`, the protocol's service holding a copy of the first holder (two shapes) | 501 `NOT_IMPLEMENTED` (the REST host resolves no metadata service of its own) | 409 `RESOURCE_CONFLICT`, `details` null | The FROM on a host whose REST metadata service has `getPublished` (the service's answer, served 200) was NOT MEASURED. The probe shape for it, which stubs the host's `resolveMetadataService`, never got the verify lock: four 540 s waits behind pid 16926, a `pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=1` holding over 60 minutes. That row is read from the tree (`meta-item-history-routes.ts`, the fallthrough after the overlay read). Each VERDICT command-exit 0. </details> <details><summary>REST /published with a package-unbound active row (review#2 S3), measured at 9dd398c</summary> A throwaway probe beside the REST pins, deleted and never committed. Same real protocol and `SchemaRegistry`. A package-less `saveMetaItem` stores the dashboard `sales` as a package-unbound active row (`[sales, null, active]`). Then two packages register `sales` in code, both registration orders, and the RestServer has no `objectQLProvider`. TO is the head as built. FROM is the head with the resolver call ablated: the marker was present in 2 built files, then restored, with the blob equal to HEAD and the marker absent from all 24 built files. | door | FROM | TO | |---|---|---| | `GET /meta/dashboard/sales/published` | 200, the package-unbound row (`env row`) | 409 `RESOURCE_CONFLICT`, `details` null | | `GET /meta/dashboard/sales` (plain read) | 409 with `details.candidates` naming both | the same | VERDICT command-exit 0. The dispatcher rows are read from the tree, not measured. </details> <details><summary>Dogfood battery, on fa7fb66</summary> Built `@objectstack/dogfood^...` (turbo, VERDICT command-exit 0), then under the lock `pnpm --filter @objectstack/dogfood test` with no `OS_TEST_SHARD` and no path: VERDICT command-exit 0, Test Files 467 passed, 3 skipped (470); Tests 3959 passed, 42 skipped (4001). The final head adds only the `protocol.ts` docblock commit; the emitted JS differs from `fa7fb66a7c`'s in comment lines alone, so the battery reading covers the head's executable bytes. The final head adds a changeset edit and the 4-line `@throws` docblock, again comment-only. </details> <details><summary>Packages, on head 6e50dbd (before merging main) and on 02d6109 (after it)</summary> On `6e50dbd5c7`, under the verify lock (VERDICT command-exit 0): typecheck and test green for metadata-protocol (22883 passed), rest (8451), runtime (10874), plugin-security (6681), objectql (13110), service-automation (3976), client (812), cloud-connection (1217), plugin-auth (5465), plugin-email (1018), service-messaging (966), service-package (144), plugin-dev tests (89). organizations, plugin-approvals, verify, cli and three typechecks went red there on `Cannot find module` / `Failed to resolve entry` for packages this worktree had not built (build state, not this diff). On `02d6109dde` (one merge of `origin/main`, no conflict, no touched file moved upstream), after building the whole closure of those packages (turbo exit 0), under the lock (VERDICT command-exit 0): the targeted files rest 62/62, metadata-protocol 3/3, runtime 367/367; typecheck green for all 17 packages (metadata-protocol, rest, runtime, plugin-security, objectql, service-automation, client, cloud-connection, organizations, plugin-approvals, plugin-auth, plugin-dev, plugin-email, service-messaging, service-package, verify, cli); tests green for service-automation (3977), organizations (252), plugin-approvals (1652), plugin-dev (89), verify (439), cli unit (6000). </details> <details><summary>Gates</summary> The derived set (`dispatch-gates.mjs --commands`, 70 commands) ran on `d0a5dbd220`: 67 exit 0. `check:test-source-alias` was red on a runtime pin file this PR edits (a dynamic `@objectstack/metadata` load in a clocked window); fixed in `6e50dbd5c7` (module-top import), re-run exit 0. `check:dual-build-cjs-loads` and `check:type-check-debt`: PREREQUISITE NOT MET locally (no full build; the lock queue), so NOT MEASURED here; CI runs both. PR body gates on this body: closing-keyword-parity, partof-closing-keyword, changeset-no-major and adr-0087-registration exit 0. ESLint on the changed files exit 0. The union on the final head is cited in the report on objectstack-ai#32622. On `e516f3534b`, re-derived (74 commands, the `protocol.ts` touch adds `check:adr-symbol-anchors`, `check:facade-delegation-only`, `check:filter-alias-parity`, `check:wildcard-fallthrough`): 73 exit 0; `check:type-check-debt` exit 3 PREREQUISITE NOT MET (its build lost the lock queue), NOT MEASURED, CI runs it. `dispatch-gates --ran`: 74 accounted, 73 run, 1 NOT-MEASURED, 0 UNRUN. `check-platform-checklist --changed-from origin/main` exit 0. On this body: changeset-no-major (LEVEL AXIS reads `no (narrowing)` + `none` at patch), adr-0087-registration (1 declared-breaking changeset, `not-required (no-migration-prescription)`), closing-keyword-parity and partof-closing-keyword exit 0. On the final head `e57e7c0566` (the `/published` banner row and the `@throws` docblock): the 74 derived commands again gave 73 exit 0, with `check:type-check-debt` exit 3 PREREQUISITE NOT MET, so NOT MEASURED. `--ran` accounted for 74 (73 run, 1 NOT-MEASURED, 0 UNRUN). `check-platform-checklist --changed-from origin/main` exit 0. Changeset gates (adr-0087-registration, changeset-no-major, empty-changeset, changeset-fixed, nul-bytes) exit 0. `git merge-tree --write-tree --name-only` against `origin/main` `e71ecc1b32` exit 0, so it still merges clean now that objectstack-ai#33898 is merged; objectstack-ai#33889 `bdb3a20a71` exit 0. CI `Test Core (3/8)` on `e57e7c0566` failed twice: run 43743965993, job 132903743253, and the lane's one re-run, job 132914286588. Both times the only failed task was `packages/qa/scenarios` `run-date.test.ts`, on vitest's 5000 ms timeout. The first run failed `2028-03-31` at 6278 ms. The re-run failed `2028-02-28` at 5619 ms and `2028-02-29` at 6907 ms, while `2028-03-31` passed there at 4615 ms. A different case each time, and no assertion failed. The test imports only `@objectstack/spec` and the scenarios package's own sources, which this diff does not touch. The same file failed the same way on `main` without this PR: the merge-queue run of the unrelated objectql-only objectstack-ai#33902 (run 43747969462, job 132917233366, Test Core 4/8) failed `2028-02-28` at 5719 ms. `main`'s push run does not run scenarios at all (affected-only shards). Locally, on the branch merged with `origin/main` at `9dd398cda0`, the file passed 3 of 3 runs (34/34 each, about 5.4 s of tests). The scenarios closure is byte-identical to `main` there (`git diff origin/main -- packages/qa/scenarios packages/spec docs/qa` is empty). Read: a load timeout that is `main`'s, not this PR's. No rerun from here. On the final head `a2b29893d0`, two merges of `origin/main` landed, both clean. `9dd398cda0` came first. `a2b29893d0` contains objectstack-ai#34104 (`e9fb09871d`), the fix for those run-date timeouts (p0 objectstack-ai#34081). Under the lock, at that head: - build closure exit 0; - targeted pins: metadata-protocol 3/3, rest 389/389 (the S1 describe included), runtime 421/421, scenarios `run-date.test.ts` 35/35; - typecheck exit 0 for metadata-protocol, rest and runtime. Between the two merges, the runtime typecheck went red once, on `meta-object-publish-column-changes.test.ts` (`TursoDriver` not assignable to `SqlDriver`). The cause was build state: `@objectstack/driver-turso` is a peer dependency, so it is outside `runtime^...`, and its `dist` was older than `driver-sql`'s. It went green once `driver-turso` was built. Derived gates on that head: - 75 commands, 74 exit 0; - `check:type-check-debt` exit 3 PREREQUISITE NOT MET, so NOT MEASURED; - `--ran` exit 0; - `check-platform-checklist` exit 0; - changeset gates exit 0; - `git merge-tree` against `origin/main` `bf594ebd72` exit 0. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ --> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #34081
Clause-②: no
Metadata-protocol: none
维护者速读
packages/qa/scenarios/test/runner/run-date.test.ts的工作日 oracle。它仍然逐日走日历(独立于实现的workingDayNumber算术),但只走一次,走成 1960–2040 的工作日序号表;walkShift/walkCount/onOrBefore/onOrAfter改为查表。step*保留,下面是一次建表的calendar()和查表函数),以及新加的自检用例the calendar walked once reads the same as stepping through it…。pnpm --filter @objectstack/scenarios exec vitest run --reporter=verbose test/runner/run-date.test.ts,35 项全过,2028 三例本地约 330–360 ms(修前约 1 s)。What changes
The oracle of
every dated card, rebased onto each run dateread each moved date by stepping through the calendar one day at a time, from scratch, for every date leaf of every card on every run date. The step count grows with the distance from the card'sasOfto the run date, so the three 2028 run dates (about 380 working days out) were the slowest: about 1 s each locally and 5.4–7.0 s on CI runners, past vitest's 5000 ms default.The fix keeps the same reading and takes the walk once:
calendar()steps from 1960-01-01 to 2040-12-31 a day at a time withshiftDate(d, 1)and the test's ownweekday/isWorking, the same primitives the stepping oracle used. It numbers the working days in order and records, for every calendar day, the number of the working day on or before it. It is built lazily on first use.onOrBefore,onOrAfter,walkCountandwalkShiftread that table. They keep the stepping semantics, including the edges: a weekenddmoved forward counts from the Friday before it and moved back from the Monday after it,n = 0returnsdas given, and a time suffix is carried through. A date or result outside the walked range throws instead of readingundefined.stepOnOrBefore,stepOnOrAfter,stepCountandstepShift. They are now the reference for a new self-check.workingDayNumberarithmetic is still not used by the oracle, and run-date.ts's functions are not swapped in for it.Nothing else changed. The per-test timeout, RUN_DATES (all nine), the cards and the assertions of every existing case are the same.
Tests
whole working days > the calendar walked once reads the same as stepping through it, across the epoch week, a year end and a leap day. It compares table against stepping walk on:onOrBefore/onOrAfter, andwalkShiftby −6, −1, 0, 1 and 6;walkCountboth ways over the epoch week, 2026-09-30 ↔ 2028-03-31, 2028-03-04 ↔ 2026-12-26 and 2028-02-26 ↔ 2028-03-04, with weekend endpoints;Verification
Per-case times of
every dated card, rebased onto each run date,--reporter=verbose, local,--maxWorkers=2, throughos-verify-lock:63db7240a)teststotalscripts/ablation-replace.mjs:walkCountpointed back atstepCountandwalkShiftatstepShift, both mutations landed (anchor 1 → 0, blob changed). The 2028 cases go back to 1027/966/1050 ms. The one red is the new self-check's out-of-range assertion, which the unbounded stepping walk cannot meet, as expected. All other 34 pass. Restored,git diff HEADempty.Local subset at head
8dd3edfc0a, derived bynode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon this diff:dispatch-gates --ran: 48 derived, 48 run, 0 NOT-MEASURED. One first answered exit 3 (prerequisite not met) and was re-run after the prerequisite was built:pnpm check:dual-build-cjs-loadsafter a fullpnpm build(119/119 tasks), exit 0. All others exit 0 on the first run.packages/qa/scenarios:pnpm buildexit 0;vitest run34 files, 884 tests, exit 0;tsc --noEmit -p tsconfig.json(includestest/**) exit 0.pnpm exec eslint packages/qa/scenarios/test/runner/run-date.test.ts: exit 0.Full record:
/mnt/project-files/devx-seat1/34081-gates-ran.txt.Human Minimum
packages/specholds no runtime logic. (not touched)calendar,numberOf,dayOf,stepShift,stepCount,stepOnOrBefore,stepOnOrAfter: camelCase;CALENDAR: constant)pnpm lintpasses. (eslint on the one touched file: exit 0; the repo-wide run is CI's)main, one pull request.skip-changeset)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmRWUrXgua6hAwuKweu