Skip to content

docs(skills): renaming a position tells the author to re-point their own source, names the environment owner, and restores the explain gate - #34105

Merged
os-zhuang merged 4 commits into
mainfrom
claude/project-thread-4na0we
Nov 16, 2026
Merged

os-zhuang merged 4 commits into
mainfrom
claude/project-thread-4na0we

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #33566
domain:skills#2 · os-steve · session_01ADHkmTSWHtysbqqYGcsTP1
Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:objectstack-data 技能 security 规则里「Renaming a position(岗位改名)」一段补三处:作者要自己改掉包源码里仍写旧岗位名的地方(共享规则接收方、审批人、队列成员、策略 positions、current_user.positions 谓词);「被另一方记录」的拒绝条件把环境(Setup 创建,sys_metadata)也列为所有者;明说改名搬运只改写持有人行,其他引用旧名的地方一概不改写(含 Setup 里写的)。同时把 PR docs(skills): the security rules teach a position rename through renamedFrom #33480 删掉的运维规则补回:用 explain 查看别人的权限需要 manage_users、该用户所在组织的管理员身份,或覆盖该用户的委派 adminScope。另追加一条评测用例。
  • 为什么改:原文只说「启动日志为管理员列出其他引用」,读起来像作者什么都不用做;实际上搬运从不改写包里的共享规则、审批槽位等,作者不改源码,新版本上线后这些引用仍指向已不存在的旧名。
  • 风险与回滚:只动已发布技能文字、评测夹具、changeset 和 token 上限行,不动运行时与契约;先就地删重复付账,余额按实测抬棚(本 PR 净增 108 字节;与 docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019 合并后 16164 → 16272 字节,上限 4041 → 4068 token,零余量)。回滚即 revert 本 PR。
  • 先看:① skills/objectstack-data/rules/security.md 末尾「Renaming a position」段(新增句是否与 position-renamed-holder-carry.ts 一致);② 同文件 § Assigning a permission set 的 explain 句;③ 本文件的删减处与 scripts/check-skills-token-ratchet.mjs 的 security.md 行。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs,预期 skills/objectstack-data/rules/security.md is 4068 tokens (ceiling 4068; headroom 0) 且以 ✓ 收尾。
  • 需要你做的:落地档 Tier H,需 GOVERNED_APPROVERS 审批;复审 6899620269 的 FAIL 已由 delta 6900037119 关闭,docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019 合入后的串行返工(head 464f620)增量复审由席位交 review#2。

What changes

skills/objectstack-data/rules/security.md, the Renaming a position paragraph now reads:

Renaming a position: declare renamedFrom: ['old_name'] on the renamed position, never delete and re-add (holders lose its sets). At boot its holders (sys_user_position) move to the new name in every organization, idempotently. Only holders: no other reference to the old name is rewritten, Setup-authored ones included. Re-point your own source naming the old one: a type: 'position' sharing recipient, queue member or approver, a policy's positions, a current_user.positions predicate. The boot log lists stored references by table (sharing, queue and share recipients, pending approvers, invitations) for an admin. Not carried (warned): an old name still a position anywhere, claimed twice, recorded under another owner (a package or the environment), switched off, or a disabled claimant.

