Skip to content

feat(comments): a member resolves any thread they can read and deletes their own comments, through two server doors (#36186, #36191) - #36200

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-bvfzy8
Nov 22, 2026
Merged

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

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgUH1jEKbDzYRc4nghq

Fixes #36186
Fixes #36191

Clause-②: yes (widening) — @objectstack/plugin-audit's AuditPlugin mounts two new HTTP routes, PUT /api/v1/comments/:id/resolution and DELETE /api/v1/comments/:id, and the resolution stamp reads a system write's provenance.attributedUserId. @objectstack/core's OwnRowDeleteDoor adds the optional refuseRemoval(row, engine, context) (step 7, after the owner check). @object-ui/react's DiscussionContextValue adds the optional ownCommentDeletesOnly; @object-ui/plugin-detail's RecordCommentsData adds the optional ownDeletesOnly, which RecordCommentThreadProps['comments'] may carry; @object-ui/core's affordance-to-grant map adds the row feedCommentDeleteOwn. Nothing existing is removed or re-typed.
Metadata-protocol: none

维护者速读

  • 普通成员现在能给任何自己看得到、也能在上面发评论的评论串点对勾(标成已解决),也能恢复。以前只能点自己发起的串,别人发起的只有管理员能点。点了以后「已由 某某 解决」写的是点的人。这就是你 13:25Z 的裁定 A(能看记录就能解决,门槛和发评论一样)真正生效。
  • 普通成员现在能删自己的评论。以前成员的「更多」里只有编辑。删别人的评论还是不行,能编辑记录也不行;管理员照旧。
  • 自己的评论下面已经有回复(不管是谁回的,自己回的也算),就不能删(可以改文字)。原因:平台删一条顶层评论时会把下面的回复各自变成独立的串,等于改动了别人的评论,这不符合你 21:59Z 的裁定(别人的评论删不了)。座位核过,认为这是裁定本身的结论,不再单独问你。管理员有删除权限,删法和以前一样。
  • 评论的文字照旧只有作者能改。平台的底线规则、删除权限一行没动:两个新的服务端入口各只做一件事(一个只改「已解决」,一个只删自己的那一行)。走原来的数据接口,成员改别人评论、改别人的「已解决」、删任何评论,仍然是 403。
  • 只能看评论、不能发评论的人(比如只给了只读权限的外部成员),点不了对勾,控制台也不显示对勾。审核指出裁定 A 里同时写了「能看记录的人」和「和发评论同一道门槛」,座位定了按后者,较窄。普通成员都能发评论,所以对他们没有区别;能发评论的外部成员照样能点。
  • 已知限制:删评论时「下面有没有回复」的检查和真正删除是两步。如果恰好在这一瞬间有人发了回复,这条回复会变成独立的串,和今天管理员用数据接口删评论时一样。平台的数据引擎没有「条件删除」可以把两步并成一步,套一层事务在默认隔离级别下也挡不住别的请求插进来的回复,所以先写明,不在这次改。

What changes

The resolution door (plugin-audit comment-routes.ts, #36186)

  • PUT /api/v1/comments/:id/resolution, body exactly { "resolved": boolean }. Order: caller (the own-row doors' one composition, ownRowDeleteCallerResolver), anonymous 401, held sign-in 403, any query parameter or other body 400 VALIDATION_ERROR, the comment read AS THE CALLER (object grant + organization wall + the comment read gate; unreadable and unknown both 404 RECORD_NOT_FOUND), the posting gate (the security service's canWriteObject('sys_comment', 'insert', caller): a caller who reads comments but may not post one is 403 PERMISSION_DENIED, a check that throws refuses, and a deployment with no security service has no posting gate either; ruling 7063285032 names "the same gate as posting a comment", contract review F1), a reply 400 (refuseResolutionOnReply, the data door's sentence), then a system write of { is_resolved } alone by id, attributedUserId = caller, the caller's organization kept. Answers 200 { id, is_resolved, resolved_by, resolved_at } read back as stored.
  • stampCommentResolution (comment-resolution.ts): on a system write the resolver is provenance.attributedUserId (the audit writer's own read of the attribution), so resolved_by names the door's caller. A non-system write still stamps its session user; a system write with no attribution still stamps null.
  • Untouched: owner_only_writes, sys_comment_moderation, member_default, the data door's resolve limb (feat(plugin-audit): a comment thread can be marked resolved and reopened #36104). No sys_comment update twin: a row policy cannot scope a column, so one would also admit a member's edit of a colleague's words, which ruling 7069889899 keeps author-only.

The own-comment delete door (same file, #36191)

  • DELETE /api/v1/comments/:id on @objectstack/core's shared own-row delete door; owner column author_id. Another member's comment 403 PERMISSION_DENIED, even for a record editor (the moderator's delete stays the data door's, behind the delete grant).
  • Step 7, new in the kit: OwnRowDeleteDoor.refuseRemoval, asked after the owner check. The comment door's refuses a comment with any reply under it (a system read of parent_id = id), 409 DELETE_RESTRICTED: parent_id is a lookup that clears on delete, so the removal would turn each reply into a thread of its own, a rewrite of other members' rows. The other three doors on the kit declare none and are unchanged. Known limit (contract review F2): the reply check and the removal are two engine calls and the data engine offers no conditional delete to join them (wrapping both in a transaction would not close it either: at the stores' default isolation another request's reply insert still lands between the probe and the delete), so a reply posted within that one request is promoted to a thread of its own, the same result as an administrator's data-door delete today; stated in the module doc.
  • Both doors mount beside the unreact door (mountCommentDoors, renamed from mountUnreactDoor); one warn names all three routes when no HTTP server is registered. Ledger rows in comment-route-ledger.ts (gap: the console is the consumer, the SDK has no method), with their conformance test; scripts/check-route-envelope.mjs declares the module.

Console (RecordDetailView, plugin-detail, react, core)

  • ✓ calls the resolution door and is offered on every thread, the viewer's and anyone else's, under the sys_comment create grant (the door's posting gate), wherever the rows store resolution; it no longer depends on updatesOthersComments. The explain probe of a foreign sys_comment update stays, and gates Edit on someone else's comment alone.
  • Delete: with the sys_comment delete grant, the data door as before (others' comments included where the viewer moderates). Without it, the new affordance row feedCommentDeleteOwn (grant: 'create', as feedReactionRemove) hands Delete over, it calls the own-comment door, and the host sets ownCommentDeletesOnly: CommentThread and the legacy CommentBody then offer Delete on the viewer's own comments with no reply and on nobody else's, whatever moderatesComments says. So the panel offers exactly what the doors admit.
  • handleResolveComment's jsdoc says what the write is now (L2 S-D1 on feat(record-page): the comment panel resolves, reopens and filters threads and counts the unresolved ones; ✓ and Edit on others' comments appear only where the server admits them (#36075) #36178). affordanceGrantMap-12082: handleResolveComment is no longer a data-source write site (its row is gone); feedCommentDeleteOwn is in the grant table.

Prose: plugin-detail.mdx (Delete wording; ✓ on every thread; the own-comment door). The two unreleased notes of #36104 (36071-comment-threads-resolved.md) and #36178 (36075-comments-resolved.md) stay as written; the new changeset 36186-36191-comment-doors.md ends with one sentence for each, naming the line it replaces.

Why

Ruling 7063285032 (any reader may resolve) never reached a rank-and-file member: the row floor runs before the comment hook (L1-c HOLD 7068026256, readings in #36178). Ruling 7069889899 kept comment text author-only, which rules out loosening the floor for update, and added the own-comment delete (member_default may carry no delete bit, ADR-0090 D5). Shape agreed in the premise read and the seat's claims 7069978538 / 7069989751.

Verification

  • plugin-security comment-doors.integration.test.ts (16 cases, real kernel + SecurityPlugin with the shipped sets + AuditPlugin + the real caller resolution, SQLite, two plain org_member principals, an org_admin and two org_external principals with explicit grants): member resolves and reopens a colleague's thread (200, resolved_by = member, cleared on reopen); data door unchanged (member's body, is_resolved, { is_resolved, body } on a colleague's comment all 403); reply 400; unreadable = unknown 404; anonymous 401, query and every malformed body 400; own delete 200; colleague's 403 and stays; own comment with a reply 409, root and reply unchanged; own reply 200; own comment on an unreadable record 404; an external who reads the thread but may not post is 403 on resolve and still reads the comment, an external who may post resolves (200); member's data-door delete of their own still 403; admin resolves through the data door (floor does not bind) and the comment rule still decides edits.

  • plugin-audit: comment-routes.test.ts (mount, pre-engine answers, the write's exact shape and context; +4 for the posting gate: refused 403 with no write, a throwing check refuses, an unreadable comment still 404 before the gate, a poster resolves), comment-resolution.test.ts (+2: attribution stamps a system write; never outranks a session user), comment-route-ledger.conformance.test.ts; unreact ledger unchanged. core: own-row-delete-routes.test.ts (+3: step 7 refuses before any removal, runs only after the owner check, resolving admits).

  • UI: RecordDetailView.commentsResolved-36075 also pins no ✓ for a viewer without the sys_comment create grant. CommentsPanel.resolved-36075 (✓ on others' threads without the floor verdict; own-door Delete matrix), RecordDetailView.commentsResolved-36075 (✓ → door URL and body, no data-source update; refused ✓; member without delete grant deletes through the door, none on others', none on own-with-reply; refused door delete), RecordDetailView.feedCommentEditDelete-12268 (the no-delete-grant pin now asserts the door, plus own-with-reply). Local: app-shell comment/feed/discussion/reaction/explain RecordDetailView files + all of plugin-detail + react context: 437 files, 4067 passed.

  • Typecheck: plugin-audit, core, plugin-security clean. check-route-envelope, check-single-authz-resolver green. check-governed-merges --test on the file list: not governed.

  • Rig readings, CRM dev server (objectstack dev --fresh). Before: the feat(record-page): the comment panel resolves, reopens and filters threads and counts the unresolved ones; ✓ and Edit on others' comments appear only where the server admits them (#36075) #36178 hold readings at a2dc85896 (reader and a record editor, both plain org members). After: this branch at dd9f5571; a fresh rig is invite_only now, so the admin creates both members through POST /api/v1/auth/admin/create-user, the reader with viewer_readonly and the record editor with crm_sales_user.

    Reading Before After
    Member resolves the admin's thread data API 403 PERMISSION_DENIED door 200, resolved_by = the member
    Member resolves a colleague's thread / reopens it data API 403 door 200 / 200, resolved_by and resolved_at cleared
    Member resolves a reply n/a door 400 VALIDATION_ERROR
    Member's data-API is_resolved on the admin's thread 403 403 (unchanged)
    Record editor edits a member's comment (data API) 403 403 (unchanged)
    Member edits the admin's comment 403 403 (unchanged)
    Member deletes own comment, data API 403 403 (unchanged)
    Member deletes own comment, door n/a 200 { deleted: true }
    Member deletes a colleague's comment, door n/a 403 PERMISSION_DENIED
    Member deletes own comment with a reply, door n/a 409 DELETE_RESTRICTED, root and reply kept
    Colleague deletes that reply, door; member then deletes the root n/a 200, then 200
    Admin edits / resolves / deletes a member's comment (data API) 200 200 / 200 / 200 (unchanged)

    Rows left on the record afterwards: the admin's thread (resolved by the member), the record editor's thread (reopened); nothing else. Script and report: build-seat1/36186-36191/rig/doors.cjs, doors-report.json in the project files.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (No packages/spec change.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the touched files: 0 errors.)
  • 4. One issue, one branch off an up-to-date main, one pull request. (Two folded cards, one Fixes line each.)
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English. (The 维护者速读 section is the maintainer's Chinese summary, as on this seat's other PRs.)
  • The Before Submitting list in CONTRIBUTING.md is done.

Follow-ups

  • None filed. A "comment deleted" placeholder that would let an author remove a comment that has replies is a product question of its own (needs a stored marker), not in scope. Contract review F3 (the console asks the create grant for own-comment Delete while the door asks none) is left as is, consistent with feedReactionRemove.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUH1jEKbDzYRc4nghq

@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/core, @objectstack/plugin-audit, touching 43 documentable anchor(s).

50 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json af2361ee85bf5e3d2192f9f69467bed67270f188.

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

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: PERMISSION_DENIED (literal, 56 pages)
  • 9 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 67 of 249 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 48 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json af2361ee85bf5e3d2192f9f69467bed67270f188 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 2a2015e717a66880688bb131e4bee10a86807f73 — the merge of head 6069a983f8f880e1a7f0b423abe2efe21fd258c8 into base af2361ee85bf5e3d2192f9f69467bed67270f188, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2a2015e717a66880688bb131e4bee10a86807f73 && git checkout 2a2015e717a66880688bb131e4bee10a86807f73
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin af2361ee85bf5e3d2192f9f69467bed67270f188 6069a983f8f880e1a7f0b423abe2efe21fd258c8 && git checkout -B drift-repro af2361ee85bf5e3d2192f9f69467bed67270f188 && git merge --no-ff 6069a983f8f880e1a7f0b423abe2efe21fd258c8

node scripts/docs-audit/affected-docs.mjs --json af2361ee85bf5e3d2192f9f69467bed67270f188

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs af2361ee85bf5e3d2192f9f69467bed67270f188 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

… points to it

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUH1jEKbDzYRc4nghq
…the resolver with the audit writer's precedence

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUH1jEKbDzYRc4nghq
… resolution door's write

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUH1jEKbDzYRc4nghq
…eaves an unhandled rejection

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUH1jEKbDzYRc4nghq
…ry their corrections in this PR's own note

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-22T00:27Z. The brief handed to the isolated declaration-face reviewer for PR #36200 (owed by Clause-②: yes (widening): two new comment routes, the OwnRowDeleteDoor hook, and optional UI props). The seat raises the tier to CONTRACT_REVIEW_TIER because the routes are permission doors. The record follows as its own comment.

Contract review brief — PR #36200 @ 591de69037c4f208f98198bc09b270dcb1dd6e7b (cards #36186 and #36191)

You review at CONTRACT_REVIEW_TIER (the seat raises the tier: these are permission doors). Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face declaration — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· cards #36186 and #36191: its body and EVERY comment (rulings and earlier records included)
· also epic #36062 (body); the maintainer ruling 7069889899 on #36186 (both answers: comment text stays author-only; a resolve door; an own-row delete door), ruling 7063285032 on #36071 (anyone who can read the record may resolve and reopen a thread), the seat claims on #36186 and #36191, merged PRs #36178 and #36104 (bodies only), for context; ruling A on changeset levels (level follows the Metadata-protocol line; a Clause-② widening alone ships patch)
· Security: judge every door against the ruling — the resolve door writes only is_resolved / resolved_by / resolved_at after checking the caller can read the parent record; the delete door removes only the caller's own row; owner_only_writes and sys_comment_moderation are unchanged; no other field or row opens. Any widening beyond the ruling is a must-fix. Do NOT write security details beyond what the PR already states publicly.
· PR #36200: its body, its file list, and the net diff against main at 591de69037c4f208f98198bc09b270dcb1dd6e7b
· the check-runs on 591de69037c4f208f98198bc09b270dcb1dd6e7b: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-36200/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

你定的两条评论权限,这个 PR 在服务端真正落实了,我读的部分没有发现问题:
① 能看到记录的人都能给任何一串评论点「已解决」,也能恢复;「已由 某某 解决」写的是点的人。新加的入口只改「已解决」这一项,评论文字照旧只有作者能改。
② 普通成员能删自己的评论,删不了别人的,能编辑记录也一样。自己的评论下面已经有回复的不能删(还可以改文字),这样就不会动到别人的回复。
平台原有的底线规则和权限设置一行没动,走原来的数据接口,结果和以前完全一样。开发环境里的实测结果(之前被拒的现在通过,该拒的照旧拒)都写在正文里。
另外提醒一点:这个 PR 合进去以后,手机评论页 #36208 有一条新测试的预期会变,那边合主干时要顺手改。
L1 结论:通过。

席位核对 — ACCEPT (L1-c) · repo:objectstack#1 · head 591de690 · 2026-11-22T00:31Z

Card: Fixes #36186, Fixes #36191 (folded; seat claims 7069978538 / 7069989751). Rulings 7063285032 (option A) and 7069889899. Declarations: Clause-②: yes (widening), Metadata-protocol: none. Not governed. 25 files, +1559 / −122.

Gates:

  • CI is 63 success · 11 expected skip on 591de690, and mergeable is clean.
  • The branch is 12 behind main, and a trial merge is textually clean.
  • l1-face FLAGGED two items, both accepted:
    • Fixes #36191 is the fold.
    • changeset for @objectstack/plugin-security (comment-doors.integration.test.ts) and @object-ui/plugin-form (affordanceGrantMap-12082.test.tsx): both are test-only, so nothing ships.

The doors against ruling 7069889899

  • Resolution door (comment-routes.ts). The steps, in order:

    1. The caller, through the own-row doors' composition, with the 503 and API-key refusals.
    2. Anonymous: 401.
    3. A held sign-in: 403.
    4. Exactly { resolved: boolean } with no query: anything else is 400.
    5. The comment read as the caller: object grant, organization wall and the comment read gate, so an unreadable comment and an unknown id are the same 404.
    6. A reply is 400, through the data door's own refuseResolutionOnReply.

    Then one system update of { is_resolved } alone, by id, with attributedUserId set to the caller and the caller's tenant kept, and a read-back. Nothing but the one column is written, and nothing is written before every refusal is past.

    • This is the ruling's "dedicated resolve door": the floor is untouched, and there is no sys_comment update twin. The module doc states correctly why a twin is not possible (a row policy cannot scope a column).
    • External readers of the thread pass step 5, as the seat confirmed against option A's text.
  • stampCommentResolution. The resolver is session.userId ?? provenance.attributedUserId, the audit writer's precedence. A session user still wins, and a system write with no attribution still stamps null. There is one side effect to know about, not a defect: any other system write that carries an attribution (a flow acting for a user) now names that user as resolved_by where it named null. That reads as the truer record.

  • Own-comment delete door. It is the shared kit, with ownerField: 'author_id' (stamped and read-only), so another member's comment is 403 even for a record editor, and the moderator's delete stays the data door's.

    • The new step 7 of OwnRowDeleteDoor, refuseRemoval, runs after the owner check and before any removal. The other three doors declare none, so they are unchanged. own-row-delete-routes.test.ts gains 3 cases.
    • The comment door's step 7 is a system read of parent_id = id, giving 409 DELETE_RESTRICTED. It follows from the ruling (parent_id clears on delete, so the replies would become threads of their own), and the seat confirmed it as option B.
  • Routes. There is no collision with the unreact door (/comments/reactions/:id has a different segment count). A PUT /comments/reactions/resolution would only read a comment id reactions and answer 404. The ledger rows are gap, with their conformance test, and check-route-envelope declares the module.

  • Proof on the real floor. This is what feat(plugin-audit): a comment thread can be marked resolved and reopened #36104 lacked, and what my feat(record-page): the comment panel resolves, reopens and filters threads and counts the unresolved ones; ✓ and Edit on others' comments appear only where the server admits them (#36075) #36178 HOLD asked for.

    • comment-doors.integration.test.ts has 14 cases on a real kernel with SecurityPlugin and the shipped sets, SQLite, two plain org_member principals and an org_admin. Among them: a member's data-door body, is_resolved, and { is_resolved, body } on a colleague's comment are all still 403. That is the ruling's required test.
    • The rig table repeats the HOLD readings before and after, with both members plain org members.

The console against what the doors admit

Cross-PR, for the seat: #36208 after this lands

#36208 (approved at e7d93e69) lands after this PR. On the combined tree, its new CommentsPage.test.tsx case "the press engages before the hold opens…" asserts the sheet is ['delete'] before the verdict, for Grace's root c2 (resolved: false, onResolveComment given).

Nit (does not block)

  • The changeset says "A comment others replied to stays", and the docs say "someone has replied to". The door refuses any reply under the comment, the author's own included (findOne({ parent_id })), as the body's own table says ("own comment with a reply"). "A comment with any reply under it" would be exact.

L1 never replaces L2. The contract L2 (brief 7071567186) is the seat's.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 591de69037c4f208f98198bc09b270dcb1dd6e7b
Local-runs: none

PR #36200 (cards #36186 and #36191), declaration face, tier raised by the seat because the PR adds two permission doors. Read: both cards with every comment, rulings 7069889899 and 7063285032, epic #36062, the bodies of #36104 and #36178, the PR body, its 25-path file list, the net diff against main (merge base 6c7c6db2), and the check-runs on the head. Code outside the diff was read to judge the doors, not reviewed.

① Derived judgments

Judged against the rulings, door by door.

  • Resolution door, PUT /api/v1/comments/:id/resolution: right. Body is exactly one boolean key, any query parameter or other body is refused before the engine is touched. The comment is read as the caller, so the object grant, the organization wall and the comment read gate (parent record readable) decide, and unreadable answers as unknown. A reply is refused. The one write is is_resolved by id; resolved_by and resolved_at come from the existing stamp hook and nothing else is in the payload. The body-edit stamp fires only on a changed body, so a resolve does not mark the comment edited. The answer carries the four resolution fields only. This is ruling 7063285032 inside the limits ruling 7069889899 set: no sys_comment update twin, comment text stays author-only.
  • stampCommentResolution reading provenance.attributedUserId: right. The session user still wins; the attribution is read only when the write names no session user, and it is set server-side by the door, never by a client. No other writer in the plugin sets is_resolved true under an attributed system context (the reopen hook writes false, which clears the stamp), so no existing stamp changes.
  • Own-comment delete door, DELETE /api/v1/comments/:id: right. It is the shared own-row kit unchanged in steps 1 to 6: read as the caller, then the structural author_id equals caller check, which is the only thing that admits the removal. author_id is platform-stamped and read-only, the right owner column. Another member's comment is refused even for a record editor, as ruled.
  • Kit step 7, OwnRowDeleteDoor.refuseRemoval: right, and it only narrows. Optional, asked after the owner check and before the removal; the three existing doors declare none and are byte-for-byte the same path. The comment door's refusal (a reply exists under the comment) runs as a bare system read, which sees every reply regardless of the caller's read scope, so it errs toward refusing. Other rows keyed to a comment: reactions and attachments hold id columns with no delete behaviour, so the removal touches no other member's row; parent_id is the only lookup onto sys_comment.
  • Floor and grants: unchanged, confirmed in the diff. default-permission-sets.ts is not in the file list: owner_only_writes, sys_comment_moderation and member_default are untouched, and so is the data door's resolve limb. The only plugin-security path is the new integration test, which pins the data door's 403s beside the doors' 200s on the shipped sets.
  • Caller resolution: right. Both doors share the kit's one composition (session or API key, OAuth withheld, anonymous fail-closed, held sign-in refused). The resolution handler repeats the kit's steps 1 to 4 in the same order.
  • Public surface, each additive and optional: right. OwnRowDeleteDoor.refuseRemoval (@objectstack/core); DiscussionContextValue.ownCommentDeletesOnly (@object-ui/react); RecordCommentsData.ownDeletesOnly and its key on RecordCommentThreadProps['comments'] (@object-ui/plugin-detail); affordance row feedCommentDeleteOwn (@object-ui/core). plugin-audit's index is not in the diff, so the door module's exports stay package-internal. Two ledger rows (gap, console is the consumer) with a conformance test; check-route-envelope declares the module.
  • Changed meaning of an existing prop: right, and not a narrowing. The panel now draws the resolve control on every thread whenever the host passes onResolveComment, where it used to need updatesOthersComments for others' threads. Both the old meaning (feat(plugin-audit): a comment thread can be marked resolved and reopened #36104, feat(record-page): the comment panel resolves, reopens and filters threads and counts the unresolved ones; ✓ and Edit on others' comments appear only where the server admits them (#36075) #36178) and the new one are unreleased in the same release, the jsdoc states the host's new precondition, and the changeset carries the correction lines for both earlier notes.
  • Console: right. Resolve always goes through the door; Delete goes through the data API with the delete grant and through the door without it, and ownCommentDeletesOnly keeps the offer to exactly what the door admits (own, no reply). A refused door call rejects and leaves the row.

② Semver level

  • Changeset 36186-36191-comment-doors.md: patch on @objectstack/plugin-audit, @objectstack/core, @object-ui/app-shell, @object-ui/plugin-detail, @object-ui/react, @object-ui/core. These are the six packages whose shipped source changes; plugin-security and plugin-form change tests only and are correctly absent.
  • Clause-②: yes (widening) on the PR body and in the changeset, same sentence, and it names every surface the diff adds (two routes, the attribution read, refuseRemoval, the two optional UI members, the affordance row). Nothing is removed or re-typed, so no narrowing arm applies.
  • Metadata-protocol: none is right: no packages/spec path, no schema, no stored-metadata shape. Under ruling A the level follows that line, and a Clause-② widening alone ships patch. Level stands.
  • Check Changeset is green on the head.

③ Boundary flags

  • Dev flag, own comment with replies answers 409 (card comments: an ordinary member cannot delete their own comment; add an own-row delete door (maintainer ruling 7069889899) #36191 item 2): answered, stands. The card asked the PR to decide and state it; it does, in the maintainer summary and the changeset. It is the narrower of the available readings (the alternative clears parent_id on other members' replies through a system write), it follows ruling 7069889899's "not others'", and it is reversible by a later card. Administrators are unchanged.
  • Dev flag, external members who can read a thread may resolve it: answered, stands. Ruling 7063285032 says anyone who can see the record. An external member reaches sys_comment only through an explicit grant and then passes the same read gates.
  • F1, should-fix, escalate to the maintainer, not blocking. The door asks for a readable comment and no sys_comment write grant. Ruling 7063285032 reads "anyone who can see the record", and adds "the same gate as posting a comment". The two agree for every stock member, who holds comment create. They part for a principal that reads comments but holds no create on sys_comment (a deployment that grants a read-only set alone, or an external grant of read only): that principal cannot post, and can resolve through the door. The door follows the ruling's headline and the PR states "whoever can read the thread", so this is inside the ruling as written; the maintainer should confirm the headline is meant for a caller with no comment write grant, or the door should also ask the create grant. No test in the PR covers this principal either way.
  • F2, should-fix, not blocking. The reply check and the removal are two statements with no shared transaction or re-check. A reply posted between them has its parent_id cleared by the system delete, which is the rewrite of another member's row that step 7 exists to prevent. The window is one request wide and the result is what an administrator's delete does today, so it does not widen who may delete what; it should be closed (one transaction, or a store-level refusal on the lookup for this path) or stated as a known limit.
  • F3, nit. feedCommentDeleteOwn asks the create grant while the door asks none, so the console is narrower than the server for a read-only viewer who somehow authored a comment. Harmless, and consistent with feedReactionRemove.
  • SQL push-down: no finding. The doors add a by-id findOne as the caller, a one-row findOne on parent_id as the existence probe, a by-id update, a by-id read-back and the kit's by-id delete. No id set is materialised and nothing is joined in the application. The panel's reply test reads rows it already holds.
  • Open questions: none left. The PR files no follow-up; the "deleted comment placeholder" it mentions is a product question outside both cards.
  • Check-runs on the head: every run completed, none failed. Green: Test Core and its 10 shards, Test UI and its 16 shards, TypeScript Type Check and the four Type Check lanes, Lint and Repo Gates and every Lint lane including Lint PM dispatch-gates, Build Core, Build Docs, Build and E2E UI, Live E2E UI, Dogfood Regression Gate, Check Changeset, Check PR Size, Check Documentation Links, Spec property liveness, Governed Surface Queue Guard, PR-body guards. Skipped, as expected outside the merge queue or as opt-in: Queue verdict, Borrowed queue verdict, UI Published Artifacts, Temporal Conformance, Dogfood Verify CLI, the Dogfood shard template row, Packed-tarball smoke, 18.x upgrade harness. No legacy commit status is reported.

No must-fix: neither door opens a field or a row beyond the rulings, and the floor and the moderation policy are unchanged.

Implemented-by: claude/project-thread-bvfzy8
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

…ent with any reply is the one the delete door keeps

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

这一轮把「谁能点已解决」收窄到和你的裁定原文完全一致:能看到记录、并且能在这里发评论的人,才能点。只能看、不能发评论的人(比如纯只读的外部账号)点了会被拒,界面上也不再给他们显示对勾。普通成员都能发评论,所以对他们没有变化。删评论那边的说明改成了「下面有回复就不能删,不管回复是谁写的」。
上一轮我把裁定读成「能看就能点」,漏了「和发评论同一个门槛」这半句,这次改过来是对的。
L1 结论:通过。

席位核对 — ACCEPT (L1-c, delta) · repo:objectstack#1 · head 6069a983 · 2026-11-22T01:13Z

Delta read: 591de690..6069a983, one commit, 12 files, +205 / −31. My ACCEPT 7071609534 stands for everything outside this delta.

Gates: CI is 63 success · 11 expected skip on 6069a983, and mergeable is clean.

F1: the posting gate (the resolution door's new step 6)

  • What it does. After the as-caller read, and only if that read succeeds (so an unreadable comment is still the same 404 as an unknown id), the door asks the security service canWriteObject('sys_comment', 'insert', context). Anything but true, or a throw, is 403 PERMISSION_DENIED, and nothing is written. The service is read per request (getSecurity), and a deployment with no security service admits, as posting does there.

  • Why it is right. Ruling 7063285032 says "anyone who can see the record … the same gate as posting a comment". My previous record read only the first half, and called a read-only external reader's ✓ consistent with option A. The door now requires both halves:

    • the record-level part of posting (can read the record) is step 5;
    • the object-level part (the sys_comment insert grant) is step 6.

    For every stock member, who posts, nothing changes.

  • The narrowing. canWriteObject's contract ("nothing here may be used to widen") is respected: the door uses it only to refuse.

  • Tests:

    • comment-routes.test.ts +4 cases: refused is 403 and the check is asked with ('sys_comment', 'insert', caller); a throw refuses; an unreadable comment is 404 before the gate is asked; a poster resolves.
    • comment-doors.integration.test.ts, on the real kernel and security service: an external who reads the thread but may not post gets 403 and can still read it; an external who may post resolves.
  • The console follows it. onResolveComment is now handed over only under feedGates.comment (the feedComment create grant). That is the same object-level answer, so ✓ shows exactly where the door says 200. The new app-shell case pins no ✓ without the comment grant.

F2 and the wording

  • The delete door's reply check and the removal are two engine calls, and the engine has no conditional delete. That one-request window is now written down in the module doc, with its consequence: a reply posted in that window is promoted, as under an admin's data-door delete today. This is acceptable as documented.
  • My nit is taken up in all four places: the changeset, plugin-detail.mdx, the door's error text, and the component docs. A comment "that has replies stays, whoever wrote them".
  • The changeset's ✓ lines now name the create grant. Read sentence by sentence, and accurate.

For #36208 (unchanged by this delta)

The heads-up in 7071609534 still applies, with one refinement. After this PR, ✓ in #36208's CommentsPage.test.tsx case depends on onResolveComment being handed over, and that test's provider passes it directly. So the first expectation still becomes ['resolve', 'delete'].

L1 never replaces L2. The contract L2 delta is the seat's.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6069a983f8f880e1a7f0b423abe2efe21fd258c8
Local-runs: none

Delta read of PR #36200 after the PASS record 7071618612 on 591de690. The new head is one commit on top of that head (6069a983, 12 paths), and only that commit was read, with the current PR body and the check-runs on the new head. Everything the earlier record judged outside this commit stands as written there. Code outside the diff was read to judge the new check, not reviewed.

① Derived judgments

  • F1 is closed: right. After the comment is read as the caller and before the reply refusal, the resolution door now asks the security service's own object-level answer for a sys_comment insert by that caller (canWriteObject). Anything but a definite true is 403 PERMISSION_DENIED, a check that throws included, and nothing is written. That is the narrower reading of ruling 7063285032 ("the same gate as posting a comment"), so a principal who reads comments and may not post one no longer resolves. Every stock member holds comment create, so the ruled behaviour for them is unchanged.
  • The new check opens nothing: right. It only adds a refusal to a path that already admitted; no branch that refused before admits now. It runs after the read, so an unreadable comment still answers as an unknown id and the new 403 is given only to a caller who can already read the thread. It is the same method the engine's write gate asks, not a second spelling of the rule, and it is itself fail-closed on an unresolvable answer. It is asked with the caller's own context and no payload, so it reads the caller class, the capability gate and the object create grant; the organization wall for this caller has already been applied by the read in the step before.
  • No security service registered admits, as stated: right. With none, the data API has no object gate on posting either, so the door is no wider than posting there. This is what the PR body says.
  • Console: right. The resolve control is handed over only under the comment create affordance (feedComment), the same grant the door asks, so the panel offers what the door admits. One new console test pins that a viewer who reads but may not post is offered none.
  • Public surface in this commit: none new outside the package. CommentPostingGate and the optional getSecurity dependency live in the door module, which the package index does not export. The engine-double-contract pin moves from 1 to 2 for the test double the new unit tests add.
  • Tests: right for the claim. Four unit tests (refused with no write, a throwing check refuses, unreadable still 404 ahead of the gate, a poster resolves) and two integration cases on the real kernel with the shipped sets (an external member who reads and may not post is refused and still reads; an external member who may post resolves).
  • Wording, "has replies": right. The changeset, plugin-detail.mdx, the refusal message and the comments now say a comment that has replies is kept, whoever wrote them, which is what the door does (the probe does not ask who wrote the reply).

② Semver level

  • Unchanged and still right: patch on the same six packages, Clause-②: yes (widening), Metadata-protocol: none. This commit narrows a route that has never shipped, inside the PR that adds it, so no narrowing arm applies. The changeset's resolve bullet and its console bullet now state the posting gate and the create grant.
  • Check Changeset is green on the new head.

③ Boundary flags

  • F1: closed by this commit, as above. No maintainer escalation is left on it: the door now satisfies both sentences of the ruling.
  • F2, disclosure: accurate in the module doc, one clause wrong in the PR body. Stays open as a stated known limit, not blocking. The module doc says the reply check and the removal are two engine calls, the engine offers no conditional delete to join them, and a reply posted in the one request between them becomes a thread of its own, as under an administrator's data-API delete today. That is accurate, and so is "one request wide". The PR body adds "or transaction", which is not accurate: the engine does expose transaction() and other plugins use it. See F4.
  • F4, should-fix, new, prose only, not blocking. Correct the PR body's F2 sentence. The true reason is that the engine has no conditional delete, and a transaction at the stores' default isolation would not stop a reply inserted by another request between the probe and the delete, so wrapping the two calls would not close the window on every driver. As written the body states a platform fact that is false. The module doc needs no change.
  • F3, nit, unchanged. feedCommentDeleteOwn asks the create grant where the delete door asks none; the reason is in the PR body. With this commit the resolve control and the resolve door now agree exactly, so F3 is the only place the console is narrower than a door.
  • F5, nit, new. The posting gate is skipped when the registered security service carries no canWriteObject, or when a composer mounts the doors without getSecurity. AuditPlugin always passes it and plugin-security's service always serves the method, so no shipped composition reaches either case; a one-line note in the dependency's jsdoc that omission admits would do.
  • SQL push-down: no finding. The commit adds no engine read: the gate is an in-memory grant answer over the caller's resolved sets.
  • Check-runs on the new head: every run completed, none failed (63 success, 11 skipped). Green includes Test Core and its shards, Test UI and its shards, the Type Check and Lint lanes, Build Core, Build Docs, Build and E2E UI, Live E2E UI, Dogfood Regression Gate, Check Changeset, Governed Surface Queue Guard and the PR-body guards. Skipped are the merge-queue and opt-in runs, as on the earlier head. No legacy commit status is reported.

No must-fix. The commit narrows the resolution door to the ruling's posting gate and changes nothing else that admits.

Implemented-by: claude/project-thread-bvfzy8
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6069a983f8f880e1a7f0b423abe2efe21fd258c8
Local-runs: none

Delta read of PR #36200 after the PASS delta record on this same head. The head has not moved; only the PR body changed, and only its F2 sentence was re-read. Everything the two earlier records judged stands as written there.

① Derived judgments

  • No code, changeset or doc path changed, so no derived judgment moves.

② Semver level

  • Unchanged: patch on the same six packages, Clause-②: yes (widening), Metadata-protocol: none.

③ Boundary flags

  • F4: closed. The PR body's known-limit sentence now says the data engine offers no conditional delete to join the reply check and the removal, and that wrapping both in a transaction would not close the window, because at the stores' default isolation another request's reply insert still lands between the probe and the delete. The false "no transaction" clause is gone, and the sentence now agrees with the module doc.
  • F2: stays a stated known limit, one request wide, accurately disclosed in the module doc and the PR body.
  • F1: closed, as recorded on this head.
  • F3 and F5: nits, accepted as they are.
  • Check-runs on this head are as the earlier delta record read them: every run completed, none failed.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-bvfzy8
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-22T01:18Z · #36186 + #36191, the two comment doors the maintainer ruled (7069889899): anyone who can read the record and may post a comment can mark a thread resolved and reopen it, through a door that writes only the resolution; a member can delete their own comment while it has no replies. Comment text stays author-only for ordinary members; the row floor and the moderation grant are unchanged. The console offers ✓ and own-row Delete exactly where the doors admit.

Reviews:

  • L1-c: ACCEPT 7071609534 on 591de69; delta ACCEPT 7072069675 on this head.
  • Contract L2 (declaration face, raised to CONTRACT_REVIEW_TIER for permission doors): PASS 7071618612 on 591de69; delta PASS 7072077051 on this head (F1 closed: the resolve door also asks the posting gate, the seat's narrower reading of ruling 7063285032, told to the maintainer); F4 (PR body prose) closed in 7072100916 on this head. F2 (one-request window between the reply check and the removal, as an admin delete today) is disclosed; F3 and F5 left as accepted nits.

Gates on this head (6069a983):

  • check-governed-merges --pr 36200 reads NOT governed (1,855 changed lines).
  • K = 13 first-parent commits since the merge base, read by hand; no translations/ or skills/ path.
  • All check-runs on their latest runs are success or skipped; the Check Changeset re-run from the body edit is read green before this stroke.
  • Changeset: six packages at patch, Clause-②: yes (widening), Metadata-protocol: none (ruling A); the two earlier notes are restored and corrected inside this PR's own note.

The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #36186 and Fixes #36191. #36208 (#36076) merges main after this one.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 01:18
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit d12ac84 Nov 22, 2026
79 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-bvfzy8 branch November 22, 2026 01:48
os-sales pushed a commit that referenced this pull request Nov 22, 2026
…ad, Delete behind the own-comment door (#36076)

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…hreads first, replies inside, the box docked at the foot, a long press for actions (objectstack-ai#36076) (objectstack-ai#36208)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuLteuRKBSRXDK9REnG68QAD)_

repo:objectstack#1 · os-sales · session_01L6bhgTfxZyB5T41DdoPaBy

Fixes objectstack-ai#36076

Clause-②: yes (widening) — `@object-ui/plugin-detail` exports
`CommentsPage` and `CommentsPageProps`; `CommentThread` takes a third
`mode` (`'page'`) and optional `itemInteraction`, `heldId` and
`onHeldActions`; `CommentItem` an optional `interactionProps`;
`CommentComposer` and `RichTextCommentInput` an optional `layout`
(`'default' | 'phone'`). `@object-ui/app-shell` reserves the console URL
parameter `comments` (`RECORD_COMMENTS_PARAM`, listed in
`RESERVED_URL_PARAMS`). `@object-ui/i18n` gains four `detail.*` keys in
every pack. Nothing is removed or re-typed; the desktop is unchanged.
Metadata-protocol: none

## 维护者速读

- 手机上打开一条记录,右上角多了评论图标,旁边是未解决的评论串数。点了进**整页**评论,盖在记录页上;左上「‹
记录名」或系统返回键回到记录页,记录页滚到哪还在哪(实测返回前后都是 74)。
- **两层**:列表只列第一层评论,有回复的下面是回复人头像加「N 条回复」;点一条进这一串,原评论在上,回复按时间往下,左上「‹
评论」回列表。
-
**输入框固定在屏幕底部**,键盘弹起时站在键盘上面。平时一行,点了展开,下面一排:提到人、加粗、斜体、列表、代码,右边发送。在列表里发的是新评论,在一串里发的是回复(两个框各留各的草稿)。页面上没有「Ctrl+Enter」字样。
-
**长按一条评论**(或系统的长按菜单),从底部升起面板:第一行六个表情,下面「标记已解决」(只在第一层)、「编辑」「删除」(红色,点了先确认)。每一项出现的条件和电脑端悬停那排完全一样,手机没有另判权限。
- 列表右上角筛选:「显示已解决」「只看我参与的」,和电脑端同一个菜单。手机上「动态」页签只剩系统记录。
- **删除的门**:objectstack-ai#36186+objectstack-ai#36191
已合并并合入本分支。手机长按面板和电脑端用同一套判定:普通成员能删自己没有回复的评论,能给自己看得到的任何评论串标记已解决。
- 不改电脑端,不改任何权限和服务端。

## What changes

**The phone's comment page** (`@object-ui/plugin-detail`,
`src/comments/`)

- `CommentsPage`: a full-screen page (`role="dialog"`, fixed over the
host) that reads `useRecordComments()`, the same discussion, writes and
gates as the desktop panel. Props: `threadId` (`null` = the list),
`onOpenThread`, `onBack`, `backLabel`, `onEngage`.
- The list draws each thread with `CommentThread mode="summary"`; a tap
on a comment outside its own controls, Enter on a focused comment, or
its 「N 条回复」 opens the thread. A thread that is not held (deleted, stale
link) shows the list.
- The thread draws `CommentThread mode="page"` (new): its comment, then
every reply, with no reply box of its own; 「回复」 there puts the caret in
the docked box.
- Two docked `CommentComposer layout="phone"` boxes (list and reply),
each keeping its own draft; the list's stays mounted while a thread is
open, so its draft and the list's scroll survive a visit to a thread.
- The page follows the on-screen keyboard through `visualViewport` (top
and height while the keyboard covers more than 80 px), the same reading
as `PhoneListPanels`' sheet; the inline style is positional only.
- Esc returns one level (`data-owns-escape`); the focus lands on 「‹」
when a level opens.
- `useCommentPress`: 500 ms hold, cancelled past 10 px of travel; the
click that ends a hold is swallowed. `onPressStart` fires at the press
itself (pointer down, context menu, Enter/Space), and the page hands it
`onEngage`, so the host's question about the comment's actions is on the
wire before the hold completes. `contextmenu` opens the same sheet
(Android's own long press, the keyboard's menu key, a right click). One
record of the press serves every comment.
- `CommentActionSheet` (vaul `Drawer`): six reactions (the viewer's own
marked `aria-pressed`), then Mark resolved / Reopen, Edit, Delete
(destructive). A row is drawn only where the comment's
`CommentItemActions` hands its handler: these are the object
`CommentThread.actionsOf` builds for the desktop's hover row, so every
gate is the thread's. The sheet is never a snapshot of the press:
`CommentThread` takes `heldId` and reports the held comment's current
actions to `onHeldActions` each time what they offer changes, so a
verdict that lands while the sheet is up adds its rows (L1-c REWORK
7070700220). A comment with no action raises nothing.
- `CommentsFilterMenu`: the desktop panel's filter menu, extracted
unchanged so both surfaces draw the same one.
- `CommentItem.interactionProps`: spread on the comment's box with
`select-none` and no iOS callout, except while it is being edited.
- `RichTextCommentInput layout="phone"`: the editor first, then one row
(mention, bold, italic, list, code; send at the right end, round, 44
px), no preview, the names without their shortcut (`detail.formatBold`,
`detail.formatItalic`), 16 px text. A press on the row keeps the caret
(and the keyboard) in the box. The default layout is untouched.

**The record page** (`@object-ui/app-shell`)

- `commentsPageOffered` in `RecordDetailView`: the same rule as
`commentsPanelOffered` (feeds on, a standard page, a record id) on a
phone and not embedded. `commentsSurfaceOffered` (either one) now drives
what `commentsPanelOffered` drove: the discussion rides the open's
payload, the 动态 stream gives the comments up
(`RecordCommentsInPanelContext`) and its count leaves them out.
- `?comments=` (list) / `?comments=<id>` (thread), read from the router:
opening and a thread push an entry flagged `__commentsPushed` in history
state (the entry's other state kept); 「‹」 pops a flagged entry and
otherwise replaces the URL one level up (a reload or a shared link). The
page is mounted inside the record's `DiscussionContextProvider`, over
the record, which stays mounted, so nothing is read again and the scroll
is kept. Closing returns the focus to the top bar's comments icon.
- The phone's `RecordTopBar` gets the `comments` slot (`CommentsButton`
at 44 px).
- The explain probes: `moderatesComments` is asked while the panel or
the page is open; `updatesOthersComments` on the first press on a
comment (the page's `onEngage`, fired at pointer down), as on the
desktop's first reach into the panel. Opening the record asks nothing
more.

**Strings**: `detail.addReactionEmoji`, `detail.commentThread`,
`detail.formatBold`, `detail.formatItalic` in all eleven packs (zh-Hant
regenerated) and the provider-less defaults; the rest reuse existing
keys (`detail.sendComment` already existed).

**Docs**: `content/docs/frontend/plugins/plugin-detail.mdx` (### On a
phone) and the plugin-detail README (### The phone's comment page).

**Pending release notes**: `.changeset/36075-record-comments-panel.md`
(from objectstack-ai#36114) is left as it stands on main. Its line "the phone keeps
the comments in its 动态 tab" is answered in this PR's own changeset,
which says that on a phone the comments live on the phone's page and
that this replaces that line. `36075-comments-resolved.md` ("…and the
phone keep their feed as before") is left as it stands too; the same
sentence of this PR's changeset answers it.

## Small calls made here (dev-thread rule, Sales 22:19:27Z)

1. The full page is a URL parameter over the record route, not a new
route: the record stays mounted (no re-read, scroll kept), precedent
`?related=`.
2. No 「回复」 row in the long-press sheet: in a thread the docked box is
the reply; in the list a tap opens the thread.
3. No 「预览」 on the phone toolbar; the card's row lists mention, bold,
italic, list, code and send.
4. The filter is the desktop's dropdown, not a bottom sheet.
5. A long press on a comment with no available action opens nothing (a
read-only discussion).
6. Thread title 「评论串」; the list keeps 「评论」.

## Overlap

- objectstack-ai#36136 (wide-screen pinned details): MERGED (48c732c) and merged into
this branch; the only conflict was the `@object-ui/plugin-detail` import
line in `RecordDetailView.tsx` (main's list plus `CommentsPage`). After
the merge `tsc` for app-shell is clean and every `RecordDetailView.*`
and `plugin-detail/src/comments` test passes (103 files, 873 tests), as
does `i18n` (105 files).
- objectstack-ai#36200 (objectstack-ai#36186+objectstack-ai#36191 comment doors): MERGED (d12ac84) and merged
into this branch with no conflict. The phone sheet draws from the same
`actionsOf`, so it takes the new ✓ gate (any thread the viewer reads)
and the own-comment delete door (`ownCommentDeletesOnly`: own comment
with no reply only) with no code change; one CommentsPage test
expectation moved from `['delete']` to `['resolve','delete']`, and a new
test pins the door on the phone sheet.
- objectstack-ai#36151 (phone record bottom bar, not pushed yet) and objectstack-ai#36147: same
file, different blocks.

## Verification

**New tests (all pass)**

- `plugin-detail/src/comments/CommentsPage.test.tsx` (18): the list
shows top-level comments with 「2 replies」, no reply; a tap on a comment
or its count opens the thread, a tap on a reaction is the reaction's;
Enter opens; 「‹」 names the record; the docked box writes a comment,
toolbar order @ B I list code Send, no 「Ctrl」 in the page; a thread
shows comment then replies and replies to its comment; a missing thread
shows the list; the list draft survives a thread visit; long press on
own comment: 6 reactions (own one pressed), resolve, edit, delete, and
the release opens nothing, `onEngage` once; another's comment: no edit
or delete; a reply: no resolve; a sheet reaction toggles, Delete reaches
the host; a press that travels is a scroll; contextmenu opens the sheet;
read-only raises nothing and docks no box; a moderator's press on
another's comment engages at pointer down, the sheet opens with Mark
resolved and Delete, and when `updatesOthersComments` turns true with
the sheet up Edit joins (fails on the pre-fix head); behind the
own-comment delete door Delete is on the viewer's own reply only, not on
their comment with replies nor on another's reply; resolved threads
hidden by default with the filter offered.
- `app-shell/src/views/RecordDetailView.commentsPanel-36075.test.tsx`,
new top-level describe (6), the real `RecordDetailView` at 375: the
top-bar icon with 「2」, a press pushes `?comments=` (flagged) and draws
the list over the still-mounted record; tap → `?comments=c-ada` with the
reply, 「‹」 → list → record, focus on the icon; a link straight to a
thread: 「‹」 replaces one level up twice; the 动态 tab draws no comment and
no 「Ctrl」; no icon with feeds off; a moderator's first long press on
Grace's comment with the `sys_comment` explain answered late: no comment
explain before the press, asked at the press, the sheet shows Delete,
then Edit and Delete once the answer lands (fails on the pre-fix head).

**Local runs** (after merging main `cbd582f4`): every
`app-shell/src/views/RecordDetailView.*`, `plugin-detail/src/comments`
and `i18n` test file, 209 files, 2,830 tests pass. Before the merge, a
wider set (all `RecordDetailView.*`, `recordCommentsPanel*`,
`ObjectView.phone*`, `app-shell/src/__tests__`, all of `plugin-detail`
and `i18n`): 640 files, 6,991 tests pass. `tsc` (src and tests) clean
for plugin-detail and app-shell. ESLint on the changed files: 0 errors
(warnings only of the kinds already in these files).
`overlap-check.mjs`: clean against main; objectstack-ai#36136 conflict as above. After
the L1-c fix: all of `plugin-detail` (405 files, 3,745 tests) and the
host comments file (16 tests) pass; ESLint 0 errors on the touched
files.

**Browser evidence** (CRM example on `objectstack dev --fresh`, console
on Vite from this branch, zh-CN, 375×812 touch, light and dark;
seat-side folder `/mnt/project-files/build-seat1/36076/`, script and
readings in its README)

| Shot | Reading |
|---|---|
| Record page | icon 「3」 at the top bar's right |
| List | 「‹ Globex Ltd」 · 评论 · filter; three first-level comments, 「2
条回复」 under the first |
| Thread | comment, then both replies; URL `?comments=<id>` |
| Composer expanded | @ B I list code, round send at the right; the
box's bottom at 812 (the viewport's) |
| Long press, own comment | six reactions, 标记已解决, 编辑, 删除 (red) |
| After 👍 | 「👍 1」 under the comment, marked as own |
| Back to the record | scrollTop 74 before, 74 after |
| 动态 tab | 「动态 (0)」, no comment, no box |

Not shown in the browser (the run's only account is an administrator,
who moderates): a member's long press on someone else's comment; pinned
by the unit test above. The iOS keyboard cannot be emulated in headless
Chromium.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes on the changed files.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English (the 维护者速读 block is the
maintainer's summary, in the maintainer's language).

Branch name is the harness-assigned `claude/project-thread-uzlelf`.

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

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

https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgTfxZyB5T41DdoPaBy -->

---------

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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants