fix(spec): enableOnInstall becomes optional() so absence survives the parse - #19690
Conversation
The published declarations claimed `.default(true)` — "absent means enabled" — while the install door has honoured 「缺省 = 保持,有旗 = 设置」 since the runtime half landed: absent makes no lifecycle call, so a package an operator disabled stays disabled across a re-install. A `.default()` resolves absence at parse time, which erases the third state from the published surface and leaves a declared-but-unenforced default on a contract this repo does not own both ends of. `optional()` keeps the state visible; the `true` and `false` arms are unchanged. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
The #18605 consistency pin asserted `true` on every 缺省 (absent) reading, which was the behaviour this change moves. The cell is flipped with its registered flip-trigger phrase rather than patched green, so the next reader meets the reason instead of a silently edited expectation. Only the 缺省 cell moves. The `true` and `false` arms are re-read after the change on all three declarations — a fix that makes absence visible by making the key mean nothing would be worse than the defect. `check:authorable-surface` refuses an undeclared default move, so the four published def keys are declared in DEFAULT_CHANGES_BY_MAJOR. Four keys from three declarations: `InstallPackageRequestSchema` is re-exported through `src/api/protocol.zod.ts` and publishes under both `kernel/` and `api/`. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
`gen:docs` reprojects the four published defs whose `describe` moved: the `(default: true)` cell is gone and the prose now states all three states. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
…ableoninstall-optional
…ableoninstall-optional
📓 Docs Drift CheckThis PR changes 1 package(s): 10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 136 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 107281972e65586c76e512e72c205c16f3153436 && git checkout 107281972e65586c76e512e72c205c16f3153436
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1d41aa88553754276eb350c1a068a817d3560e2d 6584b9dcd72706e4ca9af7291424297fbc50461a && git checkout -B drift-repro 1d41aa88553754276eb350c1a068a817d3560e2d && git merge --no-ff 6584b9dcd72706e4ca9af7291424297fbc50461a
node scripts/docs-audit/affected-docs.mjs --json 1d41aa88553754276eb350c1a068a817d3560e2d
|
The header block claimed this file "registered in advance" the phrase the 缺省 cell would later flip on. Measured on the parent commit: the file carried no such phrase and no flip or trigger note of any kind — zero hits for 缺省 / 保持 / 有旗 / flip / trigger, with `MATRIX` and `absent` as the controls proving the file was read. The claim was false about this repository, and it contradicted the const's own docblock twenty lines below, which said correctly that the phrase is registered here. The const's version is the true one and is kept. The header now states that the trigger is registered WITH the flip rather than ahead of it, and records the gap as the lesson: a pin written against a contested cell needs its trigger when the pin lands, while the contest is known, not when the cell finally moves. Comment-only. No assertion, matrix cell, changeset or declaration moves. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
Contract review
Reviewed-by: ⛔ Reviewed against the diff and Which limb of clause ② this is — and which it is NOT⛔ The accept set does not move, in either direction. ✅ What moves is the published PARSE OUTPUT and the published surface — two of the other three forms at once:
⭐ The consumer this actually protects is the sharpest thing in the diff, and it survives my own re-reading: a client that VALIDATES its request through the published schema materialised What this seat verified by reading the diff, ⛔ not the report
One item was sent back before this record, ⛔ not waved throughThe pin's new header claimed Declared, so it is not discovered later
VerdictACCEPT. CI on this head: 33 success · 2 skipped · 0 incomplete, latest-per-name, Generated by Claude Code |
Carrier stripped on PASS, and the record it cites. 2026-09-22T09:10Z
The record: the in-seat contract review at ⛔ Why this PR was ejected at 08:48:24Z — the fault is this seat's, stated rather than left as a mystery
⇒ this seat enqueued with the carrier still hung. The protocol's step 3 (strip on PASS, cite, re-enqueue) was written into this seat's own notes as a POST-landing step; it is a PRE-enqueue one. Corrected here, and corrected for the sibling PR #19685, which was ejected by the identical leg at 09:00:35Z for the identical reason. Generated by Claude Code |
⛔⛔ WITHDRAWN AS THE REVIEW OF RECORD — this seat is not at
|
Docs drift — receipted by the seat, with the reading that answers the run's own gap. 2026-09-22T09:29Z
The gap the run declared, answered rather than inherited
Those three files are the GENERATED authorable-default ledgers, and what documents them is the served JSON Schema rendered into The question that actually matters, and its measurementThis PR removes a published DEFAULT. The page it could falsify is one that states 「absent means enabled」. Measured over
⇒ it shows the key optional and written explicitly as The other nine pagesEvery one is matched through a ROUTE literal (
Generated by Claude Code |
Contract review
Served-tier: Reading time: 2026-09-22T09:33Z — checks, mergeability and carriers read at this instant. Rendered by the isolated at-tier review subagent spawned by the ① Derived judgmentsLimb. ⛔ Not 收紧, ⛔ not 放宽. On all three declarations the only change is
So the seat's two readings hold, tested independently: the accept set does not move, and the clause is hit by the published parse output plus the Consumer observability. In-repo: none — no serving path parses through the schema, so no deployed behaviour moves. Out-of-repo: only a caller that validates through the published schema and sends the PARSED object; for that caller absence used to materialise as an explicit Pin discipline. PR #19130's consistency pin FLIPPED with Direction. Ruled, not chosen: batch #210 item 4 letter A (
Non-blocking, declared so it is not discovered later. Two comment sentences elsewhere go stale once this lands — ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS — on head Generated by Claude Code |
…ableoninstall-optional # Conflicts: # packages/spec/src/kernel/package-registry.zod.ts
Discharges the merge commit's os-regen deferral. The three pages both sides moved were restored to main's side by the regen-merge script's step 2 — the driver had merged them with exit 0 while silently dropping one side — and are re-derived here from a dist built on the merged source, never text-merged. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
Contract review
Served-tier: CONTRACT_REVIEW_TIER — the constant's NAME; verified first on Reading time: 2026-09-22T10:40Z — checks, mergeability and carriers read at this instant. Rendered by the isolated at-tier review subagent spawned by the ⭐ This record SUPERSEDES ① Derived judgmentsWhat moved between the two heads, measured. Condition ① — Condition ② — the describe. The merged Condition ③ — the docblock. Both sections stand: Condition ④ — regenerated, ⛔ never text-merged. This is the one only the generator can answer, so it was answered by the generator, four ways.
Condition ⑤ — the one-authority matrix re-run. Limb, re-affirmed on this head. ⛔ Not 收紧, ⛔ not 放宽: ② Semver level
③ Boundary flags
Joint with Carried from Still standing, outside this PR: CI on this head: 35 check runs — 33 Implemented-by: VERDICT: PASS — on head Generated by Claude Code |
Carrier stripped on the at-tier PASS, and the record it cites. Enqueueing. 2026-09-22T10:41Z
The record: the at-tier contract review at Read back by this seat before stripping: heading present · head sha alone in a code span · One question this seat handed the reviewer rather than deciding — and it was right not to decide it
Ruled: no — and ⛔ do not file it either. The reviewer found what this seat had not: card #19339 ( Generated by Claude Code |
Fixes #19273
Clause-②: yes
Ruling batch #210 item 4 · letter A · maintainer 「210 同意」 (
5770455384, 2026-09-22T02:41Z). The direction was ruled, not chosen here.The defect
packages/runtime/src/domains/packages.ts:1095has honoured 「缺省 = 保持,有旗 = 设置」 since PR #19291 landed:truecallsenablePackage,falsecallsdisablePackage, and an absent key makes no lifecycle call at all — so a package an operator disabled stays disabled across an upgrade. Verified unchanged on this branch; the runtime is not touched by this PR.The published declarations said something else.
z.boolean().default(true)resolves absence at parse time, so a request that omitted the key came out of the parse byte-identical to one that settrue. The third state did not exist on the published surface while the door went on acting on it — a declared default the runtime deliberately stops applying, on a contract this repo does not own both ends of.What changed
All three declarations now spell
z.boolean().optional(), with the semantics on the field in both thedescribeand the docblock — absent = keep the row's current lifecycle state; explicittrue/falseunchanged; a fresh install lands enabled:api/PackageInstallRequest— the authoritypackages/spec/src/api/package-api.zod.tskernel/InstallPackageRequest— the copypackages/spec/src/kernel/package-registry.zod.tsmarketplace/MarketplaceInstallRequest— a different party's keypackages/spec/src/marketplace/marketplace.zod.tsThe executable criterion, both directions
Read off the built package (
packages/spec/dist), notsrc/, at headf5b094a96:The
trueandfalsearms are re-read after the change on all three declarations, never assumed — the card's control in the other direction: a fix that makes absence visible by making the key mean nothing would be worse than the defect. The two refusal cells are unmoved: a string'false'andnullare still refused by name.PR #19130's consistency pin — flipped with its trigger registered, ⛔ not patched green
packages/spec/src/api/package-install-one-authority.test.tsassertedtrueon every 缺省 reading. Only the 缺省 cell moves; thefalse,true, string andnullcells are untouched, and the authority/copy agreement is still judged cell by cell.The flip-trigger phrase registered in the test is:
It is a named
FLIP_TRIGGERconst with its own docblock explaining that while the declarations spelled.default(true)the 缺省 reading was living on borrowed time — the phrase says absence is a state the door ACTS ON, and a.default()resolves absence at parse time so that state cannot survive to the published surface. It is quoted into the 缺省 cell's name so a test run prints it, and into the two flipped assertion titles. The file's header docblock carries a section stating that the cell FLIPPED, that this was expected on the day the pin landed, and that reading the red as "the pin needs updating" and writing the new value in silently is the failure the const exists to prevent.Beyond the three declarations, their tests and the changeset, four more paths are in this diff. Each is mechanically forced; none is a discretionary edit.
packages/spec/scripts/lib/default-changes.ts(+101).check:authorable-surfacerefuses the build on an undeclared move of an authorable key's default, and prints the copy-pasteable block naming each key and both fingerprints. The build exits 1 until the entries exist. Four entries are required, not three:InstallPackageRequestSchemais re-exported throughsrc/api/protocol.zod.ts, so one declaration publishes under two def keys (kernel/InstallPackageRequestandapi/InstallPackageRequest, byte-identical but for the$id) — theCreateImportJobRequest/ImportRequestshape already in that table. The ratchet names keys, not schemas, so dropping either row leaves that def unauthorised and the gate red.packages/spec/authorable-defaults/{api,kernel,marketplace}.json(-4 lines total). Generated.pnpm --filter @objectstack/spec buildwrites them; exactly the four… = trueentries are removed and nothing else moves.content/docs/references/{api/package-api,api/protocol,kernel/package-registry,marketplace/marketplace}.mdx(+5 / -5). Generated bygen:docs, run viacheck:generated --fix, which regenerated only the one artefact it proved stale. The four projected rows lose their(default: true)cell and gain the three-state prose. No other row moves.authorable-surface/*.jsonandauthorable-surface.base.jsonare not in this diff: the keys stay authorable, and the base anchor is only ever written by the explicitgen:authorable-surface-base, never by a build.Verification
Reconciliation line, verbatim, derived and run at head
f5b094a96:✓ dispatch-gates --ran: 108 derived famil(ies) accounted for — 108 run, 0 NOT-MEASURED (a DERIVED zero — all 108 recorded an exit code and none of them is 3).Every command's exit code was captured before any pipe; no command answeredexit 3, so nothing in the derived set measured nothing.Everything below ran in the foreground; each heavy run went through
scripts/pm/os-verify-lock.shwithOS_VERIFY_LOCK_SLOT=issue-19273, and each verdict is that wrapper's ownVERDICT command-exitline, never a bare shell status.pnpm --filter @objectstack/spec testVERDICT command-exit 0— 512 files, 14955 passed, 1 todopnpm --filter @objectstack/rest testVERDICT command-exit 0— 194 files, 3265 passed, 1 skippedpnpm --filter @objectstack/runtime testVERDICT command-exit 0— 272 files, 3799 passed, 1 skippedpnpm exec turbo run typecheckVERDICT command-exit 0— 143 tasks successfulpnpm buildVERDICT command-exit 0— 73 tasks successfulpnpm --filter @objectstack/spec check:generatedVERDICT command-exit 0— all 15 generated artifacts up to datepnpm linteslint . --no-inline-config), not narrowed — so no narrowing evidence is owedorigin/mainwas merged and the build state refreshed before the final push; the generated re-check and the union above were both taken after that merge, on the head this PR carries.Zero consumers found that parse an install request through the published schema. The instrument's reachable radius, stated because a zero without one is not a reading:
objectstack-ai/objectstackatf5b094a96—packages/**,apps/**,examples/**,scripts/**,content/**,docs/**,skills/**, excludingnode_modules. Andobjectstack-ai/objectuiat0cf2d66, the only sibling checkout in this container, excludingnode_modules.enableOnInstall— 0 hits.PackageInstall(the schema name) — 0 hits. Control that proves the instrument reads that tree:packages.install//api/v1/packages— 52 hits. So objectui calls the install route and never names the key, never parses through the published schema.objectstack-ai/cloud(no checkout exists in this container) and any third-party consumer of the published@objectstack/spec. The changeset body and all fourDEFAULT_CHANGES_BY_MAJORreasons are written for exactly that unreachable consumer — the caller who validates before sending — because they are the only channel that reaches them.Changeset grade
minorfor@objectstack/spec, ⛔ not thepatchruling #157 item 5 wrote. Ruling #210 item 4 overrode it and the override is measured:check-changeset-no-major.mjs'sjudgeLevelverdictenforcerefuses a clause-②-carrying diff whose moved packages are gradedpatchwith none atminoror above. Judged againstpackages/spec/package.json'sfiles[]after a build as usual —dist/andjson-schema/both ship, and both move here — so the floor and the measurement agree.node scripts/check-changeset-no-major.mjs --base origin/mainandnode scripts/check-adr-0087-registration.mjs --base origin/mainboth exit 0 on this head.⛔ Fences honoured
packages/runtime/src/domains/packages.ts:1095verified to still readconst requestedEnabled = wrapped ? body?.enableOnInstall : undefined;. The runtime is not in this diff.Acceptance notes
None. Nothing outside this card's scope was surfaced that meets the filing bar.
维护者速读(草稿)
改了什么 — 三处
enableOnInstall声明从「默认 true」改成「可缺省」。安装接口的实际行为半年前就被裁决改成了「不写这个键 = 保持这个包当前的启用/停用状态」,但对外发布的协议声明一直还写着「不写 = 启用」。这次让声明跟上已经生效的行为。为什么改 — 声明与实际不一致,受伤的是仓库外面的调用方。一个会先按协议校验请求再发送的客户端,会从「默认 true」里自动补出一个
enableOnInstall: true发过来;而这个显式的 true 的含义是「强制启用」。结果就是:同样一个请求体,先校验的那一方会在每次升级时把运维手动停用的包悄悄重新打开,不校验的那一方则正常保持停用。两边行为相反,差别只在于有没有先校验。风险与代价(含回滚) — 本仓内运行时行为零变化:安装接口读的是原始请求体,没有任何服务路径经过这几个 schema 解析,接受集也一个字节没动(缺省、true、false 照收,字符串和 null 照拒)。真正受影响的是仓外那位会校验的调用方,处方已写进 changeset 和四条默认值台账记录里:想要每次都强制启用,就把
enableOnInstall: true显式写出来。回滚代价低——三处声明改回.default(true)、撤掉四条台账记录、重跑生成即可,但回滚会把「声明 ≠ 实际」这个问题原样退回去。席位意见 —
你要做的 — 确认一件事就够了:仓外(尤其 cloud 侧和第三方)有没有会先按发布的 schema 校验安装请求、再把校验后的对象发出去的调用方。本次探测半径只到本仓和 objectui 两棵树,读数为零且带正控(objectui 会调安装接口但从不提这个键);cloud 在本容器里没有检出,所以那边是未测,不是「没有」。若那边确实有这样的调用方,它就是这次改动唯一会碰到的对象,而 changeset 里的处方正是写给它的。
Generated by Claude Code