Skip to content

docs(spec, plugin-security): the renamedFrom holder carry runs at boot and after each announced reload - #33478

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-6cr30t
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-6cr30t

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Refs #33301

Clause-②: no
Metadata-protocol: none

PR 1 of 2 for #33301. This one carries the spec and plugin-security text and lands by the seat. The ADR-0150 D7 addendum sentence is docs/adr/** (Tier H) and goes in a separate PR after this one merges; that PR closes the card.

维护者速读

  • 改了什么:只改文字。PositionSchema.renamedFrom 的说明(jsdoc 与 .describe(),及其生成的参考文档)、liveness/position.json 中 renamedFrom 的证据描述、以及 plugin-security 中职位改名持有人迁移的两处代码注释,改为与 fix(plugin-security): carry renamed position holders after a hot install, not only at boot #33245 合入后的实际行为一致:启动时迁移全部声明,运行中每次 metadata:reloaded 只迁移通告点名的包或职位。
  • 为什么改:fix(plugin-security): carry renamed position holders after a hot install, not only at boot #33245 之后迁移不再只在启动时运行,原文“只在启动时”已不实;评审 6880449445 ④ 指出两处注释对通告条目的描述比代码更窄。
  • 风险与回滚:无行为变化,无 schema、取值或测试改动。回滚即 revert。
  • 先看:packages/spec/src/identity/position.zod.ts(renamedFrom 的说明)、packages/plugins/plugin-security/src/position-renamed-holder-carry.ts("When it runs" 一节)。
  • 两分钟验证:git grep -n "At boot the platform moves" -- packages content,预期无命中;content/docs/references/identity/position.mdx 的 renamedFrom 行与新的 describe 一致。
  • 需要你做的:无,席位落地。

What changes

Each text now says what PR #33245 does on main (read from the code, not the card): the carry runs at kernel:bootstrapped over every claim, then on each metadata:reloaded after the boot run over the claims of what the announcement names as registered, read from its changed list (positionRenameReloadScope): app/ID while the registry holds package ID, and position/NAME of any grammar-valid name, whichever announcer sends the entry. Carried at once: a hot install-local install, a per-item publish of a position, the positions of a publish-drafts. Carried at the next restart: a hot upgrade over a version the running kernel still serves (its old position still reads as declared), the runtime POST /packages install and enable routes (they do not announce), and an artifact reload that names only its file.

  • packages/spec/src/identity/position.zod.ts, PositionSchema.renamedFrom:
    • jsdoc: "Read only by the boot carry (… at kernel:bootstrapped)" now names both runs and the doors above; "the boot carry judges the same rules again" reads "the holder carry"; "named in the boot log" reads "named in the run's log".
    • .describe(): "At boot the platform moves every holder … a second boot moves nothing" now says holders move at boot and again when a running kernel announces the position or its package as registered (a hot install, a per-item publish, a publish of drafts), names the three cases carried at the next restart, and ends "A second run moves nothing". "listed in the boot log" reads "listed in the log". No tracker number in the runtime string.
  • content/docs/references/identity/position.mdx: regenerated by pnpm --filter @objectstack/spec check:generated --fix (gen:docs), one row.
  • packages/spec/liveness/position.json, renamedFrom.evidence: the prose after the #carryRenamedPositionHolders pointer names both runs. The pointers are unchanged; verifiedAt and note are unchanged.
  • packages/plugins/plugin-security/src/position-renamed-holder-carry.ts, "When it runs" (review 6880449445 ④ nits 1 and 2), comments only:
    • an entry in the app/ID or position/NAME spelling counts whichever announcer sends it;
    • position/NAME admits any name in the position-name grammar (the claims whose new name is NAME), not only "a position the catalog serves now";
    • publish-drafts' unhidden app/NAME counts when NAME is a held package id;
    • the artifact reload has two payload shapes: the file watcher announces the file path, the dev HMR POST (POST /api/v1/dev/metadata-events) announces the changed list its caller sent (the file path when it sent none), whose entries in those two spellings count.
  • packages/plugins/plugin-security/src/security-plugin-start-hooks.ts: the carry's hook comment says the same, and the metadata:reloaded handler comment names the per-item publish and publish-drafts beside the hot install. Comments only.
  • .changeset/33301-renamed-from-carry-text.md: @objectstack/spec patch (the describe ships in dist, json-schema/ and src/**/*.zod.ts; liveness/ is in files[]).

Tests

No test, no ablation: no behaviour, schema or test expectation changes. No test pins the old sentences (git grep for "At boot the platform moves", "Read only by the boot carry" and "from SecurityPlugin's start hooks" on origin/main hit only the three edited files and the generated reference).

Acceptance notes

  • No @objectstack/plugin-security changeset (measured). Its files[] ships dist, README.md, CHANGELOG.md only. After turbo run build --filter=@objectstack/plugin-security, grep -rl over packages/plugins/plugin-security/dist (js, mjs, d.ts, d.mts, maps) finds neither new comment phrase ("whichever announcer sends", "dev HMR POST"); positive control: carryRenamedPositionHolders hits dist/index.js and dist/index.mjs. The comment change publishes nothing from that package.
  • The artifact reload: the card lists it among the doors carried at the next restart. The code agrees for the file watcher, but the dev-only HMR POST forwards its caller's changed list, so an HMR POST that names app/ID or position/NAME is scoped and carried at once. The texts say "an artifact reload that names only its file".
  • liveness/position.json renamedFrom.note still says other references are "named in the boot log"; still true of the boot run and outside the order's line, so left.
  • The ADR-0150 D7 addendum (docs/adr/0150-…md ~:288) is PR 2 (Tier H), opened after this merges.

Verification

All at head 2f305516 (git rev-parse --short HEAD), off origin/main 19cc8976.

  • Build first (under os-verify-lock): turbo run build --concurrency=2 over spec, the lint / objectql / client / client-react closures and plugin-security, 43/43 tasks; then the check:i18n closure it names, 64/64.
  • pnpm --filter @objectstack/spec check:generated --fix: 1 of 14 artifacts stale (content/docs/references/**), gen:docs ran, re-check check:docs green.
  • pnpm --filter @objectstack/spec test: Test Files 840 passed (840), Tests 26865 passed, 1 todo.
  • pnpm --filter @objectstack/plugin-security typecheck: exit 0. vitest run src/position-renamed-holder-carry.test.ts: 35/35.
Derived gates: 111 from dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, 110 green, 1 NOT MEASURED
  • Every command run with its exit code captured before any pipe; the record is pm-orders/spec/33301-gates-ran.txt in the project share.
  • check:i18n: exit 3 (closure unbuilt) in the loop; after building the closure it names, exit 0 ("10 package(s), all bundles in sync").
  • check:dual-build-cjs-loads: exit 3 on both runs (needs every package's dist): NOT MEASURED here, CI's.
  • dispatch-gates.mjs --ran: "111 derived famil(ies) accounted for, 110 run, 1 NOT-MEASURED".

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5n95roc2dShmeuBAoB

…t and after each announced reload

The PositionSchema.renamedFrom jsdoc and describe, the position liveness
evidence, and the carry's "When it runs" and start-hook comments say what
the carry does on main: at kernel:bootstrapped over every claim, then on
each metadata:reloaded over the claims of what the announcement names as
registered (app/ID of a held package, position/NAME), whichever announcer
sends the entry. Text only.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5n95roc2dShmeuBAoB
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation 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 2 package(s): @objectstack/plugin-security, @objectstack/spec, touching 2 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/plugins/plugin-security/src/position-renamed-holder-carry.ts, packages/spec/liveness/position.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/releases/v13.mdx (via PositionSchema (symbol, a top-level const))
  • content/docs/releases/v14.mdx (via PositionSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-0.mdx (via PositionSchema (symbol, a top-level const))

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
  • 2 changed file(s) yielded no anchor (packages/plugins/plugin-security/src/position-renamed-holder-carry.ts, packages/spec/liveness/position.json) — pages documenting those are invisible to this run
  • 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 — 175 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 0e9ff949cb4bd2bb51716c4154e36699bd6d3a55 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 0e9ff949cb4bd2bb51716c4154e36699bd6d3a55

⚠️ 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 0e9ff949cb4bd2bb51716c4154e36699bd6d3a55 → 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:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 2f305516532bb157dedde77ff6afc43f6a403185
Local-runs: none
Scope: packages/spec/src/identity/position.zod.ts + packages/spec/liveness/position.json, packages/plugins/plugin-security/src/position-renamed-holder-carry.ts, packages/plugins/plugin-security/src/security-plugin-start-hooks.ts

PR #33478 (Refs #33301, PR 1 of 2), read as the net diff against origin/main 0e9ff949 (merge base 19cc8976; no commit between them touches a file this diff changes or cites). Card #33301 body and comments 6880960865, 6884480897, 6884987055 read. Text only: 6 files, +64/-35.

① Derived judgments

  • Accept set: unchanged — right. renamedFrom is still z.array(SnakeCaseIdentifierSchema).optional(); the diff touches only its jsdoc and the string passed to .describe(). No value is newly accepted or refused.
  • Public surface: one description string — right. The describe ships in dist, json-schema/ and src/**/*.zod.ts, and liveness/ is in @objectstack/spec files[]. No export, type or key changes.
  • Generated reference matches — right. The renamedFrom cell of content/docs/references/identity/position.mdx at the head is character-for-character the concatenated describe string at the head (1203 characters each, compared by script over git show output; nothing built).
  • Liveness pointers unchanged — right. In liveness/position.json the three path#symbol pointers (position-renamed-holder-carry.ts#carryRenamedPositionHolders, position-renamed-from.ts#refuseSelfRenamedFrom, #refuseDishonestPositionRenamedFrom), status, verifiedAt, evidenceScope and note are byte-identical; only the prose inside the first parenthesis changed.
  • plugin-security: comments only — right. Both hunks sit inside a module jsdoc and // comments; no statement changes.
  • Check-runs on the head, as read on 2026-11-14: 45 runs; 14 success (among them Check Changeset, Spec property liveness, Governed Surface Queue Guard, PR-body guards, Lint · PM dispatch-gates, Check Documentation Links), 9 skipped (opt-in or matrix placeholders), 22 still in progress (builds, type checks, the remaining lint families, Test Core 1/8 to 8/8, Live E2E UI), none failed. The in-progress runs have no conclusion yet, so they are no gate verdict yet; this record judges ① to ④ and does not stand in for them.

② Semver level

Clause-②: no — right. No accept set narrows or widens and no behaviour changes.

@objectstack/spec patch is the right level: a description string in a published schema changes and nothing else does.

No @objectstack/plugin-security changeset is right. Its files[] is dist, README.md, CHANGELOG.md. Its build is the root tsup.config.ts (esm + cjs, sourcemap: true with dropSourcesContent, dts): esbuild drops non-legal comments from the js, the maps carry no source text, and neither changed comment is attached to an exported declaration (one is the detached file-top module doc, the other sits inside registerStartHooks), so the d.ts does not carry them. Read from the manifest and build config, not built here; it agrees with the dev's measured grep over dist.

③ Boundary flags

  • open_questions: empty.
  • Deviation 1 (no plugin-security changeset against the order's line): answered in ②, the dev is right.
  • Deviation 2 (the artifact reload has two payload shapes): confirmed in packages/metadata/src/plugin.ts on main. The file watcher calls _reloadAndAnnounce(ctx, src, [src.path]); the HMR POST handler (setOnPostReload, mounted only under a literal NODE_ENV=development) calls it with body?.changed ?? [src.path]. So "an artifact reload that names only its file" is the true form, and the card's flat "an artifact reload" was too wide. This is nit 1 of record 6880449445.
  • Deviation 3 (the regenerated reference is in the diff): inside the claim's file surface ("a regenerated reference only if the describe renders there"); it does.
  • Out-of-scope note (renamedFrom.note still says "named in the boot log"): still true of the boot run, outside the order's line; left as is, no escalation.
  • The ADR-0150 D7 addendum sentence is not in this diff (Tier H, PR 2). Nothing in this diff touches a governed path.

④ Design judgment

Every changed sentence was read against the code on main: positionRenameReloadScope, carryRenamedPositionHolders and createPositionRenameCarryRuns in position-renamed-holder-carry.ts; the kernel:bootstrapped and metadata:reloaded hooks in security-plugin-start-hooks.ts; and the four announcers of metadata:reloaded (marketplace-install-local-plugin.ts install and uninstall, objectql/src/plugin.ts announcePerItemPublish, runtime/src/domains/packages.ts publish-drafts, metadata/src/plugin.ts _reloadAndAnnounce). No must-fix and no should-fix.

packages/spec/src/identity/position.zod.ts (hits) — holds.

  • "at kernel:bootstrapped over every claim": atBoot runs with no only. True.
  • "again on each metadata:reloaded after that over the claims of what the announcement names as registered: app/ID while the registry holds package ID, and position/NAME, whichever door announces them": afterReload returns before reading anything until atBoot has been called, reads payload.changed, admits app/NAME only when registry.getPackage(NAME) is non-null and position/NAME when NAME passes the grammar, with no test of who announced. True.
  • Carried at once: install-local announces app/manifestId after registering; the per-item publish announces type/name; publish-drafts announces one type/name per published item. True.
  • Carried at the next restart: an upgrade over a version still served leaves the old name in the catalog, so the claim is refused still-declared; packages.ts has one announce site, in publish-drafts, so install and enable are silent; the watcher names only the path. True.
  • The describe says the same in plain words, carries no tracker number, and "A second run moves nothing" holds (once moved, no row names the old name).

packages/spec/liveness/position.json — holds. The evidence names both runs and the two admitted spellings; the refusal list is the code's six reasons.

position-renamed-holder-carry.ts, "When it runs" — holds, and closes both nits of record 6880449445. "whichever announcer sends it", "NAME is in the position-name grammar: the claims whose new name is NAME" (only.positions.has(c.to)), publish-drafts' unhidden app/NAME counting only for a held package id, and the two artifact-reload payload shapes all match the code.

security-plugin-start-hooks.ts — holds. The hook comment repeats the same four facts; the handler comment now names the per-item publish and publish-drafts beside the hot install, which is what the hook receives.

Tried against the texts and found sound: an absolute artifact path has its first slash at index 0 and is skipped; a relative path is another item type, or an app/ name that is no held package, or a position/ name that fails the grammar on its dot; a per-item publish of an app item whose name is a held package id is in scope, which "whichever announcer sends it" already says; an old name with one claim in scope and one outside is judged with both and refused claimed-twice.

Nits (no effect on correctness or the contract):

  1. position.zod.ts jsdoc, "the runtime POST /packages install and enable routes": the enable route is PATCH /packages/:id/enable; only the install route (and its enable-on-install flag) is POST /packages. Neither announces, so the claim itself is true; the verb is loose. The wording is the card's.
  2. position.zod.ts jsdoc, "is named in the run's log": a reload run that moves no holder row skips the left-behind read (leftBehindOnlyWhenMoved), so those references are named by a run that moves rows, or by the next boot run. The describe's "listed in the log" is not affected.
  3. position-renamed-holder-carry.ts, "(a name no position serves has none)", and liveness/position.json, "reads ... only the renamedFrom of what the announcement names": claims are also built from a disabled package's positions, which the catalog does not serve (judged, refused claimant-disabled, nothing carried); and a reload run reads every position's renamedFrom and then judges only the scope's claims. Same outcome either way; only the wording is looser than the code.

All three are jsdoc or evidence prose inside reviewed files, so a fix moves the head: accepted deviations, or folded into PR 2's follow-up text. Nits alone end the round.

Implemented-by: claude/project-thread-6cr30t
Reviewed-by: session_01FEkQ5mswnWm181XgYcCUag

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag

ACCEPT · PR #33478 (#33301, part 1 of 2) · head 2f305516532bb157dedde77ff6afc43f6a403185 · 2026-11-14T22:44Z

席位核对

  • 形态: 6 files, +64/−35 (read from the PR's file list, not the report): the PositionSchema.renamedFrom jsdoc and describe in packages/spec/src/identity/position.zod.ts, its generated row in content/docs/references/identity/position.mdx, the renamedFrom evidence prose in packages/spec/liveness/position.json, comments only in plugin-security's position-renamed-holder-carry.ts and security-plugin-start-hooks.ts, one @objectstack/spec patch changeset. No governed path, under 3000 lines: Tier S, seat lands. The Tier H ADR-0150 line is split off to part 2 (Fixes #33301), opened after this merges and left for a human approver.
  • 前提实测: the head is the one the contract review read; no push since. On main the three texts still said the carry runs at boot only, false since PR fix(plugin-security): carry renamed position holders after a hot install, not only at boot #33245.
  • 门禁 check-runs: on this head 68 runs: 58 success, 10 skipped, 0 failed.
  • 契约复审: CONTRACT_REVIEW_TIER PASS, record 6885042878 on this head (isolated reviewer; Ruling-ref 「你有 fable ,车道契约复审可以自己做」 2026-11-07). Three nits, no must-fix or should-fix.
  • 接受的偏差: nit 1 (jsdoc says "POST /packages install and enable routes"; enable is PATCH /packages/:id/enable; neither announces, so the claim holds; part 2's ADR text uses the exact verbs), nit 2 (a reload run that moves no row names other references at the next run or boot), nit 3 (claim building and scope wording looser than the code; same outcome). Dev deviation 1: no plugin-security changeset, since comments do not reach its dist (reviewer confirmed from files[] and the tsup config). Dev deviation 2: an artifact reload carries at once only via the dev HMR POST's changed list; the texts say "an artifact reload that names only its file" (reviewer confirmed in packages/metadata/src/plugin.ts). Clause-②: no / Metadata-protocol: none.
  • 范围外去向: none new. Part 2 (ADR-0150 addendum ~:288) stays on this card.
  • 落地条款: ready + auto-merge now under the maintainer's standing order 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z). K = 7 commits on main past this head's affected-set base 0e9ff949 (< 15, no merge of main needed).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 22:44
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 1da43fe Nov 15, 2026
69 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-6cr30t branch November 15, 2026 00:26
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…drawal (objectstack-ai#33546)

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

Part of objectstack-ai#33527 (items 1 and 3; item 2, the two plugin-security comments,
stays open because open PRs objectstack-ai#33478 and objectstack-ai#33473 edit those files).

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:停用(`PATCH /packages/:id/disable`)与卸载(`DELETE
/packages/:id`)两个接口,在注册表撤下包之后广播 `metadata:reloaded { changed: ['app/ID']
}`,与安装、启用、marketplace 本地卸载同一写法。
- 为什么改:实测停用后,包里的记录触发流程仍绑定在自动化引擎里,每次写记录照样执行,直到重启;卸载后接口返回的瞬间,下一次写记录仍会执行一次。
- 风险与回滚:只是多发一个已有事件,订阅方都是幂等的;广播失败只记一条 warn,不改变接口结果。回滚即还原 `packages.ts`
的两处调用。
- 先看:`packages/runtime/src/domains/packages.ts` 停用接口里的 `wasEnabled`
判断与卸载接口里的 `if (registryRemoved)` 调用;其次是同文件 `announcePackageReload`
的失败文案分支。
- 两分钟验证:`pnpm --filter @objectstack/runtime exec vitest run
src/domains/packages-reload-announce.test.ts`,预期 10/10 通过。
- 需要你做的:无,席位落地。

## What changes

- `PATCH /packages/:id/disable` announces `metadata:reloaded` with `{
changed: ['app/ID'] }` after `registry.disablePackage`, only when the
package was enabled before (read with the registry's own
`isPackageDisabled`, which mirrors the enable door's reading). Disabling
a package that is already disabled announces nothing.
- `DELETE /packages/:id` announces the same payload after the registry
withdrawal, the state-record clear and the verb's cleanups, and only
when the running registry actually withdrew the package
(`registryRemoved`). This is the order the marketplace install-local
uninstall uses ("LAST", and "not when the registry refused"). The
announce runs before both answers, `200` and the partial `400`, because
the package has left the registry either way.
- Both doors go through `announcePackageReload`, the same seam
(`deps.announceKernelEvent`) and failure rule as the install and enable
doors: a subscriber failure logs one `warn` and never changes the
answer. The warn text names what a withdrawal keeps (flows stay armed)
instead of what an install misses.
- Item 3 (N2): the `announcePackageReload` jsdoc now says that an
install which lands disabled is announced too, and that this is harmless
because subscribers read through the registry's disabled filter. The
jsdoc also covers the two withdrawal doors and records the measurement.

Decision record, on the order's axes (correctness first, then smallest
change, then effort): the withdrawal goes through the existing helper
and the existing event. There is no new event, and no engine-side
teardown list. The install-local uninstall comment warns that a second
teardown is how the two would drift.

## Probe (item 1), measured on `origin/main` e3f0cfd

Rig: a real `ObjectKernel` with the SQL driver (better-sqlite3
`:memory:`), `ObjectQLPlugin` (with its built-in protocol), the real
`AutomationServicePlugin` and the real `RecordChangeTriggerPlugin`, and
an `HttpDispatcher` over the kernel. An authored package is installed
through `POST /packages` and declares a dependency on a code package
that serves `probe_ticket`. Its flow is saved through
`protocol.saveMetaItem({ type: 'flow', packageId })` (publish mode). The
flow is `record-after-create` on `probe_ticket`, and a `create_record`
node is replaced by a recorder so that a run is observed. The probe was
a one-off scratch file and is not committed.

| Step | `origin/main` | This branch |
|:--|:--|:--|
| Before any withdrawal, insert a row | flow runs | flow runs |
| `PATCH /:id/disable` → 200, then insert a row | **flow still runs**;
trigger binding still active; `GET /meta/flow` no longer lists it | flow
does not run; binding gone |
| (main only) a manual `metadata:reloaded { changed: ['app/ID'] }` after
the disable | binding gone, flow does not run | n/a |
| `PATCH /:id/enable` → 200, insert | flow runs again | flow runs again
|
| `DELETE /:id` → 200, bindings read right after the answer | **binding
still active** | binding gone |
| insert right after the `DELETE` answered | **flow runs once** | flow
does not run |
| insert 1 s later | flow does not run (the async metadata-mutation sync
of the deleted row withdrew it) | flow does not run |

So the premise holds for both doors. Disable left the package armed
until a restart. `DELETE` left a window: the withdrawal rode only on the
asynchronous mutation sync of the deleted `sys_metadata` row, after the
door had answered. The authored hooks and actions re-sync on the same
`metadata:reloaded` subscriber set. This PR fixes them through the same
announce, but did not measure them separately.

<details><summary>Probe output, origin/main</summary>

```text
PROBE disable: bindings before [{"flowName":"probe_dis_flow","triggerType":"record_change"}] ran ["probe_dis_flow"]
PROBE disable: door 200 isDisabled true
PROBE disable: bindings after [{"flowName":"probe_dis_flow","triggerType":"record_change"}] ran ["probe_dis_flow"]
PROBE disable: GET /meta/flow served []
PROBE disable: after manual announce bindings [] ran []
PROBE enable: door 200 ran ["probe_dis_flow"]
PROBE delete: door 200 ... "deleted":[{"type":"flow","name":"probe_del_flow","state":"active"}] ... registry has false
PROBE delete: bindings right after door [{"flowName":"probe_dis_flow",...},{"flowName":"probe_del_flow","triggerType":"record_change"}]
PROBE delete: bindings after [{"flowName":"probe_dis_flow",...}] ran ["probe_dis_flow","probe_del_flow"]
PROBE delete: 1s later bindings [{"flowName":"probe_dis_flow",...}] ran ["probe_dis_flow"]
```
</details>

<details><summary>Probe output, this branch</summary>

```text
PROBE disable: bindings before [{"flowName":"probe_dis_flow","triggerType":"record_change"}] ran ["probe_dis_flow"]
PROBE disable: door 200 isDisabled true
PROBE disable: bindings after [] ran []
PROBE enable: door 200 ran ["probe_dis_flow"]
PROBE delete: bindings right after door [{"flowName":"probe_dis_flow","triggerType":"record_change"}]
PROBE delete: bindings after [{"flowName":"probe_dis_flow",...}] ran ["probe_dis_flow"]
```
</details>

## Tests

New top-level describe in the shared harness
`packages/runtime/src/domains/packages-reload-announce.test.ts` (real
kernel, real `SecurityPlugin`, real `HttpDispatcher`; the recorder now
also records whether each held package was disabled when the announce
arrived):

1. A disable of an enabled package announces `app/ID` once, with the
package held and already disabled.
2. A disable of a package that is already disabled announces nothing.
3. An uninstall announces `app/ID` once, with the package no longer
held.
4. An uninstall of a package the registry does not hold answers 404 and
announces nothing.
5. A throwing subscriber: both doors still answer 200, and each failure
is logged once at `warn` naming the package.

The three objectstack-ai#33302 expectations gained the recorder's new `off` field
(`false`). Nothing else in them changed.

Ablation (one-off, not committed). After the fix was committed,
`packages.ts` was restored to `e3f0cfd422` in the working tree only. The
test subject is imported from `src/`, so no rebuild was needed. The
mutation was proven on disk: the blob changed and the `'uninstalled'`
anchor count went to 0. Result: **3 failed | 7 passed (10)**. The red
cases were 1, 3 and 5. The green ones were the five objectstack-ai#33302 cases and the
two no-announce cases, which should stay green. Restore: `git checkout
HEAD -- PATH`, blob equal to the HEAD blob, `git diff HEAD` empty.

## Verification

- `vitest run src/domains/packages-reload-announce.test.ts`: 10 passed
(10).
- `pnpm --filter @objectstack/runtime typecheck`: exit 0
(`check:test-typecheck: OK`).
- `eslint --no-inline-config` on the two changed source files: exit 0.
- `node scripts/check-test-source-alias.mjs`: exit 0.
- The full runtime suite and the derived gate families are reported on
the card's os-dev report comment. CI runs the rest.

Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom

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

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…uns after each announced reload (objectstack-ai#33568)

<!-- 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

PR 2 of 2 for the card. PR 1 (objectstack-ai#33478, merged) brought the
`PositionSchema.renamedFrom` text, its liveness evidence and the
plugin-security comments in line with PR objectstack-ai#33245. This one changes only
`docs/adr/**` (Tier H), so it waits for a GOVERNED_APPROVER.

## 维护者速读

- **改了什么**:只改 ADR-0150 第 288 行 2026-11-13
补遗中关于运行时机的两句及“启动日志”一句:职位改名持有人迁移不再“只在启动时”运行,还会在启动后每次 `metadata:reloaded`
时,只为通告点名的包或职位运行。补遗其它句子与裁决文字不动。
- **为什么改**:objectstack-ai#33245 合入后原句已不实,评审 6879548824 与 6880449445 均要求以单独的 Tier H 文档
PR 修正。
- **风险与回滚**:纯文档,无代码、无发布内容。回滚即 revert。
-
**先看**:`docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`
第 288 行。
- **两分钟验证**:`git grep -n "It runs at boot only" docs/adr`,预期无命中;第 288 行与
`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, the 2026-11-13 addendum (ruling A1, record 6841971722). Three
sentences, no other sentence of the addendum and no ruling text:

1. FROM "and at `kernel:bootstrapped` the platform moves that position's
holders" TO "and at `kernel:bootstrapped`, and again on each later
`metadata:reloaded` that names the position or its package as
registered, the platform moves that position's holders".
2. FROM "It runs at boot only: a package installed or upgraded into a
running kernel is carried at the next restart." TO "It runs at boot over
every claim, and on each `metadata:reloaded` after the boot over the
claims of what the announcement names as registered (`app/ID` while the
registry holds package `ID`, `position/NAME`): a hot install-local
install, the runtime `POST /packages` install, a `PATCH
/packages/:id/enable` that switches a disabled package on, a per-item
publish of a position and the positions of a publish-drafts 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."
3. FROM "Every other stored reference to an old name is named in the
boot log and never rewritten" TO "Every other stored reference to an old
name is named in the log of the run (at boot for every old name it
carries, after a reload for the old names it moved rows of) and never
rewritten" (contract review 6886866329 nit; `readLeftBehind` with
`leftBehindOnlyWhenMoved` on a reload run).

The facts are read from `positionRenameReloadScope` and the
`metadata:reloaded` announcers on `main`, which since objectstack-ai#33448 include the
runtime install door (`announcePackageReload`, both answers) and the
enable door (only when the package was disabled before). Round 2 answers
contract review 6886866329 (FAIL at `99ff68df`): PR 1 listed those two
doors as not announcing, true at its base `19cc8976`, false since objectstack-ai#33448
merged; that text on `main` is corrected by a separate follow-up PR
(Refs objectstack-ai#33301).

## Tests

None: a docs-only diff.

## Acceptance notes

- `skip-changeset`: no published package's `files[]` names `docs/adr`
(every non-private `package.json` read), so the diff ships nothing.

## Verification

At head `16cb2bc7` off `origin/main` `8e63ed87`: 21 derived gates
(`dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`), all
exit 0 (`check:doc-formula-expressions` exit 3 in the loop until the
lint closure was built, then exit 0); `--ran`: "21 derived famil(ies)
accounted for, 21 run, 0 NOT-MEASURED". Record:
`pm-orders/spec/33301-pr2-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>
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>
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/s 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