Repository navigation
fix(cloud-connection, driver-sql): a package upgrade relaxes the NOT NULL its own declaration makes nullable - #33769
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jV7qVLvKw6wnC1Kwdy
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jV7qVLvKw6wnC1Kwdy
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jV7qVLvKw6wnC1Kwdy
…face Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jV7qVLvKw6wnC1Kwdy
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jV7qVLvKw6wnC1Kwdy
📓 Docs Drift CheckThis PR changes 3 package(s): 10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 20 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 742593aa121cc77d91d9b879dd322cd12a0bdfa0 && git checkout 742593aa121cc77d91d9b879dd322cd12a0bdfa0
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 12a0f09fca49bf90747e9cea21d566229c33de70 b99495bed5d07f92713a0ffe411b26dca7c5745b && git checkout -B drift-repro 12a0f09fca49bf90747e9cea21d566229c33de70 && git merge --no-ff b99495bed5d07f92713a0ffe411b26dca7c5745b
node scripts/docs-audit/affected-docs.mjs --json 12a0f09fca49bf90747e9cea21d566229c33de70
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ Request: review · PR #33769 · S2/A4 · Part of #33724 · head 9ef79bb Reviewer: review-b of seat domain:server#5. Report: 6892684526 on #33724. Clause-②: no · Metadata-protocol: none. 676+/4−, 12 files (cloud-connection install door step 4b″, driver-sql relaxDeclaredNotNull, schema-drift remedy text, driver-turso remote face row). |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review claim · head 9ef79bb · 2026-11-15T10:02Z review (review-b, areas S2+S4). Verdict follows on this PR. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review — FAILHead-sha: review (review-b, areas S2+S4) · read at 2026-11-15T10:05Z · diff read against GitHub at this head (merge-base Must-fix
Should-fix (fold into this PR, ≤30 lines)
Nit
Checked and holds
|
…ithout the relax door The install relax is now pinned not to run when the hot-register fails leniently, and an object whose driver has no relax door is logged at warn. The changeset declares the new public exports as a widening. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jV7qVLvKw6wnC1Kwdy
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Contract reviewServed-tier: review (review-b, areas S2+S4) · 2026-11-15T10:18Z · face: declaration. The review is owed by the ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review — PASSHead-sha: review (review-b, areas S2+S4) · 2026-11-15T10:18Z · delta review of
Not changed by the delta: driver-sql and driver-turso (as at Check-runs at this head (read at review time):
Follow-ups, not part of this PR:
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ 席位核对ACCEPT · area S2 (A4) · head
Landing: held. This area has no maintainer authorising line yet, so |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ Landing · area S2 · maintainer authorising line in this area thread: 「本区通过复审的 PR 都可以 ready + auto-merge」. Head unchanged since the ACCEPT; mergeable_state clean. pr_ready + automerge_enable. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG Landing · 2026-11-15T11:08Z Authority: maintainer line 「server 车道通过复审、检查全绿的非受管 PR,你可以 ready + auto-merge」 (seat thread, 2026-11-15T11:06Z)
State: pr_ready + automerge_enable now; #33724 (Part of) keeps its remaining parts; seat clears pm:dispatched by hand if nothing remains on MERGED. |
…holds (objectstack-ai#33991) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbSUQWB2j9eHYsRcrCiq1X1C)_ Fixes objectstack-ai#33200 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - **改了什么:** 「设置上级」(Set Manager) 现在只拒绝真正由 SCIM 目录同步的人;只通过 SSO 登录、背后没有目录的人,管理员可以照常改上级。按钮对平台管理员在每一行用户上都显示。 - **为什么改:** 托管环境里第一次通过平台 SSO 登录的人都会被标成 `idp_provisioned`,旧规则把他们全当成「目录持有」,登录后上级就再也改不了,按上级流转的审批跟不上组织调整。按裁决记录 6895645364 选项 A 修。 - **风险与回滚:** 只放宽:以前能成功的请求没有一个变成拒绝。SCIM 判定多读一次 `sys_scim_subject`,读失败返回 500 且不写入。回滚即 revert 本 PR。 - **先看:** `admin-set-user-manager.ts` 的 refusal 5 判断(`applyUserManagerLink`);`scim-sso-adoption.ts` 新导出的 `isHeldByScimDirectory`;`sys-user.object.ts` 的 `set_user_manager` `visible`。 - **两分钟验证:** `pnpm --filter @objectstack/plugin-auth exec vitest run src/admin-set-user-manager.test.ts`,预期 38 个全过,其中 "an SSO-only identity ... is SET like a local one" 为 200 并写入 `manager_id`。 - **需要你做的:** 无,席位落地。 ## What changes Built to the maintainer ruling recorded in 6895645364 (option A: only identities a SCIM directory holds stay locked). - **`POST /api/v1/auth/admin/set-user-manager` (refusal 5).** It refused on `sys_user.source = 'idp_provisioned'` alone. ADR-0135 D4 stamps that value on every federated link without a local password, so a person who only signs in through SSO carried it with no directory behind them. The refusal now also needs a `sys_scim_subject` row. The answer for a SCIM-held identity keeps its envelope (`403 PERMISSION_DENIED`, `details.reason: 'idp_provisioned'`), and the message says to change the manager in the directory. It no longer claims a sync would revert the value, because nothing projects the SCIM `manager` attribute onto the column today. The self, cycle, depth and cross-organization refusals are unchanged. - **One predicate, imported.** `scim-sso-adoption.ts` now exports `isHeldByScimDirectory(engine, userId)`. It is the same `sys_scim_subject` read its adoption judge already ran as condition 2, moved into an exported function. The judge calls it, and so does the endpoint. A missing `sys_scim_subject` table reads as "not held" at the endpoint. Any other read failure propagates, so the mount answers 500 and writes nothing. - **The `source` term stays a conjunct.** A SCIM-provisioned user with a local password is `env_native` under D4 and was accepted before. Requiring the SCIM row alone would have refused that user, so the endpoint still checks `source` too, and no request that was served before is refused now. - **Bulk import and demo staff.** Both run `applyUserManagerLink`, so their `manager_id` links follow the same rule with no code change. The import docblock now says who is refused. - **`sys_user.set_user_manager` visibility** is `current_user.isPlatformAdmin == true`. No column on the row says "held by SCIM", so the button is shown on every row and the endpoint refuses a SCIM-held one with its message. No new field or key. - **Lint prescription.** `os explain approval-approvers-may-resolve-empty` now says the operation refuses an identity a SCIM directory holds, and that an identity that only signs in through SSO is set like any other. The docblock in `validate-approval-approvers.ts` says the same. - **Docs.** `content/docs/automation/approvals.mdx`, `content/docs/capabilities/approvals.mdx` and `content/docs/permissions/authentication.mdx` state the narrowed refusal. - ⛔ The `idp_provisioned` stamp (ADR-0135 D4) and the password refusals are untouched. ## Tests On head `fa70eaa06`: - `admin-set-user-manager.test.ts`, refusal 5 rewritten. SCIM-held SET and CLEAR give 403 `PERMISSION_DENIED` / `idp_provisioned`, write nothing, and read `sys_scim_subject` for that user. SSO-only SET and CLEAR give 200, and `update` gets `{ id, manager_id }`. An SSO-only self-assignment is still a 400 `self_assignment`. `env_native` gives 200, also with a SCIM subject, and the SCIM table is not read. A missing table gives 200. A failed read rejects and writes nothing. - `admin-import-users-manager-pass.test.ts`: a SCIM-held row is refused with `idp_provisioned`. An SSO-only row is `linked`, and `manager_id` is written. The no-fork pin also asserts that the importer spells neither `sys_scim_subject` nor `isHeldByScimDirectory`. - `demo-staff.test.ts`: the refusal fixture is now a SCIM-held identity. - `sys-user-set-manager-action.test.ts` and `platform-objects.test.ts`: the action is offered on an `idp_provisioned` row and on the sparse face. It is hidden from a non-admin. It reads no record column, which has a positive control on the standing term. - `validate-approval-approvers.test.ts`: the new prescription is present, and the old `source 'idp_provisioned'` sentence is absent. <details><summary>Suite runs</summary> - `@objectstack/plugin-auth` full suite (locked, before the demo-staff fixture fix): 276/277 files. The one red was `demo-staff.test.ts`, whose fixture is fixed in the next commit. Re-run: `demo-staff.test.ts` + `demo-staff-provisioning.test.ts` 32/32. - Targeted: plugin-auth 3 files 76/76; platform-objects 2 files 169/169; lint 1 file 64/64. - `@objectstack/platform-objects` full: 122 files, 1994 tests passed. `@objectstack/lint` full: 212 files, 9026 tests passed. - Typecheck exit 0 for plugin-auth (all three legs, incl. `check:test-typecheck`), platform-objects and lint. - Dependent: `@objectstack/runtime` `platform-admin-action-gate.test.ts` 16/16. </details> <details><summary>Ablations (each mutation landed by ablation-replace.mjs, restored to the HEAD blob)</summary> - A1, refuse on `source` alone (the old predicate): 7 red, incl. every SSO-only pin in both endpoint and import suites. - A2, no refusal 5 at all: 4 red, incl. SCIM-held SET, CLEAR and the import row. - A3, refuse on the SCIM row alone (drop the `source` conjunct): 1 red, "env_native ... even one that owns a SCIM subject". - A4, swallow every SCIM read failure: 1 red, "a FAILED SCIM-subject read is never read as no directory". - A5, put the `record.source` term back on `visible`: 5 red across `sys-user-set-manager-action.test.ts` and `platform-objects.test.ts`. - A6, put the old lint sentence back: 1 red, "GRADES the routes". - A7, missing table rethrows: 1 red, "a missing sys_scim_subject table means no directory". </details> ## Acceptance notes - SCIM-held users stay unchangeable from both sides until the SCIM `manager` projection lands. The ruling records this and the separate card objectstack-ai#33918 carries it. - The action's `helpText` still lists the four other refusals and not the SCIM one. The endpoint message names the directory. Changing `helpText` would move nine translation bundles, so it is left as it is. - `details.reason` keeps the value `idp_provisioned` so no client keyed on it changes. Only the predicate behind it narrowed. ## Verification - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`: 105 derived families. 101 exit 0. 3 exit 3 (prerequisite not met, NOT MEASURED, left to CI): `check:skill-examples`, `check:dual-build-cjs-loads`, `check:i18n`. 1 not run: `check:type-check-debt`, because the verify lock was held by another run for more than 60 minutes. `--ran` reconciliation agrees. - `--tier`: no path-derived mandate. The same verdict as merged objectstack-ai#33646 and objectstack-ai#33769. - eslint on the changed `.ts` files: exit 0. `check-nul-bytes`: OK. - `git merge-tree --write-tree` of this head against `origin/main`, objectstack-ai#33956, objectstack-ai#33268 and branch `claude/area-A2-33828`: clean, no conflicted paths. Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
…LOG line, and an 18-5 page erratum (objectstack-ai#34042) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9EaC9kmPYBDw3v97tMkTaQu)_ Fixes objectstack-ai#33903 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:18.5.0 已发布但发布说明漏记的 11 条变更,补进 14 个包的 CHANGELOG 18.5.0 节(私有包 app-shell 补在它这次发的 18.4.1 节),删掉这 11 个 changeset 文件,并在 18-5 发布页加一节勘误。 - 为什么改:18.5.0 的版本提交 `b914e724` 没有消化这 11 个 changeset,代码已随 18.5.0 发出,但 CHANGELOG 和发布页都没写;其中 objectstack-ai#33637 是破坏性变化(`os audit verify` 遇到被两个 checkpoint 同时列出的行,现在报 `listed_twice` 并失败)。按裁决 6896138728「事后补就可以」只做补记。 - 风险与回滚:纯文字,不发布代码;删掉的 changeset 若留着,下一个版本会把它们当新变化再发一遍。回滚即 revert 本 PR。 - 先看:`content/docs/releases/v18/18-5.mdx` 的勘误节;`packages/plugins/plugin-audit/CHANGELOG.md`(破坏性那条);`packages/spec/CHANGELOG.md`(两条,其中一条进 Minor Changes)。 - 两分钟验证:`git grep -c -E '^- (ac0b9a5|2e1e3b9|fbe349f|2673f59|0feb5ff|1e65a38|e302d32|f8f35db|e0775f7|4b5024d|81371e1): ' -- '*CHANGELOG.md'` 预期 14 个文件共 18 行;`ls .changeset/*.md | wc -l` 比 main 少 11。 - 需要你做的:无,席位落地(Check Changeset 会按规则保持红色,见下方 DELIBERATE CORRECTION)。 ## What changes `packages/*/CHANGELOG.md` and `content/docs/releases/` are release-owned. AGENTS.md (Documentation Guardrails) routes a factual error in a released entry, or on a releases page, to a dedicated docs-only PR, and the maintainer's ruling on this card (comment 6896138728, verbatim: 「没必要,事后补就可以:让发布流程在版本提交之前还有没消化的 changeset 时,拒绝发正式版。」) keeps only the amendment half. This is that PR. Precedent: objectstack-ai#33925. The 18.5.0 version commit `b914e724` (objectstack-ai#33097) consumed 283 of the 294 changesets on its parent. The other 11 landed on `main` after the Version Packages branch point `b76df9a6` and before the merge; each one's adding commit is an ancestor of `b914e724`, and its file is byte-identical on `b914e724` and on this branch's base `bc6b7ffd`. 1. **CHANGELOG entries.** Each changeset's entry is added to the release section `b914e724` wrote for each package it names, in the stock generator's form (`- SHA7: ` + the summary, continuation lines indented two spaces), under the commit that added the changeset, in the `### Minor Changes` or `### Patch Changes` list its bump names, after the last changeset entry and before the `Updated dependencies` lines. No dependents line is invented. 2. **The 11 changeset files are deleted**, so the next version commit does not present them as new. 3. **The 18-5 page** gains `## Erratum — eleven changes 18.5.0 shipped with no CHANGELOG line [#erratum]`: objectstack-ai#33637's FROM → TO and what an operator does, one line for each of the other nine, and a pointer from the release-facts row that said 284 were consumed. objectstack-ai#33725 is already on the page (自动迁移, "Announced, not yet at any door"); it is checked, not repeated. | Changeset | Package | Added to | Commit | 18-5 page | | :--- | :--- | :--- | :--- | :--- | | `31908-p4b2-bounded-checkpoints` | `@objectstack/plugin-audit` | `## 18.5.0` › Patch Changes | `ac0b9a5` (objectstack-ai#33637) | Erratum, breaking: FROM → TO, what to do, rollback note | | `33186-managed-add-people-actions` | `@objectstack/platform-objects` | `## 18.5.0` › Patch Changes | `2e1e3b9` (objectstack-ai#33755) | Erratum, one line | | `33609-related-list-parent-lookup-page` | `@object-ui/console`, `@object-ui/plugin-detail` | `## 18.5.0` › Patch Changes | `fbe349f` (objectstack-ai#33780) | Erratum, one line | | `33649-messaging-preferences-emitting-organization` | `@objectstack/service-messaging` | `## 18.5.0` › Patch Changes | `2673f59` (objectstack-ai#33779) | Erratum, one line | | `33660-ai-model-picker-cost-multiplier` | `@objectstack/spec`, `@object-ui/plugin-chatbot`, `@object-ui/i18n`, `@object-ui/console`; `@object-ui/app-shell` | `## 18.5.0` › Patch Changes; app-shell `## 18.4.1` › Patch Changes | `0feb5ff` (objectstack-ai#33746) | Erratum, one line | | `33689-ai-action-confirmation-elicited` | `@objectstack/spec` | `## 18.5.0` › Minor Changes | `1e65a38` (objectstack-ai#33725) | Already covered (自动迁移 row), not repeated | | `33724-install-relaxes-declared-not-null` | `@objectstack/driver-sql`, `@objectstack/cloud-connection`, `@objectstack/driver-turso` | `## 18.5.0` › Patch Changes | `e302d32` (objectstack-ai#33769) | Erratum, one line | | `33739-scenario-runner-effort` | `@objectstack/scenarios` | `## 18.5.0` › Patch Changes | `f8f35db` (objectstack-ai#33767) | Erratum, one line | | `33753-scenario-dates-follow-run-date` | `@objectstack/scenarios` | `## 18.5.0` › Patch Changes | `e0775f7` (objectstack-ai#33776) | Erratum, one line | | `33754-scenario-grader-written-date` | `@objectstack/scenarios` | `## 18.5.0` › Patch Changes | `4b5024d` (objectstack-ai#33797) | Erratum, one line | | `a2-skills-docs-32678-32825` | `@objectstack/skills` | `## 18.5.0` › Patch Changes | `81371e1` (objectstack-ai#33355) | Erratum, one line | **DELIBERATE CORRECTION.** This PR adds no changeset and deletes eleven (`git diff --name-status` over `.changeset/*.md`: 11 × `D`, 0 × `A`). Each deleted note is already released: its text now stands, unchanged, as the entry named in the table above, in the 18.5.0 tarballs' release section. Under ruling D on objectstack-ai#18375 (the Check Changeset step's route 0) and `.claude/agents/os-dev.md`, `skip-changeset` is not applied to a PR that deletes an existing changeset, so `Check Changeset` stays red by design; it is not a required context. The diff publishes nothing until the next release republishes the tarballs. ## Tests No source changes, so no test suite moves. The CHANGELOG lines are generated, not hand-typed: the summary parse and the stock release-line format were re-implemented in a script and first checked against `b914e724^`: for every changeset `b914e724` consumed among the first 60 (103 package entries), the generated text is found verbatim in that package's CHANGELOG; the only miss is `31908-p4b2-bounded-checkpoints`, the unconsumed one this PR adds. The script asserts, per changeset, one adding commit, an identical blob at the tag and at the base, the release section being the top section of the version `b914e724` gave the package, and the entry not already present. The diff of every CHANGELOG is insertions only. ## Acceptance notes 1. `@object-ui/app-shell` is private and `b914e724` versioned it `18.4.1`, not `18.5.0` (the 18-5 page's release facts say so too), so its entry goes into its `## 18.4.1` section. 2. The 18-5 page still opens with "Release status: 18.4.0 is released, and 18.5.0 is not yet." and its release facts say no 18.5.0 tag or npm version exists. Both are stale since the publish. Outside this card's file surface; left for the seat (noted, not filed). 3. The changeset of objectstack-ai#33649 has no summary line, so its entry opens `- 2673f59: Clause-②: no`, as the stock generator would have written it. ## Verification <details><summary>Premise readings, at base bc6b7ff and the 18.5.0 spec tag = b914e72</summary> - `git ls-tree --name-only b914e72 .changeset/` minus `README.md` and `config.json`: 11 files, the card's list. `b914e724^` holds 294; `b914e724` deletes 283. - For each of the 11: `git rev-parse b914e72:PATH` equals `git rev-parse bc6b7ff:PATH`; the adding commit (`git log --diff-filter=A`, one per file) is an ancestor of `b914e724` (`merge-base --is-ancestor` exit 0, after deepening the shallow clone by 800 commits). The adding commits all fall between `b76df9a6` (the Version Packages branch point the 18-5 page names) and `b914e724`. - Before this PR: `listed_twice`, `ac0b9a5`, `objectstack-ai#33637` each 0 hits on `content/docs/releases/v18/18-5.mdx`. - The erratum's wording is read from the changeset text and `packages/plugins/plugin-audit/src/audit-seal/verifier.ts` (`listed_twice` fault: `checkpoint N: lists row(s) … that another checkpoint already lists`), `content/docs/deployment/cli.mdx` § `os audit verify` (exit 1 when two checkpoints list the same row), and the 18.5.0 entry `f4cafd5` (a late checkpoint leaves out every row a checkpoint stored in between already lists). </details> <details><summary>Gates</summary> Head `f5754612`. Derived with `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` (no paths): 99 commands, each run with stdin from `/dev/null` and its exit captured before any pipe; `--ran` reconciliation: 99 derived, 99 run, 0 NOT-MEASURED, 0 UNRUN. - 98 exit 0. Eleven of them first exited 3 (PREREQUISITE NOT MET, no `dist/` in a fresh worktree) and were re-run exit 0 after the builds they name, each under `scripts/pm/os-verify-lock.sh` with VERDICT command-exit 0: the `@objectstack/lint...` closure plus the `check:i18n` extract closure (64/64 tasks), `@objectstack/client` and `client-react` (43/43), then `pnpm build` (119/119). Re-run: `check:doc-formula-expressions`, `check:doc-security-posture`, spec `check:docs`, spec `check:skill-examples`, `check:docs-transcript-drift`, `check:i18n`, `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:sourcemap-no-sources-content`; and `pnpm --dir ui exec vitest run scripts/`, which first failed 22 files only on the missing `@objectstack/spec` `dist/` and then passed (171 files passed, 2 skipped; 5,065 tests passed). - 1 exit 1, by design: `node scripts/check-empty-changeset.mjs --base origin/main` refuses the eleven deletions as edits of existing notes (one `::error` per file). This is the DELIBERATE CORRECTION class declared above; it stays red, and so does `Check Changeset`. - Release-text gates all exit 0 on the amended tree: `check-release-section-coverage` (plain and `--strict`), `check:release-notes`, `check:release-page-status`, `check-affected-docs`, `check:doc-authoring`, `check:doc-anchors`, `check:nul-bytes`, `check-adr-0087-registration --base origin/main`. `origin/main` moved to `159757ab` while the gates ran; the commits since the base `bc6b7ffd` touch none of this PR's paths (they add four other changesets), so no merge was taken. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmPfCRZtZTTC4KzLjJR)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPfCRZtZTTC4KzLjJR <!-- signed: domain:devx#2 · os-steve · session_01ADHkmQTVjryTSkqydKVS6z --> Co-authored-by: Claude <noreply@anthropic.com>
…er of a name two packages hold (objectstack-ai#34092) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbBePzY6g11h3hyWk5ud4vWy)_ Fixes objectstack-ai#33832 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:两个包同名的仪表板、报表(以及同类"按包寻址、但元数据服务按名字只存一份"的类型)在删除一条记录后,注册表自动修复不再把"最后注册的那个包"的内容塞进裸槽位。 - 为什么改:元数据服务对这些类型每个名字只留最后注册的一份,修复时拿它当基线等于在两个包之间"猜一个"(违反 ADR-0150 D3)。真实启动实测:删除后注册表的裸查找改答最后注册的包,列表里同一项出现两次;对外的读接口(裸读 409、按包读各自内容、列表接口)不受影响。 - 风险与回滚:只在注册表里有两个及以上持有包时跳过基线读取,单持有包照旧恢复;回滚即 revert 本 PR。 - 先看:`packages/metadata-protocol/src/protocol-registry-hydration.ts` 的 `readHealBaseline` 开头新增的判断,再看 `packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts` 末尾新增的 describe。 - 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/protocol-registry-heal-packageless-refusal.test.ts`(需先构建 metadata-protocol),预期 12 个用例全绿。 - 需要你做的:无,席位落地。 ## What changes Ruling: ADR-0150 D3 (a bare read never picks between holders) and epic ruling 6818436831, which says of this heal: "Nothing picks a holder and no baseline is registered. The next bare read is the 409 naming exactly the two holders." Seat ruling 6812637203 Q2 ruled the same footing: "the removed row's entry in the bare slot is retired and no baseline is registered." `readHealBaseline` (the delete heal's tier 2) now returns a settled miss, before any service read, for a type that is addressed by `(package, name)` (`isPackageScopedType`) but is stored in the metadata service by name alone (outside `PACKAGE_SLOTTED_STORE_TYPES`), when the registry holds the name for two or more packages (`packageScopedHoldersOf`, disabled packages counted). For those types the service keeps only the item registered last and answers it to a read naming any package or none, so its answer there is a pick. Tier 3 then retires only the removed row's own bare-slot entry (its verb refuses a packaged artifact). A name one package holds is read as before. The types this reaches: `dashboard`, `report`, `page`, `app`, `book`, `analytics_cube`, `hook`, `job`, `sharing_rule`, `queue`, `assignment_rule`. Pinned: `dashboard` and `report`, the card's two. No change to `protocol.ts`, to `applyRegistryWriteThrough`, to `restoreArtifactRegistryView`'s catch branch, to the objectql registry, or to any spec surface. ### The premise, measured on a real boot (H2 first) A kernel booted from a compiled artifact with three package bodies (alpha and beta each ship `dashboard mix_dash` and `report mix_rep`; a third, `other`, ships neither), the way `createStandaloneStack` composes it (`MetadataPlugin`'s artifact door plus `AppPlugin` over the same bundle). Both registration orders, both kernel shapes (`environmentId: env_local` with DB hydration, and none), 8 boots, at `45dee177`. A scratch rig, not committed. - **The card's exact shape does not form on a real boot.** Every boot registered both holders in composite slots (`com.qa.alpha:mix_dash`, `com.qa.beta:mix_dash`). The metadata service kept only the body registered last, and answered it both bare and for `other`. - **The pick does form.** `PUT` of `dashboard mix_dash` naming `other` was accepted (row stored, bound to `other`, kept out of the bare slot). Its delete answered `success: true`, logged nothing, and left the last-registered holder's body in the bare slot. After that `registry.getItem(type, name)` answered that holder (it answered the first-registered one before), and `registry.listItems(type)` listed that holder twice (3 entries for 2 holders). For `report` the save was refused (the rig's dataset did not exist), and the delete with no row still ran the heal and planted the same entry. - **What did not move:** the protocol reads. The bare read was the 409 naming both holders, each holder's read served its own item, the read naming `other` was refused, and the protocol list showed each holder once, before and after. The composite slots answer them. So the card's symptom (a holder's read refused naming the other) is unreachable on a real boot, while its mechanism (tier 2 registers a picked holder) reproduces there. This PR takes the fix route for the mechanism. ### FROM → TO | Reading after the delete of a non-holder's row, two holders, either order | FROM (`45dee177`) | TO | |:--|:--|:--| | Registry bare slot of the name | the last-registered holder's item | empty | | `registry.listItems(type)` entries of the name | 3 (that holder twice) | 2 (each holder once) | | `registry.getItem(type, name)` | the last-registered holder | the registry's first-composite fallback, as before the delete (follows from the empty bare slot; not re-read on the rig) | | Protocol reads: bare / each holder / non-holder / list | 409 both / own / 409 / each once | unchanged | | Heal log line | none | none | | One holder (CONTROL) | that holder's baseline registered | unchanged | `Clause-②: no`: no accepted or served answer of any door moves; only the registry's internal bare slot does. ## Tests `packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts` (the shared real-registry heal harness), one new top-level describe on a real `SchemaRegistry` and a real `MetadataManager`, in the real boot's shape: each holder in its composite slot, the service keeping the last-registered one, the non-holder's stored row hydrated by `loadMetaFromDb` and kept out of the bare slot. - `dashboard` and `report`, each in both registration orders: after `deleteMetaItem` naming the non-holder, the bare slot is empty, the registry lists each holder once, each holder's read serves its own item, the bare read is the 409 naming both holders in registration order, and the heal logs nothing. - CONTROL, `dashboard` with one holder: the same delete still registers that holder's baseline in the bare slot. **Ablation**, once, with the fix committed first. objectql pins resolve `@objectstack/metadata-protocol` through `dist/`, so each leg was rebuilt and preflighted. - Mutation through `scripts/ablation-replace.mjs`: the guard's `return` line replaced by a marker assignment (anchor 1 → 0, blob `5b888bd3` → `8f51c415`). `pnpm --filter @objectstack/metadata-protocol build` exit 0; `ablation-dist-preflight` exit 0 (marker in `dist/index.js` and `dist/index.cjs`). - Mutated run: **4 failed, 8 passed (12)**. All four two-holder cases failed at the bare-slot assertion: `expected 'shipped:com.acme.beta' to be undefined` (alpha first) and `expected 'shipped:com.acme.alpha' to be undefined` (beta first). The CONTROL and the 7 existing cases passed. - Restore: blob back to `5b888bd3` = HEAD, `git diff HEAD` empty, rebuilt (exit 0), `ablation-dist-preflight --absent` exit 0 (marker absent from all 24 built files, tree clean). Restored run: 12 passed (12). ## Acceptance notes - The no-composite shape the card measured (holders only in the metadata service) does not form on a real boot: every real boot above registered both holders in composite slots. In that harness shape the service holds one item for the name (the other was overwritten), so the registry knows no second holder and this change does not move it. Recorded, not filed. - A delete naming a package that stores no row of the name answered `success: true` and ran the heal (the `report` rig above). With this change it registers nothing for a two-holder name. Recorded for the seat, not filed. ## Verification Readings at the heads named. `HEAD` `929fc53e43` is the final head (origin/main merged in twice; the second merge brought objectstack-ai#33851's edits to the same file, in other functions). <details><summary>Package suites and typechecks</summary> - At `9c4f75f36e` (first merge of main), under the verify lock: `@objectstack/metadata-protocol` typecheck exit 0, test exit 0 (341 files passed, 9 skipped; 22894 tests passed, 43 skipped). `@objectstack/objectql` typecheck exit 0, test exit 0 (596 files, 13177 tests). Direct dependents: `@objectstack/rest` test exit 0 (412 files; 8442 passed, 332 skipped), `@objectstack/runtime` test exit 0 (605 files; 10958 passed, 19 skipped). - At `929fc53e43`, after the second merge (closure rebuilt, exit 0): the heal harness `protocol-registry-heal-packageless-refusal.test.ts` 12/12; metadata-protocol `protocol.registry-heal-package-read.test.ts` plus `protocol.revert-commit-honest-outcome.test.ts` (objectstack-ai#33851's pins on the same walk) 48/48; metadata-protocol and objectql typecheck exit 0. The full suites were not re-run at this head; CI's `Test Core` runs them. </details> <details><summary>Derived gates</summary> - `dispatch-gates --commands --repo objectstack-ai/objectstack` at `929fc53e43`: 67 families derived; 65 run unlocked, each exit 0 (the PR-body gates read this body through `GITHUB_EVENT_PATH`); `check:type-check-debt` run under the verify lock, exit 0 (0 raw tsc errors above the ledger). `check:dual-build-cjs-loads` NOT MEASURED (needs a full-repo `dist/`), left to CI. `--ran` reconciliation: 67 derived, 66 run, 0 not measured, 1 unrun (that one). - ESLint (`--no-inline-config`) over the two touched source and test files: exit 0. </details> <details><summary>Declaration self-check</summary> `Clause-②: no` and `Metadata-protocol: none`, as claimed: no door's accepted or served answer moves (the protocol reads were read before and after on the real boot), no export or spec surface changes, so no `!`, no BREAKING banner and no ADR-0087 marker. `dispatch-gates --tier`: no path-derived mandate, 117 changed lines. Compared with objectstack-ai#33646 (`yes (narrowing)` with `!`: served → refused answers) and objectstack-ai#33769 (`yes (widening)`: new exports): neither shape applies here. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12 Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steedos · project thread
Part of #33724 — this PR closes the platform half: the install door relaxes the column, the driver door it asks, and the remedy text. The hosted half stays open on the card: a hosted install through
os package publish --installruns in the control plane's own install door, which is not in this repository; whether that door calls the exportedrelaxInstallDeclaredNotNullafter its schema sync is the cloud lane's question.Clause-②: yes (widening) — new root exports of @objectstack/cloud-connection (relaxInstallDeclaredNotNull, declaredNullableColumns, types InstallRelaxDriver/InstallRelaxEngine/InstallRelaxEntry/InstallRelaxReport) and the public method SqlDriver.relaxDeclaredNotNull
Metadata-protocol: none
维护者速读
storage: { notNull: false }后,install-local 安装门在 managed 安装/升级的 schema sync 之后,把该包自己声明可空的列的 NOT NULL 放开;[schema-drift]警告与migrate plan的补救文案按对象种类分别说明(环境内创作的对象走发布,包对象走安装/升级包)。NOT_OVERRIDABLE,启动又从不改列,所以升级后每条不填该字段的写入都被数据库拒绝,只能本地os migrate apply;托管租户无路可走(blackcat CRM 的产品价格即此例)。packages/cloud-connection/src/marketplace-install-declared-relaxations.ts(只认本包声明的规则)、packages/drivers/driver-sql/src/sql-driver-schema-sync.ts的relaxDeclaredNotNull(只选 relax 条目)、marketplace-install-local-plugin.ts第 4b″ 步(只在热加载成功后调用,不在启动/rehydrate 调用)。pnpm --filter @objectstack/cloud-connection exec vitest run src/marketplace-install-local-declared-relax.test.ts,预期 7 个用例全绿:v1 NOT NULL → v2 可空的升级后列变为可空、缺该字段的创建成功;热注册宽松失败(无 4xx)时列保持 NOT NULL。What changes
SqlDriver.relaxDeclaredNotNull(obj, columns, opts?)(packages/drivers/driver-sql). Applies the oneneeds_confirmentry the publish door also applies for a declaration in words —relax_not_nullon a NOT NULL column whose served field declaresstorage: { notNull: false }— and only on a column the caller names. Nosafeentry, no undeclared NOT NULL, no index, nothingdestructive. It reads neitherautoMigratenorNODE_ENVand no boot calls it (ADR-0113 D5;schema-drift.ts's ⛔ note on the relax entry: a boot never applies it, a deliberate act does).packages/cloud-connection/src/marketplace-install-local-plugin.ts). After a managed install or upgrade's schema sync, and only when the running kernel serves the new version (not on the lenient path, whose restart rehydrate is a boot), the door asks the driver to relax the columns the installing package's own body declares nullable. Applied relaxes are logged by the driver; an object whose driver has no relax door, a skipped entry or a failure is logged atwarnwith the remedy. The install's answer is unchanged.relaxInstallDeclaredNotNull/declaredNullableColumns(newmarketplace-install-declared-relaxations.ts, exported from@objectstack/cloud-connection). The rule, reusable by a host's own install door: the package's own objects and the fields itsobjectExtensionscontribute (the declared-rename planner'scontributionsOf, now exported from its module), federated objects skipped, the engine and driver read structurally as the rename carry reads them.schema-drift.ts). The relax entry's message named "publishing the object" alone, which a sealed package object refuses. It now names publish for an object authored in the environment, a managed install or upgrade of its package for a package object, andos migrate applyfor either.turso-driver.ts, seat-approved). OneREMOTE_FACE_ANSWERSrow,relaxDeclaredNotNull: 'inherited': the relax needs the SQLite table rebuild that transport does not run, so it comes back skipped with the face's reason.Tests
packages/drivers/driver-sql/src/sql-driver-install-declared-relax.test.ts— every dialect cell: only the named, declared column is relaxed; a create without it then succeeds; an undeclared NOT NULL and an unnamed declared-nullable column stay; thesafedate → datetime widening is not applied (off SQLite); idempotent; empty column list is a no-op; the per-kind remedy text.packages/cloud-connection/src/marketplace-install-local-declared-relax.test.ts— the door over a realSqlDriver(SQLite): v1 → v2 upgrade relaxes and the create succeeds; undeclared NOT NULL stays; an extension field is relaxed; an unrelated package's install leaves another package's column; the lenient path (a cloud upgrade whose register throws with no 4xx, after writing the new declaration) leaves the column NOT NULL and answershotLoaded: false; a driver without the door installs as before and is logged atwarn;declaredNullableColumnsreads only the body's own words.packages/drivers/driver-turso/src/turso-remote-migration-entries.test.ts— one top-leveldescribe: on the remote face the relax is skipped with the face's reason and the column stays NOT NULL.Acceptance notes
os package publish --installinstalls through the control plane, whose install door is in the cloud repository; this PR exports the step so that door can call it. Reported on the card ascarrier: cloud.maintoday) names the publish as the deliberate relax of an explicitstorage: { notNull: false }. This PR adds the managed package install as the same deliberate act for a sealed package object; it auto-applies nothing and the boot still applies nothing, so it reverses no line of D5. A one-line D5 amendment naming the install isdocs/adr/**(Tier H) and is left to the seat as a follow-up, not edited here.safewidening entries (widen_date_to_datetime,widen_varchar,drop_column_default) on a sealed package object have the same "publishing the object applies it" sentence and the same missing door; the card asked for NOT NULL only, so they are listed as a loose end in the report, not changed here.Verification
Readings on head
b99495be(review-b rework on9ef79bb8, the merge oforigin/mainat346d56d4; driver-sql and driver-turso unchanged sinced248309b).Pins, full suites, typecheck, lint
sql-driver-install-declared-relax.test.ts16 passed on SQLite + live Postgres 16 (OS_TEST_POSTGRES_URL, server zone Asia/Shanghai,TZ=America/New_York); the MySQL cell is NOT MEASURED locally (no MySQL on the box).marketplace-install-local-declared-relax.test.ts7 passed (onb99495be). The turso remote pin 1 passed.d248309b:@objectstack/driver-sql5374 passed, 142 skipped, 4 failed + 2 files erroring, all six the live-Postgres "server runs at UTC, this cell proves nothing" precondition; after setting the server zone to Asia/Shanghai those six files plus the two touched ones: 257 passed, 9 skipped, 0 failed.@objectstack/cloud-connection82 files, 1223 passed; onb99495be, 82 files, 1224 passed.@objectstack/driver-turso97 files, 2540 passed, 34 skipped.origin/main(incoming touchespackages/coreimport coercion, not these packages): closure rebuilt, the two new pins plusmarketplace-install-local-declared-rename.test.ts42 passed.typecheck: driver-sql, cloud-connection (both programs), driver-turso: exit 0.pnpm lint: exit 0 (re-run onb99495be).typecheckcloud-connection (both programs) re-run onb99495be: exit 0.Ablations (scripts/ablation-replace.mjs, each restored blob == HEAD and git diff HEAD empty)
notNull: false: 3 of 11 red (the undeclared NOT NULL relaxed).d248309b) (upgrade and extension cases keep NOT NULL).declaredNullableColumnstakes every field: 1 of 6 red.if (hotLoadError === undefined)replaced byif (true): 1 of 7 red, the lenient-path case (AssertionError: expected true to be false, the column relaxed), green after restore.unsupportedwarn loop iterates nothing: 1 of 7 red, the no-door case, green after restore.driver-sqldist (ablation-dist-preflight: marker in 2 dist files, absent from all 6 after restore and rebuild): the turso remote pin red, green after restore.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackond248309bderived 74 families; 73 exit 0,pnpm check:dual-build-cjs-loadsexit 3 (PREREQUISITE NOT MET: needs a whole-workspace build; left to CI).--ran: 74 accounted, 73 run, 1 NOT-MEASURED, exit 0. Driver conformance (pnpm check:driver-conformance) exit 0.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code