Skip to content

fix(objectql): an upgrade or re-install withdraws the items its new version no longer ships (#33050) - #33304

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/area-A5-33050
Nov 14, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/area-A5-33050

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Fixes #33050

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:同一个包再次注册(install-local 重装或升级)时,注册表撤下旧版本带来、新版本不再携带的条目(tool、flow、page、app、权限集……),并释放新清单不再声明的裸名与安全目录占用。
  • 为什么改:之前被新版本丢掉的 tool/flow 会一直注册到重启,并继续占着名字——另一个包声明同名会被 422 拒绝;现在热路径与重启后的状态一致。
  • 风险与回滚:改的是 registerApp 的再注册语义(objectql),只撤"上一次包体注册写过、这次没再写"的槽位;环境覆盖层、包体之外按包 id 注册的条目、函数占用都不动;被拒的升级照旧整体回滚(含原顺序)。回滚 = revert 本 PR。
  • 先看:packages/objectql/src/registry.ts(replacingPackageBody 与 noteItemOrder,风险在撤回与拒绝回滚的配合)、packages/objectql/src/engine-registration.ts(接线一处)、packages/objectql/src/package-refused-upgrade-keeps-installed.test.ts(语义钉子)。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run src/package-refused-upgrade-keeps-installed.test.ts,预期 18/18 通过;其中 [#33050] 五条在修复前全红。
  • 需要你做的:无,席位落地。

What changes

SchemaRegistry.replacingPackageBody(packageId, manifest, register) (new) is what the engine's registerApp now runs its body registration through, inside the existing restore-on-refusal run:

  • registerItem records every slot a package's own body registration writes (type + storage key, only when the item's package id is the body's).
  • After the body registers, for a package whose body was registered before, the slots the previous body wrote and this one did not are withdrawn, and the bare-name claims (registry types only, never the hook binder's function claims) and security catalog claims the new manifest no longer declares are released.
  • Each withdrawn slot and claim is journaled before it is removed (noteItem, noteBareNameClaim, noteSecurityCatalogClaim), plus a new noteItemOrder so a refusal later in the run puts the slots back where they stood (the store's order is read by listItems and by a no-package getItem).
  • uninstallPackage forgets the package's body record. The shared registry double (registry-module-mock.ts) carries the new member.

What is deliberately not withdrawn: an environment overlay in the bare slot (ADR-0005), an item registered under the package id outside a body (a stack residual owned by the id, a plugin's own registerItem), and anything on a first registration. Objects and object extensions are not items and are untouched.

The install-local door needs no change: it already re-registers through the manifest service and then announces metadata:reloaded.

Tests

  • packages/objectql/src/package-refused-upgrade-keeps-installed.test.ts — new [#33050] describe (5 cases: a clean 2.0.0 withdraws the 1.0.0-only page, app and permission set; the same body again keeps everything; an overlay and an out-of-body item are kept; a refusal later in the run restores every withdrawn item and claim in place; a dropped connector name is free once sealed while a kept one stays held). The existing control a clean 2.0.0 upgrades as before changes one assertion FROM ['probeup_v1_ps', 'probeup_v2_ps'] TO ['probeup_v2_ps']: it pinned the defect for permission sets.
  • packages/cloud-connection/src/marketplace-install-local-bare-name-conflict.test.ts — new [#33050] describe over the real door, a real ObjectKernel + ObjectQLPlugin, holders sealed: the card's reproduction (tool + flow dropped by a same-version re-install, then another package installs the tool name: 200), an upgrade dropping one of two tools, and a CONTROL (still shipped ⇒ the other package is still refused 422).
Before the fix (origin/main e540baf build) — both new describes red
cloud-connection: Tests  2 failed | 8 passed (10)
  × a re-install of the same version without the tool and the flow withdraws both; ...
    AssertionError: expected { name: 'qa_shared_tool', …(6) } to be undefined
  × an upgrade to 1.0.1 that drops one tool withdraws it and keeps serving the tool it still ships
objectql: Tests  6 failed | 12 passed (18)   (the 5 new cases + the corrected control)
After the fix, final head c161470 (merged with origin/main)
closure build (pnpm --filter '@objectstack/cloud-connection^...' build) exit=0
@objectstack/objectql test        exit=0  Test Files 595 passed (595) · Tests 12947 passed (12947)
@objectstack/objectql typecheck   exit=0
@objectstack/cloud-connection test      exit=0  Test Files 80 passed (80) · Tests 1209 passed (1209)
@objectstack/cloud-connection typecheck exit=0

The cloud-connection suite reads @objectstack/objectql through its dist; the rebuilt dist carries the new verb (grep -c replacingPackageBody packages/objectql/dist/index.js = 6) and the door test turned green only after that rebuild.

Acceptance notes

  • The flow half of the card: the registry no longer holds the dropped flow after the re-install (pinned). The automation engine's own binding is withdrawn by the metadata:reloaded re-sync the door already announces after every install (resyncFlowsFromProtocol drops a flow the protocol no longer lists); that leg was NOT MEASURED here (the door harness composes no automation engine).
  • Same family, not changed here and not measured: a package's objects, object extensions and picklist extensions that a new version drops are also kept until restart — they live outside the item store (objectContributors, picklistExtensionContributions) and dropping an object has table consequences, so they are out of this card's scope.
  • Downstream consumers of registerApp (runtime, metadata-protocol, cli, the dogfood apps) are not run locally; CI's Test Core runs them.

Verification

Local gate families (dispatch-gates --commands at c161470)

72 commands derived for this change set (merge base with origin/main), each run at c161470 with its exit captured before any pipe:

dispatch-gates --ran: 72 derived famil(ies) accounted for — 70 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).
70 x exit 0, among them check:engine-double-contract, check:registry-log-declared, check:startup-registry-verdict,
  check:durability-log-level, check:test-source-alias, check:nul-bytes, check:type-check-coverage, check:type-check-debt,
  check:wildcard-fallthrough, check-adr-0087-registration --base origin/main, check-empty-changeset --base origin/main
NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 3 (positive control pinned to a commit a shallow clone cannot reach)
NOT MEASURED: pnpm check:dual-build-cjs-loads :: exit 3 (needs every workspace dist; this worktree built only the cloud-connection closure)

Both NOT MEASURED families run in CI's Lint & Repo Gates on this PR.

Stock boot, no withdrawal at boot (review#2's should-fix). examples/app-showcase at head c161470d5, after pnpm --filter '@objectstack/cli...' --filter '@objectstack/example-showcase^...' build (exit 0): OS_REGISTRY_LOG=info objectstack serve --dev --log-level debug, health 200 after 12 s, 53 plugins, 138 seed rows. The boot stream holds 653 [Registry] lines and 0 [Registry] Withdrew lines. So no second registerApp under one id at boot withdraws anything. (Without --log-level debug the CLI prints no [Registry] line at all, so that reading would say nothing; the count above is from the debug stream.)


Generated by Claude Code

…laims its new version no longer ships

An upgrade or re-install through the manifest door (install-local among
them) left every item the new body dropped registered, holding its bare
name, until the next restart. The registry now records the item slots each
body registration writes and, on a re-registration of the same id,
withdraws the previous body's slots the new one did not write again, plus
the bare-name and security catalog claims its manifest no longer declares,
inside the same restore-on-refusal run.

Claude-Session: https://claude.ai/code/session_016WV4cykhsWAtSL6Sr4VWFG
Co-authored-by: Claude <noreply@anthropic.com>
…dy; patch changeset

Claude-Session: https://claude.ai/code/session_016WV4cykhsWAtSL6Sr4VWFG
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql, touching 13 documentable anchor(s).

19 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 9f736f2e2469d159422fb2ce1456bd932278ffff.

⛔ 8 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 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 — 21 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 9f736f2e2469d159422fb2ce1456bd932278ffff → packageMentionDocs.

Which tree this was computed on

This run read content/docs from d61c583baf9c4c2552c3a03d008ce0129dd0c66e — the merge of head c161470d5cb91860912eeb08559bafc4ebdf7ed4 into base 9f736f2e2469d159422fb2ce1456bd932278ffff, 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 d61c583baf9c4c2552c3a03d008ce0129dd0c66e && git checkout d61c583baf9c4c2552c3a03d008ce0129dd0c66e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9f736f2e2469d159422fb2ce1456bd932278ffff c161470d5cb91860912eeb08559bafc4ebdf7ed4 && git checkout -B drift-repro 9f736f2e2469d159422fb2ce1456bd932278ffff && git merge --no-ff c161470d5cb91860912eeb08559bafc4ebdf7ed4

node scripts/docs-audit/affected-docs.mjs --json 9f736f2e2469d159422fb2ce1456bd932278ffff

⚠️ 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 9f736f2e2469d159422fb2ce1456bd932278ffff → 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 · os-elon-musk · session_016WV4cykhsWAtSL6Sr4VWFG

Request: review · area A5 · head c161470 · 2026-11-14T16:57Z

Fixes #33050 · Clause-②: no. CI green on this head (35 success, 16 skipped, 0 failed); mergeable clean.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4czuuneAppDnJbrNejw · head c161470 · 2026-11-14T16:58Z

review#2 (server area pilot, A5).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Review: changes needed (one should-fix, evidence only)

Head: c161470d5cb91860912eeb08559bafc4ebdf7ed4 · reviewer review#2 (session_016WV4czuuneAppDnJbrNejw) · area A5 · Fixes #33050

Clause-②: no is right for the intended case: no authorable key, value or type moves, and an upgrade now serves what the new body ships.

Checked and fine:

  • Slot tracking: registerItem records type\0storageKey only when the open body's packageId matches. Package items live under the composite pkg:name key and environment overlays under the bare key, so an overlay is never in previous and is never withdrawn (pinned). Items registered under the id outside a body are not recorded either (pinned).
  • Withdrawal runs only after register() returns and only when a previous body record exists. A first registration withdraws nothing, and uninstallPackage forgets the record.
  • Claims: bare-name and security-catalog claims the new manifest does not declare are released; function claims stay with the hook binder.
  • Refusal: noteItemOrder snapshots the type's map before the first removal, and the packageBody record is noted, so a later refusal in the same run restores items, claims, the record and the original order (pinned).
  • CI: 35 success, 16 skipped, none failed; mergeable clean.

should-fix (evidence, likely no code change): the change has a wider reach than install-local. Any second registerApp under the same id now withdraws what the first body wrote and the second does not. That is right for an upgrade, but it would also remove items if some code path registers one id twice with different bodies (a plugin contributing in two calls, a legacy app.* service plus a manifest, a boot-time re-register). I found one same-id pair, com.objectstack.metadata-objects (packages/metadata/src/plugin.ts and packages/metadata-protocol/src/plugin.ts). Both are objects-only and identical, so it is unaffected. I could not rule out others statically. Please boot a stock showcase (or CRM) on this head and confirm it logs no [Registry] Withdrew line, then paste the count in the PR body. If a line appears at boot, that caller needs its own fix before this lands.

Out of scope as the body says (objects, object extensions, picklist extensions): fine for this card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Review: PASS

Head: c161470d5cb91860912eeb08559bafc4ebdf7ed4 · reviewer review#2 (session_016WV4cxDxAYxdtDhtR1kQQe, continuing session_016WV4czuuneAppDnJbrNejw) · area A5 · Fixes #33050

Delta review of the evidence should-fix in 6881098156. The head is unchanged, so the code findings of that review stand.

  • Should-fix resolved. The PR body's Verification now records a stock examples/app-showcase boot on this head (OS_REGISTRY_LOG=info objectstack serve --dev --log-level debug): health 200, 53 plugins, 138 seed rows, 653 [Registry] lines and 0 [Registry] Withdrew lines. The withdrawal line goes through the same this.log channel as the other [Registry] lines, so the debug stream that shows those 653 would also show a withdrawal. No boot-time caller registers one id twice with different bodies on the showcase stack.
  • Clause-②: no stands, as in the previous review.

Landing still needs every check green on this head; two runs were still in progress at review time.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cykhsWAtSL6Sr4VWFG

ACCEPT · area A5 · head c161470 · 2026-11-14T17:18Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 17:19
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 7adb1b5 Nov 14, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-A5-33050 branch November 14, 2026 18:18
This was referenced Nov 14, 2026
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…arry through install-local on a real kernel (objectstack-ai#33238) (objectstack-ai#33473)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DFWmDYdUPFhME7Z7Ky3ySCZ)_
Part of objectstack-ai#33238

Area-lease pilot objectstack-ai#33059, area A3.

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:只加测试与更正文字,不改运行逻辑。在真实内核上钉住"市场本地安装热升级 v1→v2、v2
把岗位改名"时,旧名任职人立即迁到新名、不需重启;对照岗位的任职人不动;同一个 v2 再装一次不写任何任职行。
- 为什么改:本卡剩下的第 1 个缺口(热升级时旧版本仍在服务)已因 objectql 的升级撤回旧条目(PR objectstack-ai#33304)而在
`origin/main` 上实际关闭;本 PR 实测并钉死它,并更正仍写着"要等下次重启"的模块注释与尚未发布的变更说明。
- 风险与回滚:无运行行为变化;风险只在一条尚未发布的变更说明被改写(DELIBERATE CORRECTION,见下)。回滚即回退本 PR。
-
先看:`packages/cloud-connection/src/marketplace-install-local-hot-resync.test.ts`
末尾新 describe(真实门 + 真实
SecurityPlugin);`packages/plugins/plugin-security/src/position-renamed-holder-carry.test.ts`
中收紧的热升级用例;`.changeset/33238-position-rename-hot-install.md` 的改写段。
- 两分钟验证:`pnpm --filter @objectstack/cloud-connection exec vitest run
--maxWorkers=2 src/marketplace-install-local-hot-resync.test.ts`,预期 6/6
通过。
- 需要你做的:无,席位落地。本卡在 A5 区的运行时安装/启用宣告卡(objectstack-ai#33302)落地后即可关闭。

## What changes

Tests and prose only; no runtime behaviour changes.

- **Measured on `origin/main` (ba35dfd):** gap 1 of the hand-over (a
hot upgrade over a version the running kernel still serves) is closed.
The re-register withdraws the position v2 no longer ships
(`SchemaRegistry.replacingPackageBody`, landed in objectstack-ai#33304), so when
install-local announces `metadata:reloaded` with `app/ID`, the old name
is no current position and plugin-security's reload run carries its
holders. Both pins below passed on the unchanged tree.
-
`packages/cloud-connection/src/marketplace-install-local-hot-resync.test.ts`:
new top-level describe, end to end through the real install-local door.
It boots a real `ObjectKernel` with a SQL driver, `ObjectQLPlugin` and
`SecurityPlugin`, and gives the door's `trigger` a real plugin context,
so the announcement reaches the kernel's hook bus. Install v1, seed
holders, install v2 (which renames `hotrename_sales_rep` to
`hotrename_crm_sales_rep` with `renamedFrom`), and the pin checks three
things. The holder moves at once. The CONTROL holder on
`hotrename_auditor` is untouched. A second identical v2 install makes
zero `sys_user_position` updates.
-
`packages/plugins/plugin-security/src/position-renamed-holder-carry.test.ts`:
the case "a hot upgrade over v1, which the running kernel still serves"
accepted either outcome ("no holder is left on a position the catalog
does not serve"). It now asserts that v1's position is withdrawn and the
holder holds the new name at once, that the CONTROL is untouched, and
that a second identical upgrade writes no holder row and says nothing.
-
`packages/plugins/plugin-security/src/position-renamed-holder-carry.ts`:
module doc ("When it runs") only. It no longer lists a hot upgrade over
a served version as carried at the next boot. The runtime install and
enable routes are still listed there.
- `.changeset/33238-position-rename-hot-install.md`: **DELIBERATE
CORRECTION** of a pending release note (`check-empty-changeset` stays
red on purpose). The bullet "a hot upgrade over a version the running
kernel still serves: its old position keeps serving until the restart,
so its holders keep it until then" is removed from "Still carried at the
next restart". The install-local bullet under "Carried at once" now
reads: "a hot install or upgrade through the marketplace install-local
door (`/marketplace/install-local`), for the positions of the package it
names (`app/ID`). An upgrade over a version the running kernel still
serves is carried too: re-registering the package withdraws the position
its new version no longer ships (`@objectstack/objectql`, objectstack-ai#33050), so
the old name is no position the kernel serves when the announcement is
heard;". Restoring the base text would publish a sentence that is now
false.

**What keeps objectstack-ai#33238 open:** gap 2, the runtime `POST /packages` install
and package enable routes not announcing `metadata:reloaded`. That is
objectstack-ai#33302, held by area A5 (branch `claude/area-A5-33302`). This PR does
not touch `packages/runtime/**`. The card can close once that lands.

## Why

The hand-over (comment 6881180984) left the card open on two gaps, with
gap 1 expected to need only a pin once dropped items were withdrawn on
upgrade. This PR measures that, pins it on a real kernel through the
real door, and corrects the two texts that still describe the old
behaviour.

## Tests

- New and tightened pins: both green on the base tree with no source
change.
- Ablation, both legs through `scripts/ablation-replace.mjs` (anchor hit
1 → 0, blob changed, restored to the HEAD blob with `git diff HEAD`
empty). Both suites alias `@objectstack/objectql` and
`@objectstack/plugin-security` to `src/`, so no rebuild was needed
between legs.
- (A) `registry.ts`: the line
`this.withdrawPackageBodyItemsNotShipped(packageId, previous,
body.written);` was replaced. Both new pins went red. plugin-security:
`expected [ 'platform_admin', 'org_owner', …(8) ] to not include
'hot_sales_rep'`. cloud-connection: `expected [ 'hotrename_auditor',
…(2) ] to deeply equal [ 'hotrename_auditor', …(1) ]`.
- (B) `security-plugin-start-hooks.ts`: the line `await
positionRenameCarry.afterReload(payload);` was replaced. Both went red
on the holder assertion: `expected { h1: 'hot_sales_rep', …(1) } to
deeply equal { h1: 'hot_crm_sales_rep', …(1) }`, and the same for
`hotrename_*`.

## Verification

<details><summary>Package suites and typecheck (full suites at ee6585a;
head d742709 changes only the cloud-connection test's import, re-run
there: 6/6 and typecheck exit 0)</summary>

- `pnpm --filter @objectstack/plugin-security test`: Test Files 267
passed (267), Tests 6653 passed, 45 skipped (6698). `typecheck` exit 0,
including `check:test-typecheck` OK.
- `pnpm --filter @objectstack/cloud-connection test`: Test Files 80
passed (80), Tests 1210 passed (1210). `typecheck` (`tsc --noEmit && tsc
--noEmit -p tsconfig.test.json`) exit 0. Both touched test files are in
their package's test tsconfig (`--listFiles`: 1 hit each).
- eslint `--no-inline-config` on the three touched `.ts` files: exit 0.
</details>

<details><summary>Derived gate families (`dispatch-gates.mjs
--commands`, 64 families)</summary>

- 59 families exit 0.
- `check-empty-changeset --base origin/main`: exit 1. This is the
DELIBERATE CORRECTION above, declared and expected red.
- `check-plugin-teardown-shape --self-test`: exit 3 on the shallow
clone, then exit 0 after deepening.
- `check:test-source-alias`: exit 1. The first version imported
`@objectstack/platform-objects/identity`, which is not aliased. It now
imports the aliased root and the gate exits 0.
- `check:dual-build-cjs-loads` and `check:i18n`: exit 3, PREREQUISITE
NOT MET (no full-repo `dist/`). NOT MEASURED locally. The diff touches
neither area, and CI runs them on a full build.
- `--ran` reconciliation: 64 derived, 64 run.
</details>

- The repo-wide `pnpm lint` and the dependents' test sweep are left to
CI (`Lint & Repo Gates`, `Test Core`). No published surface changes: the
only source change is a module comment.

## Human Minimum

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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016WV4cwotoQMyrtSr5EqqAF

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…of a disabled package and a hot upgrade carry renamedFrom holders at once (objectstack-ai#33642)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XXWfT73m4BSPgeTFD7644gK)_

Refs objectstack-ai#33301

Follow-up PR for the card (PR 1 objectstack-ai#33478 merged; PR 2 objectstack-ai#33568 is the
separate Tier H ADR leg). This one corrects the
`PositionSchema.renamedFrom` text that objectstack-ai#33448 and objectstack-ai#33304/objectstack-ai#33473 made
false on `main`.

## 维护者速读

- **改了什么**:只改文字与一条日志文案,不改行为。`PositionSchema.renamedFrom` 的 jsdoc 与
`.describe()`(及其生成的参考文档行)、`plugin-security` 迁移模块注释:运行时 `POST /packages`
安装、`PATCH /packages/:id/enable`
启用一个已停用的包、以及热升级,现在都"立即迁移",不再列为"等下次重启"。同时更正两条未发布的变更说明(同一句错话),以及
`claimant-disabled` 警告里"启用后的第一次启动才迁移"的说法。
- **为什么改**:objectstack-ai#33478 合入时写了"运行时安装/启用不发通告,要等重启",但 objectstack-ai#33448 已让两扇门发
`metadata:reloaded`;另外 objectstack-ai#33304 让热升级撤回旧版职位(objectstack-ai#33473 已在模块注释里改过),spec
文字还说要重启。契约评审 6886866329 指出前者。
- **风险与回滚**:无 schema、取值或行为变化;唯一发布的运行时字节是一条警告文案。`check-empty-changeset`
因有意更正两条未发布说明而保持红(DELIBERATE CORRECTION,见下)。回滚即 revert。
- **先看**:`packages/spec/src/identity/position.zod.ts` 的 `renamedFrom`
jsdoc 与 describe。
- **两分钟验证**:`git grep -n "do not announce\|does not announce, and"
packages/spec/src/identity content/docs/references/identity`,预期无命中;对照
`packages/runtime/src/domains/packages.ts` 里两处 `announcePackageReload`
调用。
- **需要你做的**:无,席位做契约复审并落地。

## What changes

Text only; no schema, accepted value or behaviour changes.

- `packages/spec/src/identity/position.zod.ts`, `renamedFrom` jsdoc: the
doors carried at once are now a hot install-local install **or
upgrade**, for the package the door announces, the runtime `POST
/packages` install, a `PATCH /packages/:id/enable` that switches a
disabled package on, a per-item publish and a publish-drafts. A package
still disabled when its announcement is heard is refused
`claimant-disabled` until the enable that switches it on announces it
again. The other packages of a multi-package artifact (install-local
announces only the artifact's own id, review 6889382518 on objectstack-ai#33653; the
code change is tracked in objectstack-ai#33656) and an artifact reload that names only
its file stay "at the next restart".
- Same file, `.describe()`: "(an install or hot upgrade of the package
the door announces, the enable of a disabled package, a per-item
publish, a publish of drafts). A package still disabled then is carried
when it is enabled. The other packages of a multi-package artifact, and
an artifact reload that names only its file, are carried at the next
restart."
- `position-renamed-holder-carry.ts` module doc: "When it runs" says a
hot install-local install or upgrade is carried at once for the package
the door announces, the other packages of a multi-package artifact at
the next restart; the `claimant-disabled` bullet (~:48-51) now names the
enable that carries, matching the warning reason.
- `content/docs/references/identity/position.mdx`: the `renamedFrom`
row, regenerated (`pnpm gen:schema && pnpm gen:docs`), not hand-edited.
-
`packages/plugins/plugin-security/src/position-renamed-holder-carry.ts`,
module doc "When it runs": the runtime install and the enable of a
disabled package announce `app/ID` and are carried at once; an install
that leaves the package disabled is refused `claimant-disabled` until
that enable.
- `.changeset/33301-renamed-from-install-enable-announce.md`:
`@objectstack/spec` patch.
- `position-renamed-holder-carry.ts` ~:690, the `claimant-disabled`
warning reason, FROM "the renamed position's package is disabled; the
first boot after it is enabled carries them" TO "the renamed position's
package is disabled; enabling it through `PATCH /packages/:id/enable`
carries them, and so does the first boot after it is enabled". No test
pins the string (`git grep` over `*.test.ts`); the only test of the
refusal asserts `reason: 'claimant-disabled'`. This string ships in
`dist`, so `.changeset/33301-claimant-disabled-log-reason.md` is an
`@objectstack/plugin-security` patch.
- Two pending release notes, corrected in place (see DELIBERATE
CORRECTION below).

### DELIBERATE CORRECTION of two pending release notes

`check-empty-changeset` stays red on purpose: both notes are unreleased
and describe the same doors, and restoring them would publish sentences
that are false on `main`.

- `.changeset/33301-renamed-from-carry-text.md` (this card's PR 1), FROM
"(a hot install, a per-item publish of the position, a publish of
drafts). A hot upgrade over a version the kernel still serves, a package
install or enable that does not announce, and an artifact reload that
names only its file are carried at the next restart." TO "(an install or
hot upgrade, the enable of a disabled package, a per-item publish of the
position, a publish of drafts). A package still disabled when it is
announced is carried when it is enabled; an artifact reload that names
only its file is carried at the next restart."
- `.changeset/33238-position-rename-hot-install.md` (objectstack-ai#33238): the bullet
"the runtime's package install and enable routes, which do not announce
`metadata:reloaded`;" is removed from "Still carried at the next
restart". "Carried at once" gains: "the runtime's package install (`POST
/packages`) and the enable of a disabled package (`PATCH
/packages/:id/enable`), which announce `app/ID` (`@objectstack/runtime`,
objectstack-ai#33302). A package still disabled when it is announced is not carried
until the enable switches it on and announces it again."

### Where each claim is read on `main` (1cf2a5a)

- Install announces on both answers:
`packages/runtime/src/domains/packages.ts` ~:2781
`announcePackageReload(deps, _context, pkgId, 'installed')`, before the
`enableOnInstall` lifecycle refusal returns.
- Enable announces only when the package was disabled: ~:2856 `if
(wasDisabled) await announcePackageReload(…, 'enabled')`. Pinned by
`packages-reload-announce.test.ts`.
- A disabled claimant is refused: `position-renamed-holder-carry.ts`
`claimant-disabled` (judged on the reload path as on boot), so an
install that lands disabled carries nothing until the enable announces.
- Hot upgrade: `SchemaRegistry.replacingPackageBody` (objectstack-ai#33050, landed in
objectstack-ai#33304) withdraws the positions the new body no longer ships inside
`registerApp`; objectstack-ai#33473 pinned it end to end through install-local and
already corrected the carry's module doc, but not the spec text.

### Deviation from the prepared patch

The order's patch (be318a6d) no longer applied: objectstack-ai#33473 had rewritten the
carry's module doc under it. It was re-applied by hand, and it kept "a
hot upgrade over a version the kernel still serves … carried at the next
restart", which objectstack-ai#33473 measured false. Re-asserting that in rewritten
text would claim more than the code does, so the same sentences drop it.
Round 2, at the seat's request, adds the warning string and the two
pending notes below.

## Tests

None: a description and comment diff, no behaviour change.

## Acceptance notes

- `@objectstack/plugin-security` changeset: the module-doc edit ships
nothing (tsup strips comments; after the build `grep -rl 'enable of a'
dist` has no hit), but the warning string does (`enabling it through` is
in `dist/index.js` and `dist/index.mjs`), so the package gets a patch
note for the string.
- Left as is, at the seat's word: objectstack-ai#33568's ADR-0150 wording still lists
"a hot upgrade over a version the running kernel still serves" as
carried at the next restart, false since objectstack-ai#33304. That is the card's ADR
follow-up after objectstack-ai#33568 merges.
Clause-②: no
Metadata-protocol: none

## Verification

At head `27a39b87` (`origin/main` `4c32b969` merged in), after building
the lint, plugin-security, objectql, client-react and cli closures:

- 106 derived gates (`dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`): 104 exit 0; `--ran` reads "106 derived
famil(ies) accounted for — 105 run, 1 NOT-MEASURED".
- `check-empty-changeset.mjs --base origin/main` exit 1: the DELIBERATE
CORRECTION above, red on purpose.
- NOT MEASURED: `check:dual-build-cjs-loads` (exit 3, a PREREQUISITE
refusal: it reads every package's `dist`). CI runs it.
- `pnpm --filter @objectstack/plugin-security test`: 267 files, 6679
passed, 45 skipped. `typecheck` exit 0.
- Round 1 at `63085567`: `pnpm --filter @objectstack/spec test` 840
files, 26871 passed, 1 todo; `gen:schema && gen:docs` moved only
`content/docs/references/identity/position.mdx`. Round 2 does not touch
`packages/spec`.

Round 3 at head `85543852` (`origin/main` `3c0033f9` merged in; the net
diff against main was unchanged by the merges): `pnpm --filter
@objectstack/spec test` 840 files passed, 1 skipped, 26878 passed; `pnpm
--filter @objectstack/plugin-security test` 267 files, 6679 passed, 45
skipped, `typecheck` exit 0 (at `a797bffe`; the round-3 edit after it is
comment and describe text only, and
`position-renamed-holder-carry.test.ts` 35/35 at `85543852`);
`gen:schema && gen:docs` moved only the `position.mdx` row;
`check:generated` (after a spec rebuild), `check:docs`,
`check:spec-docblock-symbol-anchors` and `check-issue-citations` exit 0.

Records: `pm-orders/spec/33301-followup-gates-ran.txt` (round 1) and
`pm-orders/spec/33301-followup-r2-gates-ran.txt` (round 2) in the
project share.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5pKQmfpw66kCN9pAhn)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5pKQmfpw66kCN9pAhn

<!-- signed: domain:spec#1 · os-project-manager ·
session_01FEkQ5mswnWm181XgYcCUag -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…on carries at once (objectstack-ai#33653)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X5wpk1gsxYNKAkG5qioWPNY)_

Fixes objectstack-ai#33301

A two-sentence correction to the ADR-0150 D7 addendum that PR objectstack-ai#33568
landed. While objectstack-ai#33568 sat in the merge queue, PR objectstack-ai#33473 (and objectstack-ai#33050, PR
objectstack-ai#33304, before it) made a hot upgrade over a version the running kernel
still serves carry its holders at once: the re-register withdraws the
position the new version no longer ships, so the old name is no current
position when the announcement is heard. objectstack-ai#33568's text still listed that
case under the next restart. `docs/adr/**` only (Tier H): it waits for a
GOVERNED_APPROVER.

## 维护者速读

- **改了什么**:只改 ADR-0150 第 288
行补遗里的一句:热升级(即使运行中的内核仍在提供旧版本)也会立即迁移持有人,移入“立即迁移”一栏;“下次重启才迁移”只剩“只报文件路径的产物重载”。
- **为什么改**:objectstack-ai#33568 排队期间 objectstack-ai#33473 合入(建立在 objectstack-ai#33050 之上),热升级已在通告时立即迁移;objectstack-ai#33568
的原句因而不实。
- **风险与回滚**:纯文档,无代码、无发布内容。回滚即 revert。
-
**先看**:`docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`
第 288 行 “It runs at boot over every claim” 一句。
- **两分钟验证**:读该句,预期 “carried at the next restart” 之前只剩 “an artifact
reload that names only its file”;与 `position-renamed-holder-carry.ts`
“When it runs” 一节的热升级段一致。
- **需要你做的**:审阅并批准(Tier H,需 GOVERNED_APPROVER 批准后由席位落地)。

## What changes


`docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`
~:288, one clause of the sentence "It runs at boot over every claim, …":

- FROM "a hot install-local install, the runtime `POST /packages`
install, … are carried at once; a hot upgrade over a version the running
kernel still serves and an artifact reload that names only its file are
carried at the next restart."
- TO "a hot install-local install or upgrade, for the package the door
announces (an upgrade over a version the running kernel still serves
included, since the re-register withdraws the position the new version
no longer ships), the runtime `POST /packages` install, … are carried at
once; the other packages of a multi-package artifact, which
install-local registers but does not name, and an artifact reload that
names only its file are carried at the next restart."

Round 2 (contract review 6889382518): install-local announces only
`app/` + its manifest id (`marketplace-install-local-plugin.ts` :3817,
:6805), so the other `packages[]` members of a multi-package artifact
wait for the next boot; the code fix is objectstack-ai#33656, which will drop the
qualifier. Nit 2 folded in the refusals sentence: FROM "It does not
carry an old name that is switched off." TO "It does not carry an old
name that is switched off, nor carries holders onto a claimant whose
package is disabled (refused `claimant-disabled` until an enable
announces the package)."

No other sentence of the addendum and no ruling text changes.

## Tests

None: a docs-only diff.

## Acceptance notes

- Read against `origin/main` `babd5d4a`:
`position-renamed-holder-carry.ts` "When it runs" says a hot upgrade
over a still-served version is carried at once (objectstack-ai#33050), pinned by PR
objectstack-ai#33473's real-kernel test through install-local. Whether an upgrade
through the runtime `POST /packages` install also withdraws is not
measured, so the text claims it for install-local only.
- PR objectstack-ai#33546 (objectstack-ai#33527) made the package disable and `DELETE` routes
announce the withdrawal; the addendum says nothing about withdrawals, so
nothing is claimed about them here.
- The refusals clause still reads true against `main`: the refusal set
(`claimed-twice`, `claimant-disabled`, `still-declared`,
`held-by-other`, `owned-by-other`, `switched-off`) is unchanged.
- `skip-changeset`: no published package ships `docs/adr`.

## Verification

At head `1bb25336` off `origin/main` `babd5d4a`: 21 derived gates
(`dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`), all
exit 0; `--ran`: "21 derived famil(ies) accounted for, 21 run, 0
NOT-MEASURED". Record: `pm-orders/spec/33301-pr3-r2-gates-ran.txt` in
the project share.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5n95roc2dShmeuBAoB)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5n95roc2dShmeuBAoB

<!-- signed: domain:spec#1 · os-project-manager ·
session_01FEkQ5mswnWm181XgYcCUag -->

---------

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/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants