Skip to content

feat(plugin-security): a position declares its earlier names in renamedFrom, and its holders move with it at boot - #33008

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-5h3u45
Nov 13, 2026
Merged

objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-5h3u45

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #32983
Clause-②: yes (widening) — PositionSchema gains an optional renamedFrom (a list of the position's earlier names). A position that does not declare it parses and behaves exactly as before; a declaration is refused only under rules that are new with the key.
Metadata-protocol: added
Skills-docs: follow-up owed — #33044 (skills/objectstack-data/rules/security.md does not yet teach that a renamed position declares its earlier names in renamedFrom so its holders move with it)

维护者速读

  • 改了什么:岗位可以写「曾用名」(renamedFrom)。新版本启动时,平台以系统身份把每个组织里挂在旧名上的任职记录(sys_user_position)改到新名下,只改岗位名这一列,重启第二次什么都不再改。这是裁决 A1(6841971722):只搬任职人;共享规则、队列成员、记录共享、在途审批、待接受邀请和停用台账里的旧名,只在启动日志里按表点名,不改写。
  • 为什么改:应用为避开同名岗位而改名后(HotCRM 18.4.0 改了 12 个),每个已安装组织的任职人还挂在已不存在的旧名上,静默失去该岗位的全部权限,只能管理员逐条改。现在声明一次,所有组织自动跟上。
  • 风险与回滚:这是一次以系统身份改变「谁持有岗位」的启动写入(ADR-0150 D7 补了一行)。裁决的三条条件都已钉死:旧名在停用台账里是停用的,不迁(否则人会以新名复活权限);旧名被别的包(含已停用的包)或环境占用、或台账记录在别的包或环境名下,不迁;两个岗位抢同一个旧名、或旧名仍是现役岗位,不迁。不迁的都以 warn 写明原因。有一处按现有数据做不到裁决原文:一个旧名若已没有任何岗位占用、台账里也没记在别的包名下,就迁给唯一声明它的包,因为平台没有别的记录能说明它从前属于谁(任何包本来也可以直接声明这个空出来的名字);详见 Acceptance notes,请批准时确认。只在启动时迁:运行中安装或升级的包,下次重启才迁;本次启动没能加载的包(例如 marketplace 重新加载被拒)占着的名字,这一轮看不到。同一人在同一组织已持有新名时,旧记录保留并点名,不删除。降级不会搬回。回滚即 revert 本 PR;已搬的任职记录不会自动回到旧名。
  • 先看:packages/plugins/plugin-security/src/position-renamed-holder-carry.ts(判定顺序在 carryRenamedPositionHolders,写入只在 carryHolders)、packages/spec/src/identity/position-renamed-from.ts(解析期的四条拒绝)、packages/plugins/plugin-security/src/security-plugin-start-hooks.ts(在启动报告之前运行,失败不影响启动)。
  • 两分钟验证:pnpm --filter @objectstack/plugin-security exec vitest run src/position-renamed-holder-carry.test.ts,预期 23 条全过;其中「condition 1」「condition 2」「condition 3」三组各自同时钉了拒绝和放行两个方向。
  • 需要你做的:批准时确认两点,都已写进 ADR-0150 的补充行:(1) 条件 2 的残余——没有任何岗位占用、台账也没记在别的包或环境名下的旧名,迁给唯一声明它的包;本次启动没能加载的包占着的名字也看不到,会被迁走且不会迁回。(2) 只在启动时迁,运行中安装或升级的包要等下次重启。其余由席位落地(含 docs/adr/ 一行,按 Tier H 走批准)。

What changes

Ruling A1 on #32983 (record 6841971722), executed as the seat's re-claim 6841987296 describes.

  • packages/spec — the key. PositionSchema.renamedFrom: an optional list of earlier names in the position-name grammar (^[a-z][a-z0-9_]*$, two characters or more, the same grammar as name). Its docblock and .describe() state what reads it and what it never rewrites.
  • packages/spec — the refusals (condition 3), modelled on the field renamedFrom's refuseDishonestRenamedFrom. One position alone (refuseSelfRenamedFrom, a superRefine on PositionSchema): never the position's own name, each entry once. The positions collection (refuseDishonestPositionRenamedFrom, a superRefine on ObjectStackDefinitionSchema.positions): never a name another position of the collection still declares, which also rules out a cycle, and never an old name a second position claims (reported on the later claimant, naming the first). Both live in identity/position-renamed-from.ts, which identity/index.ts does not re-export, so the public surface is the key alone (check:api-surface unchanged).
  • packages/spec — the ledgers the new key and its refinements owe. liveness/position.json gains renamedFrom: live with the executor named; dropped-refinements.baseline.json declares the new refinement sites (identity/Position root and the four installed-package API schemas' manifest.positions) and its header totals; the form reconciliation records why the Setup position form does not offer the key (a package author's declaration, like the field renamedFrom). Regenerated: authorable-surface/identity.json, content/docs/references/identity/position.mdx, liveness/state-counts/position.md.
  • packages/plugins/plugin-security — the carry. position-renamed-holder-carry.ts, run at kernel:bootstrapped from SecurityPlugin's start hooks, before the catalog reference report (so a moved holder is not reported as naming no position). It reads every position's renamedFrom from the security catalog and judges each old name over the one catalog, since a parse sees one package body:
    • claimed-twice — two positions claim it: neither carries;
    • still-declared / held-by-other — it is a current position of the same holder, or of another package or the environment (condition 2, and condition 3 across packages). A DISABLED package's positions count: the catalog hides them, but a disabled package is still installed and the registry's one-holder rule says it still holds its names, so they are read from the registry with includeDisabledPackages;
    • claimant-disabled — the one position claiming it belongs to a disabled package: nothing is carried onto a position switched off with its package, and the first boot after it is enabled carries (a disabled claimant also counts for claimed-twice);
    • owned-by-other — it is no position now, but the activation ledger (sys_metadata_activation.package_id, ADR-0150 D8 R4) records it under another package, or under any package for an environment position, or as the environment's own (the sys_metadata sentinel the activation door stores) for a package's claim (condition 2). A ledger row naming no package is no evidence either way (it may predate the column);
    • switched-off — readDisabledCatalogNames, the authorization resolver's own read, says the old name is switched off: its holders would come back active under the new name (condition 1).
      Every holder and ledger owner is read through core's catalogEntryAddress, so the environment's sys_metadata sentinel reads as the environment, never as a package. A row whose write fails is named and skipped, so the rows after it still move; a read that fails ends that claim only. Either way the other claims run, and what moved is logged with its organizations.
      An old name it may carry has each holder row's position moved, as the system ({ isSystem: true }, the way every boot pass writes), one row at a time by id. A holder who already holds the new name in that organization keeps both rows: the old row is left and named (read first, and the (user_id, position, organization_id) unique key backs the read). Idempotent: a carried name has no rows left to read, and a row another replica moved after this one read it is skipped, not named as a twin.
  • Holders only. For each old name it carried this boot, the pass reads (never writes), a page at a time, and names by table, with row and organization counts: sys_sharing_rule, sys_queue_member and sys_record_share recipients of type position; sys_approval_approver.approver and pending sys_approval_request.pending_approvers slots position:NAME; pending sys_invitation.positions; activation-ledger rows. A table the composition does not register is skipped; a read that fails is reported as not read. No file in plugin-sharing, plugin-approvals or platform-objects is changed.
  • docs/adr/0150 — one dated addendum line under D7 records the system write that changes who holds a position (condition 4).
  • Changeset: minor for @objectstack/spec and @objectstack/plugin-security. The ADR-0087 record of an addition is the added[] projection check:spec-changes computes from the authorable surface; an addition needs no adr-0087: marker (that gate judges breaking changesets only), so the changeset carries the two declaration lines and no marker.

Tests

  • packages/spec/src/identity/position-renamed-from.test.ts (new, 15): an honest rename parses and keeps the key; a position renamed twice; the key is optional; the grammar refuses CamelCase, a leading underscore (field keys allow it, position names do not), a leading digit, one character, a space and a bare string; the own name and a repeated entry are refused at the entry; in a collection, two honest renames parse, a still-declared name is refused naming it, a cycle is refused on both members, and a second claimant is refused naming the first.
  • packages/plugins/plugin-security/src/position-renamed-holder-carry.test.ts (new, 23), on a real ObjectQL engine over better-sqlite3: holders in two organizations move and only position changes (reason and validity window kept, rows of other names untouched); a second run moves nothing and calls no update; a twin holder keeps both rows and the old one is named; no renamedFrom anywhere reads nothing; condition 1 both ways (switched off: stays; recorded active: moves) through the resolver's own ledger read; condition 2 both ways (another package's or the environment's current name: refused; a dead name recorded under another package: refused; under the claiming package, or under no package: moved; an environment position claiming a name recorded under a package: refused); condition 3 across the catalog (two claimants: neither moves, both named; a cycle: nothing moves); holders only (a sharing-rule recipient and a pending approval slot are named with their organization counts and stay as they were, a non-pending request and a longer name are not matched); the boot wrapper never throws. Through the REAL reader (createSecurityCatalogReader) over the engine's own SchemaRegistry: a position of a disabled package is refused as held, and the same claim carries once that package is uninstalled; a disabled package's lone claim is claimant-disabled, and beside an enabled claimant both are claimed-twice; an environment position stamped sys_metadata is "the environment" as a holder and null as a claimant. A row whose write is refused is named and skipped: the rows after it move, and the next claim is carried. A ledger row carrying the environment's sentinel refuses a package's claim and lets an environment position's through. A row another replica already moved is neither moved again nor named as a twin.
  • packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts: the served position card counts 14 top-level properties (13 + renamedFrom).
  • Moved with the new key: scripts/dropped-refinements.test.ts (header totals) and src/system/metadata-form-zod-reconciliation.test.ts (the position form's omission entry).

Acceptance notes

  • Not covered by A1, as ruled: the non-holder references (named, not rewritten), a downgrade carrying holders back, and Setup-authored metadata bodies that name an old position (not read).
  • Ownership of a dead name. Condition 2 asks that a package not claim an old name it never owned. The platform keeps no history of which package declared a position that no longer exists; the only stored record is the activation ledger's package_id, which exists only for a position that was ever switched on or off. So the pass refuses on that evidence when it exists and on any current holder (a disabled package's included), and otherwise carries for the one claimant, whichever package that is; the ADR-0150 addendum says so in the same words. A package that declares an old name nobody holds and no ledger row records can take that name's stranded holders; the boot log names every carry (old name, new name, rows, organizations) at info, so an operator can see it at the boot it happens.
  • Disabled packages. A disabled package still holds its position names (the registry's one-holder rule), so a claim on one of them is refused while the package is disabled and carries only once it is uninstalled. A disabled package's own claim is not carried until the package is enabled and the environment restarts.
  • Loaded packages only. The pass judges the packages this boot loaded. A marketplace entry whose rehydrate the engine refuses, or whose protocol range this runtime does not meet, is not registered at all this boot (measured on the existing rehydrate pins in marketplace-install-local-register-refusal.test.ts: such an entry's package reads getPackage(id) === undefined; a failure after a successful register leaves it loaded and judged). A standing claim on a position name of a package in that state is carried. Recorded as the limit in the ADR line; a stand-down would need the marketplace door to publish what it failed to load.
  • Boot only. A package installed or upgraded into a running kernel through the marketplace door is carried at the next restart, not when the upgrade lands (out of scope here, see the report).
  • Twin rows. A holder of both names in one organization keeps both rows, as the HotCRM script does; it is named for review in Setup, never deleted by the platform. The warning says that when the row on the new name is a time-boxed delegation, the old row is the lasting one to re-point.
  • Field renamedFrom form entry. The reconciliation's existing field entry still calls the field key "planned, not yet read" although it is live since A field's declared renamedFrom carries the old column's data to the new name on package upgrade, instead of leaving it behind an empty new column (epic cloud#3652 Q3) #30885. Noted, not changed here (another key's record).

Verification

Final head and merge base are in the gates block below. Local scope per os-dev: the affected packages' own suites and typecheck, plus every family dispatch-gates.mjs --commands derives; CI runs the farm.

Head cc6cce96cd (main merged once, at 04c35f095; the three commits after d9befe7f9f are the metadata-protocol count and the two review rounds' fixes, with no merge). Readings are on 74fff9ff1f unless they name cc6cce96cd; the last commit touches only the carry module, its test, the ADR line and the changeset.

  • Package suites. pnpm --filter @objectstack/plugin-security test: on cc6cce96cd, 265 files, 6551 passed, 45 skipped; typecheck exit 0. pnpm --filter @objectstack/metadata-protocol test: 337 files, 22790 passed, 36 skipped (on 7a1bbb3f; the fix commit after it touches no file that suite reads besides the spec rebuild, whose key count is unchanged). @objectstack/spec: the full suite ran before the merge (837 files); on this head the identity, stack, form-reconciliation and dropped-refinement files ran again: 16 files, 414 passed. The other suites that read PositionSchema: core position-row-definition 9, metadata typescript-serializer-annotation 7, downstream-contract 31, all passed. pnpm --filter @objectstack/spec typecheck and pnpm --filter @objectstack/plugin-security typecheck: exit 0.
  • Generated artefacts. pnpm --filter @objectstack/spec check:generated: exit 0 after a fresh build.
  • The rehydrate limit, measured. marketplace-install-local-register-refusal.test.ts -t "notLoaded|failure after a successful register|register fault": 8 passed; the refused entry's package reads getPackage(id) === undefined, the after-register failure stays loaded.
  • Dogfood. Not owed: no ! in the title and Clause-② is (widening).
Ablations (one per new rule, each through scripts/ablation-replace.mjs, restored to the HEAD blob, git diff HEAD empty after each)

Both suites import the rules by relative path from src/, so no dist/ sits between the mutation and the run.

rule file result with the rule ablated
own name position-renamed-from.ts spec 1 failed / 14 passed
repeated entry position-renamed-from.ts spec 1 failed / 14 passed
still declared in the collection (and cycle) position-renamed-from.ts spec 2 failed / 13 passed
one old name claimed twice position-renamed-from.ts spec 1 failed / 14 passed
claimed-twice (catalog) position-renamed-holder-carry.ts carry 1 failed / 15 passed (on d9befe7f9f)
still-declared / held-by-other (condition 2, 3) position-renamed-holder-carry.ts carry 3 failed / 13 passed (on d9befe7f9f)
owned-by-other (condition 2) position-renamed-holder-carry.ts carry 2 failed / 14 passed (on d9befe7f9f)
switched-off (condition 1) position-renamed-holder-carry.ts carry 1 failed / 15 passed (on d9befe7f9f)
twin read alone position-renamed-holder-carry.ts stays green: the unique key answers and the catch reports the same twin
twin read AND the unique-violation catch position-renamed-holder-carry.ts carry 1 failed / 15 passed (on d9befe7f9f)
a disabled package's positions as holders position-renamed-holder-carry.ts carry 2 failed / 19 passed
claimant-disabled position-renamed-holder-carry.ts carry 1 failed / 20 passed
the sys_metadata sentinel read through catalogEntryAddress position-renamed-holder-carry.ts carry 1 failed / 20 passed
one claim's failure isolated position-renamed-holder-carry.ts carry 1 failed / 20 passed
a row another replica moved position-renamed-holder-carry.ts carry 1 failed / 20 passed
a ledger row with the environment's sentinel is the environment's record position-renamed-holder-carry.ts carry 1 failed / 22 passed (on cc6cce96cd)
a failed row is skipped, not the end of the claim position-renamed-holder-carry.ts carry 1 failed / 22 passed (on cc6cce96cd)
Gates ran: node scripts/pm/dispatch-gates.mjs --commands on head 74fff9ff1f, 125 families, every one exit 0; --ran with exit codes: 125 derived, 125 run, 0 NOT-MEASURED (a derived zero)

On cc6cce96cd the 32 families that read the changeset, the ADR, the census or plugin-security sources ran again, every one exit 0: node scripts/check-adr-0087-registration.mjs --base origin/main, node scripts/check-adr-0087-registration.mjs --self-test, node scripts/check-adr-links.mjs, node scripts/check-adr-links.mjs --self-test, node scripts/check-changeset-no-major.mjs --base origin/main, node scripts/check-closing-keyword-parity.mjs, node scripts/check-closing-keyword-parity.mjs --self-test, node scripts/check-empty-changeset.mjs --base origin/main, node scripts/check-empty-changeset.mjs --self-test, node scripts/check-issue-citations.mjs, node scripts/check-plugin-teardown-shape.mjs, node scripts/check-plugin-teardown-shape.mjs --self-test, node scripts/check-tenant-audit-census.mjs, node scripts/check-tenant-audit-census.mjs --self-test, node scripts/docs-audit/check-affected-docs.mjs, node scripts/docs-audit/check-drift-comment.mjs, pnpm check:adr-anchors, pnpm check:adr-index, pnpm check:adr-symbol-anchors, pnpm check:changeset-gate-self-tests, pnpm check:closed-ceremony-text, pnpm check:corpus-claim-drift, pnpm check:doc-authoring, pnpm check:docs-audit-scope, pnpm check:issue-citations, pnpm check:logger-receiver-detach, pnpm check:optional-error-sink, pnpm check:role-word, pnpm check:spec-docblock-symbol-anchors, pnpm check:system-context-census, pnpm check:test-source-alias, pnpm check:undeclared-dep-imports.

The first pass (on 2b41c135) was red on three families this diff caused, each fixed then: check-tenant-audit-census, check:doc-authoring, check:spec-docblock-symbol-anchors. On this head the census was regenerated again (the carry's write now names sys_user_position inline, so it counts as a decidable write against a tenancy-enabled object) and the page's prose counts moved with it.

  • node scripts/check-adr-0087-registration.mjs --base origin/main → exit 0
  • node scripts/check-adr-0087-registration.mjs --self-test → exit 0
  • node scripts/check-adr-links.mjs → exit 0
  • node scripts/check-adr-links.mjs --self-test → exit 0
  • node scripts/check-changeset-no-major.mjs --base origin/main → exit 0
  • node scripts/check-closing-keyword-parity.mjs → exit 0
  • node scripts/check-closing-keyword-parity.mjs --self-test → exit 0
  • node scripts/check-comment-mask-adoption.mjs → exit 0
  • node scripts/check-comment-mask-adoption.mjs --self-test → exit 0
  • node scripts/check-comment-mask-corpus.mjs → exit 0
  • node scripts/check-dev-prereqs.mjs --self-test → exit 0
  • node scripts/check-doc-route-spelling.mjs --advisory → exit 0
  • node scripts/check-doc-route-spelling.mjs --self-test → exit 0
  • node scripts/check-docs-section-name.mjs → exit 0
  • node scripts/check-docs-section-name.mjs --self-test → exit 0
  • node scripts/check-dts-emitted.mjs --self-test → exit 0
  • node scripts/check-empty-changeset.mjs --base origin/main → exit 0
  • node scripts/check-empty-changeset.mjs --self-test → exit 0
  • node scripts/check-issue-citations.mjs → exit 0
  • node scripts/check-plugin-teardown-shape.mjs → exit 0
  • node scripts/check-plugin-teardown-shape.mjs --self-test → exit 0
  • node scripts/check-section-landing-index.mjs → exit 0
  • node scripts/check-section-landing-index.mjs --self-test → exit 0
  • node scripts/check-tenant-audit-census.mjs → exit 0
  • node scripts/check-tenant-audit-census.mjs --self-test → exit 0
  • node scripts/ci/assert-turbo-remote-cache.mjs --self-test → exit 0
  • node scripts/ci/plan-test-core-shards.mjs --self-test → exit 0
  • node scripts/ci/prune-turbo-cache.mjs --self-test → exit 0
  • node scripts/ci/snapshot-next.mjs --self-test → exit 0
  • node scripts/docs-audit/check-affected-docs.mjs → exit 0
  • node scripts/docs-audit/check-drift-comment.mjs → exit 0
  • node scripts/pm/release-rehearsal-clone.mjs --self-test → exit 0
  • node scripts/release-pending-publish.mjs --self-test → exit 0
  • pnpm --filter @objectstack/lint run check:doc-formula-expressions → exit 0
  • pnpm --filter @objectstack/lint run check:doc-security-posture → exit 0
  • pnpm --filter @objectstack/spec run check:api-surface → exit 0
  • pnpm --filter @objectstack/spec run check:authorable-surface → exit 0
  • pnpm --filter @objectstack/spec run check:browser-reachable-entries → exit 0
  • pnpm --filter @objectstack/spec run check:docs → exit 0
  • pnpm --filter @objectstack/spec run check:dual-source-exports → exit 0
  • pnpm --filter @objectstack/spec run check:duration-unit-keys → exit 0
  • pnpm --filter @objectstack/spec run check:empty-state → exit 0
  • pnpm --filter @objectstack/spec run check:entry-nameability → exit 0
  • pnpm --filter @objectstack/spec run check:error-code-provenance → exit 0
  • pnpm --filter @objectstack/spec run check:export-origins → exit 0
  • pnpm --filter @objectstack/spec run check:exported-any → exit 0
  • pnpm --filter @objectstack/spec run check:generated → exit 0
  • pnpm --filter @objectstack/spec run check:liveness → exit 0
  • pnpm --filter @objectstack/spec run check:llms-txt → exit 0
  • pnpm --filter @objectstack/spec run check:skill-examples → exit 0
  • pnpm --filter @objectstack/spec run check:skill-refs → exit 0
  • pnpm --filter @objectstack/spec run check:strictness-ledger → exit 0
  • pnpm --filter @objectstack/spec run check:variant-docs → exit 0
  • pnpm --filter @objectstack/spec run check:yaml-examples → exit 0
  • pnpm check:adr-anchors → exit 0
  • pnpm check:adr-index → exit 0
  • pnpm check:adr-symbol-anchors → exit 0
  • pnpm check:authz-resolver → exit 0
  • pnpm check:changeset-gate-self-tests → exit 0
  • pnpm check:ci-filter-parity → exit 0
  • pnpm check:cli-command-ids → exit 0
  • pnpm check:closed-ceremony-text → exit 0
  • pnpm check:corpus-claim-drift → exit 0
  • pnpm check:cross-package-test-inputs → exit 0
  • pnpm check:dispatcher-error-vocabulary → exit 0
  • pnpm check:doc-anchors → exit 0
  • pnpm check:doc-authoring → exit 0
  • pnpm check:doc-frontmatter → exit 0
  • pnpm check:docs-audit-scope → exit 0
  • pnpm check:docs-redirects → exit 0
  • pnpm check:docs-single-h1 → exit 0
  • pnpm check:docs-spec-enumerations → exit 0
  • pnpm check:docs-transcript-drift → exit 0
  • pnpm check:driver-memory-census → exit 0
  • pnpm check:dts-closure → exit 0
  • pnpm check:dual-build-cjs-loads → exit 0
  • pnpm check:durability-log-level → exit 0
  • pnpm check:engine-double-contract → exit 0
  • pnpm check:error-status-conformance → exit 0
  • pnpm check:gitlink-declared → exit 0
  • pnpm check:i18n → exit 0
  • pnpm check:i18n-stale-fill → exit 0
  • pnpm check:init-service-contract → exit 0
  • pnpm check:issue-citations → exit 0
  • pnpm check:keyed-text-bounds → exit 0
  • pnpm check:lean-entry-closure → exit 0
  • pnpm check:logger-receiver-detach → exit 0
  • pnpm check:merge-driver → exit 0
  • pnpm check:nul-bytes → exit 0
  • pnpm check:object-def-param-keys → exit 0
  • pnpm check:objectql-double-limit → exit 0
  • pnpm check:optional-error-sink → exit 0
  • pnpm check:org-identifier → exit 0
  • pnpm check:page-declaration-shape → exit 0
  • pnpm check:platform-checklist → exit 0
  • pnpm check:platform-object-tenancy-census → exit 0
  • pnpm check:pm-governed-merges → exit 0
  • pnpm check:pm-prior-rulings → exit 0
  • pnpm check:published-files → exit 0
  • pnpm check:published-readme-links → exit 0
  • pnpm check:query-options-erasure → exit 0
  • pnpm check:react-page-adapter-contract → exit 0
  • pnpm check:refd-timer-probe → exit 0
  • pnpm check:registry-log-declared → exit 0
  • pnpm check:rest-log-spy-declared → exit 0
  • pnpm check:role-word → exit 0
  • pnpm check:settings-bind-window → exit 0
  • pnpm check:skill-identifier-liveness → exit 0
  • pnpm check:skill-top-level-keys → exit 0
  • pnpm check:slot-lookup → exit 0
  • pnpm check:sourcemap-no-sources-content → exit 0
  • pnpm check:spec-docblock-symbol-anchors → exit 0
  • pnpm check:spec-parsed-alias → exit 0
  • pnpm check:stack-collection-maps → exit 0
  • pnpm check:startup-registry-verdict → exit 0
  • pnpm check:system-context-census → exit 0
  • pnpm check:test-source-alias → exit 0
  • pnpm check:tier-file-adoption → exit 0
  • pnpm check:type-check-coverage → exit 0
  • pnpm check:type-check-debt → exit 0
  • pnpm check:undeclared-dep-imports → exit 0
  • pnpm check:vendor-version-stamps → exit 0
  • pnpm check:vouch-for-reference-callers → exit 0
  • pnpm check:watch-hint-literal → exit 0
  • pnpm check:where-matcher → exit 0

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (two parse-time refinements, like the field renamedFrom's; the carry lives in plugin-security)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint is CI's run.
  • 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.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/. (position.mdx is gen:docs output)
  • 8. Title, body and comments are in English. (except the 维护者速读 section, which the dispatch contract writes in Chinese)
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq

…er the field renamedFrom refusals

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
…t boot, as the system, in every organization

Holders only (ruling A1): an old name two positions claim, that a position
still declares, that another package or the environment holds or is
recorded as owning, or that is switched off is not carried and is named.
Every other stored reference to an old name is named in the boot log and
never rewritten.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
…ts for renamedFrom

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
…ssion record renamedFrom

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
…nant census counts the new system write

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-security, @objectstack/spec, touching 75 documentable anchor(s). ⚠️ 4 changed file(s) yielded no anchor (packages/spec/authorable-surface/identity.json, packages/spec/dropped-refinements.baseline.json, 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.

55 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 64c426ab22aa1f13290240aff1cd02dc1bf56027.

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

What this run could not see
  • 4 changed file(s) yielded no anchor (packages/spec/authorable-surface/identity.json, packages/spec/dropped-refinements.baseline.json, packages/spec/liveness/position.json, …) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: organization_id (literal, 40 pages)
  • 20 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 — 174 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 64c426ab22aa1f13290240aff1cd02dc1bf56027 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 64c426ab22aa1f13290240aff1cd02dc1bf56027

⚠️ 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 64c426ab22aa1f13290240aff1cd02dc1bf56027 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…14 top-level properties

The degenerate-derivation control pins each served type's top-level
property count. PositionSchema gained `renamedFrom` (the earlier names
whose holders the security plugin moves at boot), so `position` serves 14.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#3 · os-elon-musk · session_016WV4d1T5HEokjRgR6vCBX8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d9befe7f9ff249c3b99789579052e623632ed5e4
Local-runs: probe — the declaration-line readers in scripts/pm/clause2-line.mjs were run over the PR body and the changeset, as the order allowed; nothing was built and no test was run
Scope: packages/spec/src/identity/position-renamed-from.ts, packages/spec/src/identity/position.zod.ts, packages/spec/src/stack.zod.ts, docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md + packages/plugins/plugin-security/src/position-renamed-holder-carry.ts, packages/plugins/plugin-security/src/security-plugin-start-hooks.ts, packages/plugins/plugin-security/src/position-renamed-holder-carry.test.ts, packages/spec/src/identity/position-renamed-from.test.ts, packages/spec/src/system/metadata-form-zod-reconciliation.test.ts, packages/spec/liveness/position.json, packages/spec/liveness/state-counts/position.md, packages/spec/authorable-surface/identity.json, packages/spec/dropped-refinements.baseline.json, docs/audits/2026-08-tenant-audit-write-call-sites.counts.md, content/docs/permissions/tenant-audit-census.mdx (the generated counts only), .changeset/32983-position-renamed-from-carries-holders.md (declaration lines only)

Read, not reviewed (outside the diff): packages/core/src/security/security-catalog.ts, packages/core/src/security/resolve-authz-context.ts, packages/objectql/src/registry.ts, packages/objectql/src/security-catalog-namespace.ts, packages/plugins/plugin-security/src/objects/sys-user-position.object.ts, packages/plugins/plugin-security/src/stored-permission-set-package-backfill.ts, packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.ts, packages/plugins/plugin-security/src/builtin-positions.ts, packages/platform-objects/src/system/sys-metadata-activation.object.ts, packages/runtime/src/domains/catalog-activation.ts, packages/runtime/src/package-state-store.ts, packages/cloud-connection/src/marketplace-install-local-plugin.ts, packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts, packages/spec/src/data/field.zod.ts (the field renamedFrom doctrine), packages/spec/src/shared/identifiers.zod.ts, ADR-0150 D1, D7 and D8, card #32983 with the dev report 6841803143, the decision analysis 6841869138, the ruling 6841971722, the claims 6841987296 and 6843365364, the dev report 6843412313, the PR body, and hotcrm PR #2446 scripts/migrate-position-holders.ts at its merge commit. The changeset prose, the reference page and the PR body are prose faces: the seat's ACCEPT, not this record. The dev's suite counts and ablations are the dev's readings. Also run, read-only: scripts/pm/record-recognisers.mjs --template --paths for the Scope hits, and scripts/check-changeset-no-major.mjs (no major). scripts/check-adr-0087-registration.mjs could not run without an install, so no reading was taken from it. Check-runs on this head when read: 40 success, 10 skipped, 1 failure (Test Core (6/8)), 14 in progress, 65 in all. PR author is objectstack-fleet[bot] (relay write). The PR is a draft.

① Derived judgments

  • Holders only, nothing wider than A1: holds. The diff has one write call site, engine.update on sys_user_position writing position alone (position-renamed-holder-carry.ts:252). readLeftBehind (:340-367) only calls find on the six other stores and names what it finds. No file in plugin-sharing, plugin-approvals or platform-objects moves. No install or upgrade hook is added: the carry sits inside the kernel:bootstrapped handler that already exists (security-plugin-start-hooks.ts:377, :396-404).
  • Written as the system: holds. Every read and the write carry the isSystem context (:96, :201, :244, :252), the spelling the sibling boot passes use.
  • Every organization, no cross-tenant move: holds. One unscoped read takes the rows naming the old name (:232), then one by-id update per row. organization_id is never written, the twin is looked up in the row's own organization (:241), and the report counts per organization (:260). The pass crosses organizations inside one environment by design. It never leaves the kernel's own engine and catalog, so it crosses no environment boundary.
  • Once per boot, not per load: holds. It runs once in the kernel:bootstrapped handler, after the permission-set package backfill and before the catalog reference report, so a moved holder is not reported as naming no position. A package registered into a running kernel does not run it (see ③).
  • Idempotent on restart and partial failure: holds. A carried name has no row left to read (pinned, position-renamed-holder-carry.test.ts:135-147), and a row moved by hand is not on the old name, so it is not read. After a failure the rows already moved stay moved and the next boot reads the rest. What a failure does to the rest of the run is should-fix 5.
  • No duplicate key: holds. The twin is read first (:240-249). The declared unique key (user_id, position, organization_id) (sys-user-position.object.ts:216) backs the read, and a violation is caught and the row left and named (:253-258). For a row with no organization the SQL key is NULL-distinct, so only the read guards it; such a row applies nowhere (ADR-0131 D1), and no pin covers it.
  • Condition 1: holds for the activation ledger. switched-off asks the resolver's own read (:395-397, :443-447; resolve-authz-context.ts:1652) and is pinned both ways (test:172-187). Only position is written, so the validity window, reason and delegation columns of a row stay (test:114-133). The ledger row is a non-holder store and is not moved, so the choice is refusal, the second arm the analysis offered. A package-level disable is also a deactivation, and the carry does not read it (must-fix 1).
  • Condition 2: fails in one arm. A name a served position holds is refused, pinned for another package and for the environment (:427-436, test:190-202). The six built-in names are registered by the platform under its own package id (builtin-positions.ts:157), so they read as live holders. A position of a disabled package is not refused (must-fix 1). A dead name is judged in ④.
  • Condition 3: holds. The entry grammar equals the grammar of name (position.zod.ts:169-172 against identifiers.zod.ts:130-137). Own name and repeat are refused on one position (position-renamed-from.ts:28-52). A name still declared, which covers a cycle, and an old name claimed twice are refused on the positions collection (position-renamed-from.ts:64-98, stack.zod.ts:958-959). The carry judges both again over the one catalog (:415-436, test:223-249).
  • Clause-② yes (widening): holds. PositionSchema is a closed strictObject, so no position that parses on origin/main carries renamedFrom. Both refinements return early when the key is absent (position-renamed-from.ts:30, :73), so they refuse nothing that parses today. No extend, pick or omit of PositionSchema exists under packages, so the added refinement breaks no derived schema.
  • Census: consistent with the one new write. docs/audits/2026-08-tenant-audit-write-call-sites.counts.md:215 adds one row for the carry (update, elevated). The totals move by exactly one in both files: sites 308 to 309, run-time object name 94 to 95, threading a context 238 to 239, elevated 173 to 174.

② Semver level

Metadata-protocol: added takes at least minor on a package the diff moves (AGENTS.md Post-Task 3). The changeset is minor for @objectstack/spec and for @objectstack/plugin-security (.changeset/32983-position-renamed-from-carries-holders.md:2-3). Correct. Clause-②: yes (widening) and Metadata-protocol: added are line-leading in the changeset (lines 6-7) and in the PR body, and the one reader reads both as declared in both places. A Skills-docs: follow-up owed line is in both. The change is not breaking, so no ADR-0087 marker is owed; the ruling's "ADR-0087 entry" is the added projection from the authorable surface (authorable-surface/identity.json:60). The rules module is not re-exported, so the public surface grows by the one key. The ADR-0150 addendum is one paragraph under D7 (docs/adr/0150-...md:288).

③ Boundary flags

  • For the maintainer, with the Tier H approval request: the dead-name residual of condition 2 (④). The carry is a runtime security behaviour on the human floor, so a condition of the ruling is the maintainer's to relax, not the seat's.
  • A marketplace upgrade applied to a running kernel carries nothing until the next restart. The install door hot-registers the new version (marketplace-install-local-plugin.ts:3185 and the header at :529), and nothing fires kernel:bootstrapped again. The field precedent carries at that door (field.zod.ts:2627-2632). The order scoped this card to the existing start hook, so this is not a defect of this head. It is a gap against the ruling's "when the renamed definition loads" and against the card's own marketplace case, and it needs a card or the maintainer's word. The hand-off should say it.
  • Overlays, not measured. An ADR-0005 overlay body replaces the package body in the catalog, and the Setup form omits the key (metadata-form-zod-reconciliation.test.ts:430-436). Whether a Setup save of an overlay keeps renamedFrom was not measured. An overlay of the old name that outlives the rename reads as a live environment position, so the carry refuses and the holders keep the old customised position. That direction is closed and loud.
  • The metadata save door accepts the key. It parses a position with PositionSchema (kernel/metadata-type-schemas.ts:169), so an environment position or an overlay may declare renamedFrom through the API although the form omits it. A metadata author gains nothing by it: the same author may already author a position under the dead name itself.
  • Audit, not measured. Whether plugin-audit records each system update was not measured. The one record this diff itself guarantees is one info line (:470), which a logger set to warn drops.
  • Tier H is owed for docs/adr/. The Skills-docs: follow-up card for skills/objectstack-data/rules/security.md is owed outside this PR.

④ Design judgment

The dev's flagged judgment: is the activation-ledger evidence for a dead old name sufficient and safe?

  • What the evidence is. A ledger row exists only for a position somebody switched on or off: absence of a row means active (sys-metadata-activation.object.ts:9-13), and the only writers are the enable and disable actions (:57). A row that names no package is read as no evidence (position-renamed-holder-carry.ts:406), although that is also how the ledger spells an item the environment authored (sys-metadata-activation.object.ts:145-153).
  • Can a package claim an old name whose ledger row is absent or was never written? Yes. With no row, others is empty (:437), nothing is switched off, and the one claimant is carried (:448). That is the common case, HotCRM's twelve old names among them.
  • A fresh tenant. The ledger is empty, so every single claim on a name no served position holds is carried. With no holder row on the name it moves nothing.
  • Fail direction: open (carry). It is closed only for a served live holder, a row that records another package, a switched-off row, a double claim, and a ledger or catalog that cannot be read (the read throws and nothing is written).
  • Sufficient: no. The ledger records a toggle, not an owner, so the ruling's sentence "a package cannot claim an old name it never owned" is not enforced for a dead name. A closed direction is not buildable from stored state without defeating A1: the ruled use case has no ledger row either.
  • Safe: yes, on one condition that this head does not meet. A dead name is already free for any package to declare (ADR-0150 D7, one slot per name), and a holder row is a bare name (D8 row R2), so a package that declares the dead name itself holds its stranded rows at once. The open carry therefore grants no power that name reuse does not already grant, provided the carry refuses every name the registry's one-holder rule would refuse the claimant to declare. That holds for a served package, the environment and the built-ins. It does not hold for a disabled package (must-fix 1). The one real difference from name reuse is that the carry is permanent: name reuse leaves the rows where they are, and the carry rewrites them and nothing carries them back.
  • Disposition. Accept the open direction as a recorded residual once must-fix 1 closes the condition. It deviates from the letter of condition 2, so the seat puts it to the maintainer in plain words (③), and the ADR line says it (should-fix 3).

The schema files against the ruling: hold. The key, its grammar and the four parse refusals follow the field precedent's shape (refuseDishonestRenamedFrom), with the position grammar where the field uses the field-key grammar. The form omission is recorded with its reason.

The ADR addendum against its first consumer. The line states the write, the scope and the refusals. Two of its statements are wider than the code: "another package ... holds" is not true for a disabled package (must-fix 1), and it does not say that a dead name nobody is recorded as owning is carried for its one claimant (should-fix 3).

First consumer. The carry is the only reader of the key, and the liveness row grades it live with the executor named. Every condition-2 pin runs on a stand-in catalog; the real reader's shapes are where the gaps below were found (must-fix 1, should-fix 4).

Implemented-by: card thread session_016WV4czhuyaTe2ySbAbhCjq
Reviewed-by: domain:spec#3 seat (CONTRACT_REVIEW_TIER subagent)

Verdict: FAIL

Items:

  1. must-fix: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:378-380 and :427-436. Condition 2's live-holder arm reads catalog.list('position'), and that list hides every position of a disabled package (packages/core/src/security/security-catalog.ts:515-521, :900, :931; pinned at security-catalog.test.ts:138). The registry says a disabled package is still installed and still holds its names (packages/objectql/src/registry.ts:4677-4678), and the disabled state is restored in AppPlugin.start(), before kernel:bootstrapped (packages/runtime/src/app-plugin.ts:764, :784). So while package Z is disabled, another package's renamedFrom naming Z's position meets no refusal, and Z's holders are moved to the claimant's position in every organization, for good. This is the feature's own scenario (two apps wanted one name, one renamed away) plus a temporary disable, and the claim is standing, so every boot re-judges it. People on a deactivated position also come back active under the new name, which is condition 1. Judge holders, and the claimants for claimed-twice, over every installed package, disabled included, and pin both ways: a disabled holder is refused, an uninstalled one is carried. Read, not run.
  2. must-fix: packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts:385. The control pins position: 13 served top-level properties and the new key makes 14, so Test Core (6/8) is red on this head (job 131679495396, step "Run this shard's tests", first error AssertionError: expected 14 to be 13 at :399). Move the count with its note, as the field renamedFrom did at :374-375. The file is not in the diff, and the red is this diff's.
  3. should-fix: docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md:288. Add one clause: an old name that no installed position holds and no ledger row records under another package is carried for its one claimant, whichever package that is. The PR body's maintainer summary says all three conditions are pinned, and its Acceptance notes say a package can take such a name's stranded holders; the approver should meet the second sentence where the first is (the seat's ACCEPT for the PR body).
  4. should-fix: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:385, :429, :437. The carry reads entry.packageId raw. The real reader stamps a stored environment item with the sentinel sys_metadata (security-catalog.ts:402-403), and core exports catalogEntryAddress so every reader spells the holder one way (resolve-authz-context.ts:1452-1461). An environment position is therefore reported as package "sys_metadata" (:222-223), and the activation door can store the same value for a position (catalog-activation.ts:885). Every pin spells the environment as no packageId (position-renamed-holder-carry.test.ts:91-97), so none exercises the real shape. Normalise through catalogEntryAddress and add one pin through createSecurityCatalogReader.
  5. should-fix: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:256, :448, :514-524. A write that fails for any reason other than a unique violation ends the whole run. Later claims are not tried, and the report of the rows already moved in that boot is dropped: the only line is "did not finish". The next boot meets the same row first, so one position-level refusal blocks every later rename on every boot; the agent-ceiling refusal judges an update naming a position for every writer, the system included (agent-ceiling-grant-refusal.ts:320-331). Isolate a failure per claim, and log what moved before it.
  6. should-fix: packages/cloud-connection/src/marketplace-install-local-plugin.ts:1781. A package whose rehydrate fails is logged and the boot continues, so its positions are absent from the catalog the same way as in item 1, and a standing claim on one of its names would carry its holders. Not measured here. Measure it, and either stand the carry down for that boot or record the limit in the ADR line.
  7. nit: packages/spec/liveness/position.json:40. The evidence anchors refuseDishonestPositionRenamedFrom in position.zod.ts, where the name appears only in a comment. The function is at position-renamed-from.ts:64 and its call at stack.zod.ts:959.
  8. nit: the position-name grammar is typed three times (position.zod.ts:170, position-renamed-from.ts:14, position-renamed-holder-carry.ts:93) instead of reusing SnakeCaseIdentifierSchema (identifiers.zod.ts:130). The carry's copy drops the two-character minimum.
  9. nit: docs/audits/2026-08-tenant-audit-write-call-sites.counts.md:215. The new row reads undecidable for the object because the name arrives through an imported constant. The sibling invitation-placement.ts row reads sys_user_position, enabled. A local literal would let the census count the carry as an elevated write against a tenancy-enabled object.
  10. nit: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:415-424, :440, :445. A refused name is added to the left-behind set, so "Re-point each in Setup to the renamed position" (:495) prints for a rename that was not carried, and on claimed-twice for a name that may still be live.
  11. nit: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:302, :311, :197-208. While any renamedFrom stays declared, every boot reads every pending approval request and every pending invitation into memory.
  12. nit: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:479-480. The twin warning tells the administrator to remove the old row. When the row on the new name is a time-boxed delegation, the old row is the durable assignment.
  13. nit: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:240-245. When two replicas boot together, the second reads a row the first already moved as its own twin and reports it as left on the old name. The data is right and the warning is false.

A delta review by the same reviewer is owed on the head that fixes items 1 and 2. Landing also waits for the head's check-runs to finish green (14 in progress when read) and for the Tier H approval.

… against a rename claim

Contract review of the holder carry:
- condition 2 is judged over every installed package: a position of a
  disabled package is a holder (the catalog hides it, the registry does
  not), and a disabled claimant is counted for claimed-twice and not
  carried alone (claimant-disabled);
- holders and ledger owners are read through catalogEntryAddress, so the
  environment's `sys_metadata` sentinel is never reported as a package;
- a failed claim is that claim's: the others still run, and the rows it
  moved before failing are logged;
- a row a second replica already moved is not reported as a twin; the twin
  warning names the time-boxed delegation case; only carried names have
  their other references reported, counted a page at a time;
- the grammar reuses SnakeCaseIdentifierSchema, the liveness evidence
  anchors the rules' own module, the census reads the written object;
- ADR-0150 addendum: the one-claimant carry of a dead name, the loaded-only
  limit and the boot-only timing are stated.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#3 · os-elon-musk · session_016WV4d1T5HEokjRgR6vCBX8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 74fff9ff1fa5e359d6177c32340d136cc1c77876
Local-runs: probe — the declaration-line readers in scripts/pm/clause2-line.mjs were run over the PR body and the changeset, as the order allowed; nothing was built and no test was run
Scope: packages/spec/src/identity/position-renamed-from.ts, packages/spec/src/identity/position.zod.ts, packages/spec/src/stack.zod.ts, docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md + packages/plugins/plugin-security/src/position-renamed-holder-carry.ts, packages/plugins/plugin-security/src/position-renamed-holder-carry.test.ts, packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts, packages/spec/liveness/position.json, docs/audits/2026-08-tenant-audit-write-call-sites.counts.md, content/docs/permissions/tenant-audit-census.mdx (the generated counts only)

Round 2, a delta review of d9befe7f..74fff9ff against the round-1 record (PR comment 6843809762, FAIL at d9befe7f9ff249c3b99789579052e623632ed5e4). The delta is two commits: 7a1bbb3, the metadata-protocol count pin, and 74fff9f, the review fixes. Every PR file outside the delta, packages/spec/src/stack.zod.ts and the changeset among them, is byte-identical to the round-1 head. Its round-1 judgment stands and was not derived again.

Read, not reviewed (outside the diff): packages/objectql/src/registry.ts (listItems, isPackageDisabled, installPackage, uninstallPackage, disablePackage, unregisterItemsByPackage, registerItem, the security-catalog claims, packageScopedHoldersOf), packages/objectql/src/engine-registration.ts, packages/objectql/src/engine-top-level.ts, packages/objectql/src/security-catalog-namespace.ts, packages/core/src/security/security-catalog.ts and its test, packages/core/src/security/resolve-authz-context.ts, packages/core/src/kernel.ts, packages/runtime/src/app-plugin.ts, packages/runtime/src/domains/catalog-activation.ts, packages/runtime/src/domains/packages.ts, packages/services/service-package/src/index.ts, packages/cloud-connection/src/marketplace-install-local-plugin.ts, packages/metadata-protocol/src/protocol-registry-hydration.ts, packages/metadata-protocol/src/protocol-package-install.ts, packages/platform-objects/src/system/sys-metadata-activation.object.ts, packages/spec/src/shared/identifiers.zod.ts, packages/spec/src/shared/protection.zod.ts, packages/types/src/keyset-walk.ts, packages/plugins/plugin-security/src/security-plugin-start-hooks.ts, the ruling 6841971722, the round-1 record, the dev's fix list for this head, and the PR body. The changeset prose, the reference page and the PR body are prose faces: the seat's ACCEPT, not this record. The dev's suite counts, ablations and the rehydrate measurement are the dev's readings. Also run, read-only: scripts/pm/record-recognisers.mjs --template --paths for the Scope hits, and scripts/check-changeset-no-major.mjs (no major). The review worktree has no install, so every judgment on behaviour below is read, not run. Check-runs on this head when read: 76 in all, 61 success, 14 skipped, 1 cancelled, 0 failure, 0 in progress. The cancelled run is Check Changeset 131703592814, which a later run of the same name (131703928023, success) replaced. Test Core (6/8), the red shard of round 1, is green. No log was failed, so none was saved. The PR is a draft by objectstack-fleet[bot] with no review on it.

① Derived judgments

The round-1 items, one by one.

  • Item 1, must-fix (a disabled package's positions): closed. The carry now judges the served catalog plus every position of a disabled package (position-renamed-holder-carry.ts:264-276, :456-462), builds the claims from that whole set (:463-470), refuses a name a disabled package holds as held-by-other with the holder labelled disabled (:510-519), counts a disabled claimant toward claimed-twice (:499-508), and refuses a lone disabled claimant as claimant-disabled (:520-523). Both directions are pinned on the real SchemaRegistry through the real createSecurityCatalogReader: disabled is refused and uninstalled is carried (position-renamed-holder-carry.test.ts:302-322), and a disabled claimant alone and beside another claimant (:324-338). The five questions of the order:
    • Is includeDisabledPackages the registry's real installed set? Yes for positions. The flag returns the whole item store and only skips the disabled filter (registry.ts:9338-9361), and the registry names it the read a durable judgment takes, because such a judgment must not move with a reversible disable (registry.ts:8848-8851). A disable only flips the package row and leaves the items registered (registry.ts:10108-10121). An uninstall removes the package's items and its row (registry.ts:8617-8632, :10040-10046), after which isPackageDisabled answers false (:9367-9371).
    • Does it cover a package whose position items exist in the registry only when enabled? No such package was found. The package door installs the row, disabled when the boot seed says so, and then registers the collections with no enabled test (engine-registration.ts:275, :358; positions is in the list at engine-top-level.ts:4146; registry.ts:9659-9675). A stored row is registered with its package binding whatever the package's state (protocol-registry-hydration.ts:444-460). The registry also remembers declared names as claims that carry no item (registry.ts:4647-4665), and the carry does not read those. The doors that install a row without registering a body are the authored-package doors, and the install primitive's own note says its declaration parse refuses a manifest that carries a metadata collection (protocol-package-install.ts:398-407). So no path was found that leaves a package holding a position name by claim alone.
    • Is the order right at kernel:bootstrapped? Yes. The persisted disable state is seeded in init, before the first install (app-plugin.ts:748-790). Authored packages are installed in the package service's start (service-package/src/index.ts:839). The marketplace rehydrate is awaited inside its kernel:ready handler (marketplace-install-local-plugin.ts:1589-1605), and kernel:bootstrapped fires after every kernel:ready handler (kernel.ts:622-632). So every package this boot loads is in the registry with its disabled state before the carry reads.
    • Is claimant-disabled the right call, and does it widen? It is right and it only refuses. Every branch a disabled claimant can reach ends in a refusal (:499-523), so it never reaches carryHolders. It also keeps a reversible disable from deciding a durable move. The cost is that the holders wait for the first boot after the package is enabled, which the refusal sentence says (:553).
    • Is an uninstalled-then-reinstalled package, or the environment sentinel, mis-judged? Not in the registry read. An uninstall forgets the boot seed (registry.ts:10035), so a reinstall is a fresh enabled row whose positions are served and refuse the claim. A row an uninstall leaves in the bare slot is served by the catalog, so it refuses too. No package row has the id sys_metadata, so the sentinel is never read as a disabled package. The sentinel is mis-read in one other place, the ledger read: new item 1.
  • Item 2, must-fix (the position count pin): closed. protocol.meta-types-degenerate-derivation.test.ts:383-387 pins position: 14 with its note, and Test Core (6/8) is green on this head.
  • Item 3, should-fix (the ADR dead-name clause): closed. The addendum now says that an old name no installed position holds and no ledger row records under another package is carried for its one claimant, whichever package that is, with the reason (docs/adr/0150-...md:288). One clause of the sentence before it is now wider than the code: new item 1.
  • Item 4, should-fix (catalogEntryAddress): closed for holders and claimants. Both are read through holderOf (:257, :467, :512), and the real reader's sentinel shape is pinned as "the environment" for a holder and null for a claimant (test:340-354). The same normalisation was applied to the ledger read, where it changes an outcome: new item 1.
  • Item 5, should-fix (failure isolation): closed as asked. A claim's failure is caught for that claim, the later claims run, and the rows it moved are kept in the report and logged by organization (:533-542, :579-585; pinned at test:358-381). Inside one claim a failed row still stops the rows after it: new item 3, a nit.
  • Item 6, should-fix (a package that fails to rehydrate): closed by recording the limit, the second arm round 1 offered. The module doc states it (:93-100) and the ADR line carries a sentence for it. That sentence gives the cause and leaves the consequence out: new item 2. The measurement behind it is the dev's reading of existing pins; by reading, a refused registration is caught and logged with nothing registered (marketplace-install-local-plugin.ts:1750, :1780-1782).
  • Items 7 to 13, nits: closed. 7: the liveness evidence anchors both functions in position-renamed-from.ts (liveness/position.json:40). 8: the spec reuses SnakeCaseIdentifierSchema for the key and for both checks (position.zod.ts:170, position-renamed-from.ts:15), and the carry's own copy now requires two characters (:116). 9: the write names sys_user_position inline (:329) and the census row reads enabled (counts.md:215). 10: only a name a carry ran for has its other references read and listed (:497, :534, :544). 11: the reference tables are counted a page at a time and never held whole (:426-437). 12: the twin warning says to review before removing either row and names the delegation case (:572-576). 13: a row that is its own twin is skipped and not named (:318-321, pinned at test:383-403). Nits 10, 11 and 12 carry no pin of their own; the dev's "all pinned" is the dev's reading.

The order's other checks.

  • The ADR addendum stays one line: holds. It is still one paragraph on line 288, nine sentences. The three added sentences are the dead-name carry, the loaded-only limit and the boot-only timing. It carries no narrative. The dead-name sentence is the one statement in the line that the ruling did not make: it records the deviation from condition 2 that the approval is asked to cover.
  • No write call site beyond sys_user_position.position: holds. The carry has one write, engine.update('sys_user_position', { id, position }) at :329. The new registry read, the paged reads and the per-claim catch write nothing.
  • Census: consistent. The totals still read 309 sites. The carry's row moved from undecidable to decidable, and the counts moved by exactly one with it: decidable 214 to 215, run-time 95 to 94, tenancy-enabled 207 to 208, inline 129 to 130, other run-time expression 85 to 84. The sums hold (215 + 94 = 309; 130 + 85 = 215; 10 + 84 = 94; 208 + 7 = 215), and threading a context (239) and elevated (174) are unchanged.
  • Declarations are line-leading: holds. The one reader reads Clause-②: yes (widening) and Metadata-protocol: added as declared in the PR body and in the changeset.
  • Check-runs: no failure. The counts are in the header paragraph.

② Semver level

Unchanged by the delta, and still correct. The changeset is minor for @objectstack/spec and @objectstack/plugin-security, which Metadata-protocol: added requires. The key's entry grammar moved from an inline pattern to SnakeCaseIdentifierSchema, which accepts the same strings (two characters or more, the same pattern, identifiers.zod.ts:130-137), so the accepted set did not move and Clause-②: yes (widening) still holds. The new report members (failed, claimant-disabled, disabled) live in a module that neither package re-exports, so the public surface is the one key, as in round 1.

③ Boundary flags

  • For the maintainer, with the Tier H approval request: the condition-2 residual. The head now records it plainly in three places: the ADR line (docs/adr/0150-...md:288), the module doc (position-renamed-holder-carry.ts:57-65), and the PR body, whose maintainer summary says one point cannot meet the ruling's text and asks the approver to confirm it, in the same terms as its Acceptance notes. The wording this review would put to the maintainer is in ④. Two things should go with it: a ledger row that records the environment's own position does not stop a package's claim (new item 1), and a package that fails to load at a boot does not hold its names for that boot (new item 2).
  • For the seat, on the PR body: the summary's last bullet says nothing is needed from the maintainer, while the risk bullet asks the approver to confirm the residual. The two should agree before the approval request.
  • For the seat, on the changeset prose: the changeset did not move with the delta. It still says the twin row is for an administrator to remove, and it does not state the disabled-package rule, the one-claimant dead-name carry, the loaded-only limit or the boot-only timing. It ships as the changelog.
  • Boot only. A package installed or upgraded into a running kernel, and a disabled package enabled in a running kernel, are carried at the next boot. The ADR line and the module doc now say so for the install. It still needs a card or the maintainer's word, as round 1 flagged.
  • Not measured: a booted kernel with a disabled package. The disabled-package pins run the real registry and the real reader over a stand-in metadata service. By reading, the app plugin registers the same converted definition with the engine and with the metadata service (app-plugin.ts:654-660, :1662, :1702), and the registry stamps the package on the item in place (protection.zod.ts:237-239), so the metadata service's copy is hidden with the package and the registry read supplies the position. If a composition gave the metadata service a copy with no package on it, the catalog would serve that position as the environment's: a claim on its name is refused either way, but the disabled package's own claim would then read as the environment's and carry. A position that only the metadata service held for a disabled package would be invisible to both reads. No composition that produces either shape was found by reading.
  • Unchanged from round 1 and still open: whether a Setup save of an overlay keeps renamedFrom; the metadata save door accepts the key; whether plugin-audit records each system update. Tier H is owed for docs/adr/. The Skills-docs: follow-up card is owed outside this PR.

④ Design judgment

Is claimant-disabled the right design? Yes. A disabled package serves nothing, so moving people onto its position gives them nothing today, and a move is permanent. Refusing keeps the decision with the boot at which the package is enabled, when the old name is judged again against whoever holds it then.

The ledger read after the normalisation (new item 1). The activation door stores a position's package as the catalog entry spells it, the environment sentinel included (catalog-activation.ts:885). At the round-1 head a ledger row carrying the sentinel refused a package's claim, under a wrong label. At this head holderOf turns it into no package and the row is skipped as no evidence (position-renamed-holder-carry.ts:488-489), so the same claim is carried. A row with an empty package is ambiguous, because a row written before the column existed looks the same, and round 1 accepted reading it as no evidence. A sentinel row is not ambiguous: it is the one stored record that the environment authored the old name, which is the "or by no package" arm of condition 2. Refusing on it costs the ruled use case nothing, because a package's own old name is never recorded under the sentinel. It is not a must-fix: a dead name is free for any package to declare, so the carry grants nothing that name reuse does not, which is the test round 1 set. It is a should-fix because the delta opened it, no pin holds either reading, and three texts say the opposite.

The residual, in the words this review would put to the maintainer. Condition 2 of the ruling says a package cannot claim an old name it never owned. For a name that is still a position, of any installed package (disabled ones included) or of the environment, the head enforces it. For a name that is no position any more it cannot, because the platform keeps no record of who owned a position that no longer exists, except an activation-ledger row for a position somebody once switched on or off. So when no installed position holds the old name and no ledger row records it under another package, the people still assigned to that name are moved to the one position that claims it, whichever package ships that position, and the move is not undone. A ledger row that records the environment's own position does not stop a package's claim. A package that failed to load at a boot does not hold its names for that boot. The case for accepting it: any package may already declare a free position name and take the same people that way. The alternative is no carry without positive evidence of ownership, which would also stop the ruled HotCRM case, whose old names have no ledger row, unless an ownership record is added first.

The schema files and the ADR against the code. The entry grammar is now one declaration. The key's docblock and .describe() and the ADR line share the clause that new item 1 corrects. Nothing else in the delta's schema or ADR text disagrees with the carry.

Implemented-by: card thread session_016WV4czhuyaTe2ySbAbhCjq
Reviewed-by: domain:spec#3 seat (CONTRACT_REVIEW_TIER subagent)

Verdict: PASS

Both must-fix items of round 1 are closed and the delta raises no new must-fix. New items:

  1. should-fix: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:488-489, with docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md:288, packages/spec/src/identity/position.zod.ts:156-158 and :173. A ledger row that carries the environment sentinel is now read as no evidence, so a package's claim on a dead name the ledger records as the environment's own is carried; the round-1 head refused it. The ADR line, the key's docblock and its .describe() (which generates content/docs/references/identity/position.mdx:36) all say an old name the environment "is recorded as owning" is refused. Either keep a sentinel row as a record of the environment, so a package claimant is refused owned-by-other naming the environment and an environment claimant is not, or keep the open reading and correct the three texts. Pin the chosen reading; the only ledger pin for the environment is the empty-package row (position-renamed-holder-carry.test.ts:209). The first option makes the texts true as written.
  2. should-fix: docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md:288. The loaded-only sentence says a package that failed to load holds no name the pass can see. Say what follows, as the module doc does (position-renamed-holder-carry.ts:95-99): a standing claim on one of its position names is carried at that boot, and the move is not undone. The approver reads this line, and the trigger can be a single failed rehydrate.
  3. nit: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts:333, :536-542. Inside one claim, a row whose write fails ends that claim's run. The walk is ordered by id, so every later boot meets the same row first and the holders after it never move. Continuing past the row, and reporting it, would isolate the failure per row. Round 1 asked for isolation per claim, which is done.

Landing still waits for the Tier H approval on docs/adr/. A change that takes the first option of item 1 moves the carry and its pin, so the seat should read that hunk before the queue; a wording-only change to the three texts needs no further contract review.

… package's rename claim; a failed row no longer holds back the rows after it

Round-2 review of the holder carry:
- a `sys_metadata_activation` row carrying the environment's sentinel is
  the record that the environment authored the old name: a package's
  claim is refused owned-by-other, an environment position's is not (a
  row naming no package stays no evidence);
- inside one claim, a row whose write fails is named and skipped, so the
  rows after it still move;
- ADR-0150 addendum states what the loaded-only limit carries; the
  changeset prose covers the disabled-package rule, the dead-name carry,
  the loaded-only limit, boot-only timing and the twin-row wording.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#3 · os-elon-musk · session_016WV4d1T5HEokjRgR6vCBX8

Maintainer confirmation · 2026-11-13T05:54Z · the maintainer chose 「接受,按现状落地」 on the seat's decision card 「岗位改名带任职人:接受「无归属记录的旧名迁给唯一认领者」吗?」

What is accepted (the condition-2 residual of ruling A1, recorded in ADR-0150 D7's addendum line and in contract review 6845170316 ④): an old name that no installed position holds (any package, disabled included, or the environment) and that the activation ledger does not record under another package or the environment is carried for its one claimant, whichever package that is, and is not carried back. A package that failed to load at that boot does not hold its names for that boot. Holders are carried at boot only; a hot install, upgrade or enable carries at the next restart.

Not covered by this confirmation: the Tier H approval of docs/adr/ that this PR still owes from a GOVERNED_APPROVER.

Conflicts: the tenant-audit census pages (regenerated on the merged tree
with `tenant-audit-census.mjs --write`; the page's prose counts moved to
310 sites with it) and the metadata-protocol card counts (main's `object`
50 kept, `position` 13 -> 14 applied on top).

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czhuyaTe2ySbAbhCjq
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#3 · os-elon-musk · session_016WV4d1T5HEokjRgR6vCBX8

席位核对 · ACCEPT · PR #33008 · head 9b3d8b8169fd170b316d7fda7ea7a0c5907caca6 · 2026-11-13T07:10Z

  • 形态: 18 files: PositionSchema.renamedFrom (optional list of earlier names, position-name grammar, the field renamedFrom refusals) in packages/spec, and one boot pass in @objectstack/plugin-security that moves a renamed position's HOLDERS (sys_user_position.position old → new) in every organization, as the system, idempotently, inside the existing kernel:bootstrapped handler. Executes ruling A1 (6841971722), conditions 1–4. One write call site; the other stored references to an old name are named in the boot report, never rewritten. check-governed-merges --pr 33008: Tier H for docs/adr/0150 (the D7 addendum line); size under the human-merge threshold.
  • 前提实测: contract review 6843809762 (d9befe7f, FAIL: must-fix 1 = a disabled package's positions were invisible to condition 2, so another package could take its holders; must-fix 2 = metadata-protocol position count pin) → 6845170316 (74fff9ff, PASS: both closed; disabled positions judged from the registry's installed set, a disabled claimant refused; SF3–SF6 and nits 7–13 closed). Round-2 should-fixes closed at cc6cce96, read by the seat (Elon 05:39Z: further contract reviews go to triage; none owed here): a ledger row carrying the sys_metadata sentinel records the environment as owner, so a package claim on it is refused (pinned both ways, environment claimant normalised to the same key); the ADR line states the loaded-only consequence; a failed row is named and skipped so later rows still move. Skills follow-up filed as skills: the security rules do not teach a position's renamedFrom (a renamed position carries its holders) — PR #33008's Skills-docs follow-up #33044, PR body line points at it.
  • 维护者确认: the condition-2 residual (a dead old name with no recorded other owner is carried for its one claimant, not carried back; a package that failed to load does not hold its names at that boot; boot-only timing) — maintainer chose 「接受,按现状落地」, recorded 6845410998.
  • 治理批准: os-zhuang APPROVED (GOVERNED_APPROVERS) at cc6cce96. The approval is not sha-pinned (check-governed-queue-guard), and stale-review dismissal is off on main.
  • 合 main 一次: K was 26 and the relay pr_update_branch was refused with 422 (conflict), so the card thread merged origin/main (0216d0022b) once: cc6cce96 → 9b3d8b81. Per-file git patch-id --stable is identical for 15 of the 18 files; the census pair was regenerated on the merged tree (main added its own write site: 310 sites, the carry's one row unchanged), and the meta-types test differs by context only (position: 14 beside main's object: 50). metadata-protocol 22799 passed, plugin-security 6557 passed on the merged tree (card thread's readings). K on the landing head: 1.
  • 门禁 check-runs on 9b3d8b81: 68 runs, 58 success, 10 skipped, 0 failed or pending (read through the API this act); mergeable_state clean.
  • 接受的偏差: check-closing-target-claim UNDETERMINED (thread branch outside CLAIM_BRANCH_SHAPE; claim 6843365364 names this seat).
  • 范围外去向 (left for the next spec seat): a hot install, upgrade or enable carries nothing until the next restart (the ruling's 「when the renamed definition loads」 at boot only), recorded in the ADR line and accepted by the maintainer with the residual; a card if demand appears. Non-holder references (sharing-rule / queue / record-share recipients, pending approvers, invitations, Setup bodies) stay report-only by ruling A1. Skills: skills: the security rules do not teach a position's renamedFrom (a renamed position carries its holders) — PR #33008's Skills-docs follow-up #33044.
  • 落地条款: Clause-②: yes (widening), Metadata-protocol: added, @objectstack/spec + @objectstack/plugin-security minor, ADR-0087 entry, ADR-0150 D7 addendum line. Contract-review PASS on record, maintainer confirmation on record, governed approval on record, all checks green ⇒ ready + auto-merge now. Fixes #32983 (p1).

Seat opinion: land.

Merged via the queue into main with commit 3a83b53 Nov 13, 2026
69 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-5h3u45 branch November 13, 2026 07:40
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…medFrom (objectstack-ai#33480)

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

Fixes objectstack-ai#33044

domain:skills#1 · os-project-manager · session_01FEkQ5k9eHen9BJozXn3f7Q

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:`skills/objectstack-data/rules/security.md` 的「Renaming or
removing a shipped access item」节末新增一段:岗位改名要在新岗位上声明 `renamedFrom:
['old_name']`,不要删了重建;启动时平台在每个组织里把旧名的持有人(`sys_user_position`)挪到新名,幂等;只挪持有人,共享规则/队列/记录共享接收方、待审批人、邀请里的旧名只在启动日志里列给管理员;列出不挪的五种情况。
- 为什么改:PR objectstack-ai#33008 给 `PositionSchema` 加了 `renamedFrom`,但对外发布的技能没教,AI
写应用时改岗位名会删了重建,所有持有人静默失去权限集。
- 风险与回滚:纯技能文本(+1 changeset),不动代码与 schema;token
天花板未抬,在同一文件里删等量的示例和旁注付账;回滚即还原本 PR。
- 先看:`skills/objectstack-data/rules/security.md`
文末新段;其次同文件的付账删减(下方表格逐条列出去处)。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs | grep
rules/security.md`,预期 `3959 / 3959`,exit 0。
- 需要你做的:受管面 Tier H(`skills/**`):请批准或合并。

## What changes

`skills/objectstack-data/rules/security.md`, § Renaming or removing a
shipped access item, gains one paragraph, **Renaming a position**:

- declare `renamedFrom: ['old_name']` on the renamed position, never
delete and re-add (holders name a position by its bare name, so a
deleted one leaves them granted nothing);
- at boot the old name's holders (`sys_user_position`) move to the new
name in every organization, idempotently;
- holders only: the boot log lists the old name's other references
(sharing-rule, queue and record-share recipients, pending approvers,
invitations) for an administrator;
- not carried, warned: an old name still a position anywhere, claimed
twice, recorded under another package, switched off, or a disabled
claimant.

One changeset, `.changeset/33044-skills-position-renamed-from.md`,
`'@objectstack/skills': patch`.

### Paid in place (token ceiling unchanged)

`rules/security.md` was 15828 bytes (3957 tokens, ceiling 3959, headroom
2) on the merge base `34c05229`; it is now 15834 bytes, 3959 tokens,
headroom 0. The card carries no maintainer words that order the text, so
no raise; the new paragraph is paid by deletions in the same file:

| Cut | Where the fact still lives |
|---|---|
| `(ADR-0090 D12)` after the delegated-admin clause | ADR-0090 |
| `(explaining another user needs manage_users)` | an operator detail of
the explain door, not an authoring rule; its contract is
`packages/spec/src/security/explain.zod.ts` |
| `(no read on the roster needed)` on membership keys | "as a system
read" in the same sentence says it |
| the `com.acme.crm` / `hd_agent` example of `outside-closure` | eval
`hooks-security-seeds-datasources.json` asks exactly this scenario; the
rule sentence stays |
| the `hr` / `ops` / `auditor` example of `ambiguous-in-closure` |
illustrative; the install refusal of a second shipper is KEPT (that eval
expects it) |
| `Ciphertext lives in sys_secret, only an opaque ref on the row.` |
`rules/field-types.md` `secret` row (encrypted at rest, masked,
fail-closed, ADR-0100) |
| `e.g. identity tables a plugin writes via its own adapter
(sys_sso_provider, OAuth clients)` and `(adapter-written rows often lack
it)` | plugin-internal; the rule (a null `organization_id` row is
denied) stays |
| `— the list renders empty` | UI symptom of the denial stated beside it
|
| `an app-declared default profile, a customer-authored set` | "any set
with a wildcard read grant" states the rule; `viewer_readonly` and the
`member_default` contrast stay |

Whole-file reading: 327 → 329 lines, 3957 → 3959 tokens. Whole-package
reading (every `skills/**/SKILL.md`): unchanged, no `SKILL.md` is
touched (4602 lines at the merge base).

## Acceptance notes

Every claim in the paragraph was read from the code on `origin/main`
(`34c05229`):

| Claim | Read from |
|---|---|
| `renamedFrom` is a list of earlier position names |
`packages/spec/src/identity/position.zod.ts` (`renamedFrom`, its JSDoc
and `.describe`) |
| own name / repeated entry refused at parse; still-declared and
claimed-twice refused per collection |
`packages/spec/src/identity/position-renamed-from.ts`
(`refuseSelfRenamedFrom`, `refuseDishonestPositionRenamedFrom`) |
| moves holders at boot, as the system, every organization, `position`
column only, idempotent |
`packages/plugins/plugin-security/src/position-renamed-holder-carry.ts`
header § What it does |
| the six boot refusals (`claimed-twice`, `claimant-disabled`,
`still-declared`, `held-by-other`, `owned-by-other`, `switched-off`),
each logged at `warn`, holders left | same file, `PositionRenameRefusal`
and `logPositionRenameCarry` |
| other references named, never rewritten: sharing-rule, queue-member
and record-share recipients, pending approver slots, pending
invitations, activation-ledger rows | same file, header § What it names
and never writes, and the `leftBehind` warning |
| deleting the position leaves holders granted nothing | same file,
header § Why |

- The code also carries after a marketplace hot install or upgrade
(`metadata:reloaded`, objectstack-ai#33238); the paragraph says "at boot" only, which
always holds, since a reload carries a narrower scope and some install
doors do not announce a reload.
- Not taught (detail an author does not act on): a holder who already
holds the new name keeps both rows and is warned; a failed row write is
retried at the next boot.
- Serial constraints held: this PR does not touch
`skills/objectstack-data/evals/objects-fields-relationships.json` (PR
objectstack-ai#33394) or `skills/objectstack-data/SKILL.md` (PR objectstack-ai#33458). No eval
added: no existing eval asks about renaming a position.

## Verification

<details><summary>Derived gates on head 47d3f8e (42 of 44 exit 0, 2 NOT
MEASURED)</summary>

`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 44 commands; each ran with its exit
captured before any pipe. `--ran`: "44 derived famil(ies) accounted for
— 42 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".
`check:doc-formula-expressions` ran after `turbo run build
--filter=@objectstack/formula --filter=@objectstack/lint` under the lock
(VERDICT command-exit 0). `check:dual-build-cjs-loads` and
`check:lean-entry-closure` read every package's `dist/` and exit 3
without a full build; this diff touches no package, so no build closure
is owed and CI measures them.

```
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-doc-route-spelling.mjs --advisory :: exit 0
node scripts/check-doc-route-spelling.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-skills-token-ratchet.mjs :: exit 0
node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:corpus-claim-drift :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 3
pnpm check:gitlink-declared :: exit 0
pnpm check:lean-entry-closure :: exit 3
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-skill-id-lint :: exit 0
pnpm check:published-files :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-compatibility :: exit 0
pnpm check:skill-frame-sync :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:skill-links :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:watch-hint-literal :: exit 0
node scripts/pm/check-skill-line-ratchet.mjs :: exit 0
```
`check:dts-closure` and `check:sourcemap-no-sources-content` exit 0 over
the packages built here only (formula, lint and their closure).
</details>

<details><summary>Tier and governed-merge verdicts</summary>

- `dispatch-gates --tier`: MANDATORY contract-review tier for
`skills/**` (no one-line exit). This card thread ran on the claim's
default tier; named as a deviation in the report, and the seat's in-seat
contract review at tier is the owed record.
- `check-governed-merges.mjs --branch claude/project-thread-6ouxnr`:
exit 3, GOVERNED, landing tier H (人合), `skills/** ×1`; 52 changed lines,
under the 3000 threshold.
- Changeset: `'@objectstack/skills': patch` (`skills/**` ships in
`@objectstack/skills`).
</details>

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

<!-- signed: domain:skills#1 · os-project-manager ·
session_01FEkQ5pjSPT7ui2EUcunaVb -->

---------

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 protocol:system size/xl 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.

A position rename leaves every installed organization's holders behind: nothing carries sys_user_position across it

3 participants