Skip to content

Comments: one read returns the threads on the records a list filter selects, as the caller #39084

Description

@os-support-ai

立卡门类别:③ 维护者直派(专题 #39077 的子卡)。Source: topic #39077
thread · os-support-ai · session_01WGufzirjTJ1sVFGR5sBPSL

Blocked-by: #39080, #39081
Parent: #39077 · M2 读取口 · card S3 of the epic's milestone table
定级:area:data · Feature · priority:p1 set by the maintainer (see the Ruling-ref comment) · reach: n/a (new capability, maintainer direct) · evidence: read (isolated analysis on #39077, Served-tier: CONTRACT_REVIEW_TIER, tier verified)

维护者速读

  • 新增一个读取口:给出列表当前的筛选,返回这些记录上的评论串(按看的人的权限),给列表页评论栏用。

业务理由:维护者原话「设计列表页本身整个对象的评论入口」「用fable 分析,并立专题卡, p1」「按推荐」——在列表页上直接看当前视图里各条记录的评论串、回复和解决,不用一条条点进记录。已定的九条规则和七条待定的结论在 #39077 正文与其评论里,本卡不复述。

动手的读者:席位为本专题开的专区(维护者「这个专题直接派发吧,并发5」「开一个专区派发」),os-dev 按本卡施工。

Dedupe: 评论 列表 in:title, comments panel list view, view comments feed, list page comments, comments across records, Attio comments (objectstack, incl. closed) → no open card covers this; related #36062 (closed, origin topic), #35947 (open, paused sibling topic).

Scope and acceptance

§N below points at the English analysis inside #39077.

  • Layer: spec + backend (plugin-audit) + SDK · area:data · Feature · size L · p1
  • Scope:
    • Spec-first: request and response schemas for POST /api/v1/comments/threads/query in packages/spec/src/api/
      (strict body; limits as constants), regenerated artifacts committed.
    • The door in plugin-audit's comment registrar, steps 1–6 of §5; a ledger row; an SDK method so the row is
      sdk, not a new gap; advertised wherever the comment doors are advertised and nowhere it is not mounted.
    • Reference docs for the route (the API page that documents the comment doors).
  • Acceptance (all via HTTP against a booted showcase, as two members with different row scope):
    • With a filter selecting 3 of an object's records, the answer holds only top-level comments on those 3, newest
      first, each with the record's id and name, its reply count and at most three latest repliers.
    • The same request by a member who cannot read one of the 3 records omits that record's threads; by a member
      with no read on the object it is the object read's own refusal.
    • showResolved absent ⇒ no resolved thread; true ⇒ they appear. onlyMine: true ⇒ only threads the caller
      started, replied in or is mentioned in.
    • limit + cursor walk every thread once with no repeat while a new comment is posted between pages.
    • An unknown body key, any query parameter, limit out of range ⇒ VALIDATION_ERROR / 400 and the engine was
      never called; a filter on an unreadable field ⇒ PERMISSION_DENIED; an object with feeds off ⇒ 403; anonymous
      ⇒ 401.
    • On a view larger than the id cap the answer is still complete on SQLite and PostgreSQL (seed > 1000 matching
      records), and the threads statement is one statement (query log).
    • No new error code; ERROR_CODE_LEDGER diff is empty.
  • Order: see the Blocked-by: line at the top of this card.
  • Clause-②: yes (widening) — a new public route, schema and SDK method.
  • Metadata-protocol: none
  • Likely files: a new packages/spec/src/api/*.zod.ts beside record-page.zod.ts,
    packages/plugins/plugin-audit/src/comment-routes.ts (registerCommentDoorsRoutes),
    comment-route-ledger.ts, audit-plugin.ts, packages/client/src/, content/docs/api/data-api.mdx.

Generated by Claude Code

Activity

  1. added
    priority:p1
    pm:blocked
    on Dec 2, 2026
  2. os-support-ai commented on Dec 2, 2026

    @os-support-ai
    CollaboratorAuthor

    Ruling-ref: priority:p1 — maintainer, project thread, 2026-12-02: 「用fable 分析,并立专题卡, p1」 (07:13Z) and 「按推荐」 (07:36Z); recorded on #39077.

    thread · os-support-ai · session_01WGufzirjTJ1sVFGR5sBPSL


    Generated by Claude Code

  3. os-support-ai commented on Dec 2, 2026

    @os-support-ai
    CollaboratorAuthor

    Card thread: yes — per pm-dispatch dispatch-runbook.md 卡线程 (big card = L/XL or contract change): size L, Clause-②: yes, and non-test packages/spec/src/** paths (new route schemas). Not a zone mode:subagent card.

    thread · os-support-ai · session_01WGufzirjTJ1sVFGR5sBPSL


    Generated by Claude Code

  4. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

    Carried from S1 (#39080, PR #39100, landing record 7341500134) · 2026-12-02T09:48Z · for whoever builds this card:

  5. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

    Carried from #39080's ADR-0139 note PR (#39124) · 2026-12-02T10:47Z: a planned leaf from ObjectQL.planReadScope carries the scope of the context it was planned under. This card's read must plan and place it per request and never cache it across requests or users. Pin that with a two-user test.

  6. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

    Claim: card thread of seat repo:objectstack@os-support-ai, epic #39077 (list-page comments, the maintainer's 「这个专题直接派发吧,并发5」), M2 card S3
    Session: session_01WGufzhPdWmTd47Fi2bKYZS
    Thread session: session_01WGufzfHCzQWh6PeQnvToFz
    Account: os-support-ai
    Branch: claude/project-thread-nfg4vp (restarted from main after #39110 merged)
    Domain: domain:server
    Seat: repo:objectstack@os-support-ai
    File surface: packages/spec/src/api/comment-threads.zod.ts (new) and comment-threads.test.ts (new), packages/spec/src/api/index.ts; regenerated packages/spec/authorable-surface/api.json, packages/spec/declaration-map/api.json and content/docs/references/api/comment-threads.md (regenerated, never hand-edited); packages/plugins/plugin-audit/src/comment-threads-query.ts (new) with its unit and integration tests, comment-routes.ts, comment-routes.test.ts, comment-route-ledger.ts, comment-route-ledger.conformance.test.ts, audit-plugin.ts, index.ts; packages/objectql/src/index.ts (exports PlanReadScopeOptions and ReadScopeComparand, N3 of 7341533575); packages/client/src/index.ts and a client test (the SDK method); packages/runtime/src/domains/comments.ts (reason: only if the comment doors are advertised there); packages/qa/dogfood/test/comment-threads-query.dogfood.test.ts (new); content/docs/api/data-api.mdx; a changeset. Stop on breach; explain in the report.
    Container & model: L, mode:card-thread, model: TIER_DEFAULT (dispatch-gates --tier prints no MANDATORY line), effort: high; contract-tier L2 at CONTRACT_REVIEW_TIER, in-house.
    Clause-②: yes (widening)
    Metadata-protocol: none
    Responsibility: n/a — feature card
    Premise: S1 (#39100, ObjectQL.planReadScope) and S2 (#39110, sys_comment.participants) are merged on main 81112d2. Per epic ruling 7338398195: a dedicated read returns the comment threads on the records the current view selects, where the current view is the saved filter plus the viewer's temporary filters, and the search box does not count (item 3). It covers only threads the viewer may read, and the SQL datasource only; MongoDB and OData refuse under the engine's existing rules. The planned leaf is planned and placed per request and never cached, pinned by a two-user test (7343013270). The Postgres cell runs locally on Postgres 16 and is named in the PR, recorded as not measured in CI (N5).
    Serial constraints cleared: check-handover.mjs --inflight meets #38894 (seat repo:objectstack@os-justin, claim 7336726260) at the directory packages/qa/dogfood/test/ only. This card adds one new file there with a name of its own and edits nothing else in that directory. #39092, the last claim on packages/objectql/src/index.ts, is merged.

  7. added
    pm:dispatched
    and removed
    pm:blocked
    on Dec 2, 2026
  8. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

    Claim amendment · 2026-12-02T12:59Z · claim 7343360143.
    File surface (added), for two gates this change turns red (+4/−2 in all):

  9. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfHCzQWh6PeQnvToFz
    os-dev-report

    {
      "issue": 39084,
      "status": "done",
      "branch": "claude/project-thread-nfg4vp",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/39135",
      "session": "session_01WGufzfHCzQWh6PeQnvToFz",
      "premise_still_valid": true,
      "summary": "POST /api/v1/comments/threads/query built on head cb3695e7 (10 commits on 81112d2d, 31 files). Spec: strict CommentThreadsQueryRequestSchema / CommentThreadsQueryResponseSchema + limit constants (comment-threads.zod.ts). plugin-audit comment-threads-query.ts mounted from registerCommentDoorsRoutes: every read as the caller; filter via parseFilterAST; ObjectQL#planReadScope planned per request (never cached, two-user pin); ONE threads find (top-level, open unless showResolved, participants $contains when onlyMine, keyset (created_at,id) desc, limit+1); page replies (keyset-paged, caller) for reply count at any depth + latest 3 repliers; one read of the object for display names. Ledger row sdk comments.queryThreads; client.comments.queryThreads; objectql exports PlanReadScopeOptions and ReadScopeComparand; data-api.mdx section; changeset patch x4. Claim amendment 7346184382 commit: llms.txt counts, cross-package-test-inputs.mjs + turbo.json declare comment-route-ledger.ts as a client test input. Deviations: self-hosted mount only (seat ruling; hosted follow-up #39134); inline dogfood stack, not showcase (needs a no-read persona); reply counts from the page's replies, not a grouped count by parent_id (depth needs roots); reference page at the generator's path packages/spec/docs/references/api/comment-threads.md; index on (object_name, created_at) NOT MEASURED. Postgres: local PG 16.15 run of the dogfood file at c4d42665, 17/17 incl. 4 live-postgres; not measured in CI (N5).",
      "tests": "plugin-audit 118 files / 1944 passed; client 60 / 841; objectql 646 / 14685; spec 922 / 29119 (1 todo); dogfood comment-threads-query 17/17 with OS_TEST_POSTGRES_URL. New: comment-threads-query.test.ts 19, comment-threads-query.integration.test.ts 7, comment-threads.test.ts 9, ledger conformance +1, client URL conformance +2. Ablation: planned scope cached in a module-level ??= -> 'two users through one door' red, restored.",
      "gates": "dispatch-gates --ran at c4d42665: 127 derived, 127 run, 0 NOT-MEASURED, 0 UNRUN. check:llms-txt and check:cross-package-test-inputs exit 1 until the amendment commit, exit 0 on this head. Four first exit 3 (prerequisites) cleared and rerun exit 0: plugin-teardown self-test, skill-examples, i18n, dual-build-cjs-loads. Typecheck spec/plugin-audit/client/objectql/dogfood exit 0; eslint changed sources exit 0; ERROR_CODE_LEDGER diff empty. PR check-runs: pending at report time.",
      "mcp_calls": "0",
      "api_writes": "3 — relay issue_create #39134 (hosted follow-up, seat-ordered), relay pr_create #39135, this report comment",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: PR · noted, not filed: sys_comment index leading with (object_name, created_at) for this read not measured (no plan read; object file outside the claim)"
      ]
    }
  10. added 2 commits that reference this issue on Dec 2, 2026
  11. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

    Claim amendment · 2026-12-02T13:33Z · claim 7343360143, extends amendment 7346184382.

    • File surface (added): ui/scripts/check-spec-symbol-derivation.mjs, one ALLOW entry with its reason (commit 750a1ea). The new spec export CommentThread (a schema type) shares its name with @object-ui/collaboration's published React component CommentThread. The two live in different layers, and the guard already allows that, as it does for EmptyState. The seat rules ALLOW over a rename: renaming either symbol would change a published name for no behaviour gain. Contract review r4 PASS 7347045361 agrees.
    • Declaration correction: this card and claim 7343360143 said Metadata-protocol: none. The new api schemas enter spec's authorable surface, so the declaration is Metadata-protocol: added, with @objectstack/spec graded minor, as PR feat(plugin-audit,spec,client): one read returns the comment threads on the records a list filter selects, as the caller #39135 now states (commit fb20c06). The PR's line governs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datapm:dispatchedpriority:p1

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions