Repository navigation
fix(plugin-sharing)!: a manual share or sharing rule to a user id that names no user is refused instead of stored as an inert grant - #38216
Conversation
…oes not resolve (#33912) Work in progress, released to the queue under the maintainer's 2026-11-21T15:25Z stop. Untested: no build, suite, pins, ablation or changeset yet. A narrowing (Clause-② no) when finished.
Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
… for the unknown-recipient refusal Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
…alves The inertness verdict stays one answer per object and recipient population whoever calls; the #25549 fixture's members become users. Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
…are-unknown-recipient
…al flag, not a second isSystem read Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 30444e1c97bbc4abe5568fe550fbbe88aa4580f9 && git checkout 30444e1c97bbc4abe5568fe550fbbe88aa4580f9
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e42520c67bcef027552f8db83655ff9b54d32cef 4e803259a7933c4d890892f955029cc69cf1efcc && git checkout -B drift-repro e42520c67bcef027552f8db83655ff9b54d32cef && git merge --no-ff 4e803259a7933c4d890892f955029cc69cf1efcc
node scripts/docs-audit/affected-docs.mjs --json e42520c67bcef027552f8db83655ff9b54d32cef
|
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head 1cba91f · 2026-11-28T07:48Z The lane seat runs the owed CONTRACT_REVIEW_TIER review through an isolated at-tier subagent. |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract reviewServed-tier: ① Derived judgments
② Semver levelClause-②: no (narrowing)
③ Boundary flagsSecurity-touching: yes. The hunks change which shares and sharing rules the sharing doors accept.
④ Design judgmentThe narrowing makes the spec's own refusal real and takes no declared capability away. M1 (must-fix) — the no-oracle claim is false when the grant's organization resolves to N1 (nit) — N2 (nit) — under Implemented-by: VERDICT: FAIL |
…o recipient The deployment-wide sys_user lookup answered an unknown id 400 while a real user of any organization reached the engine's 500 organization refusal: an existence oracle. The engine's refusal now answers every recipient alike; pinned. Changeset, ledger entry, docs note and jsdoc scoped to what the tree does. Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head 8eb8823 · 2026-11-28T10:01Z The lane seat runs the owed CONTRACT_REVIEW_TIER review through an isolated at-tier subagent. |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract reviewServed-tier: ① Derived judgments
② Semver levelClause-②: no (narrowing)
③ Boundary flagsSecurity-touching: yes. The hunks change which shares and sharing rules the sharing doors accept.
④ Design judgmentThe narrowing makes the spec's own refusal real and takes no declared capability away at the consumer. M1: closed. Tried in every arm:
S1 (should-fix) — the N1 (nit) — unchanged: N2 (nit) — unchanged: under N3 (nit) — the PR body is stale against the tree: "otherwise ( N4 (nit) — "for every recipient alike … nothing is written" (changeset, docs note, ledger N5 (nit) — the method jsdoc's "the engine refuses its insert" assumes the engine and the plugin read the same posture. With no N6 (nit) — the new pin covers one No must-fix. S1 is open on this head and earns a delta review of its fix. Implemented-by: VERDICT: PASS |
…rm operator in the stored row's organization Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSy8ctHY8LEkxS86U6
…he stored rule's organization on an org-less operator's update Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSy8ctHY8LEkxS86U6
|
repo:objectstack#8 · sunhaolin · session_017xRBcSy8ctHY8LEkxS86U6 {
"issue": 33912,
"delta_of": "contract review 7237682248 (head 8eb8823d2b9e1b3758ef09cfaeabb7f2f7ccb702, PASS, S1 open)",
"status": "done",
"branch": "claude/issue-33912-share-unknown-recipient",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38216",
"session": "session_017xRBcSy8ctHY8LEkxS86U6",
"premise_still_valid": true,
"summary": "S1 fixed by the reviewer's first direction: `defineRule` now judges a `user` recipient in `orgId ?? (stored?.organization_id || null)`, so a non-system platform operator with no active organization who moves a stored rule (the UPDATE half, which the engine's insert-only organization rule does not refuse) is judged in the stored row's organization, with the same `VALIDATION_FAILED` code and sentence as an organization admin, and an unknown id and another organization's user answer alike (no cross-org oracle). Measurement showed the direction is right and possible: the existence lookup already holds the stored row, its `organization_id` resolves, and the membership arm of `userRecipientRefusal` answers it with one `sys_member` read. The insert half is unchanged (a new rule with no organization under a wall still stands aside and the engine refuses its insert for every recipient). Prose scoped to match: the ledger entry's `surface`, `reason` and `acceptanceCriteria`, both changesets, the docs note and the `defineRule` comment. Head moved 8eb8823d -> 4e803259a7 (two commits: f02fb95d fix + pin, 4e803259 prose). Confirmed head 8eb8823d before starting. Residual, stated in the code comment and not changed: a stored rule row carrying no organization under a wall is not judged (the ownership ceremony leaves none on a certified deployment, ADR-0131 D10). Not touched: N1, N2, N4, N5, N6 (no dispatch for them).",
"tests": "New describe in `record-share-unknown-recipient.test.ts`, posture `isolated`, caller `{ userId: 'u_operator', systemPermissions: ['manage_platform_settings'] }` with no `tenantId`, a stored rule `r_op` of org_a whose recipient is a member of org_a, then `defineRule` with the same name: (1) unknown id -> VALIDATION_FAILED, exact RULE_REFUSAL sentence, stored recipient unchanged; (2) a member of org_b -> same code, same sentence apart from the echoed id, stored recipient unchanged; (3) CONTROL: a real member of org_a (the stored row's org) -> stored. Pin file at 4e803259a7: `vitest run --maxWorkers=2 src/record-share-unknown-recipient.test.ts` Test Files 1 passed (1), Tests 15 passed (15), VERDICT command-exit 0. Ablation via `scripts/ablation-replace.mjs` on sharing-rule-service.ts, anchor `const ruleOrgId = orgId ?? (stored?.organization_id || null);` -> `const ruleOrgId = orgId;` (anchor x1 -> x0, replacement x0 -> x1, blob b52bb7428e92 -> bbaa197904de): Tests 2 failed | 13 passed (15), red exactly the two operator refusal pins (`expected undefined to be 'VALIDATION_FAILED'`), the CONTROL and every other pin green; restore: blob after restore == HEAD (b52bb7428e92), `git diff HEAD` empty. The pin imports the service from `src` by relative path, so no dist rebuild was owed for the ablation. Package: `pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/plugin-sharing typecheck && vitest run --maxWorkers=2` at 4e803259a7: TYPECHECK_OK, Test Files 79 passed (79), Tests 1769 passed | 11 skipped (1780), VERDICT command-exit 0.",
"gates": "Local, at 4e803259a7: `dispatch-gates --commands` (8 paths, merge base 7605e0c9c): 120 derived families. First pass: 114 exit 0; 6 could not answer (exit 3 PREREQUISITE NOT MET: check-plugin-teardown-shape --self-test on a shallow clone, check:skill-examples, check:dual-build-cjs-loads, check:i18n with no full build, check:type-check-debt with the lock held; exit 1 MODULE_NOT_FOUND for the cli migrate-meta-engine-guidance test with `@objectstack/mcp` unbuilt). After `git fetch --unshallow origin main` and a full `turbo run build --concurrency=2` (124 of 124 tasks, VERDICT command-exit 0), all 6 re-run: exit 0. Note: families 64-120 of the first pass ran while that full build was writing dist; every one of them exited 0. `dispatch-gates --ran`: 120 accounted, 120 run, 0 NOT-MEASURED (the runner's claim; exit codes recorded in my results file, all 0). Key verdict lines: check-adr-0087-registration both changesets `registered share-user-recipient-unresolved-refused`; check:spec-changes and check:upgrade-guide generate from the registries in memory (protocol 19.0.0); check:nul-bytes OK; check:system-context-census OK (209 elevation read sites). dispatch-gates printed STALE TREE (branch 46 commits behind origin/main, 7 gate files changed in that range); main was not merged (no conflict, overlap-check clean, not ordered). CI on 4e803259a7, read once: 70 check-runs, every executed run success, the rest skipped opt-in jobs; required set: Lint & Repo Gates success, TypeScript Type Check success, Test Core success, Build Core success, Governed Surface Queue Guard success, Type Check UI success, Test UI success, Build & E2E UI success, Live E2E UI success, Dogfood Regression Gate success, Lint UI skipped; Check Changeset success.",
"dogfood_battery": "4e803259a7 · os-verify-lock: VERDICT command-exit 0 (held the lock 1911s) · Test Files 490 passed | 3 skipped (493) · Tests 4144 passed | 68 skipped (4212) · no failures · `pnpm --filter @objectstack/dogfood test`, no OS_TEST_SHARD, no path, closure from the full build",
"mcp_calls": "4 — reads only: github pull_request_read (get, get_comments, get_check_runs) and claude-code-remote get_session for this session's id. No GitHub write tool.",
"api_writes": "1 — this report via `scripts/pm/post-stamped.mjs --comment=38216` (POST /repos/objectstack-ai/objectstack/issues/38216/comments, through the fleet relay). Two `git push` to the branch (not REST writes).",
"open_questions": [],
"pr_body_patch": [
{
"before": " - otherwise (`single`, a record with no organization, or no membership table): an existing `sys_user`;",
"after": " - walled posture with the grant's organization unresolved (the record-organization read failed, or the record carries none and the session has no active one): no recipient is judged, and the engine refuses that insert for every recipient alike (`ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED`, 500);\n - otherwise (`single`, or a walled deployment that registers no membership table): an existing `sys_user`;"
},
{
"before": "- `SharingRuleService.defineRule` applies the same check, in the rule's organization, to a non-system `user` recipient only when the rule is new or its recipient changes; re-saving a stored rule with its recipient unchanged (for example `active: false`) is not re-judged.",
"after": "- `SharingRuleService.defineRule` applies the same check, in the rule's organization, to a non-system `user` recipient only when the rule is new or its recipient changes; re-saving a stored rule with its recipient unchanged (for example `active: false`) is not re-judged. The rule's organization is the caller's or, for a platform operator with no active organization updating a stored rule, the stored rule's own: that write is an update, which the engine's insert-only organization rule does not refuse, so it is judged here with the same code and sentence. A new rule with no organization under a wall is not judged; the engine refuses its insert for every recipient alike."
},
{
"before": "- `defineRule`: unknown user refused, no rule; another-organization user identical to unknown; member CONTROL stored; an unchanged stored recipient not re-judged (`active: false` lands); moving a stored rule onto an unknown user refused.",
"after": "- `defineRule`: unknown user refused, no rule; another-organization user identical to unknown; member CONTROL stored; an unchanged stored recipient not re-judged (`active: false` lands); moving a stored rule onto an unknown user refused.\n- walled, grant organization unresolved (`group`, the record-organization read failed): an unknown id, another-organization user and a member all get the engine's 500 `ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED`, equal in code, status and message; no row;\n- `defineRule` by a platform operator with no active organization (`isolated`, `manage_platform_settings`, no `tenantId`) moving a stored rule: unknown id refused, stored recipient stands; another-organization user identical to unknown; member of the stored rule's organization CONTROL stored."
},
{
"before": "| A5 direct-grant flag forced `true` | 1 of 11 (system context judged) |",
"after": "| A5 direct-grant flag forced `true` | 1 of 11 (system context judged) |\n| A6 `defineRule` judges in the caller's organization only (`ruleOrgId = orgId`), at head `4e803259a7` | 2 of 15 (operator unknown, operator other-org); the operator CONTROL green |"
},
{
"before": "Two-minute check: `pnpm --filter @objectstack/plugin-sharing exec vitest run --maxWorkers=2 src/record-share-unknown-recipient.test.ts` — expect 11 passed.",
"after": "Two-minute check: `pnpm --filter @objectstack/plugin-sharing exec vitest run --maxWorkers=2 src/record-share-unknown-recipient.test.ts` — expect 15 passed."
},
{
"before": "check:system-context-census: OK, register matches the tree (209 elevation read sites)",
"after": "check:system-context-census: OK, register matches the tree (209 elevation read sites)\n\nS1 round, head 4e803259a7:\n plugin-sharing typecheck TYPECHECK_OK · vitest Test Files 79 passed (79) · Tests 1769 passed | 11 skipped (1780) · VERDICT command-exit 0\n dispatch-gates --commands (8 paths, merge base 7605e0c9c): 120 derived families, 120 exit 0 (6 re-run after a clone deepen and a full build); dispatch-gates --ran: 120 accounted, 120 run, 0 NOT-MEASURED\n pnpm --filter @objectstack/dogfood test (full battery, no shard): Test Files 490 passed | 3 skipped (493) · Tests 4144 passed | 68 skipped (4212) · VERDICT command-exit 0"
}
],
"deviations": [
"The dispatch named the shared checkout; the worktree guard hook refused an edit there, so the primary checkout was detached (`git checkout --detach`, nothing uncommitted) and a worktree `../objectstack-issue-33912` was added on the same branch. Removed at the end; the primary checkout is back on the branch.",
"Local commit amended once before its first push (a typo in the Claude-Session trailer); nothing pushed was rewritten.",
"Ablation A1-A5 rows in the PR body were measured at 11 pins and were not re-run at 15; only A6 is new."
],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none · noted, not filed — under a wall a stored `sys_sharing_rule` row with `organization_id` null is updated by an org-less platform operator unjudged; the ownership ceremony leaves no such row on a certified deployment (ADR-0131 D10); stated in the defineRule comment.",
"carrier: the seat · unchanged from the previous rounds — the `rule-hooks.ts` `/data` door, the `federated-phantom-share-grant` dogfood test, the flat refusal body of `POST /api/v1/sharing/rules`."
]
}Generated by Claude Code |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract-review-claim: session_017xRBcSAaBEfQpU2yJexSJ8 · head 4e80325 · 2026-11-28T11:35Z The lane seat runs the owed CONTRACT_REVIEW_TIER delta review (S1 of 7237682248) through an isolated at-tier subagent. |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Contract reviewServed-tier: Delta round on 8eb8823..4e80325 (f02fb95 the fix and its pin, 4e80325 the prose), and the whole PR judged again at this head. ① Derived judgments
② Semver levelClause-②: no (narrowing)
③ Boundary flagsSecurity-touching: yes The hunks change which shares and sharing rules the sharing doors accept.
④ Design judgmentThe narrowing makes the spec's own refusal real and takes no declared capability away at the consumer. S1: closed The update half is now judged, in the organization the stored row belongs to, and the published sentence no longer calls that write refused by the engine. Tried:
Published sentences against the tree at this head:
N7 (nit) — the residual the dev names is real and benign, and the prose is honest about it without being complete. A stored rule row with no organization under a wall takes the update unjudged. Such a row needs a store written outside the product: the engine refuses that insert in every walled posture, N8 (nit) — the new pins cover the operator's update under N1 (nit) — unchanged: N2 (nit) — unchanged: under N3 (nit) — unchanged and still open on the prose face: the PR body still says "otherwise ( N4 (nit) — unchanged: "for every recipient alike … nothing is written" is exact for the insert half of N5 (nit) — unchanged: "the engine refuses its insert" assumes the engine and the plugin read the same posture. N6 (nit) — unchanged: the No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 维护者速读
席位意见:建议批准。合同审查(CONTRACT_REVIEW_TIER)经三轮:首轮 FAIL(M1 跨租户可探测)→ 修复后 PASS 留 S1 → 本 head 上 PASS(M1、S1 均已关闭,只余 nit),守卫读取器已核读通。 席位核对 · ACCEPT · head
|
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Request: approval · PR #38216 declares a narrowing ( |
…g, 56 changesets added) and state what npm publishes (objectstack-ai#38645) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9St4eUWHFcCKuRUrCZPperJ)_ Fixes objectstack-ai#38189 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:v19 发布页的 breaking 清单补上 11 月 26 日之后合进来的 56 条改动(其中 30 条还在 main 上、下一次预发布才带上,页上逐条标明),计数和页头的发布状态也改成现在 npm 上的真实情况。 - 为什么做:升级到 19 的人把这页当完整清单用;原清单只数到 19.0.0-next.0 的输入,之后 next.1、next.2 和 main 上的 breaking 改动大多没列。 - 出错会怎样:只改一个文档页,不影响任何代码或发布;某条写错了,读者会被误导,但直接撤回这个改动即可恢复原页。 - 要你做的:无。 ## What changes `content/docs/releases/v19/index.mdx` only. - **Header.** The publication sentence now states what npm answers: `latest` is 18.6.0, `next` is `19.0.0-next.2`; the line's versions on npm are `19.0.0-next.0` (2026-11-26) and `19.0.0-next.2` (2026-11-28). `19.0.0-next.1` was versioned on `main` (30a8047) and is not on npm, so its changes first ship in `next.2`. - **How this list was built.** Re-measured at `6eb23c87` (origin/main at start, 2026-11-29) with the method the page states: `classifyReleaseBullet` over every changeset on `main` — the 1,185 in `.changeset/pre/` (consumed by the next.0, next.1 and next.2 version passes) and the 219 still pending. 159 breaking from 155 PRs: 98 to act on, 61 registered. - **56 new lines' worth of changesets**, each sorted by the classifier into 需手动处理 (27) or 自动迁移 (29), placed under the page's existing topic headings, with three new ones: 需手动处理 → Knowledge; 自动迁移 → Knowledge sources, Sharing and permissions. The 30 still pending carry "— on `main`". - **自动迁移 intro** and **Coming from 18.x step 3**: the registered split restated in changesets (31 on the protocol-19 step, 30 on the protocol-18 step, of 61). - **Callout**: no longer says no prerelease was published. ## Tests The classifier run (script in the dev's scratchpad; it imports `classifyReleaseBullet` from `scripts/release-github-releases.mjs` and feeds each changeset body as a CHANGELOG bullet, `- ` on the first line and two-space indent on the rest), at `b03fd5f5`'s parent tree `6eb23c87` (the diff touches no changeset): <details><summary>Raw counts</summary> ``` ALL 1404 {"manual":98,"migrated":61,"other":830,"added":403,"semantic":12} OLD (in a46efa8 set) 950 {"migrated":31,"manual":71,"other":563,"added":278,"semantic":7} NEW (after a46efa8) 454 {"manual":27,"other":267,"added":125,"migrated":30,"semantic":5} NEW next.0 45 {"other":27,"added":13,"migrated":1,"semantic":2,"manual":2} NEW next.1 138 {"manual":9,"other":80,"migrated":12,"added":36,"semantic":1} NEW next.2 52 {"added":11,"other":38,"manual":3} NEW pending 219 {"added":65,"other":122,"migrated":17,"manual":13,"semantic":2} missing-from-tree of a46 set: none ``` The same function over the 950 files as they stood at `a46efa8c` (`git show a46efa8:.changeset/FILE`): `{"migrated":31,"manual":71,"other":563,"added":278,"semantic":7}`, and 0 of the 950 changed section between `a46efa8c` and `6eb23c87` — the page's first count reproduces exactly. </details> <details><summary>The 57 breaking changesets added after a46efa8 (pass · section · PR · file)</summary> ``` next.0 manual 37477 37004-retire-knowledge-ragflow.md next.0 manual 37491 36964-flow-option-label-filters.md next.0 migrated 37437 35827-data-table-staged-edit-retired.md (already on the page) next.1 manual 37605 31908-p4c-sealed-expiry.md next.1 manual 37640 37604-platform-record-followups.md next.1 manual 37668 37104-knowledge-settings-readers.md next.1 manual 37720 37682-i18n-retire-build-chat-keys.md next.1 manual 37720 37682-retire-build-chat-frontend.md next.1 manual 37818 37608-disabled-holder-publish-rollback-refused.md next.1 manual 37883 37575-first-render-grid-shell-passes.md next.1 manual 37900 36689-mcp-stdio-disabled-package-every-caller.md next.1 manual 37902 37678-knowledge-turso-settings-group.md next.1 migrated 37366 37086-define-metadata-form-rename.md next.1 migrated 37366 37086-form-metadata-type.md next.1 migrated 37371 36055-view-all-stops-voting-on-fields.md next.1 migrated 37513 35143-data-model-publish-checks.md next.1 migrated 37584 37499-disabled-holder-unbound-row-bare-write-refused.md next.1 migrated 37600 36595-related-list-key-under-arrangement.md next.1 migrated 37676 37304-knowledge-source-governed-type.md next.1 migrated 37783 37712-agent-model-provider-retired.md next.1 migrated 37807 35143-seeds-actions-checks.md next.1 migrated 37840 36377-flow-bare-ordering-record-date-arithmetic.md next.1 migrated 37870 37613-book-audience-one-gate.md next.1 migrated 37910 37717-lookup-depends-on-param-computed-field.md next.2 manual 37948 37851-disabled-holder-own-row-publish-rollback-refused.md next.2 manual 38028 managed-email-password-held-off.md next.2 manual 38042 36679-secret-rewrap-confirmation-exit.md pending manual 37896 runtime-object-less-action-no-record.md pending manual 37963 37467-knowledge-title-arm-retired.md pending manual 37982 37907-knowledge-turso-test-connection.md pending manual 38038 38019-knowledge-source-review-follow-ups.md pending manual 38085 37622-related-list-keys-agree-under-arrangement.md pending manual 38180 auth-switches-read-declaration.md pending manual 38209 35879-served-schema-platform-stamped-keys.md pending manual 38268 sec2-wf9p-f12.md pending manual 38269 37752-app-list-edit-with-ai-removed.md pending manual 38310 38041-knowledge-source-closure-system-object.md pending manual 38431 36987-auth-updateuser-returns-void.md pending manual 38452 38377-retire-split-algorithm-version.md pending manual 38580 36057-scenarios-delete-agent-confirmation-names.md pending migrated 37924 37856-ask-ai-action-type-retired.md pending migrated 37929 36495-action-locations-acted-on.md pending migrated 37971 37307-knowledge-source-references.md pending migrated 38001 automation-variable-keys-reserved-segments.md pending migrated 38013 37983-knowledge-source-save-needs-the-service.md pending migrated 38060 37961-knowledge-source-unmounted-adapter-refused-at-save.md pending migrated 38096 34562-record-structural-lint.md pending migrated 38107 35143-views-dashboards-checks.md pending migrated 38145 37214-chart-series-measure-format-refused.md pending migrated 38168 36544-form-view-modal-size-retired.md pending migrated 38216 33912-share-unknown-recipient-ledger.md pending migrated 38216 33912-share-unknown-recipient.md pending migrated 38273 33806-pending-confirmation-service-one-seam.md pending migrated 38299 35924-publish-reparses-object-draft.md pending migrated 38398 37753-build-progress-frame-retired.md pending migrated 38470 38369-knowledge-held-without-embedder-or-store.md pending migrated 38545 38150-adopt-orphans-door-retired.md ``` PR = the `(#N)` of the commit that added the changeset (`git log --diff-filter=A`). The pass is the version commit that moved the file into `.changeset/pre/`: next.0 33a31dc, next.1 30a8047, next.2 9d111a7 (`packages/spec/package.json` reads `19.0.0-next.0/1/2` at each). </details> <details><summary>Page cross-checks</summary> - Every one of the 155 PRs behind a breaking changeset is linked on the page (0 missing), and the page links no PR outside that set. - Each of the 30 pending changesets sits on a line carrying "— on `main`", and no published one does. - `!`-titled first-parent commits since 18.6.0 (958ee03) to `6eb23c87`: 135 (87 to `a46efa8c`, as the page said); all 135 are in the list. - Registered markers resolved to their entry files (`packages/spec/src/migrations/entries/*/N.*`, `packages/spec/src/conversions/entries/N/`, and metadata-core's forward conversion for `permission-view-all-fields-beside-record-bypass`): the 30 registered changesets added after `a46efa8c` name 39 ids, all on step 19; the 31 before it name 33 ids, 32 on step 18 and `protocol-18-range-refused` on step 19. </details> ## Acceptance notes - **Pending changesets are in the list.** The card's done-when covers every changeset between `a46efa8c` and the measurement sha; 30 of those are still in `.changeset/` and ship in the next cut, so their lines are marked "on `main`" and the intro says so. - **`19.0.0-next.1` is not on npm.** `npm view PKG versions` for `@objectstack/spec`, `core`, `cli`, `runtime` and `@object-ui/i18n` lists `19.0.0-next.0` and `19.0.0-next.2` only. The header states that fact and no more. - **The registered split is now counted in changesets, not entries.** The old page said 41 registered entries, 39 on protocol 18. Counting the ids in the registered markers gives 33 at `a46efa8c` (32 on step 18), so the 41/39 could not be reproduced from any stated method. The rewritten intro and step 3 count changesets (31 on step 19, 30 on step 18, of 61), which match the bullets one to one. - **Followed the classifier where a title has no `!`:** objectstack-ai#37605, objectstack-ai#37883, objectstack-ai#37963, objectstack-ai#38209 and objectstack-ai#38269 are breaking by their banner or their `(narrowing)` arm; objectstack-ai#38209's Clause-② reads "no (narrowing …)", which the classifier counts as breaking although the body says nothing a client sends is refused. Listed as classified; no changeset changed. - **objectstack-ai#37513** merged before the next.0 cut but its changeset was consumed by next.1 (its body says the next.0 CHANGELOG missed it). - **One line, several changesets**: objectstack-ai#37720, objectstack-ai#37366 and objectstack-ai#38216 each carry two changesets; objectstack-ai#37818 with objectstack-ai#37948, objectstack-ai#38038 with objectstack-ai#38310 and objectstack-ai#38013 with objectstack-ai#38060 share a line. The existing 102 lines were not rewritten. - **Counts on a release page**: each is anchored to a named measurement sha, the snapshot the card asks for; it is not a count kept in sync with the tree. - **objectstack-ai#37437** (closed card objectstack-ai#37922's bullet) is not added twice. - **Check Changeset** will be red: this docs-only PR publishes nothing from any package, the `skip-changeset` case, and the dispatch opens it without labels, so that label is the seat's to apply. ## Verification Read first, by risk: the method paragraph and header (`index.mdx` lines 6-47), the 自动迁移 intro, then the new 需手动处理 → Knowledge block. Two-minute check: `git show 6eb23c8:.changeset/pre/37851-disabled-holder-own-row-publish-rollback-refused.md | head -12` shows the `fix(metadata-protocol)!` summary and the BREAKING banner behind the objectstack-ai#37948 line; `npm view @objectstack/spec dist-tags` prints `{ latest: '18.6.0', next: '19.0.0-next.2' }`. <details><summary>Local gate readings at b03fd5f</summary> ``` dispatch-gates --commands at b03fd5f: 52 commands (1 path changed) first pass: 47 exit 0; 5 exit 3/1 = PREREQUISITE NOT MET (lint, spec, client-react unbuilt), re-run after building the closures under os-verify-lock (VERDICT command-exit 0 both): pnpm --filter '@objectstack/lint...' build ; pnpm --filter '@objectstack/client-react...' build final: 52 of 52 :: exit 0 ✓ dispatch-gates --ran: 52 derived famil(ies) accounted for — 52 run, 0 NOT-MEASURED (a DERIVED zero — all 52 recorded an exit code and none of them is 3). check-release-page-status: OK — 3 GA major(s) in scope (v16, v17, v18) ``` </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRar3Kkg6SpwVgaaVE <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmRar3Kkg6SpwVgaaVE --> Co-authored-by: Claude <noreply@anthropic.com>
Fixes #33912
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no published skill describes the shares or sharing-rules request body; the declared
sharingRulesmetadata path is not judged by this change维护者速读
What changes
SharingService.grant(non-system path) now asks whether auserrecipient names a user the read and write gates could ever match, after authorization, after the record's organization is resolved and after both ADR-0111 D7 halves:isolated/group) with the record's organization known: a member of that organization (objectqlorganizationMemberStanding, the engine's one membership predicate; a banned member still resolves);ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED, 500);single, or a walled deployment that registers no membership table): an existingsys_user;sys_userhas nothing to resolve against and the check stands aside.VALIDATION_FAILED(400 at the REST door) and nothing is written. A user of another organization gets the same sentence as an id that does not exist (only the echoed id differs), so the door is no cross-tenant existence oracle.SharingRuleService.defineRuleapplies the same check, in the rule's organization, to a non-systemuserrecipient only when the rule is new or its recipient changes; re-saving a stored rule with its recipient unchanged (for exampleactive: false) is not re-judged. The rule's organization is the caller's or, for a platform operator with no active organization updating a stored rule, the stored rule's own: that write is an update, which the engine's insert-only organization rule does not refuse, so it is judged here with the same code and sentence. A new rule with no organization under a wall is not judged; the engine refuses its insert for every recipient alike.ee1dabfcd, seat 7), with two corrections: the direct-grant check moved from inside the non-system branch to afterassertRecipientNotInert, so the D7 inertness verdict stays one answer per object and recipient population whoever calls (the WIP turned the user-path answer on a public object intoVALIDATION_FAILEDwhile the system path answeredSHARING_NOT_ENABLED, red insystem-caller-inert-grant.test.ts); and the "is this a direct grant" decision is a local flag set in the existing branch rather than a secondisSystemread ingrant(check:system-context-censusregister).share-user-recipient-unresolved-refused(step 19), two changesets (plugin-sharingminor, specpatch), and a docs note incontent/docs/kernel/runtime-services/sharing-service.mdx.Files to read first, by risk:
packages/plugins/plugin-sharing/src/sharing-service.ts— theuserRecipientRefusal/userRecipientResolvespair and the hunk afterassertRecipientNotInertingrant()(ordering is the load-bearing part).packages/plugins/plugin-sharing/src/sharing-rule-service.ts— thedefineRulehunk: which upserts are judged.packages/plugins/plugin-sharing/src/record-share-unknown-recipient.test.ts— the pins.Tests
New
record-share-unknown-recipient.test.ts, on a real ObjectQL engine over an in-memory SQLiteSqlDriverwithsys_userandsys_memberregistered. Refusals assert thecode(theCODE:prefix the share and rule routes map to a status,VALIDATION_FAILEDto 400, pinned route-side inrest-share-refusal-classification.test.ts), the exact sentence and the table left empty; the status is measured at the live door below.defineRule: unknown user refused, no rule; another-organization user identical to unknown; member CONTROL stored; an unchanged stored recipient not re-judged (active: falselands); moving a stored rule onto an unknown user refused.group, the record-organization read failed): an unknown id, another-organization user and a member all get the engine's 500ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED, equal in code, status and message; no row;defineRuleby a platform operator with no active organization (isolated,manage_platform_settings, notenantId) moving a stored rule: unknown id refused, stored recipient stands; another-organization user identical to unknown; member of the stored rule's organization CONTROL stored.system-caller-inert-grant.test.ts: the #25549 fixture's members are now alsosys_userrows (every member is a user).Ablation (
scripts/ablation-replace.mjs, each leg restored to the HEAD blob,git diff HEADempty): each mutation reds exactly the pins it should and no control.Ablation readings
grantcheck replaced bynulldefineRulecheck replaced bynullif (false))truedefineRulejudges in the caller's organization only (ruleOrgId = orgId), at head4e803259a7Acceptance notes
rule-hooks.tsbinds nouser-recipient guard onsys_sharing_rule, so a rule row saved through the/datadoor (the Setup form) skips the newdefineRulecheck (the predecessor's finding; source read, not measured live). Reported to the seat.packages/qa/dogfood/test/federated-phantom-share-grant.dogfood.test.tsshares a local note withusr_grantee_8119, a user id that does not exist, and asserts only "not 422 / not SHARING_NOT_ENABLED"; it now passes on a 400VALIDATION_FAILEDinstead of a 201. Still green, but no longer for the reason it was written; outside this card's file surface, left as is.POST /api/v1/sharing/rulesanswers its refusals in the older flat{ code, error }body (pre-existing, unchanged here), the shares route in the nested{ success, error: { code, message } }envelope.Verification
Two-minute check:
pnpm --filter @objectstack/plugin-sharing exec vitest run --maxWorkers=2 src/record-share-unknown-recipient.test.ts— expect 15 passed.Live door, showcase, fresh boot, single posture
On current main's behaviour (the
grant()recipient check ablated in plugin-sharing's builtdist/, marker count 1 indist/index.js, every other byte the branch at4a00ebdf59; restored and rebuilt after,ablation-dist-preflight --absentclean):With the fix (branch build at
4a00ebdf59; the later commit1cba91fa42only swaps theisSystemread for a local flag and is covered by the suites below):Suites and gates
All at head
1cba91fa42unless noted.CI owns the repo-wide scans (
pnpm lint) andtest:repo; not run locally.Generated by Claude Code