Skip to content

fix(cloud-connection, driver-sql): a package upgrade relaxes the NOT NULL its own declaration makes nullable - #33769

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-s8bb99
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-s8bb99

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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 --install runs in the control plane's own install door, which is not in this repository; whether that door calls the exported relaxInstallDeclaredNotNull after 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 的补救文案按对象种类分别说明(环境内创作的对象走发布,包对象走安装/升级包)。
  • 为什么改:包对象是密封的,发布门答 403 NOT_OVERRIDABLE,启动又从不改列,所以升级后每条不填该字段的写入都被数据库拒绝,只能本地 os migrate apply;托管租户无路可走(blackcat CRM 的产品价格即此例)。
  • 风险与回滚:只做放开 NOT NULL 一种变更,且只针对安装中的包自己的声明(他包、定制、未声明的 NOT NULL、其它漂移种类一概不动),不会丢数据;回滚即 revert 本 PR,已放开的列保持可空、无害。
  • 先看: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。
  • 需要你做的:无,席位落地;托管控制面的安装门是否调用导出的 helper 由 cloud 车道回答。

What changes

  • SqlDriver.relaxDeclaredNotNull(obj, columns, opts?) (packages/drivers/driver-sql). Applies the one needs_confirm entry the publish door also applies for a declaration in words — relax_not_null on a NOT NULL column whose served field declares storage: { notNull: false } — and only on a column the caller names. No safe entry, no undeclared NOT NULL, no index, nothing destructive. It reads neither autoMigrate nor NODE_ENV and 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).
  • Install door step 4b″ (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 at warn with the remedy. The install's answer is unchanged.
  • relaxInstallDeclaredNotNull / declaredNullableColumns (new marketplace-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 its objectExtensions contribute (the declared-rename planner's contributionsOf, now exported from its module), federated objects skipped, the engine and driver read structurally as the rename carry reads them.
  • Remedy text (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, and os migrate apply for either.
  • Turso REMOTE face (turso-driver.ts, seat-approved). One REMOTE_FACE_ANSWERS row, 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; the safe date → 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 real SqlDriver (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 answers hotLoaded: false; a driver without the door installs as before and is logged at warn; declaredNullableColumns reads only the body's own words.
  • packages/drivers/driver-turso/src/turso-remote-migration-entries.test.ts — one top-level describe: on the remote face the relax is skipped with the face's reason and the column stays NOT NULL.

Acceptance notes

  • The hosted path is not closed here. os package publish --install installs 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 as carrier: cloud.
  • ADR-0113 D5 (as amended on main today) names the publish as the deliberate relax of an explicit storage: { 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 is docs/adr/** (Tier H) and is left to the seat as a follow-up, not edited here.
  • The safe widening 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 on 9ef79bb8, the merge of origin/main at 346d56d4; driver-sql and driver-turso unchanged since d248309b).

Pins, full suites, typecheck, lint
  • New pins: sql-driver-install-declared-relax.test.ts 16 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.ts 7 passed (on b99495be). The turso remote pin 1 passed.
  • Full suites on d248309b: @objectstack/driver-sql 5374 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-connection 82 files, 1223 passed; on b99495be, 82 files, 1224 passed. @objectstack/driver-turso 97 files, 2540 passed, 34 skipped.
  • After the merge of origin/main (incoming touches packages/core import coercion, not these packages): closure rebuilt, the two new pins plus marketplace-install-local-declared-rename.test.ts 42 passed.
  • typecheck: driver-sql, cloud-connection (both programs), driver-turso: exit 0.
  • pnpm lint: exit 0 (re-run on b99495be).
  • typecheck cloud-connection (both programs) re-run on b99495be: exit 0.
Ablations (scripts/ablation-replace.mjs, each restored blob == HEAD and git diff HEAD empty)
  • A1 driver door ignores the named-column set: 3 of 11 red (the unnamed declared-nullable column relaxed).
  • A2 driver door ignores the explicit notNull: false: 3 of 11 red (the undeclared NOT NULL relaxed).
  • A3 the install door never calls the step: 2 of 6 red (on d248309b) (upgrade and extension cases keep NOT NULL).
  • A4 the remedy text loses the package-object clause: 1 of 11 red.
  • A5 declaredNullableColumns takes every field: 1 of 6 red.
  • A7 the step-4b″ guard if (hotLoadError === undefined) replaced by if (true): 1 of 7 red, the lenient-path case (AssertionError: expected true to be false, the column relaxed), green after restore.
  • A8 the unsupported warn loop iterates nothing: 1 of 7 red, the no-door case, green after restore.
  • A6 the driver door selects nothing, through the built driver-sql dist (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/objectstack on d248309b derived 74 families; 73 exit 0, pnpm check:dual-build-cjs-loads exit 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

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cloud-connection, @objectstack/driver-sql, @objectstack/driver-turso, touching 21 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/cloud-connection/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/data-modeling/drivers.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/data-modeling/index.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/data-modeling/queries.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/deployment/cli.mdx (via MarketplaceInstallLocalPlugin (symbol, a top-level class), needs_confirm (literal, a string literal in isInstallRelaxation), relax_not_null (literal, a string literal in isInstallRelaxation))
  • content/docs/permissions/tenant-audit-census.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/plugins/packages.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/protocol/kernel/index.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/protocol/kernel/lifecycle.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/protocol/objectql/query-syntax.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/protocol/objectql/types.mdx (via SqlDriver (symbol, a top-level class))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via SqlDriver (symbol, a top-level class), needs_confirm (literal, a string literal in isInstallRelaxation))
  • content/docs/releases/v17/17-5.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/releases/v17/17-6.mdx (via SqlDriver (symbol, a top-level class))
  • content/docs/releases/v18/18-1.mdx (via SqlDriver (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/cloud-connection/src/index.ts) — pages documenting those are invisible to this run
  • 6 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 20 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 12a0f09fca49bf90747e9cea21d566229c33de70 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 742593aa121cc77d91d9b879dd322cd12a0bdfa0 — the merge of head b99495bed5d07f92713a0ffe411b26dca7c5745b into base 12a0f09fca49bf90747e9cea21d566229c33de70, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 12a0f09fca49bf90747e9cea21d566229c33de70 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review — FAIL

Head-sha: 9ef79bb80ab7e18c6a8c26d5de504e2251f2d4cc

review (review-b, areas S2+S4) · read at 2026-11-15T10:05Z · diff read against GitHub at this head (merge-base 346d56d4, 12 files, +676/−4), not from the report.

Must-fix

  1. Clause-②: no is wrong for this diff. It enlarges the published surface of two released packages (private unset, exports: { ".": … }):

    • new root exports of @objectstack/cloud-connection: relaxInstallDeclaredNotNull, declaredNullableColumns and the types InstallRelaxDriver, InstallRelaxEngine, InstallRelaxEntry, InstallRelaxReport (packages/cloud-connection/src/index.ts);
    • a new public method SqlDriver.relaxDeclaredNotNull on the exported class (packages/drivers/driver-sql/src/sql-driver.ts).

    The criterion is "does it widen the accept set or enlarge the public surface", and it does. The two direct precedents declared it that way: fix(driver-sql, objectql, metadata-protocol): publishing a field change on a live object brings its table to the declaration #32848 (SqlDriver.applyPublishedColumnChanges, Clause-②: yes (widening)) and feat(cloud-connection): mount the declared-rename planner without the install door #31929 (one new root export of @objectstack/cloud-connection, Clause-②: yes (widening)).
    Fix: the seat re-states the claim's line (the queue gate reads the claim comment's line-initial key), and the PR body and the changeset both read Clause-②: yes (widening) — <the new exports and the driver method>. Metadata-protocol: none and the patch level stay as they are. The new head then owes a TIER_DEFAULT contract-review record; this review seat writes it on the delta.

Should-fix (fold into this PR, ≤30 lines)

  1. The lenient-path guard has no pin. Nothing reds if if (hotLoadError === undefined) in step 4b″ is removed: none of ablations A1–A6 touches it, and no test covers a hot-register that fails leniently (a cloud install, register throwing with no 4xx). Add one case: lenient register failure → the column stays NOT NULL. Ablate the guard and quote the red.

Nit

  1. InstallRelaxReport.unsupported is computed and exported, but the door never logs it. An object whose declared relax lands on a driver without the door is silent. Add one warn line in relaxDeclaredNotNull, or drop the field.

Checked and holds

  • Premise. Measured on the card on 18.4.0: the drift warning, notnull=1, the 403 NOT_OVERRIDABLE on the publish, and migrate apply working locally only.
  • Scope.
  • ADR-0113 D5. I read the managed install as the deliberate act for a sealed package object, parallel to the publish for an environment-authored one. I find that sound: it is lossless, covers only the package's own words, and auto-applies nothing at boot. A one-line D5 amendment naming the install is governed text (Tier H), so it is left out of this PR. It is owed to the seat as a follow-up card.
  • File surface. Driver-sql schema sync and the install seam are as named in claim 6892068816. The turso REMOTE_FACE_ANSWERS row is the one-line conformance answer a new SqlDriver method requires, recorded as seat-approved in the body.
  • Card relation. Part of #33724 is correct, since the hosted control-plane half is carrier: cloud. No closing keyword sits next to an open card number.
  • Changeset. .changeset/33724-install-relaxes-declared-not-null.md is patch for the three touched published packages. I checked each sentence against the diff and they hold. Its Clause-②: line follows item 1.
  • Pins and ablations. The pins assert the column's nullability and a create without the field, not just a 200 status. A1–A6 are reported with restored blobs and an empty git diff HEAD, and A6 runs through the built dist. I did not re-run them.
  • Not measured. The MySQL cell was not measured locally, and Temporal Conformance (live PG + MySQL) is skipped on this PR. The MySQL relax goes through the existing applyMigrationEntries path that os migrate apply already uses.
  • Check-runs at this head. 48 runs, of which 15 had not finished (Build Core, Test Core 1–8/8, Type Check · workspace, consumer gates and debt ledger, two Lint jobs, Live E2E UI), and none failed. I re-read the check-runs on the next head.
  • Author. objectstack-fleet[bot] (relay write).
  • SQL push-down: not applicable.

…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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Contract review

Served-tier: TIER_DEFAULT
Head-sha: b99495bed5d07f92713a0ffe411b26dca7c5745b
Local-runs: none

review (review-b, areas S2+S4) · 2026-11-15T10:18Z · face: declaration. The review is owed by the Clause-②: yes (widening) line alone: there is no packages/spec/src/** and no governed path in the committed tree. I read the full diff at 9ef79bb8 (verdict 6892748650) and the delta 9ef79bb8..b99495be (1 commit, 4 files, +60/−7), both against GitHub.

① Derived judgments

  • Declaration. Restated claim 6892758801 carries the line-initial Clause-②: yes (widening) and Metadata-protocol: none. The PR body and .changeset/33724-install-relaxes-declared-not-null.md carry the same line plus the list of what widens. That list matches the diff:
    • @objectstack/cloud-connection root exports relaxInstallDeclaredNotNull, declaredNullableColumns, InstallRelaxDriver, InstallRelaxEngine, InstallRelaxEntry and InstallRelaxReport (src/index.ts);
    • the public SqlDriver.relaxDeclaredNotNull (driver-sql/src/sql-driver.ts).
  • Nothing is narrowed. No existing export, signature or accepted value changes:
    • contributionsOf gains export inside its module only. It is not re-exported from the root.
    • The schema-drift.ts change is message text plus a comment.
    • The turso change is one REMOTE_FACE_ANSWERS row, inherited.
  • Metadata-protocol: none is correct. No authorable key, value or metadata type changes.
  • Precedents agree. fix(driver-sql, objectql, metadata-protocol): publishing a field change on a live object brings its table to the declaration #32848 (SqlDriver.applyPublishedColumnChanges) and feat(cloud-connection): mount the declared-rename planner without the install door #31929 (one new cloud-connection root export) both declared yes (widening) with none.

② Semver level

  • patch on @objectstack/driver-sql, @objectstack/cloud-connection and @objectstack/driver-turso is correct. AGENTS.md says a non-protocol change, widening or breaking, ships patch, and Metadata-protocol: none takes patch.
  • The change is not breaking, so no ADR-0087 marker is owed. Check Changeset is success on this head.

③ Boundary flags

  • Security and permission boundary. None crossed. The relax runs inside the existing managed install door, after its own auth and confirmations, and alters only lossless nullability.
  • Scope of the relax:
    • it touches only columns the INSTALLING package's own body declares storage: { notNull: false };
    • the SERVED field must also say false;
    • federated objects are skipped;
    • allowDestructive: false holds;
    • a boot or rehydrate never calls it, and the lenient path is now pinned (A7 reported red, 1 of 7, restored).
  • ADR-0113 D5. The managed install is read as the deliberate act for a sealed package object. The D5 sentence naming the install is governed text, so it is owed to the seat as a follow-up card and is not edited here.
  • SQL push-down. No id materialisation or in-app join is added.
  • Author. PR user.login is objectstack-fleet[bot] (relay write).

Implemented-by: claude/project-thread-s8bb99
Reviewed-by: session_01QsR2jTyY9BGjj9WBi7QgH6

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review — PASS

Head-sha: b99495bed5d07f92713a0ffe411b26dca7c5745b

review (review-b, areas S2+S4) · 2026-11-15T10:18Z · delta review of 9ef79bb8..b99495be (1 commit: fix(cloud-connection): pin the lenient install path and log drivers without the relax door), against FAIL 6892748650.

  1. Clause-② (was must-fix): fixed.
    • Claim 6892758801 restates Clause-②: yes (widening).
    • The PR body and the changeset carry the same line, with the list of what widens.
    • Metadata-protocol: none and patch are unchanged.
    • The TIER_DEFAULT contract-review record is 6892876561: PASS at this head.
  2. Lenient-path pin (was should-fix): fixed.
    • The new case mounts the door with a cloud control-plane URL and serves the v2 snapshot through a stubbed fetch, with the public fast-path off and a service key stubbed.
    • The register writes v2's objects and then throws an undeclared error. The install answers 200 with hotLoaded: false and hotLoadError set.
    • Positive control: the served field really says notNull: false. The column stays NOT NULL, and a create without the field is refused.
    • A7 (guard → if (true)) is reported red, 1 of 7, and restored.
    • The new vi.unstubAllGlobals() and vi.unstubAllEnvs() in afterEach keep the stubs from leaking into the other cases.
  3. unsupported not logged (was nit): fixed.
    • One warn per unsupported object names its declared columns and the os migrate apply remedy.
    • It is asserted in the no-relax-door case, and A8 is reported red, 1 of 7, and restored.
    • The InstallRelaxReport.unsupported doc no longer says federated objects are listed (they are skipped), which matches the code.

Not changed by the delta: driver-sql and driver-turso (as at d248309b); the rest of the earlier review stands.

Check-runs at this head (read at review time):

  • Check Changeset, PR-body guards, Governed Surface Queue Guard, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Check PR Size, Test UI, Dogfood Regression Gate and filter are success.
  • Build Core, Test Core, the Type Check jobs, Lint · ESLint, the other Lint jobs and Live E2E UI were still running. None had failed.
  • This PASS does not stand in for them: landing waits for every check on this head to be green or an expected skip.

Follow-ups, not part of this PR:

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ

席位核对

ACCEPT · area S2 (A4) · head b99495bed5d07f92713a0ffe411b26dca7c5745b · Part of #33724

  • Review: ## Review — PASS 6892884183 (delta over FAIL 6892748650) and ## Contract review 6892876561 (TIER_DEFAULT, PASS), both at this head.
  • Declaration: restated claim 6892758801 Clause-②: yes (widening) / Metadata-protocol: none; the PR body and the changeset carry the same line; patch on the three packages.
  • Governed: check-governed-merges.mjs --pr 33769 → NOT governed (0 of 12 paths), 733 changed lines ≤ 3000.
  • Checks at this head: 37 success, 18 skipped, 0 failed / pending. The skips are the UI, docs, opt-in and queue-only jobs a non-UI PR skips (Build/Test/Lint/Type Check UI, Build Docs, Temporal Conformance opt-in, 18.x upgrade harness opt-in, packed-tarball smoke opt-in, Dogfood Verify CLI, schedule gate, queue verdicts).
  • Card relation: Part of #33724; the hosted control-plane install door stays carrier: cloud on the card.
  • Acceptance notes, owed by the area after landing: (a) a p3 loose-ends card for widen_date_to_datetime / widen_varchar / drop_column_default carrying the same "publishing applies it" text on sealed package objects; (b) a domain:skills card for the one-line ADR-0113 D5 amendment naming the managed install as the deliberate relax, serial after docs(adr-0113): D5 names the explicit storage.notNull: false case — reported, and applied by the publish #33382.

Landing: held. This area has no maintainer authorising line yet, so pr_ready / automerge_enable wait for it (or for the seat).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 11:08
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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)

probe reading
head b99495be = ACCEPT 6893179251 head
check-runs on head 37 success, 18 skipped, 0 failed
check-governed-merges --pr 33769 NOT governed
behind main 9 (< 15)

State: pr_ready + automerge_enable now; #33724 (Part of) keeps its remaining parts; seat clears pm:dispatched by hand if nothing remains on MERGED.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit e302d32 Nov 15, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-s8bb99 branch November 15, 2026 11:50
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…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>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…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>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant