Skip to content

fix(app-shell): a member's record page asks no object definition the metadata door answers as absent - #33499

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-E1-33343
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-E1-33343

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Part of #33343 (item 2 only; item 1, the health version, is Area A4's own PR)

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:成员打开记录页时,控制台不再按名读取两个它读不到的对象定义:sys_business_unit(来自每个对象都带的隐藏系统字段 owning_business_unit_id)和 sys_comment_reaction(评论表情的存储探测)。服务端一行未改。
  • 为什么改:元数据门只把对象定义给读检查放行的调用者,对成员这两个对象都按"不存在"答 404;这个答案是对的(成员默认权限集没有这两个对象的读,也没有 schemaReadDelegate),错在页面去问,控制台于是每开一页就报两条 404。
  • 风险与回滚:隐藏的查找字段不再预读目标定义,对所有人生效,但没有任何单元格画隐藏字段;表情探测只对"已加载权限且无读权"的调用者跳过,走的仍是原来 404 带去的那条路。回滚即还原本 PR。
  • 先看:ui/packages/app-shell/src/console/appObjectScope.ts 的 lookupTargetNames(隐藏字段跳过);RecordDetailView.tsx 的 reactionReadRefused。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/appObjectScope-12811.test.tsx packages/app-shell/src/views/RecordDetailView.feedGrant-12082.test.tsx,预期全绿,其中 objectstack#33343 的两个 describe 共五例。
  • 需要你做的:无,席位落地。

What changes

A member opening a stock record page logged 404 on GET /api/v1/meta/object/sys_business_unit and GET /api/v1/meta/object/sys_comment_reaction (item approvals.record-page-decisions, sweep row 160).

The rule these answers follow. Under ADR-0106 as amended by ruling record 6787890900, the metadata door serves an object's definition only to a caller the object read check admits, and answers anyone else as if the object did not exist. Decision 6840464379 (the approval-request definitions) added one exception: an object whose owner declares schemaReadDelegate is served, field-projected, to the callers that owner's own door serves its rows to. Read at origin/main ba35dfd7: no shipped member set names sys_business_unit or sys_comment_reaction (member_default names neither; the showcase grants sys_business_unit read only to its field-ops delegate set), and neither object declares a delegate (only sys_approval_request and sys_approval_action do). Neither has an own door serving its rows to a member either: reaction rows come only through the data door and the record-page payload, both under the caller's grant. So both 404s are the rule's answer, the member must not be served these definitions, and the fix is on the page: it stops asking.

Where the page asked, and what changes.

  • sys_business_unit: the record and list routes ask, by name, the definitions of their object's lookup targets, for the cells that link and name them (lookupTargetNames, appObjectScope.ts). The platform adds owning_business_unit_id (and organization_id) to objects as hidden: true system lookups, so every route asked sys_business_unit (and sys_organization) for a field no cell draws. lookupTargetNames now skips a field declared hidden: true. This holds for every caller: the definitions were never drawn, so an administrator's page loses nothing but two requests.
  • sys_comment_reaction: the record view asks whether the deployment has the object to choose where reactions are stored (useObjectPresence), and the absent answer takes the column store. A caller whose loaded grants hold no read on the object is now not asked and takes that same store directly: the server could only have answered absent. With no permission provider mounted (every grant reads open) the page asks as before; a caller who holds the read asks as before.

No server answer changes and nothing a caller sees on the page changes.

Tests

  • appObjectScope-12811.test.tsx, new top-level describe objectstack#33343 — a hidden lookup asks no definition of its target: the route asks object/sys_user (the drawn owner lookup) and never sys_organization / sys_business_unit behind hidden lookups; CONTROL: the same lookups un-hidden ask all three targets.
  • RecordDetailView.feedGrant-12082.test.tsx, new top-level describe: a caller with no read on sys_comment_reaction asks the registry nothing about it and reads no reaction rows; CONTROL: a caller holding the read asks it and the records store reads its rows; CONTROL: no permission provider asks as before.

Acceptance notes

  • Pre-existing, not changed here (reported, not filed): on a framework that has sys_comment_reaction, a member with no grant on it lands on the column store (today through the 404, now directly). That store offers the reaction control on sys_comment update, which member_default grants, and a click writes the retired sys_comment.reactions column. Whether a member should hold reactions at all (a member_default line beside the sys_comment one) or the column store should be dropped is a decision, listed in the report.
  • A visible lookup to an object a member cannot read still asks its target by name and is answered 404; that is outside this card's two objects.

Verification

All readings at head e7b95eff, server code identical to origin/main ba35dfd7 (the diff touches ui/ and one changeset only).

Premise, live: a fresh showcase boot, an invited member bound to showcase_contributor and showcase_finance, and the seeded admin
  • GET /api/v1/meta/object/NAME, member / admin: sys_business_unit 404 / 200, sys_comment_reaction 404 / 200, sys_organization 200 / 200, sys_user 200 / 200, sys_comment 200 / 200, showcase_project 200 / 200, sys_approval_action (an object the rule withholds) 404 / 200.
  • Member GET /api/v1/meta/object?names=sys_business_unit,sys_comment_reaction,sys_user lists sys_user only.
  • Member data door: sys_business_unit 403 PERMISSION_DENIED, sys_comment_reaction 403 PERMISSION_DENIED, sys_comment 200.
  • The member's served showcase_project carries organization_id (sys_organization, hidden true) and owning_business_unit_id (sys_business_unit, hidden true) beside the drawn owner_id / created_by / updated_by / account lookups.
  • The pre-existing column-store note above: the member's PATCH /api/v1/data/sys_comment/ID with reactions answers 400 INVALID_FIELD; a POST /api/v1/data/sys_comment_reaction answers 403.
Suites and ablations
  • pnpm --dir ui exec vitest run over appObjectScope-12811.test.tsx, RecordDetailView.feedGrant-12082.test.tsx, RecordDetailView.reactionRecords-12078.test.tsx: Test Files 3 passed (3), Tests 43 passed (43).
  • Ablation 1 (scripts/ablation-replace.mjs, the hidden === true skip deleted): the hidden-lookup pin fails, expected [ 'object?package=app.crm', …(3) ] to deeply equal [ 'object?package=app.crm', …(1) ], 1 failed / 7 passed; restored, blob equals HEAD, git diff HEAD empty.
  • Ablation 2 (reactionReadRefused forced false): the refused-caller pin fails, expected [ 'sys_comment_reaction', …(5) ] to not include 'sys_comment_reaction', 1 failed / 24 passed; restored, blob equals HEAD.
  • Local gates, each exit 0: check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check:nul-bytes, check:changeset-fixed, check:cross-package-test-inputs.
  • CI on this head: every run check-run green, including Test UI (all shards), Type Check UI, Lint UI, Lint & Repo Gates, Test Core, Build & E2E UI, Live E2E UI.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn

…or nothing draws

The record route asked the targets of hidden system lookups (organization_id,
owning_business_unit_id) by name, and the record view asked the reaction
object's presence of a caller whose grants hold no read on it; the metadata
door answers both as absent for such a caller, so a member logged 404s on
every record page.

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

Copy link
Copy Markdown
Contributor Author

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

Request: review · area E1 · head e7b95ef · 2026-11-14T23:21Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4cwxS1ZpSu2hAMRcqbt · head e7b95ef · 2026-11-14T23:24Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Review — PASS

Head-sha: e7b95effb8c2b09602797d01e200d5ccde0fb046
Reviewed-by: session_016WV4cwxS1ZpSu2hAMRcqbt (review#1, area-lease pilot E1)
Contract: no contract face touched (UI only, @object-ui/app-shell patch). Clause-② no and Metadata-protocol none are correct: no authorable key, schema or server answer moves.

What I checked

  • lookupTargetNames skipping hidden: true: the served scope anchors are stamped hidden: true (packages/spec/src/data/injected-system-column-provenance.ts, objectql registry), and no surface this scope serves draws a hidden field (ObjectGrid drawer, isObjectFieldVisible, default column derivation all drop it). The test pins both arms (hidden asks only sys_user; CONTROL with hidden false asks all three).
  • useObjectPresence('') when the read is refused: names-only scope skips an empty name (if (!name ...) continue in readObjectScope), so no request; inside a packaged app it reads the package list the route already reads, so no extra request either.
  • No permission provider: the default context reports isLoaded: false, so the page asks as before. Pinned by the third test.

Nit (non-blocking, no change needed in this PR)

  • On a cold deep link while MePermissionsProvider is still loading, isLoaded is false on the first render, so a member can still send one meta/object/sys_comment_reaction read before the grants arrive (immediately on the names-only path). Waiting on isLoaded would hang the no-provider case, since both read isLoaded: false. If the cold-load 404 matters, a follow-up could expose a provider-mounted signal from @object-ui/permissions. Navigation inside the app, the reported path, is fixed.

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

ACCEPT · area E1 · 2026-11-14T23:24Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 23:25
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 549bb2f Nov 15, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-E1-33343 branch November 15, 2026 02:51
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…where sys_comment still declares the column (objectstack-ai#33591)

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

Fixes objectstack-ai#33521

Clause-②: no
Metadata-protocol: none

**Stacked on objectstack-ai#33499** (branch `claude/area-E1-33343`, head e7b95ef,
not merged when this was opened): this branch was cut from it, so until
objectstack-ai#33499 lands the diff below also shows its two commits. The commits of
this PR are the last three.

## 维护者速读

- 改了什么:记录页讨论区里,对 `sys_comment_reaction`
没有读权限的用户不再看到表情回应按钮;只有在框架确实没有该对象(`sys_comment` 仍声明 `reactions` 列,如 cloud
的 v17)时才走旧的列写入路径。
- 为什么改:被拒读该对象的用户(自定义权限集、外部/门户用户)原先被引到已退役的 `sys_comment.reactions`
列,每次点击都是 `PATCH` 并得到 `400 INVALID_FIELD`。
- 风险与回滚:只改控制台的存储选择;判断依据是 `sys_comment` 自身的定义是否声明 `reactions`(该列与新对象在同一版本
18.0.0 一退一进)。回滚即还原本 PR 三个提交。
-
先看:`ui/packages/app-shell/src/views/RecordDetailView.tsx`(`reactionStore`
一段与
`declaresReactionsColumn`)、`ui/packages/app-shell/src/hooks/useObjectPresence.ts`(新增
`definition`)、`RecordDetailView.feedGrant-12082.test.tsx` 末尾的新 describe。
- 两分钟验证:在 `ui/` 下 `pnpm exec vitest run
packages/app-shell/src/views/RecordDetailView.feedGrant-12082.test.tsx`,预期
29 个用例全绿,其中 objectstack-ai#33521 的四个(两个被拒、两个 CONTROL)。
- 需要你做的:无,席位落地(须待 objectstack-ai#33499 先合并)。

## What changes

- **Store pick** (`RecordDetailView.tsx`): the reaction store was
`column` whenever `sys_comment_reaction` could not be read (refused by
the loaded grants, or answered absent by the registry). A refusal and an
undeployed object read alike: the metadata door answers a refused
caller's definition read as absent, and grants name neither. The page
now reads `sys_comment`'s own served definition in that case and takes
`column` only where it declares `reactions`. The column left
`sys_comment` in the same release that added `sys_comment_reaction`
(plugin-audit 18.0.0, migration entry
`sys-comment-reactions-column-retired`), so a definition that declares
it is a framework without the object, and one that does not refuses a
write naming it. Anywhere else the store is `none`: no reaction control,
no reaction read, no reaction request.
- **Hook** (`useObjectPresence.ts`): the reading also carries the
object's served `definition` when it is present (additive, optional
field), so the page reads `sys_comment`'s fields without a second
registry read. The `sys_comment` definition is asked only when the
reaction object is unread.
- No server change, no new signal: the signals are the loaded grants,
the reaction object's meta answer, and `sys_comment`'s meta answer.

## Tests

New top-level describe in the shared harness
`RecordDetailView.feedGrant-12082.test.tsx`:

- refused by grants, on a framework with the object (registry serves
`sys_comment` without `reactions`): no add-reaction control, no stored
chip read off the column, zero `sys_comment` updates naming `reactions`,
zero reaction reads, zero creates;
- no permission provider, registry answers the object absent on the same
framework: no control, no column write;
- CONTROL undeployed (`sys_comment` declares `reactions`): control
offered, the chip click writes `sys_comment` `reactions` once, no
reaction read;
- CONTROL grant held: records store, one reaction read, the click
creates the caller's own `sys_comment_reaction` row, no column write.

Fixture triage: the column-store suites (`reactionRecords-12078` absent
registry, `reactionKeepIds-11019`, `reactionWriteFailure-10899`,
`reactionsCommentRowsOnly-11035`, and `feedGrant-12082`'s column
registry) served a registry with no `sys_comment` at all, a deployment
that never existed. Each now serves the `sys_comment` a pre-18 framework
serves, declaring `reactions` (a missing declaration, not a changed
assertion).

## Acceptance notes

- A refused caller gets no read-only counts: reading them needs read on
`sys_comment_reaction`, which is exactly what the caller lacks, so there
is nothing to show.
- After objectstack-ai#33584 a stock member holds read on the object and takes the
records store; this change covers every caller still refused and does
not depend on objectstack-ai#33584.
- With no permission provider and no metadata registry that serves
`sys_comment`, the store is `none` (previously `column` only on the
refused-by-grants path): the column write is offered only on evidence
that the column exists.

## Verification

<details><summary>Targeted tests (head b3eecbd, from ui/)</summary>

`pnpm exec vitest run --maxWorkers=2` over the five reaction suites plus
`packages/app-shell/src/hooks`: `Test Files 104 passed (104)`, `Tests
952 passed (952)`; os-verify-lock `VERDICT command-exit 0`.
</details>

<details><summary>Ablation (once, on the committed fix)</summary>

`node scripts/ablation-replace.mjs` replaced the anchor `:
declaresReactionsColumn(commentPresence.definition)` with `: true`
(anchor x1 to x0, blob a63343b to 71513b9976), which is the pre-fix
pick. `feedGrant-12082`: `Tests 2 failed | 27 passed (29)`, the two
refused pins red on `expect(addReaction(view)).toBeNull()` (the control
was offered); both CONTROLs green. Restore: blob equals HEAD a63343b,
`git diff HEAD` empty.
</details>

<details><summary>Typecheck, lint, gates</summary>

- `pnpm --filter @object-ui/app-shell type-check` (src and
tsconfig.test.json): exit 0.
- `eslint --no-inline-config` on the changed ui files: 0 errors.
- `pnpm check:test-source-alias`, `pnpm check:nul-bytes`, `pnpm
check:cross-package-test-inputs`, `check-empty-changeset`,
`check-changeset-no-major`, `check-adr-0087-registration`,
`check-closing-keyword-parity`: exit 0 each.
- The rest of the derived families and the full UI suites are left to CI
(Test UI, Type Check UI, Lint UI).
</details>

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m 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.

2 participants