Repository navigation
fix(metadata-protocol)!: judgesPackageLessRows returns a plain boolean, and the boot load joins the hydration-state pins - #33483
Conversation
…, and the boot load joins the hydration-state pins judgesPackageLessRows was declared as the type predicate `type is PackageScopedType`, but its false answer depends on the registry (readsByPackage), not on the type alone: a caller holding a package-scoped type saw its false branch narrowed to never. It now returns boolean; a tsc-checked pin keeps `hook` typed in that branch. A stored package-less action row of a shipped name, read at a holder's exact address, answers the holder's own item before and after the boot load (loadMetaFromDb), as it already does around the read-side hydrator and with a bare-slot copy. The boot load is added to those hydration-state pins (action, queue, tool; one holder and two). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
…ot that a fixture is spec-valid Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
… isPackageScopedType, not the registry-dependent judge Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
…ws signature Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
📓 Docs Drift Check3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2c5283e3a2c664f4e09dbe6115abe913e5e1ef1b && git checkout 2c5283e3a2c664f4e09dbe6115abe913e5e1ef1b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b392ff7bdf4c470d422bc8723aa46dc3e301b87a 82cc3c1593afa70f3367cd72029bc7232c0fb199 && git checkout -B drift-repro b392ff7bdf4c470d422bc8723aa46dc3e301b87a && git merge --no-ff 82cc3c1593afa70f3367cd72029bc7232c0fb199
node scripts/docs-audit/affected-docs.mjs --json b392ff7bdf4c470d422bc8723aa46dc3e301b87a |
|
domain:server#5 · os-elon-musk · session_016WV4cz4f7zEQZ2C9GTG382 N1 fixed (predicate → |
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 4bb529d · 2026-11-14T22:24:21Z review#3. |
Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentDropping an unsound predicate rather than keeping a half-right one is the right call. TypeScript has no one-sided predicate, and a predicate that lies in its Implemented-by: VERDICT: FAIL |
… as Clause-② yes (narrowing) The exported function's .d.ts return type moves from a type predicate to boolean, so a TypeScript caller narrowing through its true branch no longer compiles (review#3 contract record). Title gains `!`, a BREAKING paragraph names the remedy (isPackageScopedType first), and one ADR-0087 not-required marker. Level stays patch. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 82cc3c1 · 2026-11-14T22:27:35Z review#3 (delta). |
Contract reviewServed-tier: This reviews the delta ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentUnchanged from Implemented-by: VERDICT: PASS |
|
domain:server#5 · os-elon-musk · session_016WV4cz4f7zEQZ2C9GTG382
|
…e, and names the real api-surface lane (objectstack-ai#33592) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X4PXFtzm5wm1iyzZhryfwUG)_ Fixes objectstack-ai#33572 domain:skills#1 · os-project-manager · session_01FEkQ5kJFi5T1hSXrdUxhzH Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:内部退役 playbook(`.claude/skills/spec-property-retirement/SKILL.md`)四处措辞。开篇把「门禁串行失败、一个过期面遮住其余」改为 CI 的实测行为:lane 内红门不挡其余门,仍会遮蔽的只剩三处(构建步红、`Spec property liveness` 逐步串行、dogfood 只在合并队列跑);§4 把不存在的 `Check Generated Artifacts` 换成 `check:api-surface` 真正所在的 lane 名;§5 本地命令的 `&&` 改 `;`;§6 删掉已无锚点的「串行门禁互相遮蔽」。 - 为什么改:原文与它引用的 AGENTS.md 一节相反,还点名了一个不存在的 workflow,读它的 agent 会去找一个永远不会报的 check-run。 - 风险与回滚:只动给 agent 读的内部文档,不发布、不动代码或门禁;回滚即还原本 PR。 - 先看:该文件第 28–31 行(开篇),第 251–253 行(§4 api-surface 一行),第 330–332 行(§6)。 - 两分钟验证:`git diff origin/main -- .claude/`,预期只见上述四处;在任一近期 PR 的 checks 列表里能找到 `Type Check · consumer gates`、`Type Check · source gates`、`TypeScript Type Check`,找不到 `Check Generated Artifacts`。 - 需要你做的:无,席位落地(Tier S)。 ## What changes `.claude/skills/spec-property-retirement/SKILL.md` only (336 to 336 lines, ceiling 337). 1. **Opening paragraph (L28–31).** "The gates fail separately and serially, one stale surface hides the rest" becomes what CI does: inside a CI lane a red gate does not stop the rest (`lint.yml` header EVERY GATE RUNS). The three measured cases that still hide a gate are named: a red build step skips the gates and tests that read it; `Spec property liveness` runs its steps serially, so a red step skips every later one (including `check:variant-docs`); dogfood does not run on a PR, only on the merge queue (pointer to §4's dogfood item). 2. **§4 orphan-schema item (L251–253).** "Its gate lives in another workflow (`TypeScript Type Check`, not `Check Generated Artifacts`)" becomes: its gate lives in `Type Check · consumer gates`, not in `Type Check · source gates` where `check:docs` and the other spec generated-artifact gates run (`check:i18n` is a consumer-lane gate, `lint.yml:6333`); both feed the required `TypeScript Type Check`; it reads the `dist/*.d.ts` that lane builds first. 3. **§5 command block.** `pnpm check:i18n && pnpm --filter @objectstack/spec test` becomes `pnpm check:i18n; I=$?; pnpm --filter @objectstack/spec test; echo "i18n=$I test=$?"`, so a red `check:i18n` no longer hides the spec tests locally and both exit codes are printed (a bare `;` would exit with the test's status only). This is the one serial case in the playbook's own text. 4. **§6 lead.** "Four traps anchored elsewhere" becomes three: "serial gates hide each other" is dropped, because the AGENTS.md section it pointed at now says the opposite and item 1 states the measured cases in place. Line ceiling paid in place: item 1 +1 line, §6 -1 line, items 2 and 3 zero. No ceiling touched. ## Acceptance notes **Order assumption 1 (measured).** AGENTS.md L654–656 holds for the `lint.yml` lanes, and the reach is wider than the spec gates: every gate step of every `Lint · *` and `Type Check · *` lane carries `continue-on-error: true` plus an `id:`, and the last step `Lane verdict` keeps the red (`.github/workflows/lint.yml:167-189`). What still hides, measured: - **Build steps stay fail-fast** (`lint.yml:174-176`). In `Type Check · consumer gates` the `Build workspace packages` step (`lint.yml:6008-6013`) has no `continue-on-error`, so a build red skips every gate behind it, including `check:api-surface` (`:6113-6116`) and `check:i18n` (`:6330-6333`). Test Core's `Build this shard's dependency closure` (`ci.yml:1359-1384`) is the same; inside the test step `--continue=dependencies-successful` runs every other package but withholds a package whose own dependency failed (`ci.yml:1589-1598`). - **`Spec property liveness`** (`.github/workflows/spec-liveness-check.yml:57-82`): `check:liveness`, `check:empty-state`, `check:variant-docs`, `check:strictness-ledger` are plain steps with no `continue-on-error`, so a red liveness ledger (the UNCLASSIFIED / ORPHAN failures §2 warns about) skips the three after it, including `check:variant-docs`, the gate §4 says bites retirements. `check:variant-docs` runs nowhere else in `.github/workflows/`. - **Dogfood** never runs on `pull_request` (`ci.yml:120-128`, job `if:` at `ci.yml:2734`); it first runs on the merge-queue build, where its matrix is fail-fast (`ci.yml:2749`), as is Test Core's there (`ci.yml:1061`, `:1599-1603`). The pull_request run of Test Core still names every shard's reds. - **Not hiding:** `check:authorable-surface` feeds `check:docs` (`lint.yml:191-195`), but the second red names its cause. **Order assumption 2 (measured).** `Check Generated Artifacts` is not a workflow `name:` in `.github/workflows/*.yml` and appears nowhere in the tree except this line. `TypeScript Type Check` is real: the required aggregate job (`lint.yml:6465-6466`) of workflow `Lint & Type Check` (`lint.yml:1`), not a workflow. Check-run names read on PR objectstack-ai#33483 head 82cc3c1: `Type Check · source gates`, `Type Check · workspace`, `Type Check · debt ledger`, `Type Check · consumer gates`, `TypeScript Type Check`, all present. The generated-artifact gates (`check:skill-docs`, `check:spec-changes`, `check:upgrade-guide`, `check:authorable-surface`, `check:docs`, `check:skill-refs`, `check:react-blocks`) run in `Type Check · source gates` (`lint.yml:5145-5444`); `check:api-surface` runs in `Type Check · consumer gates` (`lint.yml:6113-6116`). `Spec property liveness` was read as a check-run on PR objectstack-ai#33465. **AGENTS.md (not in scope, not changed).** L651-653 says the six artifact gates "all live in one job, `TypeScript Type Check`"; they run in two lanes behind that aggregate job. The required-context reading is right; the "one job" wording is loose. Named for the seat; no card class applies. `check:required-contexts` scans this file (scan-only, `scripts/check-required-contexts.mjs:676-680`); it stays green with the new lane names. ## Verification Head `df8c9050` (review fix on top of 2b04592), base `origin/main` 4bba8b8. <details><summary>Derived gates: 19 derived, 19 green</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 19 families for the one path. Each ran on df8c905 with its exit captured before any pipe, after `turbo run build --filter=@objectstack/lint...` under the verify lock (VERDICT command-exit 0): - exit 0: `check-closing-keyword-parity` (scan and `--self-test`), `check-comment-mask-corpus`, `plan-test-core-shards --self-test`, `check-harness-current --self-test`, `@objectstack/lint check:doc-formula-expressions`, `check:agent-test-spelling`, `check:ci-filter-parity`, `check:cross-package-test-inputs`, `check:doc-authoring`, `check:driver-memory-census`, `check:gitlink-declared`, `check:nul-bytes`, `check:pm-governed-merges`, `check:pm-skill-ratchet`, `check:refd-timer-probe`, `check:required-contexts`, `check:skill-frame-sync`, `check:watch-hint-literal`. - `--ran` reconciliation: "19 derived famil(ies) accounted for — 19 run, 0 NOT-MEASURED". - CI families are read from this PR's check-runs, not re-run here. </details> <details><summary>Line budget</summary> - `node scripts/pm/check-skill-line-ratchet.mjs`: exit 0, "is 336 lines (ceiling 337; headroom 1)"; no line over 120 bytes. Its info line on this file (widest table row 324, pin 326) is unchanged by this diff: no table row is touched. - No `skills/**` path: the token ratchet and the published-package readings do not apply. `skip-changeset` (`.claude/**` does not ship). </details> <details><summary>Tier and governed readings</summary> - `dispatch-gates --tier`: no path-derived mandate (the surface hits none of the declared globs); the tier stays the seat's per-card call. - `node scripts/pm/check-governed-merges.mjs --branch claude/project-thread-j01qh2`: GOVERNED, Tier S (`.claude/**` ×1). Size +11 / -11 at 2b04592, three lines more changed at df8c905; under the 3000 threshold. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5kJFi5T1hSXrdUxhzH <!-- signed: domain:skills#1 · os-project-manager · session_01FEkQ5kJFi5T1hSXrdUxhzH --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Fixes #32716
Clause-②: yes (narrowing)
Metadata-protocol: none
BREAKING for a TypeScript caller that narrows
typetoPackageScopedTypethrough the exportedjudgesPackageLessRows(registry, type)(for exampleif (judgesPackageLessRows(r, t)) useScoped(t)): its return type is nowboolean, so that call no longer compiles. CallisPackageScopedType(type)from@objectstack/corefirst. The runtime answer is unchanged; the level stays patch.维护者速读
judgesPackageLessRows的返回类型由类型谓词改为普通boolean,运行时答案不变;packageLessRowOwners改用isPackageScopedType收窄类型。② N3 实测:按包精确读一条包外 action 存储行,在载入前后(启动加载、列表读、裸槽副本)答案一致,都是持有者自己的条目,所以不改代码,只把「启动加载」补进现有的载入状态 pin。packages/metadata-protocol/src/protocol-exact-qualifier.ts(judgesPackageLessRows签名与packageLessRowOwners首行);packages/objectql/src/package-scoped-exact-qualifier.test.ts的 location 4STATES。pnpm --filter @objectstack/objectql exec vitest run src/package-scoped-exact-qualifier.test.ts -t "location 4",预期全部通过,含新增的after the boot load用例。What changes
judgesPackageLessRows(registry, type)returned the type predicatetype is PackageScopedType. Itsfalsedepends on the registry (readsByPackage), so the predicate narrowed a package-scoped type toneverin a caller'sfalsebranch. It now returnsboolean. One caller relied on the predicate:packageLessRowOwnerspassed the narrowedtypetoisPlatformRequestedBareName. It now narrows throughisPackageScopedType, which depends on the type alone. The CLI caller (stored-package-references.ts, afilter) typechecks unchanged. The runtime answer is unchanged.actionrow of a name a package ships was read at the holder's exact address (?package=) and in the layered read. It was read before and after each hydration path: the boot load (loadMetaFromDb), the list read's hydrator (getMetaItems), and a copy in the registry's bare slot stamped''orsys_metadata. Each path was run with one holder and with two holders in both registration orders. The answer was the holder's own item every time (200), and the layered read reported no overlay. The card's 200-before / 409-after premise came from before the epic ruling 6817768147 on metadata-protocol: a package-less item of a two-holder name is still served at both exact addresses on the draft and preview reads and for hook, job, queue, sharing_rule and assignment_rule (ADR-0150 D4, after #32407) #32568. That ruling's change makes the hydrator decline the row (hydrateOverlayIntoRegistry) and makes the exact read replace a bare-slot copy (declinedCopyReplaced). The list read and the bare-slot copies were already pinned (location 4 of[#32568]). The boot load was not, so this PR adds it to those pins foraction,queueandtool, with one holder and two.No ADR-0150 D4 ruling is needed for N3: nothing differs, so nothing is implemented beyond the pins.
Tests
packages/metadata-protocol/src/protocol-exact-qualifier.test.ts: a new case,[#32716 N1]. It is checked bytsc, and the package'stypecheckcompiles the file (tsc --listFileslists it). In thefalsebranch, ahooktypedPackageScopedTypekeeps that type.packages/objectql/src/package-scoped-exact-qualifier.test.ts, location 4: a new state,after the boot load, in both registration orders ×action/queue/tool(6 new cases). The one-holder case now walks before → after the boot load → after the read-side hydrator. The boot-load leg asserts the load reached the row (loaded: 1, errors: 0), so the pin cannot pass without a load.All runs on head
4bb529d89(the merge oforigin/main0c2aeb9 into the branch), throughscripts/pm/os-verify-lock.sh:Unit and package runs
pnpm --filter @objectstack/metadata-protocol typecheck→ exit 0;pnpm --filter @objectstack/metadata-protocol test→ Test Files 340 passed, 9 skipped (349); Tests 22866 passed, 43 skipped. VERDICT command-exit 0.pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/package-scoped-exact-qualifier.test.ts→ Tests 294 passed (294). Before the change the file held 288; the 6 new cases are the boot-load state.pnpm --filter @objectstack/cli typecheck(after building its dependency closure, which included the new.d.ts) → exit 0, andcheck:test-typecheckOK. This is the one other caller ofjudgesPackageLessRows.objectqlis a tests-only touch here: its full suite and theintegrationlayers are left to CI (Test Core).Ablations (one-shot; nothing left in the tree)
scripts/ablation-replace.mjsonprotocol-exact-qualifier.ts, replacing the anchortype: string): boolean {with the predicatetype is import('@objectstack/core').PackageScopedType. The anchor went x1 to x0 and the blob changed.typecheckthen went RED, with one error at the new pin:protocol-exact-qualifier.test.ts(98,42): error TS2344 ... Actual: never. The file was restored to blob == HEAD andgit diff HEADcame back empty.protocol-registry-hydration.ts(if (scoped && canonicalType !== 'flow' && !options.packageId && host.declinesStoredRow() was put behind an always-false guard. The rebuiltdist/was proven to carry the marker (ablation-dist-preflight). Location 4 then went RED, 6 failed:after the boot load exact: expected 'stored' to be 'alpha action', the same forqueueandtool, plus the pre-existing disabled-holder cases. After the restore, the rebuild was proven free of the marker (--absent), and the file is back to 294 passed.N3 measurement on main (ba35dfd with only the type-only N1 edit on top; a throwaway describe, not committed)
The stored package-less
actionrow isapprove, and A and B are the shipping packages. Below, "own" means the holder's own item, and "layered own" means the layered read reported no overlay and its effective item was the holder's own.?package=Abefore / after?package=Bbefore / after'',sys_metadata'',sys_metadataThe boot load reported
{loaded:1, errors:0}and left the holder's slot holding the holder's own item. A boot load run before the package registers, and then the package, also gives 200 own at each holder's exact address.Acceptance notes
no; review#3's contract record (6885158237) ruled the exported return type public surface, so a caller narrowing through the predicate'struebranch stops compiling:yes (narrowing),!title, BREAKING paragraph, one ADR-0087 not-required marker (same reading as review#1 on fix(lint)!: os validate and os build resolve a dashboard's dataset through the reader's declared closure, as the runtime does #33121). Delta head 82cc3c1 changes only the changeset and this body.reach:none measured.Verification
Derived gate families (
node scripts/pm/dispatch-gates.mjs --commands, from the tree at the merge head4bb529d89): 64 commands. Each was run, and its exit code was captured before any pipe:check:changeset-no-major,check:adr-0087-registration,check:empty-changeset,check:closing-keyword-parity,check:nul-bytes,check:test-source-alias,check:cross-package-test-inputs,check:type-check-coverage,check:type-check-debt,check:durability-log-level,check:engine-double-contract,check:published-files,check:dts-closure,check:doc-authoringandcheck:issue-citations.pnpm check:dual-build-cjs-loads, exit 3,PREREQUISITE NOT MET. It reads every package'sdist/, and this worktree did not build the whole repo. CI carries it.dispatch-gates --ranwith the exit codes recorded: 64 derived, 63 run, 1 NOT-MEASURED (derived from the recorded exit 3), 0 UNRUN.eslint --no-inline-configon the three changed.tsfiles gives exit 0. The repo-widepnpm lintis CI's.check-platform-checklist --changed-fromdoes not apply.integrationlayers are CI's. The title carries no!and there is no(narrowing)arm, so no dogfood battery is owed.Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382
🤖 Generated with Claude Code