Card items, each re-checked against main 63db7240 first; none was already said, so all four were written:

  1. The author re-points their own package source. Beyond the card's three examples (sharing recipient, approval position:NAME slot, RLS over positions), the sentence also names a queue member and a current_user.positions predicate, both real authoring sites (skills/objectstack-data/SKILL.md § Ownership queues members; the placeholder table in the same file).
  2. "recorded under another package" → "recorded under another owner (a package or the environment)".
  3. "no other reference to the old name is rewritten, Setup-authored ones included" (the card's premise said Setup-authored bodies are carried; the code rewrites none of them). The carry does READ every position's renamedFrom, environment positions included, so the sentence says what is not rewritten, not what is not read (review 6899620269 M-1).
  4. § Assigning a permission set to a user, after "GET /api/v1/security/explain?object=&operation=&userId= answers from the enforcing code path.": "Explaining another user takes manage_users, administering one of their organizations, or a delegated adminScope covering them." PR docs(skills): the security rules teach a position rename through renamedFrom #33480 had cut "(explaining another user needs manage_users)"; the restored rule states the whole gate the code runs, not only manage_users.

skills/objectstack-data/evals/hooks-security-seeds-datasources.json: one appended case, id 22 (#34019 holds id 21; a package renames sales_rep → crm_sales_rep while its own sharing rule names sales_rep; the answer declares renamedFrom and re-points the rule in source).

.changeset/33566-skills-position-rename-own-source.md: @objectstack/skills patch.

scripts/check-skills-token-ratchet.mjs: the rules/security.md row 4041 → 4068 (+27, on top of #34019's 3959 → 4041, whose comment is kept), pinned at the measurement, comment ceil(16272 / 4). Standing ruling 「A:先削重复,余额按实测提高」: the cuts below were paid first (313 bytes), the measured remainder raises the row.

The tabPermissions pointer is kept, shortened (103 → 94 bytes): "tabPermissions hides an app, never gates it: objectstack-ui → Who sees or opens an app." (dev open question answered B, restored: seat ruling, review S-1).

Cuts, each with its surviving home:

Cut (bytes) Surviving home
tabPermissions pointer shortened (−9) the same pointer, shorter; the rule's home stays skills/objectstack-ui/rules/navigation.md § Who sees or opens an app
Kernel-name list in the membership-keys bullet → "a fixed placeholder above, accessible_org_ids" the placeholder table in the same file (id, email, organization_id, org_user_ids, positions, queues); accessible_org_ids kept by name as it is not in the table
Membership-tier closed list (−73) the docs anchor kept in the same sentence (#membership-tiers-are-a-closed-list)
Second definition of outside-closure / ambiguous-in-closure in the positions bullet → "as for a queue above" (−44) the queue bullet in the same section; the Setup-authored-set and install-refusal clauses are kept
", or refused below" (−19) the next bullet: "the position grants nothing through that name"
"Assignment is one POST …." merged into the next sentence (−28) the same sentence still names the POST path
"Declare the set on the roster object, not one policy per record." (−70) the section heading ("a current_user.KEY set the roster object declares") and the "Choose by what the rows are keyed on" bullet
// in a permission set code comment (−23) the RLS paragraph above it ("policies on a permission set / profile")

Authoring tier: dispatch-gates --tier answers MANDATORY CONTRACT_REVIEW_TIER for skills/** (clause ①). The card thread is served below that tier, so this diff was authored by an isolated os-dev subagent pinned to CONTRACT_REVIEW_TIER on the same branch, as the card delta orders, in both rounds (the fix round followed the seat's order on review 6899620269); the thread merged main, ran the gates and the relay.

Tests

No package source changes, so there is no package test to run. The eval case is a fixture (measured, not ratcheted) and is self-consistent: both must_contain strings (renamedFrom: ['sales_rep'], value: 'crm_sales_rep') appear in its expected_output. must_not_contain is empty: the earlier value: 'sales_rep' occurs in the prompt, so a correct before/after answer would have failed (review S-2), and no string only a wrong answer writes was found.

Size readings, before (merge base b8456ebd) and after (464f620f)
Reading before after
rules/security.md lines / bytes 334 / 16164 334 / 16272
same file, priced tokens / ceiling 4041 / 4041 4068 / 4068
evals/hooks-security-seeds-datasources.json lines / bytes / tokens (not ratcheted) 215 / 19036 / 4759 225 / 20311 / 5078
ratcheted (authored) bundle tokens / ceiling sum 188580 / 194710 188607 / 194737
eval fixtures tokens 48379 48698
bundle total tokens (whole shipped tree) 248754 249100

No SKILL.md is touched. The before column is measured on b8456ebd (#34019 landed: rules/security.md 4041, eval id 21 taken); this PR's own delta is unchanged from the earlier rounds (+108 bytes / +27 tokens on security.md, one eval case).

Acceptance notes

Each sentence was checked against the code on 63db7240, not against the card.

Items 1 and 3: the carry rewrites holders only

packages/plugins/plugin-security/src/position-renamed-holder-carry.ts, module doc, "What it names and never writes" (lines 78-80):

 * Holders only (ruling A1). Every other stored reference to an old name stays
 * as it is and is listed by table, so an administrator can re-point it in
 * Setup: sharing-rule, queue-member and record-share recipients of type

"What it is not" (lines 89-91):

 * Not a downgrade path: a version that drops the rename does not carry the
 * holders back. Not a metadata rewrite: Setup-authored bodies that name an
 * old position are not read.

So a package's own sharing rule, approver or policy naming the old position keeps naming it until the author changes the source; the boot log lists stored rows by table for an administrator. An environment position's own renamedFrom is still judged and its holders carried (position-renamed-holder-carry.test.ts lines 347-361: { from: 'old_rep', to: 'env_rep', packageId: null, rows: 1 }), and the carry reads every position's renamedFrom ("What it does", lines 23-25). That is why the sentence says what is not rewritten rather than what is not read (review 6899620269 M-1; the first round's "no metadata is read" was wrong for exactly this case).

Item 2: the environment as recorded owner

Module doc, owned-by-other (lines 63-65): "a row carrying the environment's sentinel (sys_metadata) records the environment as the owner, so a package's claim is refused and an environment position's is not." Line 173: const OVERLAY_PROVENANCE_SENTINEL = 'sys_metadata';, mapped at line 618:

      const pkg = raw === null ? null : raw === OVERLAY_PROVENANCE_SENTINEL ? ENVIRONMENT_OWNER : raw;

Test rows 214 and 216 refuse owned-by-other both ways (an environment position claiming a name the ledger records under a package; a package claiming a name the ledger records as the environment's), hence "another owner (a package or the environment)".

Item 4: the explain gate

packages/plugins/plugin-security/src/security-plugin-explain-access.ts, mayDescribeAnotherUser (lines 145-165), asked by explain and by describeEffectiveAccess alike:

  if (callerContext?.isSystem === true) return true;
  const callerSets = await this.resolvePermissionSetsForContext(callerContext).catch(() => []);
  const held = this.permissionEvaluator.getSystemPermissions(callerSets);
  if (held.has('manage_users')) return true;
  const organizationLevel = this.delegatedAdminGate
    ? await this.delegatedAdminGate
        .organizationAdminCoversUser(callerSets, userId, callerContext)

…then scopesCoverUser for a delegated adminScope. The denial (line 196): "explaining another user's access requires the 'manage_users' capability, organization administration of an organization that user is a member of, or a delegated adminScope covering that user (ADR-0090 D6/D12)." The routes are GET / POST {basePath}/security/explain (packages/rest/src/security-routes.ts). The system-caller arm is left out as not an operator fact.

Verification

Derived gates on 464f620f (serial rework after #34019): 64 derived, 64 run, all exit 0

Head 464f620f = b9479f0d plain-merged with origin/main b8456ebd (#34019). Two conflicts, resolved mechanically by the thread (no new teaching): the eval case renumbered 21 → 22; the ratchet row re-pinned at the merged measurement (16272 bytes → 4068), #34019's comment kept above it. rules/security.md merged without conflict. pnpm install exit 0; packages built under the verify lock (os-verify-lock: VERDICT command-exit 0, 81 of 81 tasks). node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack listed 64 commands (4 paths vs merge base b8456ebd4); each ran with < /dev/null, exit recorded as CMD :: exit N, reconciled:

Run reconciliation — 64 derived, 64 run, 0 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 64 derived famil(ies) accounted for — 64 run, 0 NOT-MEASURED (a DERIVED zero — all 64 recorded an exit code and none of them is 3).

Also run, each exit 0: pnpm --filter @objectstack/spec check:skill-docs, check:skill-refs, check:skill-examples ("347 prose examples type-check across 3 surface(s)"), and the seven unmatched-roster gates the derivation flags as living in a directory this diff touches (check-dts-references --self-test, check-published-list-mirrors + --self-test, check:changeset-fixed, check:engine-double-contract, check:i18n-stale-fill, check:published-readme-exports).

Token ratchet: 57 authored bundle files within their ceilings; rules/security.md 4068 / 4068; --self-test 104 cases pass.

Earlier rounds: b9479f0d 63 derived, all exit 0; 169a40a0 45 derived, all exit 0.

Governed-surface reading

node scripts/pm/check-governed-merges.mjs --pr 34105 on 464f620f: "2 of 4 path(s) hit the register" (skills/** ×2; the changeset and scripts/check-skills-token-ratchet.mjs are not on the register), landing tier H. The low-risk skills arm refuses on two counts: "a path outside skills wording and prose: scripts/check-skills-token-ratchet.mjs" and "a catalog path that names security, auth or permission". Size 84 changed lines (+60 / -24), under the 3000 human-merge threshold. Landing waits for a GOVERNED_APPROVERS approval.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmTSWHtysbqqYGcsTP1

…own source, names the environment owner, and restores the explain gate (#33566)

skills/objectstack-data/rules/security.md, the Renaming a position
paragraph and the explain sentence:

1. The author re-points their own package source that names the old
   position: a `type: 'position'` sharing recipient, queue member or
   approver, a policy's `positions`, a `current_user.positions`
   predicate. The boot log lists STORED references, by table.
2. The not-carried list says "recorded under another owner (a package or
   the environment)": the activation ledger's `sys_metadata` sentinel
   records the environment as an owner.
3. The carry reads and rewrites no metadata, a Setup-authored body
   included (position-renamed-holder-carry.ts, "What it is not"). An
   environment position's own `renamedFrom` is still judged; only
   holders move.
4. The explain sentence says again who may ask about another user:
   `manage_users`, administration of one of that user's organizations,
   or a delegated `adminScope` covering them (`mayDescribeAnotherUser`).

One eval case (id 21) asks the rename with a same-package sharing rule.

Paid in place, ceiling row unchanged (15834 -> 15835 bytes, 3959 -> 3959
tokens): the `tabPermissions` pointer (objectstack-ui
rules/navigation.md), the kernel-name list (the placeholder table in the
same file), the membership-tier list (the linked docs anchor), the
second definition of the two closure refusals (the queue bullet above),
and short restatements of what a heading or neighbouring sentence says.

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

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 169a40a03336f679cb791b9d3d3d799c16921bfa
Local-runs: none
Scope: skills/objectstack-data/rules/security.md, skills/objectstack-data/evals/hooks-security-seeds-datasources.json + .changeset/33566-skills-position-rename-own-source.md

Read-only shape: the diff of the one commit 169a40a0 over its parent 63db7240 (the merge base; no merge commit on the branch, so a main merge authored nothing), card #33566 and its order, dev report 6899557790, the PR body, the head's check-runs, and the cited code on main 27c2f1ea. Main moved two unrelated changesets since the base; the branch merges clean.

① Derived judgments

Each added or changed sentence, against main:

  • "At boot its holders move ... Only holders" and "The boot log lists stored references by table (sharing, queue and share recipients, pending approvers, invitations) for an admin": HOLDS. packages/plugins/plugin-security/src/position-renamed-holder-carry.ts module doc, "What it names and never writes" (lines 76-84): "Holders only (ruling A1). Every other stored reference to an old name stays as it is and is listed by table, so an administrator can re-point it in Setup".
  • "no metadata is read or rewritten, a Setup-authored body included": DOES NOT HOLD as written. See M-1.
  • "Re-point your own source naming the old one: a type: 'position' sharing recipient, queue member or approver, a policy's positions, a current_user.positions predicate": HOLDS. Each is a real authoring site: packages/spec/src/security/sharing.zod.ts:141 ('position' recipient type), packages/spec/src/security/queue.zod.ts:47 (type: z.literal('position', ...)), packages/spec/src/automation/approval.zod.ts:33 ('position' approver type), packages/spec/src/security/rls.zod.ts:625 (positions: z.array(z.string())), and the 'NAME' in current_user.positions predicate form (ui/packages/types/src/select-option.ts:80). Card item 1 is met.
  • "recorded under another owner (a package or the environment)": HOLDS. Same file, owned-by-other (lines 59-65): "the activation ledger records it under ANOTHER package (or, for a position the environment authored, under any package) ... a row carrying the environment's sentinel (sys_metadata) records the environment as the owner, so a package's claim is refused"; OVERLAY_PROVENANCE_SENTINEL = 'sys_metadata' (line 173); test rows 214 and 216 of position-renamed-holder-carry.test.ts refuse both directions. Card item 2 is met.
  • "Explaining another user takes manage_users, administering one of their organizations, or a delegated adminScope covering them": HOLDS, and is the whole operator gate. packages/plugins/plugin-security/src/security-plugin-explain-access.ts#mayDescribeAnotherUser (lines 145-165): if (held.has('manage_users')) return true; then organizationAdminCoversUser(callerSets, userId, callerContext) then scopesCoverUser(callerSets, userId, callerContext); the denial text (line 196) names the same three. The system-caller arm is rightly left out. Routes GET / POST {basePath}/security/explain (packages/rest/src/security-routes.ts:423,429). Card item 4 is met, in the section an operator reads when a grant looks inert. Premise check: no other skills/** file on main states this rule.
  • "Only a tenant admin ... may POST /api/v1/data/sys_user_permission_set": a merge of two sentences, meaning unchanged.
  • "a kernel name (a fixed placeholder above, accessible_org_ids)": HOLDS. packages/spec/src/contracts/rls-membership-resolver.ts:100 RESERVED_RLS_MEMBERSHIP_KEYS = id, organization_id, positions, org_user_ids, accessible_org_ids, email, queues; the placeholder table above the bullet carries the six fixed ones and accessible_org_ids is kept by name.
  • "outside-closure / ambiguous-in-closure as for a queue above (...)": the queue bullet of the previous section defines both; the Setup-authored-set and install-refusal clauses are kept. Holds, tersely (N-2).

The eight cuts and their homes:

Cut Home claimed Reading
tabPermissions pointer bullet objectstack-ui rules/navigation.md § Who sees or opens an app the rule survives there in full ("Not an access gate"), and objectstack-ui SKILL.md:149 routes to it; it is NOT in the skill this file's reader has loaded. See S-1
kernel-name list placeholder table, same file survives
membership-tier closed list the docs anchor kept in the sentence survives outside the bundle only (the docs URL), and in skills/objectstack-automation/references/state-machines-and-approvals.md:251; external, the one tier this bullet teaches, is kept. Acceptable
second definition of the two refusal codes queue bullet, same file survives
", or refused below" next bullet ("grants nothing through that name") survives
"Assignment is one POST" merged sentence survives
"Declare the set on the roster object ..." section heading and the "Choose by what the rows are keyed on" bullet survives
// in a permission set comment RLS paragraph above ("policies on a permission set / profile") survives

Size: the head file is 15835 bytes, 3959 tokens against the unmoved ceiling 3959 (scripts/check-skills-token-ratchet.mjs:1049); one spare byte.

Eval case 21: self-consistent in the narrow sense (both must_contain strings occur in expected_output; the must_not_contain string does not). It does trip on a correct answer: see S-2. Its expected_output repeats the sentence of M-1.

Check-runs on the head, read at 19:00Z: no failure. Success: Check Changeset, PR-body guards, Governed Surface Queue Guard, Check PR Size, Type Check (workspace, source gates, debt ledger), four scoped Lint jobs, Live E2E UI, Test UI, Dogfood Regression Gate. Still in progress at the read: Build Core, Test Core shards, Lint · ESLint, Lint · docs and code guards, Lint · repo and tooling gates, Lint · CI, release and engine gates, Type Check · consumer gates. The record does not vouch for those.

② Semver level

Patch on the skills package is right: published skill prose and one eval fixture, no schema, no runtime, no ratchet row. Clause-②: no and Metadata-protocol: none are on the changeset and the PR body and match the order. The changeset's prose carries the sentence of M-1 into the changelog and is corrected with it.

③ Boundary flags

  • Dev open question (keep the tabPermissions cut, or restore it): answered B, restore, in a shorter form. Reasons under S-1. Not a blocker.
  • Deviation, authoring through an isolated dev pinned at tier on the same branch: as the order prescribes; recorded in the PR body.
  • Deviation, the ratchet row comment still reads ceil(15834 / 4): accepted, the pinned ceiling is unchanged and true for 15835 bytes; the row is not touched, so the diff stays off the ratchet file.
  • File surface: three paths, all inside the order's surface; rules/relationships.md and evals/objects-fields-relationships.json untouched.
  • Landing tier: the dev's --pr reading of Tier H is not re-run here (read-only shape); nothing in the diff argues against it.
  • SQL push-down: no code in the diff; nothing to check.
  • Security: no security item found.

④ Design judgment

M-1 (must-fix) — "no metadata is read or rewritten, a Setup-authored body included" says more than the code does, and is false for a position the environment authored. The carry reads metadata: position-renamed-holder-carry.ts "What it does" (lines 23-25): "it reads every position's renamedFrom from the security catalog and judges each old name", over "every code, package and environment position this boot registers". A Setup-authored position body is among them and its claim is carried: position-renamed-holder-carry.test.ts:347-361, an environment position (_packageId: 'sys_metadata', renamedFrom: ['old_rep']) yields carried: [{ from: 'old_rep', to: 'env_rep', packageId: null, rows: 1 }]. The sentence the code offers is narrower (lines 89-91): "Not a metadata rewrite: Setup-authored bodies that name an old position are not read". The skill dropped the qualifier, so a reader is told a Setup-authored position's renamedFrom is not read, three lines above a refusal list that names the environment as a claimant's owner. The PR body sees the case and argues the sentence "says nothing against that"; as written it does. The card's item 3 is "teach only what the code does". Fix: say what is not rewritten, not what is not read, for example "no other reference to the old name is rewritten, Setup-authored ones included" (+13 bytes against one spare byte: pay in place), and carry the same correction into eval 21's expected_output ("Only holders move: no metadata is read or rewritten") and the changeset prose.

S-1 (should-fix) — restore the tabPermissions line (the dev's open question, option B). PR #32616 landed it on purpose ("objectstack-data rules/security.md gains one line under permission sets"): it is the only sentence in the file that teaches permission sets which keeps an author from using a visibility key as an access gate. The spec a data-skill reader is routed to says only "App/tab visibility" (packages/spec/src/security/permission.zod.ts:1302-1303), not that the app still opens. The full rule's home in objectstack-ui is right and stays; what is lost is the route to it from the page where the key is authored, and a reader of this file has not necessarily loaded that skill. A pointer is not a duplicate of the rule under the pay-in-place ruling. Pay with another cut, or with a measured row raise: the PR already reads Tier H, so a moved row changes nothing about its landing.

S-2 (should-fix) — eval 21's must_not_contain string occurs in its own prompt. value: 'sales_rep' is how the prompt spells the rule, so a correct answer that shows before and after ("change { type: 'position', value: 'sales_rep' } to ...") fails the case. No other case in the file's 21 has a refused string a correct answer would naturally quote back. Drop the assertion, or refuse something only a wrong answer writes (for example a deleted and re-added position with no renamedFrom); must_contain already pins both halves of the right answer.

N-1 (nit) — the boot log also lists activation-ledger rows (module doc, line 82); the parenthesis omits them. Harmless at this length.

N-2 (nit) — "(the environment: a set authored in Setup; a second package shipping a name is refused at install)" compresses two glosses into a parenthesis that needs the old text to parse. Leave unless bytes come free.

Card items 1, 2 and 4 are met and hold against main. Item 3 is written, and wrong in the one clause M-1 names.

Implemented-by: claude/project-thread-4na0we
Reviewed-by: session_01ADHkmRxXmVQ41fqnaTPGAv

VERDICT: FAIL

… tabPermissions pointer returns

Review round 1 on the position-rename follow-up.

- The carry reads every position's `renamedFrom`, an environment
  position's included, so "no metadata is read" was false. The paragraph
  now says what is not rewritten: no other reference to the old name,
  Setup-authored ones included. Same correction in the eval case's
  expected output and in the changeset.
- The `tabPermissions` pointer is back in a shorter form: it hides an
  app and never gates it, taught in objectstack-ui, Who sees or opens an
  app.
- The eval case no longer refuses `value: 'sales_rep'`, which its own
  prompt contains: a correct before/after answer quotes it.
- Token ceiling of rules/security.md 3959 -> 3986, pinned at the measured
  15942 bytes. The file already paid 313 bytes in place; no further true
  duplicate was found, so the measured remainder raises the row.

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

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b9479f0dbcab87c514e205e47a5646c654df990c
Local-runs: none
Scope: skills/objectstack-data/rules/security.md, skills/objectstack-data/evals/hooks-security-seeds-datasources.json + scripts/check-skills-token-ratchet.mjs, .changeset/33566-skills-position-rename-own-source.md

Delta review, fix round 1, over the record in comment 6899620269 (FAIL on 169a40a0). Read-only shape: the diff of fix commit 653fe698 over 169a40a0, the merge commit b9479f0d, the whole PR diff against main, the cited code on main, and the head's check-runs. Everything the first record judged as holding is unchanged by this round and stands.

① Derived judgments

  • The merge authored nothing. b9479f0d has parents 653fe698 and main 27c2f1ea; its tree 696f9a92 is byte-identical to the automatic merge of those two parents, and its diff against 27c2f1ea is exactly the PR's four files. Main has since moved to f81e4b6c with no change under skills/ or to the ratchet script; the head still merges clean.
  • M-1, closed. The paragraph now reads "Only holders: no other reference to the old name is rewritten, Setup-authored ones included." That is what the code says and no more: packages/plugins/plugin-security/src/position-renamed-holder-carry.ts module doc, "Holders only (ruling A1). Every other stored reference to an old name stays as it is" and "Not a metadata rewrite". It no longer denies the read of a Setup-authored position's own renamedFrom, which position-renamed-holder-carry.test.ts:347-361 shows carried. The same correction is in eval 21's expected_output ("Only holders move: no other reference to the old name is rewritten") and in the changeset prose ("rewrites no other reference to the old name, Setup-authored ones included"). No copy of the old sentence remains in the diff.
  • S-1, closed. "tabPermissions hides an app, never gates it: objectstack-ui → Who sees or opens an app." is back in its old place. The target exists: skills/objectstack-ui/rules/navigation.md:48 ## Who sees or opens an app. The sentence is true against that home: the key "takes the app off its holders' Home tiles, App Switcher and app:launcher block ... its URL still opens. Not an access gate." Naming the heading is a better pointer than the old "Navigation".
  • S-2, closed. Eval 21's must_not_contain is an empty array; must_contain is unchanged and both strings occur in expected_output. An empty array is within the file's convention (case 13 carries one), and no gate under scripts/ reads the assertion keys. A before-and-after answer now passes.
  • Rest of the paragraph: re-wrapped only; the re-point list, the boot-log sentence and the not-carried list are word for word as reviewed.
  • Ratchet. The diff to scripts/check-skills-token-ratchet.mjs is one row and its comment: skills/objectstack-data/rules/security.md 3959 to 3986. The head file measures 15942 bytes and ceil(15942 / 4) is 3986, so the row is pinned at the measurement with zero headroom, as the neighbouring rows are. The comment states the facts added, quotes the standing ruling (record 6513306068), names what was paid down first and each cut's home, and cites card skills(objectstack-data security): renaming a position — tell the author to re-point their own package source, and name the environment owner #33566. The raise follows the ruling: seven in-place cuts were made first and survive this round, and only the measured remainder (net +108 bytes on main's 15834) moves the row. The comment's gross figure of 313 bytes paid down was not recomputed here; the net is measured.

Check-runs on the head, read at 19:30Z: no failure. The full run on this head is complete and green: Build Core, Test Core (three shards and the roll-up), every Lint and Type Check job, Governed Surface Queue Guard, Check Changeset, PR-body guards, Check PR Size, Live E2E UI, Dogfood Regression Gate. A second Check Changeset and PR-body guards run, started at 19:29Z by the body edit, was still in progress at the read; the record does not vouch for that re-run.

② Semver level

Unchanged: patch on the skills package; Clause-②: no and Metadata-protocol: none on the changeset. The changeset prose now says the ceiling moves by the measured remainder, which is true of the diff. A moved ratchet row is tooling, not a published surface, and does not change the level.

③ Boundary flags

  • The dev's open question is settled as answered: the pointer is restored, shorter.
  • File surface: the ratchet script is new to the diff. The order allows it ("ratchet rows only if they move") and says a moved row makes the PR Tier H; the thread reports Tier H. Not re-run here.
  • SQL push-down: no code path in the diff.
  • Security: no security item found.

④ Design judgment

No must-fix and no should-fix is open.

N-1 (nit, accepted as left) — the boot-log parenthesis omits activation-ledger rows. Harmless; adding it would cost bytes on a row already raised.

N-2 (nit, accepted as left) — the parenthesis after "as for a queue above" is terse. It is correct, and the definitions it leans on are in the bullet it names.

All four card items are met and hold against main.

Implemented-by: claude/project-thread-4na0we
Reviewed-by: session_01ADHkmRxXmVQ41fqnaTPGAv

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

维护者速读

  • 改了什么:objectstack-data 的 rules/security.md「Renaming a position」一段补齐四点:作者要自己改包源码里写着旧岗位名的地方(共享接收方、队列成员与审批人、策略 positions、current_user.positions);重命名的拒绝条件改为「另一个所有者(包或环境)」;明说启动时只搬岗位持有人,不改写任何其他引用,包括 Setup 写的;恢复 explain 接口的门(manage_users、管理其所在组织、或覆盖其的委派 adminScope)。eval 加第 21 例。为腾篇幅删了同文件八处重复,各有存活处;余额按实测把 token 棚 3959→3986。changeset @objectstack/skills: patch。
  • 为什么改:PR docs(skills): the security rules teach a position rename through renamedFrom #33480 的达档复审(6886676047)指出这段让作者以为看完启动日志就没事了,且漏了环境这个所有者;explain 的权限规则被那次删掉了。
  • 风险与回滚:只改技能文字、一个评测用例和一行棚值,不动运行时。回滚 = revert。
  • 先看:security.md「Renaming a position」那段,和恢复的 tabPermissions 一行。
  • 两分钟验证:对照 packages/plugins/plugin-security/src/position-renamed-holder-carry.ts 模块注释与 security-plugin-explain-access.ts#mayDescribeAnotherUser,看句子是否逐条对得上。
  • 需要你做的:受管面 Tier H(diff 含 scripts/check-skills-token-ratchet.mjs,且路径名含 security,低风险技能臂不适用)。达档(CONTRACT_REVIEW_TIER)复审:首轮 6899620269 FAIL(M-1 一句措辞不实),delta 6900037119 在本 head PASS,全部关闭。请批准并合并,或批准后由席位落地。
  • 席位意见:可以合。

席位核对

Verdict: ACCEPT, held for the maintainer · head b9479f0dbcab87c514e205e47a5646c654df990c · card #33566 · report 6899557790 · at-tier contract review 6899620269 (FAIL on 169a40a0: M-1, S-1, S-2, N-1, N-2) → delta 6900037119 (PASS on this head, M-1/S-1/S-2 closed) · read 2026-11-15T19:31Z.

  • Shape: draft → main, Fixes #33566. skills/objectstack-data/rules/security.md, eval case 21 in the data skill's evals, one ratchet row (security.md 3959 → 3986, pinned to the measured 15942 bytes), changeset '@objectstack/skills': patch. GOVERNED, Tier H (check-governed-merges --pr 34105 exit 3). Clause-②: no; Metadata-protocol: none.
  • Premise measured: PR docs(skills): the security rules teach a position rename through renamedFrom #33480 merged as 8e63ed87; none of the four items was on main. Each added sentence was checked against main: the holder carry's module doc and tests, the owned-by-other refusal and OVERLAY_PROVENANCE_SENTINEL, and the explain gate mayDescribeAnotherUser.
  • Gates: on this head the full CI run is complete and green, none failed; dev on this head: 63 derived, 63 exit 0, --ran reconciles; skill-docs, skill-refs, skill-examples green.
  • Accepted deviations: authoring by a subagent pinned to CONTRACT_REVIEW_TIER inside a lower-tier thread (declared in the claim and body). Main merged in, nothing authored in the merge. The ratchet raise follows the standing ruling 「A:先削重复,余额按实测提高」: eight same-file cuts first, the measured remainder moves the row. The dev's open question (keep the tabPermissions cut) was ruled B by the seat: restored in a short form (review S-1). Nits N-1 (the boot-log parenthesis omits activation-ledger rows) and N-2 (one parenthesis reads hard) are left as they are.
  • Out of scope: none filed.
  • Landing: Tier H. The seat does not flip this PR ready or enqueue it. It needs the maintainer's merge, or an authorised APPROVED review after which the seat lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Serial note for the maintainer: this PR and PR #34019 (card #33978) both edit skills/objectstack-data/rules/security.md and the same row of scripts/check-skills-token-ratchet.mjs (#34019: 3959 → 4041; this PR: 3959 → 3986), each measured against main alone. Whichever merges second will conflict on that row, and its ceiling must be re-measured on the combined file. Merge either one; the seat then merges main into the other, re-pins the row to the measured size (paying in place first), and runs a delta review before it asks again. Neither PR needs anything from you beyond the merge.

Resolve the two conflicts with main's skills change: the eval case this
branch appends becomes id 22 (main's line-add case holds 21), and the
rules/security.md ratchet row is re-pinned at the merged measurement,
16272 bytes -> 4068 tokens (main's row 4041 plus this branch's +27),
with main's 3959 -> 4041 comment kept above it.

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

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer quota limit on the review tier, 2026-11-16T03:25Z) · head 464f620

Owed: the delta review of the serial rework, per serial note 6900101001. PR #34019 landed first (2026-11-16 02:57Z) and took eval id 21 and the security.md ratchet row. This head merges origin/main b8456ebd with a plain merge (no rebase, no force-push). Card #33566. Seat ACCEPT 6900051923 on the earlier head. os-dev-report 6906415750.

The seat's L1 read of the PR diff against the new merge base, for the reviewer to confirm or overturn:

  • The eval case added here is now id 22, with its content unchanged. docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019's case keeps id 21.
  • check-skills-token-ratchet.mjs keeps main's 3959 → 4041 comment and adds 4041 → 4068 for this PR, re-pinned at the merged measurement: security.md is 16272 bytes, ceil(16272 / 4) = 4068, with zero headroom. The comment quotes the standing ruling A (record 6513306068) and lists what was paid down first.
  • security.md merged without conflict. This PR's three sentences and the shorter tabPermissions pointer sit beside docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019's own_tasks example. Please read the paragraph whole, because two PRs now shape it.
  • Dev gates on this head: 64 derived, all exit 0, --ran reconciles; check:skill-docs, check:skill-refs and check:skill-examples exit 0. Tier H (--pr).
  • Known gap: the PR body's size readings and Verification still name the pre-merge head (3986, id 21). The dev is patching the body now.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 464f620 · 2026-11-16T03:27Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 464f620f45701c8b34e3ce2d1e8bf4f8c8482eb0
Local-runs: none
Scope: skills/objectstack-data/evals/hooks-security-seeds-datasources.json, skills/objectstack-data/rules/security.md + scripts/check-skills-token-ratchet.mjs, .changeset/33566-skills-position-rename-own-source.md
Security-touching: yes

Read at 2026-11-16T03:30Z. Delta review of this head against PASS 6900037119 at b9479f0 (by the lane's own reviewer); claim: comment 6906450776; hand-off 6906433374 and lane request 6906440356 on mailbox #33873 (the lane's at-tier reviewer was unavailable). Independence: implemented in an os-steve project thread, dispatched by domain:skills#2 (os-steve); reviewed by os-tesla, who neither dispatched nor implemented it.

Merge-delta review. Read-only shape: merge commit 464f620f against both parents (b9479f0d, the head of the prior PASS, and main b8456ebd, which carries #34019), the merged rules/security.md read whole in the sections both PRs touch, the ratchet row and its comment, the live PR body, and the head's check-runs. What the prior record judged against the cited code is unchanged by this head and stands; the cited code was re-located at this head, not re-reviewed.

① Derived judgments

  • The PR's diff against main is still exactly its four files.
  • skills/objectstack-data/rules/security.md merged without a hand. Against main the merged file carries this PR's hunks line for line as reviewed at b9479f0d (same added and removed lines, 22 and 22); against b9479f0d it carries docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019's hunk line for line as main has it (the own_tasks insert policy in place of org_isolation, and the four-line paragraph under the example). No sentence of either side is lost or altered.
  • Eval file, resolved by hand, correctly. Main's case keeps id 21; this PR's case is appended as id 22 with prompt, expected_output and assertions byte for byte as reviewed. The file parses; 22 cases, ids 1 to 22, each once. Both must_contain strings of case 22 occur in its expected_output; must_not_contain stays empty (prior S-2 stays closed). Nothing else in the repo addresses a case of this file by number.
  • Ratchet row, resolved by hand, correctly. The script counts Math.ceil(Buffer.byteLength(text, 'utf8') / 4). The merged file is 16272 bytes; ceil(16272 / 4) is 4068; the row reads 4068, pinned at the measurement with zero headroom. Main's file is 16164 bytes and 4041 tokens with headroom 0, as the new comment says; 4068 less 4041 is 27, and the net is +108 bytes, the same delta this PR had on its old base. Main's whole 3959 to 4041 comment is kept above the new one, unedited; the row's single reproduction line now names 16272, as each row carries one. The standing-ruling quotation is character for character the string the file quotes everywhere else, with the same record number 6513306068 and the same "verbatim and untranslated" framing.
  • The comment's pay-down list is true of the merged file: the kernel-name list now points at the placeholder table (which still holds id, email, organization_id, org_user_ids, positions, queues; docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019 did not touch it), the membership-tier list is left to the docs anchor kept in the same sentence, the second definition of the two closure refusals points at the queue bullet that still defines both, the four short restatements are gone, and the tabPermissions pointer is the shorter one. See N3 for the gross figure.
  • The two PRs read together, whole. They meet in one place, the § Row-Level Security example: this PR removed the block's leading // in a permission set comment, docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019 replaced its second policy and added the paragraph under it. The paragraph above the block still says the policies sit on a permission set or profile, so the example loses nothing; docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019's new inline comment names the field definition and does not lean on the removed one. docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019's own ratchet comment says current_user.organization_id keeps its row in the placeholder table; that row is the one this PR's kernel-name pointer relies on, so the two pay-downs lean on the same surviving text and neither removed it. This PR's three sentences (holders only and re-point your own source; another owner, a package or the environment; who may explain another user) sit in other sections and neither contradict nor restate anything docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019 added. The tabPermissions pointer still resolves: skills/objectstack-ui/rules/navigation.md has ## Who sees or opens an app at this head.
  • PR body against head: patched before this read. It names id 22, the row 4041 to 4068, ceil(16272 / 4), 334 lines and 16164 to 16272 bytes measured on b8456ebd and 464f620f; all of it matches the tree. No stale reading of the pre-merge head remains in a present-tense claim. The hand-off's staleness is closed, no finding.
  • Changeset: unchanged by the merge, and still true; it names no eval id and no ceiling figure.

Check-runs on this head at the read: 49 runs, none failed; 30 succeeded, 18 skipped, 1 in progress. Green and complete: Build Core, Test Core (shards and roll-up), Test UI, every Lint and Type Check job, Governed Surface Queue Guard, Check PR Size, Live E2E UI, Dogfood Regression Gate, PR-body guards (both runs), and one Check Changeset run. Still running: a second Check Changeset run, started by the PR-body edit. This PASS does not vouch for that re-run; the seat waits for it to finish green before acting on this record.

② Semver level

Unchanged: patch on @objectstack/skills, Clause-②: no, Metadata-protocol: none. The merge adds no published surface of its own; a re-pinned ratchet row is tooling.

CI completed before posting: 49 check-runs on this head, 31 success, 18 skipped, none failed (the re-run Check Changeset included).

③ Boundary flags

  • File surface: the same four paths; the ratchet script in the diff keeps the PR at Tier H, as the body says.
  • Serial rework: the row and the eval id were the two predicted collisions with docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019; both are resolved to the combined measurement and a free id, with no new teaching authored in the merge.
  • SQL push-down: no code path in the diff.
  • Security: no security item found. The changed hunks teach permission behaviour, hence the yes above.

④ Design judgment

No must-fix, no should-fix.

Prior ids: M-1, S-1 and S-2 of record 6899620269, closed by 6900037119, stay closed at this head; the text that closed each is unchanged by the merge.

N1 (nit) — continues N-1, accepted as left: the boot-log parenthesis omits activation-ledger rows.

N2 (nit) — continues N-2, accepted as left: the parenthesis after "as for a queue above" is terse, and correct.

N3 (nit) — new at this read, not caused by the merge: the ratchet comment and the PR body give the gross pay-down as 313 bytes. The body's seven stated figures sum to 266 and the kernel-name bullet measures 48 bytes shorter at this head, which makes 314. The prior record did not recompute this figure. The row is governed by the measured net (+108 bytes, 4068), which is exact; no effect on the gate or the contract.

skills/objectstack-data/rules/security.md holds against the card's eval prompt (case 22) and against main as merged; the eval file and the ratchet row agree with it.

Implemented-by: claude/project-thread-4na0we
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

维护者速读(刷新:与 #34019 合并后的新 head)

  • 改了什么:同上一份速读,只多一件事。docs(skills): a line-add action sets the price; a self-tied create gets a current_user default #34019 先合进了 main,和本 PR 改同一个 security.md、同一行 token 棚、同一个 eval 编号。本 PR 合入 main 后:本 PR 的评测用例改为第 22 例(main 的第 21 例不动),棚值按合并后的实测 16272 字节改为 4041→4068。两边的句子都一字未丢。
  • 风险与回滚:仍只改技能文字、一个评测用例和一行棚值,不动运行时。回滚 = revert。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs | grep security.md 应读 4068/4068。
  • 需要你做的:Tier H,请批准并合并,或批准后由席位落地。review#2 对新 head 的增量复审 6906505978 PASS,无必改、无应改。
  • 席位意见:可以合。

席位核对

Verdict: ACCEPT, held for the maintainer · head 464f620f45701c8b34e3ce2d1e8bf4f8c8482eb0 · card #33566 · supersedes the seat's earlier ACCEPT on b9479f0d · delta contract review 6906505978 (review#2, PASS on this head against PASS 6900037119) · read 2026-11-16T03:32Z.

  • Shape: → main, Fixes #33566, the same four files. GOVERNED, Tier H (the ratchet script is in the diff). Clause-②: no; Metadata-protocol: none.
  • Merge: rules/security.md merged with no hand; the eval file and the ratchet row were resolved by hand to a free id (22) and the combined measurement (16272 bytes → 4068, headroom 0). Main's ratchet comment is kept whole above the new one.
  • Gates: CI on this head is complete, 49 runs with none failed (the reviewer counted the re-run Check Changeset). Dev on this head: 64 derived, all exit 0, --ran reconciles; skill-examples 347; ratchet self-test 104.
  • Nits left open, accepted by the seat: N1 and N2 carried from the prior record; N3 (the gross pay-down is stated as 313 bytes where the parts sum to 314) does not touch the measured net that governs the row.
  • Security: a security item is with the owner seat; this text stays at the rule layer.
  • Landing: Tier H. The seat does not enqueue this PR. It needs the maintainer's merge, or a GOVERNED_APPROVERS approval after which the seat lands it. Approvers os-zhuang and hotlong are already requested.

@os-zhuang
os-zhuang added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 2c96e0d Nov 16, 2026
49 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-4na0we branch November 16, 2026 09:33
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skills(objectstack-data security): renaming a position — tell the author to re-point their own package source, and name the environment owner

3 participants