Skip to content

feat(plugin-audit): a comment thread can be marked resolved and reopened - #36104

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

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

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #36071

repo:objectstack#1 · os-sales · session_01L6bhgUJ3ExTXMikbrPFNqD

Clause-②: yes (widening)
Metadata-protocol: none
Flow: dev-thread rule (maintainer 2026-11-20 09:22:50Z 「所有 p1 都按照新规则执行」): the card thread builds itself; L1 and the isolated L2 run in parallel at hand-back.

维护者速读

  • 用户能看到什么变化:后端准备好了「已解决」:一串评论可以标记已解决、再恢复,记下谁解决的、什么时候;往已解决的串里回复会自动恢复。界面在评论栏卡里做,这个改动本身用户看不到。
  • 为什么做:评论重做专题第一阶段,评论栏的未解决数字和「显示已解决」「只看我参与的」筛选都靠它。
  • 出错会怎样:最坏是一串讨论被误收起,可以再点恢复,任何人回一句也会自动恢复;评论的文字不受影响;能直接撤回这个改动。
  • 要你做什么:无(「能看记录的人就能标记」已在 13:25 选定)。

What changes

sys_comment gains the resolution of a thread. A thread is one top-level comment (no parent_id) together with its replies; its state lives on the top-level row.

Field Type Written by
is_resolved boolean, default false the caller, on a top-level comment only
resolved_by lookup sys_user, readonly the platform: the session user when is_resolved turns true, cleared when it turns false
resolved_at datetime, readonly the platform: the server clock, same rule
  • Resolve / reopen = PATCH the top-level comment through the data API with { "is_resolved": true } or false. Resolving an already-resolved thread changes nothing (the first resolver stays).
  • Who may (maintainer ruling record 7063285032, option A, reviewed before the decision in the project's fable review): anyone who may comment on the record may resolve and reopen its threads. An update that changes nothing but is_resolved (beside the row id and the platform stamps updated_at, updated_by, resolved_by, resolved_at) is authorized by the rule that admits a new comment — the caller can read the record the thread is on — instead of the author-or-record-editor rule. This is the one, deliberate widening. Any other field beside it still needs the comment's author or an editor of the record. A caller who cannot read the record gets the platform's not-visible refusal (PERMISSION_DENIED / 403); a thread naming no record is resolvable by its author only.
  • Only a thread is resolved: an update naming is_resolved on a reply is refused, VALIDATION_ERROR / 400 (field is_resolved), its author and a record editor included. The refusal runs after the access gate, so a caller who cannot read the record meets the not-visible refusal (PERMISSION_DENIED / 403) instead, and the 400 never confirms that a reply exists. A reply's own fields stay editable as before.
  • A new comment is unresolved: on create the platform sets is_resolved: false and clears resolved_by / resolved_at over a client's values.
  • A reply reopens its thread: after a reply is inserted (afterInsert), when its thread's top-level comment is resolved, the platform updates it back to is_resolved: false (system write; the stamp clears the resolver and time). A historical import (preserveAudit) does not reopen. A reopen that fails is logged at error with the consequence and the fix; the reply stands.
  • Activity: resolving or reopening writes no entry on the record's activity tab. The comment's own update is recorded as every comment write is (audit ledger plus an activity row whose parent is the comment, per the maintainer ruling on [Decision] Actions taken while impersonating a user are recorded only under that user #30213), and the record timeline never draws those.
  • Stored rows: no migration. The SQL column default is false (applyDeclaredColumnDefault), so existing rows read unresolved, and is_resolved: { $ne: true } also matches a row with no value (pinned below with a NULL row).
  • Where: the new packages/plugins/plugin-audit/src/comment-resolution.ts holds the stamp, the reply refusal, the resolution-only predicate, the reopen hook and the "involving me" rule; comment-access-hooks.ts wires them (the resolution limb of the update gate, the create-side clear, the registrations). audit-writers.ts changes by one word: parseCommentMentions is exported so the involving-me rule reads mentions exactly as the mention notifier does.

For the comment panel (#36075): field names and query shapes

All through the existing comment read gate, as the caller:

  • The record's threads — the panel already reads the record's whole discussion in one read (the record page's discussion part, "no page size"; or GET /data/sys_comment with thread_id = OBJECT:ID). Group by parent_id; the top-level rows carry is_resolved, resolved_by, resolved_at.
  • Unresolved threads only (top-level rows): { object_name: OBJECT, record_id: ID, parent_id: null, is_resolved: { $ne: true } } — one statement. Resolved only: same with is_resolved: true.
  • Unresolved-thread count (the icon's number): count of that same filter — one COUNT. For 3 threads with 1 resolved it answers 2 (pinned).
  • ⛔ Not { parent_id: { is_resolved: … } } to fetch replies of open threads: sys_comment carries an object-scoped read middleware, so the engine reads ids under a cap instead of a subquery. Filter the loaded replies by their thread instead.
  • "Involving me" — no server query in phase 1 (the review's implementation choice: the panel holds the whole thread set, and the query engine serves no condition that selects a parent row by its children). The rule, exported as threadsInvolvingUser(rows, userId) and pinned in comment-resolution.test.ts: a thread (identified by its top-level comment's id) involves the user when
    1. the top-level comment's author_id is the user (started it), or
    2. any reply in the thread has author_id the user (replied), or
    3. the user's id is in the mentions of the top-level comment or of any reply (a JSON array of ids, or of { id } objects; unparseable reads as none) — including a user who never wrote in the thread.
      A reply belongs to the thread reached by following parent_id through the loaded rows; a reply whose chain leaves the loaded set is in no thread. The rule ignores resolution; compose it with the resolved filter.
  • Phase 2's cross-record "involving me" query (the view-wide feed) needs its own decision: an engine condition selecting parents by children, or a platform-kept participant list.

Tests

  • comment-resolution.integration.test.ts (new; real kernel, ObjectQL, AuditPlugin, SQLite): stamp and clear with the server clock; a client's resolver/time replaced by the stamp, or stripped and reported in droppedFields without one; first resolver kept; new comment unresolved; reply refusal on the wire (mapDataError → 400 VALIDATION_ERROR, nothing written); a reply reopens a resolved thread; a reply into an open thread and a new top-level comment change nothing; filter + count (3 threads, 1 resolved → 2); a NULL row reads unresolved; no new row on the record's activity stream. Its engine options are typed, not erased to any.
  • comment-access-hooks.test.ts (new top-level describe, sharing double that denies edit): a reader resolves and reopens another user's thread without the parent-edit question; the stamps beside it keep it resolution-only; the same reader with body or mentions beside is_resolved (and a bare body edit) is refused 403 RECORD_NOT_ACCESSIBLE; a non-reader gets 403 PERMISSION_DENIED; a dangling thread is its author's only; a multi-row resolution needs every row; reply refusal for author, editor and reader, and the not-visible refusal (not the 400) for a non-reader on a reply; create clears a client's resolution.
  • comment-resolution.test.ts (new): the involving-me rule (started, replied, nested reply, mentioned on root, mentioned in a reply only, others' threads, orphan reply, unknown user); isResolutionOnlyUpdate; the stamp's import, system and non-boolean arms; the reopen failure logged at error; an import does not reopen.
Readings (implementation at 77b2fb8; gate fixes through cf75b3f; L1-a S1 at e062ef2)
  • pnpm --filter @objectstack/plugin-audit test at 77b2fb8: Test Files 106 passed (106), Tests 1761 passed (1761). The two later commits touch only the reply refusal's error-code constant and the new rig's option casts; at cf75b3f the three resolution suites pass (21 unit/hook + the rig), tsc and check:test-typecheck exit 0.
  • Ablation, each with the implementation committed, mutated on disk by scripts/ablation-replace.mjs and restored (git diff HEAD empty after): gate limb off → 2 red; reopen registration deleted → 1 red; reply refusal deleted → 2 red; stamp registration deleted → 3 red. Tests import src directly, so no dist leg applies.
  • node scripts/check-i18n-bundles.mjs --filter=audit: in sync (21 bundles); the three fields carry real text in all ten locales, so no source-hash record is written for them.
  • L1-a S1 (7064443655), e062ef2: the reply refusal moved below the access gate, plus the non-reader case. comment-access-hooks.test.ts + resolution suites: 98 passed; ablation (refusal put back ahead of the gate) turns the new case red, file restored; plugin-audit typecheck exit 0; check:error-status-conformance exit 0. 0af5783 adds the create-without-edit sentence to the changeset.
  • node scripts/pm/overlap-check.mjs at e062ef2: clean against main and feat(plugin-audit): a reply in a comment thread notifies the thread's starter and earlier repliers #36098 (shares audit-writers.ts).
  • node scripts/pm/check-governed-merges.mjs --test on the file list: 0 governed paths.
  • Gates this PR had turned red, each fixed on this branch and re-measured green locally:
    • check:error-status-conformance (CI job "Lint · docs & code guards" on 77b2fb8). An earlier version of this body called its findings pre-existing; that was wrong — it exits 0 on main. The cause was this PR: a local const code: StandardErrorCode = 'VALIDATION_ERROR' in the reply refusal, which the status deriver resolves by name across files, so other files' code readings landed on it. Fixed at 79ad713 by naming the code once at module level (RESOLUTION_ON_REPLY_CODE); the gate exits 0, unresolved count back to main's.
    • check:query-options-erasure: the new rig's seven as any casts on engine options raised the test surface 236 → 242. Fixed at cf75b3f (the bags type-check as declared); the ratchet holds at 236.
    • check:tenant-audit-census: red on the new reopen write; green after regenerating docs/audits/…/plugins/plugin-audit.md (one new elevated update of sys_comment).
    • check:logger-receiver-detach: green after the reopen's error log calls through the property.
  • Not measurable in this checkout, left to CI: check:dts-closure and check:dual-build-cjs-loads (need a whole-repo build, PREREQUISITE NOT MET), check-plugin-teardown-shape --self-test (shallow clone cannot reach its pinned fixture commit).

Acceptance notes

  • A custom permission set that grants create but not edit on sys_comment can post but not resolve: resolving is an update at the object level. member_default grants edit.
  • Portal or guest users who can read a record and comment can also resolve its threads under option A (named in the review; not measured whether such deployments exist).
  • Re-pointing a reply's parent_id into a resolved thread does not reopen it; only an inserted reply does.
  • Resolving is recorded on the comment's own audit trail, by the resolver; the reopen a reply triggers is a system write.

Verification

pnpm --filter @objectstack/plugin-audit exec vitest run src/comment-resolution.integration.test.ts — 10 passed, including "a reply posted into a resolved thread reopens it" and the 3-threads-1-resolved count of 2.


Generated by Claude Code

@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 1 package(s): @objectstack/plugin-audit, touching 37 documentable anchor(s).

75 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 3543b51d37b41086275dacf91e7a29cb8c67da8b.

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

Coarse fallback — 12 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 3543b51d37b41086275dacf91e7a29cb8c67da8b → packageMentionDocs.

Which tree this was computed on

This run read content/docs from d9e4b23660d7d0ed2386f50bb2dc9a2f2369c0bc — the merge of head 5733151ebc8d9b9f727455e903f13068ff2f447f into base 3543b51d37b41086275dacf91e7a29cb8c67da8b, 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 d9e4b23660d7d0ed2386f50bb2dc9a2f2369c0bc && git checkout d9e4b23660d7d0ed2386f50bb2dc9a2f2369c0bc
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3543b51d37b41086275dacf91e7a29cb8c67da8b 5733151ebc8d9b9f727455e903f13068ff2f447f && git checkout -B drift-repro 3543b51d37b41086275dacf91e7a29cb8c67da8b && git merge --no-ff 5733151ebc8d9b9f727455e903f13068ff2f447f

node scripts/docs-audit/affected-docs.mjs --json 3543b51d37b41086275dacf91e7a29cb8c67da8b

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

@objectstack-fleet
objectstack-fleet Bot requested a review from os-sales November 21, 2026 14:02
…r reads it alone (#36071)

A local named code was read by check:error-status-conformance's name-based
resolution as the code of other files' code variables, reporting 403 and 422
VALIDATION_ERROR producers that are not.

Claude-Session: https://claude.ai/code/session_01L6bhgUJ3ExTXMikbrPFNqD
Co-authored-by: Claude <noreply@anthropic.com>
…an erase them (#36071)

The query-options erasure ratchet holds the test surface at 236; the new
rig's seven `as any` casts on engine options raised it to 242. The bags
type-check as declared, so the casts go.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUJ3ExTXMikbrPFNqD
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T14:49Z. The brief handed to the isolated declaration-face reviewer for PR #36104 (owed by the claim's Clause-②: yes (widening) line, 7063231860 on #36071). The record follows as its own comment.

Contract review brief — PR #36104 @ cf75b3ffb28c7b72ac476034c939b9c3e68f6bf9 (card #36071)

You review at TIER_DEFAULT. 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:
· card #36071: its body and EVERY comment (rulings and earlier records included)
· also epic #36062 (body only) and sibling card #36075 (the desktop panel that will show the resolved state): bodies only, for context. The maintainer ruling 7063285032 on #36071 (anyone who can read the record may resolve and unresolve) is the basis for the permission widening; judge the gate against that ruling, no wider
· PR #36104: its body, its file list, and the net diff against main at cf75b3ffb28c7b72ac476034c939b9c3e68f6bf9
· the check-runs on cf75b3ffb28c7b72ac476034c939b9c3e68f6bf9: 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-36104/ 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_01L6bhgTcFanGhTvqS1V2Q4U

席位核对 — REWORK (L1-a)

维护者速读

「已解决」的后端基本做对了。我对照了你 13:25 的裁定:能看到这条记录的人可以标记和取消已解决。代码给的权限没有比裁定更宽,在两处还更窄:

  • 只放开了「是否已解决」这一项,改任何其他内容仍要作者或能编辑记录的人。
  • 解决人、解决时间由平台填,别人填的不算。
  • 一次改多条时,每一条都要单独过检查。
  • 权限设置里只给了「新建评论」、没给「编辑评论」的人,能发评论但不能标记已解决(正文已写明)。

要改的是一处顺序问题,改动很小:拒绝「对回复标记已解决」的那一步,现在排在权限检查前面。应该挪到权限检查之后,这样看不到这条记录的人,得到的回答和平台其他地方一样。改完我再看一次,不涉及你的决定。

不属于受管面。声明了对外新增(三个新字段),座位还要在同一版本上跑一次 L2。

Head reviewed: cf75b3ffb28c7b72ac476034c939b9c3e68f6bf9. Seven commits, 20 files, +1078/−9. git merge-tree onto current main is clean. check-governed-merges --pr 36104 (PR-head register) reads NOT governed, 0 of 20 paths, 1087 lines. reviewFace with Clause-②: yes (widening) gives face declaration → TIER_DEFAULT, so the seat's declaration L2 on this head is owed. CI is as the seat reported. vitest was not run here (no node_modules).

S1 (small; ordering): the reply refusal runs ahead of the access gate

In comment-access-hooks.ts, beforeUpdate calls refuseResolutionOnReply(rows) as soon as namesResolution(data), before authorizeResolution / authorizeRows.

  • The rows come from resolveTargetRows in system context, so the 400 is answered whatever the caller may read.
  • This module's own rule is that the write door answers a caller the read door hides with the not-visible refusal (security(storage): the attachment gate's delete and update refusals name the parent record to a caller outside the floor's domain who cannot read it #21755, answerNotVisible, refuseNotVisible). The new branch should keep to it.
  • Fix: move the namesResolution(data) && refuseResolutionOnReply(rows) line below the authorization block. For a reply, the resolution-only path then authorizes first. A non-reader gets PERMISSION_DENIED / 403, and a reader, the reply's author or a record editor still gets the 400.
  • Add one case beside "is_resolved on a reply is refused 400": a caller who cannot read the record, is_resolved on a reply, answered 403 PERMISSION_DENIED.

What holds: the gate against ruling 7063285032

  • The widening is the insert rule, nothing broader.
    • authorizeResolution admits a row when the caller is its author, which is the existing update rule (authorizeRows, "authors govern their own words"). Otherwise it admits the row when callerCanRead(ctx, target) holds on the thread's record, the exact predicate onInsert uses to admit a new comment.
    • A thread naming no record has no parent to read, so it is author-only, and other callers get not-visible.
    • Every matched row must pass. resolveTargetRows keeps its unscoped and over-limit refusals.
  • It is narrower than the ruling in two places.
    • The engine's object-level edit on sys_comment still applies before the hook. A set with create but no edit can post but not resolve, which the body names.
    • isResolutionOnlyUpdate admits only is_resolved plus id, updated_at, updated_by, resolved_by and resolved_at:
      • updated_* are stamped from the session by ObjectQL's audit stamp (objectql/src/plugin.ts:2217).
      • resolved_* are readonly, so they are stripped for non-system callers.
      • stampCommentResolution writes them from the session and server clock when the state changes.
      • An unchanged state stamps nothing, which keeps the first resolver.
    • Any other key, including thread_id, falls to the author-or-editor rule, and the re-point check below it still runs.
  • Create. clearClientResolution forces false / null over a client's values. The note above it is right that the create-side readonly strip skips sys_ objects, so this guard is needed.
  • Reopen.
    • afterInsert walks to the root (16 hops) and, only when it reads resolved, sets is_resolved: false in system context, so the stamp clears the resolver.
    • preserveAudit imports are skipped.
    • A failure is logged at error with the consequence and the fix, and the reply stands.
    • Re-pointing does not reopen, as the body says.
  • No activity entries, per card item 7. The comment's own audit and activity rows stand ([Decision] Actions taken while impersonating a user are recorded only under that user #30213), and the integration rig pins that no new row lands on the record's stream.
  • Queries for 评论(一)电脑:评论从「动态」页签拿出来,做成记录页和抽屉右侧的独立评论栏;对一条评论的操作收到一处 #36075. The unresolved filter { …, parent_id: null, is_resolved: { $ne: true } } and its count are one statement each, pinned at 3 threads / 1 resolved → 2. A NULL row reads unresolved, with no migration.
  • "Involving me." threadsInvolvingUser follows parent_id through the loaded set and counts started, replied and mentioned, including mentioned-only, as the card lists. It reads mentions through the notifier's own parseCommentMentions.
  • Clause-② yes (widening) is right. Three fields are added to a published object, plus their translations in all locales, and nothing is removed. The check:error-status-conformance correction (79ad713) and the query-options-erasure surface back at 236 (cf75b3f) are as the seat relayed.

To clear

  • Push the S1 reorder and its case. That needs a delta L1 on the new head.
  • This review does not approve, mark ready, enqueue or request review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: TIER_DEFAULT
Head-sha: cf75b3ffb28c7b72ac476034c939b9c3e68f6bf9
Local-runs: none

Inputs read: card #36071 (body and all five comments: triage, claim, maintainer ruling 7063285032, os-dev-report 7063766421, its amendment 7064070077); epic #36062 and sibling #36075 (bodies, for context); the PR #36104 body, its file list (20 files) and the net diff against main; the check-runs on the head. Every check-run concluded success or skipped. None is failing or pending: Build Core, Test Core 1–10/10, the four Type Check jobs, all Lint jobs (docs & code guards, which carries check:error-status-conformance, and query-options erasure), Check Changeset, Governed Surface Queue Guard, Spec property liveness, Dogfood Regression Gate and Live E2E UI. The UI and docs jobs were skipped because no ui/ or docs path is touched.

① Derived judgments

Accept-set and public-surface changes the diff implies:

  1. sys_comment gains is_resolved, resolved_by and resolved_at. Right. is_resolved is a boolean with default false. resolved_by is a lookup to sys_user and resolved_at is a datetime, and both are readonly. Card item 1 asks for exactly these three fields, and they sit on the existing object as the card's "按现有做法定" leaves to the dev. The PR body states that choice. The default false is the SQL column default, so stored rows read unresolved without a migration. The $ne: true filter also matches a NULL row, which the integration rig pins with a NULL row. Labels and help text are present in all ten locales.
  2. Update gate: the new resolution-only limb. Right, and no wider than ruling 7063285032.
  3. A reply cannot be resolved. Right. An update that names is_resolved on any matched reply row gets VALIDATION_ERROR/400 on field is_resolved, for every non-system caller, including the reply's author and a record editor (card item 4). This check runs before authorization. I looked at whether that order lets a 400 reach a caller who cannot read the record and so disclose the row. It does not: since security(data): a by-id write answers 403 for a row the caller cannot read and 404 for an id that does not exist, for principals the write pre-image check does not bind: an existence signal the read door withholds #21771 the plugin-security by-id pre-image check answers such a caller as if the id did not exist, before this hook runs (see the NOT_VISIBLE_CODE notes in comment-access-hooks.ts). The error code is a module-level StandardErrorCode constant (79ad713), and the status-conformance gate is green on the head.
  4. The platform stamps the resolver and time. Right. stampCommentResolution is a beforeUpdate hook that runs for every caller.
    • When is_resolved turns true it sets resolved_by to the session user and resolved_at to the server clock. When it turns false it clears both.
    • When the value does not change it does nothing, so the first resolver stays.
    • A preserveAudit write keeps the values it supplies.
    • This covers card item 3 and the acceptance line "在请求里自己填解决人:被忽略或拒绝".
  5. A create clears any client resolution. Right. clearClientResolution runs in the create hook: a new comment is unresolved and has no resolver.
  6. A reply reopens its thread. Right. installCommentReplyReopens is an afterInsert hook. It follows parent_id up to the thread's top-level comment and makes a system update that sets is_resolved: false; the stamp then clears the resolver and time. An import (preserveAudit) does not reopen. If the reopen fails, it is logged at error and the reply stands. This is the one new elevated write call site, and the tenant-audit census row for it is regenerated in docs/audits/…/plugin-audit.md.
  7. No activity entries. Right. Card item 7 asks for none. The rig pins that no new row appears on the record's activity stream. The comment's own audit and activity rows (parent = the comment) stay, as ruled on [Decision] Actions taken while impersonating a user are recorded only under that user #30213.
  8. Queries for 评论(一)电脑:评论从「动态」页签拿出来,做成记录页和抽屉右侧的独立评论栏;对一条评论的操作收到一处 #36075. Right.
    • Unresolved threads: { object_name, record_id, parent_id: null, is_resolved: { $ne: true } }. The unresolved count is count on that same filter. The rig pins 3 threads with 1 resolved giving 2.
    • "Involving me" has no server query in phase 1. It is the exported pure rule threadsInvolvingUser(rows, userId) over the thread set the panel already loads, covering started, replied and mentioned-only. That is the implementation choice settled in ruling 7063285032 and stated in the PR body. The card's acceptance line "PR 正文列出新加的字段名和查询方式" is met.
  9. Public surface. Right, additive only.
    • The package index.ts is unchanged, so comment-resolution.ts is internal.
    • parseCommentMentions changes from function to export function in audit-writers.ts. The index re-exports only named members of that module, so the package surface does not change.
    • CommentAccessEngine.update? and CommentAccessLogger.error? are new optional members, which are additive.
    • Nothing is removed or renamed.

Every card acceptance line has a pinned test: top-level resolve stamps; reply refused; non-reader refused; client-filled resolver ignored; reply reopens; both filters, including the mentioned-only case; count 3/1 gives 2; PR body lists the fields and queries.

Nit, no effect on the verdict: the changeset's "Who may" bullet says "anyone who may comment on the record (who can read it)". It does not carry the create-without-edit permission-set caveat the PR body states. That bullet ships as the CHANGELOG line, so the caveat could be added there. It is not required.

② Semver level

  • The changeset is '@objectstack/plugin-audit': patch. The only package the diff publishes from is @objectstack/plugin-audit.
  • Metadata-protocol: none is correct. Nothing changes what a metadata author can write: no spec key, accepted value or metadata type. The new columns are data fields on a platform system object.
  • Under AGENTS.md Post-Task Checklist step 3, none takes patch, so the level is right. Check Changeset is green.
  • Clause-②: yes (widening) appears line-initial in both the PR body and the changeset. It is right: there are new fields, a narrow permission widening, and nothing removed. No (narrowing) arm is owed, so this is not BREAKING and needs no ADR-0087 marker.
  • No packages/spec path or governed path is in the diff, and Governed Surface Queue Guard is green. That confirms the declaration face and TIER_DEFAULT.

③ Boundary flags

  • open_questions: [] in os-dev-report 7063766421. There is nothing to answer.
  • Dev flags (out_of_scope_findings):
  • The two points the claim held for the maintainer: (1) who may resolve, and (2) where "involving me" is computed. Both are answered by ruling 7063285032 (option A), and the build matches it, as ① items 2 and 8 show.
  • Unverified at the dev's report: check:dts-closure, check:dual-build-cjs-loads and check-plugin-teardown-shape --self-test could not run locally. CI answered them: Build Core and the Lint and Type Check jobs on this head are green.
  • Residual, noted and not blocking: the reader-resolves-another-user's-thread path is pinned in the hook test double and in the real-engine rig (RESOLVER is not the AUTHOR). Neither boots plugin-security, so permission sets plus sharing on the full stack are exercised only by the existing write-door tests. sys_comment declares no sharing model of its own: its access comes from the parent through these hooks. So I see no path by which a full-stack row filter would refuse a reader before this limb runs.
  • SQL push-down (Prime Directive 5):
    • The resolved filter and the unresolved count are each one SQL statement. That is pushed down and correct.
    • threadsInvolvingUser is an in-app join over the loaded thread set. A reason is given (the engine has no condition that selects a parent row by its children, and the panel already holds the whole discussion), and ruling 7063285032 rules it for phase 1. Not a finding.
    • The PR body explicitly steers 评论(一)电脑:评论从「动态」页签拿出来,做成记录页和抽屉右侧的独立评论栏;对一条评论的操作收到一处 #36075 away from { parent_id: { is_resolved: … } } because that would materialise ids under the read middleware's cap. That is good guidance.
    • threadRootOf makes at most 16 by-id findOne hops in the reopen hook, and in practice one hop for a direct reply. The bound and the lack of a recursive-CTE seam in the engine justify it. Nit, not a finding.
    • authorizeResolution memoizes callerCanRead per parent record, the same pattern as the existing authorizeRows. No new id materialisation.

Implemented-by: claude/project-thread-5hdmxb
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob (isolated L2 sub-agent of the seat)

VERDICT: PASS

… gate (#36071)

The rows are read in system context, so the 400 ahead of the gate told a
caller who cannot see the record that the reply exists. The gate now
answers first: a non-reader meets the not-visible refusal, and a reader,
the reply's author or a record editor still gets the 400.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUJ3ExTXMikbrPFNqD
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

席位核对 — delta ACCEPT (L1-a)

维护者速读

上一轮要改的顺序问题已经改好:对回复标记已解决的拒绝,现在排在权限检查之后。看不到这条记录的人,得到的是和平台其他地方一样的「不可见」回答。新加了一条测试钉住这一点。changeset 补了一句,说明只有「新建评论」权限的人不能标记已解决。可以通过。

不属于受管面。座位的声明面 L2 增量和 CI 都绿了之后,按普通队列落地,合并后卡 #36071 关闭。

Head reviewed: 0af5783413e81fad67d24ded6ef4eb91ab308963. The delta is cf75b3ff..0af57834, two commits, 3 files, +20/−5. git merge-tree onto current main is clean. check-governed-merges --pr 36104 still reads NOT governed, 0 of 20 paths. The face is unchanged (declaration → TIER_DEFAULT). REWORK 7064443655's "What holds" stands for everything outside this delta.

S1: cleared (e062ef21)

  • if (namesResolution(data)) refuseResolutionOnReply(rows) now runs after the authorizeResolution / authorizeRows block, with a comment saying why (security(storage): the attachment gate's delete and update refusals name the parent record to a caller outside the floor's domain who cannot read it #21755).
  • A caller who cannot read the record is refused by the gate first:
    • On the resolution-only path, callerCanRead fails and the answer is refuseNotVisible.
    • With another key beside it, canEditParent and callerReadsParent fail and the answer is answerNotVisible.
  • A reader, the reply's author or a record editor passes the gate and still gets the 400.
  • New case. Both data shapes from a non-reader on a reply are answered 403 PERMISSION_DENIED. The thread reports that the case goes red with the old order put back.
  • The 400 case's editor fixture now sees the parent. That is right: a resolution-only update goes through authorizeResolution, which asks read and not edit.

0af57834

  • The changeset's "Who may" line now names the create-without-edit case, and says that a non-reader is answered not-visible on a reply too. Both match the code.

Landing terms

  • Not governed. Land it through the ordinary queue on this head's green, after the seat's declaration L2 delta. Fixes #36071 closes the card on merge.
  • A new push needs a delta L1 unless it is a clean main merge.
  • This review does not approve, mark ready, enqueue or request review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUJ3ExTXMikbrPFNqD

Test Core (6/10) on 0af5783 · 2026-11-21T15:48Z · judged a slow runner, one re-run

Job 136884001753 (run 44916602322) failed with 9 × "Test timed out in 5000ms". The shard ran 14:59–15:41Z, while the other nine shards on the same head finished in 9–22 minutes.

  • Not on this diff's path. None of the 9 tests boots @objectstack/plugin-audit.
    • paused-run-visibility.test.ts and flow-declared-override-first-boot-pull.integration.test.ts compose ObjectKernel, ObjectQLPlugin, SqlDriver and the automation engine or plugin.
    • The showcase files use ObjectQL with SqlDriver directly, or showcase-flow-run.testkit.ts, which composes ObjectQLPlugin, SqlDriver and AutomationServicePlugin.
    • service-automation's non-test source does not import plugin-audit.
    • So the new sys_comment hooks are never registered in these stacks, and a with-and-without boot comparison has nothing to measure.
  • Local, at 0af5783:
    • service-automation: both files pass (2/2), every test in 164–416 ms.
    • examples/app-showcase: the three files pass, 33/33, tests 5.29 s in total.
    • Nothing comes near the 5000 ms limit.

Re-running the failed jobs of run 44916602322 once (scripts/pm/rerun-failed.mjs). A second failure is treated as real.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat note at 2026-11-21T16:00Z: the jobs this record lists as in progress have now finished on 0af57834. 41 succeeded, 18 were skipped, and none failed. Test Core (6/10) failed on its first attempt with 9 timeouts in full-stack boot tests. None of those tests boots plugin-audit, and all 9 pass locally well under the limit (see the thread's comment 7065160507). Its one re-run passed. The record follows exactly as the reviewer wrote it.

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 0af5783413e81fad67d24ded6ef4eb91ab308963
Local-runs: none

This is a delta review on top of the PASS record for head cf75b3f. Inputs: the net diff cf75b3ff..0af57834, which is two commits (e062ef2 and 0af5783) touching three files; the updated PR #36104 body; and the check-runs on 0af5783413e81fad67d24ded6ef4eb91ab308963. Everything outside the delta stands as judged in the earlier record.

① Derived judgments

  1. e062ef2: refuseResolutionOnReply now runs after the access gate. Right. It closes a disclosure and admits nothing new.
    • Before the move, the target rows are read in system context, and the reply refusal (VALIDATION_ERROR/400) ran ahead of authorization. A caller who cannot read the record, and whom the plugin-security by-id pre-image check does not stop first, could get a 400 confirming that the comment id exists and is a reply. That would cross the security(storage): the attachment gate's delete and update refusals name the parent record to a caller outside the floor's domain who cannot read it #21755 rule that the write door never names what the read door hides.
    • After the move, authorizeResolution or authorizeRows decides first, and the 400 is reachable only by a caller the gate has admitted. So the not-visible refusal for non-readers now holds inside the gate itself, not only by relying on the earlier pre-image check.
    • The accept-set is unchanged. Before and after, every non-system update naming is_resolved on a reply is refused. Only the refusal a caller sees changes, and only for callers the gate refuses anyway:
      • A non-reader now gets 403 PERMISSION_DENIED.
      • A reader who sends is_resolved plus another field on someone else's reply, and may not edit the record, now gets the named 403.
      • The reply's author and a record editor still get the 400.
    • Nothing passes now that was refused before. Against ruling 7063285032, the gate is neither wider nor narrower.
    • Rows that resolve to none skip both checks, as before.
    • Ablation: the PR body records that putting the refusal back ahead of the gate turns the new case red.
  2. The test delta matches the new order. Right.
    • The 400 test's editor fixture now has read visibility on the parent. Under the new order a non-reading editor would meet the not-visible refusal first, so this fixture change is correct, not a loosening of the test.
    • A new case pins that a non-reader who sends is_resolved on a reply gets 403 PERMISSION_DENIED, both for a resolution-only payload and for a payload with body beside it.
    • The integration rig's on-the-wire 400 is unchanged. Its caller can read the board, so the new order does not affect it.
  3. 0af5783: changeset "Who may" bullet. Right. It now states two things: the create-without-edit case (a permission set that can post but not edit cannot resolve or reopen), and the not-visible refusal on replies. This takes up the nit in the earlier record, and it is accurate against the code. Its first bullet still reads "refused, VALIDATION_ERROR / 400" for a reply. Read together with the new sentence, that is consistent. Nit only: the 400 is for callers the gate admits.
  4. PR body. Right. The "Only a thread is resolved" bullet and the test list now describe the post-gate order and the non-reader case. The Readings section records L1-a S1 at e062ef2. Nothing in the body contradicts the code. There is no public-surface change in the delta: no exports, fields or signatures.

② Semver level

No declaration changes:

  • The changeset is still '@objectstack/plugin-audit': patch.
  • Clause-②: yes (widening) and Metadata-protocol: none are still line-initial in both the changeset and the PR body.
  • The delta adds no field, export or spec key, so none still takes patch (AGENTS.md Post-Task Checklist step 3).
  • The delta touches no governed or spec path.

③ Boundary flags

Check-runs on 0af5783413e81fad67d24ded6ef4eb91ab308963, read at review time:

  • Success: Governed Surface Queue Guard, Spec property liveness, Dogfood Regression Gate, Test UI, Check PR Size, Check Documentation Links, Flag docs affected by code changes, Auto Label, filter, and one of the two PR-body guards runs.
  • Skipped: the UI, docs and opt-in jobs.
  • Still in progress, so not yet a gate verdict:
    • Build Core and Plan Test Core shards. The Test Core shards had not been scheduled yet.
    • The four Type Check jobs: workspace, source gates, debt ledger and consumer gates.
    • All nine Lint jobs, including docs & code guards, which carries check:error-status-conformance, and query-options erasure.
    • Both Check Changeset runs, the second PR-body guards run, and Live E2E UI.
  • Failures: none.

Code verdict: PASS on the delta. The gate verdict is still owed by the in-progress jobs above. Merge should wait until Build Core, Test Core, the Type Check jobs, Lint and Check Changeset are green on this sha.

Other flags:

Implemented-by: claude/project-thread-5hdmxb
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob (isolated L2 sub-agent of the seat)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Regen-provenance: declaration-face record 7065315562 (delta PASS) · 0af578341 → 5733151eb · diff <(git diff MB_OLD 0af578341 -- . ':!.changeset') <(git diff MAINPARENT 5733151eb -- . ':!.changeset') → empty once index and @@ offset lines are set aside (MB_OLD 493ad095d, MAINPARENT 15b7f51b2) · 2026-11-21T16:06Z

5733151eb merges main because K had reached 20 at landing, and its --remerge-diff is empty. The PR's own change is byte-identical to the reviewed head, and the changeset diff is the same 25 lines on both sides, so the record carries over. Main brought in #36098 (also plugin-audit: audit-writers, audit-plugin, translations), with no textual overlap; the thread re-ran plugin-audit in full (107 files, 1,777 tests) and the census and i18n gates on the merge. Check-runs on 5733151eb are read at landing, after L1-a's merge-only re-check.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

席位核对 — delta ACCEPT (L1-a, main merge)

维护者速读

这次只是把主干合进来,没有改这个 PR 自己的内容。主干带进来的「回复通知」(#36098)也改了同一个插件,但改的是不同位置,两边没有冲突。上一轮的通过结论照旧有效。CI 绿了、座位的 L2 跟上之后,按普通队列落地。

Head reviewed: 5733151ebc8d9b9f727455e903f13068ff2f447f, a merge commit with parents 0af57834 (the delta-ACCEPTed head, 7064526139) and main 15b7f51b2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T16:34Z · #36071, backend for resolving comment threads (epic #36062 phase 1).

What changes:

  • A thread can be resolved and reopened through sys_comment.is_resolved.
  • Following Sales's ruling 7063285032, anyone who can read the record may resolve or reopen a thread.
  • Only a thread root can be resolved. A reply is refused, and the refusal comes after the access gate, so it never tells a caller who cannot read the record that the comment exists.
  • threadsInvolvingUser is exported for the "involving me" filter, which is client-side in phase 1.

Reviews:

  • Seat declaration L2: PASS 7064460731 on cf75b3ff. Delta PASS 7065315562 on 0af57834. It carries over to this head by regen-provenance 7065398306 (empty, with an empty remerge-diff).
  • L1-a: ACCEPT, then REWORK S1, then delta ACCEPT 7064526139. The merge-only delta ACCEPT 7065430697 is on this head.

Gates on this head:

  • Clause-②: yes (widening), Metadata-protocol: none.
  • check-governed-merges --pr 36104 reads NOT governed (+1093/−9).
  • K, read by hand, is 3. Main touched two skills/objectstack-automation/ files since the merge, and this PR touches no skills/ or translations/ path.
  • 39 check-runs are success, 16 skipped, none failed. On 0af57834, Test Core (6/10) timed out once in boot tests that don't load this plugin; that is in the thread's comment 7065160507, and its one re-run passed.
  • Mergeable is clean.

The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #36071. The resolved-thread UI comes next in #36075 PR 2.

Merged via the queue into main with commit 5827212 Nov 21, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-5hdmxb branch November 21, 2026 16:59
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…reads and counts the unresolved ones; ✓ and Edit on others' comments appear only where the server admits them (objectstack-ai#36075) (objectstack-ai#36178)

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

repo:objectstack#1 · os-sales · session_01L6bhgT8AtWDue4oTFNAE6H

Fixes objectstack-ai#36075

Clause-②: yes (widening): `@object-ui/react`'s `DiscussionContextValue`
adds three optional members, `onResolveComment(itemId, resolved)`,
`moderatesComments` and `updatesOthersComments`. `@object-ui/types`'
`FeedItem` adds five optional members: `resolved`, `resolvedById`,
`resolvedByName`, `resolvedAt`, `mentionsViewer`.
`@object-ui/plugin-detail` adds exports `useRecordVerdict` (three-state;
a definite allow is `allowed` with `record.visible`; `useRecordEditable`
reads as before except that `allowed: false` beside a visible record now
reads not editable), `threadResolvable`, `threadResolved`,
`threadInvolvesViewer`, `filterCommentThreads`, `unresolvedThreadCount`,
`DEFAULT_COMMENT_THREAD_FILTER` and the type `CommentThreadFilter`;
`RecordCommentsData` adds `resolvable`, `onResolveComment`, `moderates`
and `updatesOthers`, and its `count` is now the unresolved threads;
`CommentItemActions` adds `onResolve` and `resolved`;
`CommentHoverActionsProps` adds `resolved`;
`RecordCommentThreadProps['comments']` may carry `onResolveComment`,
`moderates` and `updatesOthers`. `@object-ui/i18n` adds ten `detail.*`
keys to every pack. Nothing existing is removed or re-typed.
Metadata-protocol: none

## 维护者速读

-
评论栏里,每串评论的第一条在鼠标移上去时多了一个对勾。点一下这一串就标成「已解决」,从列表里消失,头部评论图标上的数字减一。再点一次可以恢复成未解决。
-
谁能点对勾:自己发起的串,谁都能点。别人发起的串,只在服务器会接受时才显示对勾。现在只有管理员能点别人发起的串。原因是平台有一条底线规则:普通成员只能改自己创建的行,评论也算,而且这条规则在评论自己的规则之前执行。实测在开发环境里,普通成员标别人的串返回
403,标自己的返回 200。你 13:25Z 的裁定 A(能看记录的人都能标)要等后端单独一个 PR 才能真正生效,这个 PR 不改服务端。
- 评论栏右上角多了一个筛选按钮,里面两个勾选:「显示已解决」打开后,已解决的串也显示出来,上面一行灰字「已由 某某
解决」,再点它的对勾就恢复。「只看我参与的」只留我发起的、我回复过的、提到我的串。筛选不记在浏览器里。全部都已解决时,评论栏说「没有未解决的评论」,并给一个「显示全部评论」的按钮。
- 往已解决的串里再回复,这一串自动变回未解决。图标上的数字现在是未解决的串数。
- 「更多」里的编辑和删除:
  - 自己的评论照旧(普通成员默认只有编辑:平台默认不给成员删评论的权限,这是另一张决定卡)。
  - 别人的评论:删除给能编辑这条记录、并且有评论删除权限的人。编辑还要服务器同意改别人写的行,现在也只有管理员。
  - 判断都问服务器,只有明确说「可以」才显示,没回来或出错就不显示。所以普通成员不会看到点了会被拒的按钮。
- 服务端权限一行没改。老部署(评论表里没有「已解决」这一列)不显示对勾和筛选,数字数全部串,和以前一样。手写的记录页和手机端不变。

## What changes

**Resolved threads** (`@object-ui/plugin-detail` `src/comments/`, the
backend is objectstack-ai#36071 / objectstack-ai#36104)

- `commentThreads.ts`: `threadResolvable` (a real top-level comment, and
the host set `resolved`: a reply whose parent is gone cannot be
resolved, the server refuses it), `threadResolved`,
`threadInvolvesViewer` (the viewer started the thread, replied in it, or
is mentioned in it: objectstack-ai#36071's `threadsInvolvingUser` rule, read off the
host's viewer-relative marks), `filterCommentThreads` with
`DEFAULT_COMMENT_THREAD_FILTER` (`showResolved: false`, `onlyMine:
false`), `unresolvedThreadCount`.
- `useRecordComments`: `count` is the unresolved threads; `resolvable`
says some thread here can be resolved; hands `onResolveComment` and
`moderates` on from the context.
- `CommentThread`: ✓ on the thread's first comment only (`onResolve`,
reading 「恢复」 and pressed when resolved), on a thread the viewer started,
and on anyone's only with `updatesOthers` (see the row floor below). A
resolved thread carries `data-comment-thread-resolved` and a 「已由 X 解决」
line (`data-comment-resolved-mark`) above its first comment, the comment
muted while collapsed. The resolver's name is the host's
(`resolvedByName`), else the entry in a mention list the composer
already loaded (never read for this), else plain 「已解决」. A refused
resolve is swallowed here (the host has said so).
- `CommentsPanel`: the filter menu (`ListFilter`, left of ✕) with two
checkbox items, offered only while `resolvable`; held in state while the
panel is open, never stored. With every thread filtered out it says
「没有未解决的评论」 (or 「没有你参与的评论」) and offers 「显示全部评论」.
- `CommentHoverActions`: `resolved` turns the ✓ into the reopen control
(`aria-pressed`). Its test hook changes value with it:
`data-comment-action="resolve"` on an open thread, `"reopen"` on a
resolved one. The panel's other new hooks are `data-comments-filter`,
`data-comments-filter-option="show-resolved" | "only-mine"`,
`data-comments-empty="filtered"` and `data-comment-thread-resolved`;
they are test hooks and carry no contract.

**Edit and Delete on other people's comments** (card item 6)

- The comment hook (`plugin-audit` `comment-access-hooks.ts`, "Parent
EDIT") lets a comment's author, or a caller whose by-id update of the
parent record the explain engine admits, edit or delete a comment. The
page asks the same question: `useRecordVerdict(object, id, 'update')`, a
three-state reading of the verdict `useRecordEditable` fails open on
(same cache, same in-flight sharing, same staling; `useRecordEditable`
is now `useRecordVerdict(...) ?? true`). A definite allow is `allowed
=== true` together with `record.visible === true`, as the server admits
a by-id write (L2 S3); an answer with `allowed: false` beside a visible
record (an on-behalf-of session whose delegator is gone) now reads not
editable for `useRecordEditable` too, which is the server's answer.
`moderatesComments` is `true` only on a definite allow, and is asked
once the panel is open, so a record whose object sets `userActions.edit:
false` still sends no explain on open (objectstack-ai#13045). The page's own edit
gates (approval lock, `userActions.edit`, predicates) are not the
server's comment rule and do not join.
- `CommentThread` offers Delete on a comment that is the viewer's own
or, with `moderates`, anyone's; Edit on the viewer's own or, with
`moderates` AND `updatesOthers`, anyone's; still only where the host
hands `onEditComment` / `onDeleteComment` (the `sys_comment` grants).

**The row floor (measured; the interim this PR ships)**

- The platform's wildcard floor `owner_only_writes`
(`default-permission-sets.ts`, `update`, `positions: ['org_member']`,
`created_by == current_user.id`) runs before the comment hook.
`sys_comment` widens it for `delete` only (`sys_comment_moderation`);
`update` is left under the floor on purpose. So the hook's resolve rule
(objectstack-ai#36104, ruling 7063285032) and its parent-editor rule are never reached
for a rank-and-file member on someone else's row.
- Readings on the CRM example with the security service on (one org, two
`org_member` members; scripts and JSON in the evidence folder `floor/`):
- a member who reads the record PATCHes `{ is_resolved: true }` on the
admin's thread: **403** `PERMISSION_DENIED`; on another member's thread:
**403**; on their own: **200**;
- a member who may edit the record PATCHes `{ body }` on another
member's comment: **403**;
- explain `sys_comment` `update` by id answers `record.visible: false`
for a member on another person's comment, `true` on their own and for
the admin.
- The interim: `RecordDetailView` asks ONE explain, `update` of the
first top-level comment the viewer did not write
(`updatesOthersComments`), when the reader first reaches into the open
panel (pointer or focus), so opening the record and opening the panel
still read nothing more (objectstack-ai#28470). The floor answers the same for every
such row. ✓ and Edit on others' rows need its definite allow; pending, a
refusal, an error, no explain service and a stale answer offer them on
the viewer's own rows alone. Delete keeps its own gates
(`feedCommentDelete` and `moderatesComments`), which the floor's delete
widening already matches.
- Not here: making ruling 7063285032 true for members is a server change
(a resolve-only path past the floor), a separate backend PR after Sales
answers the decision on editing others' comments. Delete was verified
with a principal holding the `sys_comment` delete bit (the admin);
`member_default` grants members none, so a member's More holds Edit only
(a second decision card).

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

- The comment read already returns every column (no select, on both the
record-page payload and the fallback `find`), so the rows'
`is_resolved`, `resolved_by`, `resolved_at` map onto the feed item
(`commentResolutionOf`), only where the row carries `is_resolved`. The
resolver is named from the viewer or an author of the same discussion;
any other resolver is named by ONE `sys_user` read of exactly those ids
(`$filter: { id: { $in } }`, `$select: ['id', 'name']`), sent after the
discussion is drawn and never twice for an id (L2 S2: the record-page
payload has no expand for it, and the 50-user mention roster missed
resolvers past it). A refused read leaves 「已解决」. `mentionsViewer` comes
from the row's stored `mentions` (`rowMentionsUser`: a JSON id list, ids
or `{ id }` objects).
- `handleResolveComment`: `dataSource.update('sys_comment', id, {
is_resolved })` and nothing else (the one update ruling 7063285032
admits for any reader), offered under the `sys_comment` update grant;
the row changes from the stored record the server answers with, a
refusal toasts `detail.commentResolveFailed` and changes nothing.
- A reply into a resolved thread shows its first comment reopened
(`threadRootIdOf`), as the platform stores it; a new comment is
unresolved where the deployment stores resolution.
- The icon's count is `unresolvedThreadCount` over the rows the page
already holds from its one open request (objectstack-ai#28470), not objectstack-ai#36104's `COUNT`
read: that would be a second request for an answer already on the page.

**Strings**: `detail.reopenThread`, `threadResolved`,
`threadResolvedBy`, `filterComments`, `showResolvedComments`,
`commentsInvolvingMe`, `noUnresolvedComments`, `noCommentsInvolvingMe`,
`showAllComments`, `commentResolveFailed` in all eleven packs (zh-Hant
regenerated) and the provider-less defaults.

**Docs**: the plugin-detail README and
`content/docs/frontend/plugins/plugin-detail.mdx` describe resolved
threads, the filter, the count, and Edit / Delete for record editors.

## Why

Card objectstack-ai#36075 items 3, 6, 7 and 8, owed by this second PR after objectstack-ai#36114
(the panel, `Part of objectstack-ai#36075`) and objectstack-ai#36104 (the resolved backend, objectstack-ai#36071)
merged: resolve and reopen a thread, the 「显示已解决」 / 「只看我参与的」 filter, the
icon counting unresolved threads, and Edit / Delete 「只对自己的评论,或有权限的人」.

## Side effects reviewers should know

- No server change and no permission change. Resolving rides the backend
objectstack-ai#36104 shipped, and moderating uses the server's existing parent-editor
rule, each offered only where the server's row floor admits it today
(above).
- A deployment without the explain service shows ✓ and Edit on the
viewer's own rows only, administrators included.
- The moderation verdict fails CLOSED where `useRecordEditable` fails
open: a deployment whose explain engine does not answer (501, network)
shows Edit / Delete on the viewer's own comments only, though its
degraded server mode might admit more. A permitted moderator there loses
an affordance, never sees a refused one.
- The old `RecordActivityTimeline` (hand-written pages, the phone) is
unchanged: own Edit / Delete only, no resolve.
- Overlap: `overlap-check.mjs` against main and 5 open PRs that share a
file: clean, except objectstack-ai#36136, which already conflicts with main on
`RecordDetailView.tsx`'s `@object-ui/plugin-detail` import line; this PR
adds its two names on a separate import so it adds nothing to that
conflict.
- Not in this PR: 「复制链接」 in the More menu (in the mock, not in the
card's items), and reactor names on hover.

## Verification

**New tests (all pass)**

- `plugin-detail/src/comments/CommentsPanel.resolved-36075.test.tsx`
(16): resolved threads hidden by default; ✓ on a top-level comment only;
「显示已解决」 with 「Resolved by Ada」 and the reopen control; 「只看我参与的」 keeps
started / replied / mentioned; without `updatesOthersComments`, ✓ only
on the viewer's own threads; the resolver named from a mention list
already loaded, never read for it; all resolved → the note and 「Show all
comments」; no ✓ and no filter where rows carry no `resolved`; no ✓
without the write; a moderator's Edit / Delete on another's comment; a
moderator whose update of others' rows is refused gets Delete, not Edit;
`updatesOthersComments` alone is not moderating; the CONTROL without
moderation; none without the host's writes; the count is unresolved
threads, and every thread with no resolution stored.
- `plugin-detail/src/useRecordVerdict-36075.test.tsx` (6): true / false;
`allowed: false` beside a visible record reads false, a visible record
with no `allowed` reads `undefined`; `undefined`, never true, while
pending, on non-OK, offline, and no record verdict; nothing asked when
disabled; CONTROL `useRecordEditable` still fails open; one shared
question.
- `app-shell/src/views/RecordDetailView.commentsResolved-36075.test.tsx`
(15), the real `RecordDetailView`: the icon counts 1 of 2 threads and
the resolved one appears under 「显示已解决」 named; a resolver the page cannot
name read by id, once, and named; no user read when every resolver is
named; ✓ writes exactly `{ is_resolved: true }` on the top-level row,
the thread leaves, the count goes; a refused ✓ toasts and changes
nothing; reopen writes `{ is_resolved: false }` and the count returns; a
reply into a resolved thread reopens it; another member's comment offers
Edit / Delete on an explain allow, not on a refusal, not on an answer
with no record verdict; ✓ on another member's thread beside a moderation
refusal (N3); the row floor: ONE `sys_comment` explain, only once the
reader reaches into the open panel; refused → no ✓ and no Edit on
others' rows, Delete still, own rows unchanged; admitted → ✓ and Edit;
no answer → own threads alone.
- Reverse checks: with the moderation gate made fail-open (`!== false`),
「not offered on a guess」 fails; with the row-floor gate made fail-open,
「not on a guess: no answer offers ✓ on the viewer's own threads alone」
fails; with the old `record.visible`-only reading, the `allowed: false`
case fails.
- `RecordDetailView.recordOpenOneRequest-28470` pins that opening the
panel reads nothing more; the probe waits for the reader to reach into
the panel for that reason.

**Local runs** (at `c268e113`, base main `6aacad95`): every
`app-shell/src/views/RecordDetailView.*`, `recordDrawer*`,
`recordCommentsPanel*` file and the whole `plugin-detail/src` (504
files, 4,517 tests): all pass but one at the first reading,
`hiddenAffordanceVerdicts-13045` (the moderation verdict was asked on
open where `userActions.edit: false` asks none); fixed by asking it once
the panel opens, then that file and the comment files re-run green (7
files, 65 tests). `type-check` (src and tests) clean for types, react,
plugin-detail and app-shell; ESLint on every changed file: 0 errors;
`check:i18n-keys`, `check:i18n-drift`, `check:i18n-stale-fill`,
`check:new-line-citations` pass; `check:i18n` / `check:i18n-coverage`
answer exit 3 locally (they need a full `pnpm build`), CI reads them.

**Local runs at the new head**: `plugin-detail/src` and every
`app-shell/src/views/RecordDetailView.*`, `recordDrawer*`,
`recordCommentsPanel*` file: 504 files, 4,509 passed; the one failure
(`recordOpenOneRequest-28470`, the probe on panel open) is fixed by
asking on engagement, and those files plus `plugin-detail/src/comments`
re-ran green (104 files, 837 tests). `type-check` clean for react,
plugin-detail and app-shell; ESLint 0 errors on the changed files.

**Browser evidence** (seat-side folder
`/mnt/project-files/build-seat1/36075/pr2/`):
- the first set (`README.md`, light and dark: the panel, the filter, the
count, 「已由 林晓 解决」, admin's Edit / Delete on a member's comment);
- `floor/`: the row-floor readings above;
- `interim/` (`README.md`, light and dark), on the CRM example with the
security service on:
- a reading member on another member's thread: Reply and emoji only; on
their own: ✓, and More → 编辑;
- a record-editing member on another member's thread: Reply and emoji
only;
  - the admin: ✓, and More → 编辑 / 删除;
- E1: a member resolves their own thread, count 2 → 1, after reload 1,
「已由 林晓 解决」, reopen → 2;
- S2: 「已由 Dev Admin 解决」 from one
`sys_user?filter=["id","in",[…]]&select=id,name&top=1` read.

## 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.
- [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).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

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

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

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…s their own comments, through two server doors (objectstack-ai#36186, objectstack-ai#36191) (objectstack-ai#36200)

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

repo:objectstack#1 · os-sales · session_01L6bhgUH1jEKbDzYRc4nghq

Fixes objectstack-ai#36186
Fixes objectstack-ai#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`, objectstack-ai#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 (objectstack-ai#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, objectstack-ai#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
objectstack-ai#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 objectstack-ai#36104
(`36071-comment-threads-resolved.md`) and objectstack-ai#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 objectstack-ai#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
objectstack-ai#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

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No `packages/spec` change.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (eslint on the touched
files: 0 errors.)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (Two folded cards, one `Fixes` line each.)
- [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: its generated artifacts are
regenerated and committed. (Not touched.)
- [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 维护者速读 section is
the maintainer's Chinese summary, as on this seat's other PRs.)
- [x] 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.com/claude-code)

https://claude.ai/code/session_01L6bhgUH1jEKbDzYRc4nghq

<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgUH1jEKbDzYRc4nghq -->

---------

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

Development

Successfully merging this pull request may close these issues.

评论(二)后端:一串评论可以标记「已解决」,可恢复,可按已解决和「我参与的」筛选

2 participants