Skip to content

Comments: a thread stores who took part, so 'threads involving me' filters in one query #39081

Description

@os-support-ai

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

Parent: #39077 · M1 打底 · card S2 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: backend (plugin-audit) · area:data · Feature · size M · p1
  • Scope:
    • A platform-written, read-only participant list on a thread's first comment: its author, every replier at any
      depth, everyone mentioned in any comment of the thread. Maintained when a comment is created, when an edit
      changes its mentions, and never written by a client (stripped and reported like the other platform columns).
    • A one-off backfill command in the family of the parent-pair backfill, dry-run by default.
    • The existing in-memory rule and the reply-notice audience keep their answers; this card adds the stored
      fact and pins that the two agree.
  • Acceptance:
    • HTTP: after A starts a thread, B replies and C is mentioned in a reply, GET /data/sys_comment filtered on
      the participant column by A, by B and by C each returns that thread's first comment; by D it does not.
    • A client-supplied value for the column on create or update never lands (response reports it dropped).
    • The backfill, run on a database with threads written before this card, makes the same filter return them;
      a second run changes nothing.
    • A reply two levels deep adds its author to the first comment's list.
  • Order: no upstream card.
  • Clause-②: yes (widening) — a new column on a platform object served by the data API, and a new CLI subcommand.
  • Metadata-protocol: none (platform object; nothing an author writes)
  • Likely files: packages/plugins/plugin-audit/src/objects/sys-comment.object.ts,
    packages/plugins/plugin-audit/src/audit-writers.ts (readThreadParticipants),
    packages/plugins/plugin-audit/src/comment-resolution.ts (threadsInvolvingUser), a new backfill module beside
    comment-parent-pair-backfill.ts, the CLI's migrate command, generated translation bundles.

Generated by Claude Code

Activity

  1. added
    priority:p1
    pm:queue
    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): Clause-②: yes (a new served column on a platform object and a new CLI subcommand). 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

    Claim: card thread of seat repo:objectstack@os-support-ai, epic #39077 (list-page comments, the maintainer's 「这个专题直接派发吧,并发5」), M1 card S2
    Session: session_01WGufzhPdWmTd47Fi2bKYZS
    Thread session: session_01WGufzfHCzQWh6PeQnvToFz
    Account: os-support-ai
    Branch: claude/project-thread-nfg4vp
    Domain: domain:server
    Seat: repo:objectstack@os-support-ai
    File surface: packages/plugins/plugin-audit/src/objects/sys-comment.object.ts, packages/plugins/plugin-audit/src/comment-participants.ts (new), packages/plugins/plugin-audit/src/comment-participants-backfill.ts (new), packages/plugins/plugin-audit/src/comment-access-hooks.ts (the install call), packages/plugins/plugin-audit/src/comment-resolution.ts (docblock), packages/plugins/plugin-audit/src/index.ts, packages/plugins/plugin-audit/src/translations/en.objects.generated.ts (regenerated), packages/cli/src/commands/migrate/comment-participants.ts (new), packages/cli/src/utils/schema-migrate.one-shot-family.integration.test.ts, packages/cli/src/commands/migrate/data-commands.absent-database.integration.test.ts, packages/cli/test/migrate-confirmation-exit.pin.test.ts, packages/cli/test/json-stdout-purity.e2e.test.ts, content/docs/deployment/cli.mdx, the new modules' tests beside them, a changeset. (The package paths are as the card thread read them on main; the plugin directory's exact spelling is the one on main.) Stop on breach; explain in the report.
    Container & model: M, mode:card-thread, model: TIER_DEFAULT (dispatch-gates --tier prints no MANDATORY line), effort: high; contract-tier L2 at CONTRACT_REVIEW_TIER for the widening.
    Clause-②: yes (widening): a new read-only field on the published sys_comment object
    Metadata-protocol: none
    Responsibility: n/a — feature card
    Premise: holds on main 7814822. readThreadParticipants (audit-writers.ts) is ancestors plus direct repliers, with no mentions. threadsInvolvingUser (comment-resolution.ts) is the in-memory rule, and nothing is stored. The plan: participants is a read-only multiple lookup to sys_user (a JSON column, where $contains is element membership on SQLite, Postgres and MySQL), derived by the threadsInvolvingUser rule over the thread's rows and pinned equal to it. It is kept current after a create and after an update that changes mentions or the parent. The backfill is os migrate comment-participants, a dry run by default. Epic ruling 7338398195 chose the stored route.
    Serial constraints cleared: check-handover.mjs --inflight meets #38879 (seat repo:objectstack@os-justin, claim 7336933200) at the directory packages/cli/src/commands/migrate/ only. That claim's reason confines it to new per-card test files meta.write-exportsof*.test.ts and fixtures; this card's new comment-participants.ts and the shared data-commands.absent-database.integration.test.ts are neither, and #38879 has no code PR open. No file is shared. If #38879's surface later widens to either file, this card thread stops and asks the seat.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Dec 2, 2026
  6. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

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

    {
      "issue": 39081,
      "status": "done",
      "branch": "claude/project-thread-nfg4vp",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/39110",
      "session": "session_01WGufzfHCzQWh6PeQnvToFz",
      "premise_still_valid": true,
      "summary": "sys_comment gains platform-written participants (multi-value sys_user lookup, JSON list) on top-level comments: author, mentions, every reply author at any depth and their mentions, derived by participantsByThread, pinned equal to threadsInvolvingUser incl. past the 16-hop bound. installCommentParticipants stamps on create over the client value, drops it from non-system updates (preserveAudit imports included), and reconciles the thread after a reply insert, a mentions/parent/thread edit and a delete (delete is beyond the card's list, kept so the stored list equals the in-memory rule); the rewrite is a system update under preserveAudit keeping updated_at, tenantId = row organization; failures log at error naming os migrate comment-participants --apply. Backfill backfillCommentParticipants + CLI os migrate comment-participants (dry-run default, idempotent). Deviation: on create the client value is replaced silently (engine does not strip readonly on create for sys_ objects); droppedFields reports it on update only. Head 258a0365, 29 files +1342/-12.",
      "tests": "plugin-audit full suite 116 files / 1911 passed (before the org + double-limit fixes; participant files rerun green after). New comment-participants.test.ts 11 passed, comment-participants.integration.test.ts 6 passed (real kernel + SqliteWasm: A/B/C found, D and prefix u_a1 not; depth-2 reply; updated_at kept, is_edited false; mention edit + delete; create stamp + update drop reported; backfill dry-run/apply/second run changed 0). Ablation: afterInsert reconcile removed on disk -> 4/6 integration red, restored -> 6/6. plugin-audit + cli typecheck exit 0. CLI absent-database + one-shot family + confirmation pin: 3 files 323 passed. eslint --max-warnings=0 on changed sources exit 0. HTTP GET /data/sys_comment not measured locally (engine-level find through the read gate is).",
      "gates": "dispatch-gates --ran at 258a0365: 112 derived, 112 run, 0 UNRUN. Fixed findings: check-tenant-audit-census (regenerated, 22->23 write sites), check:objectql-double-limit (test double honours limit), check:system-context-census (new row 45a + regenerated register). check:query-options-erasure exit 0 on rerun (first run hit my 200s timeout). NOT MEASURED exit 3 (missing prerequisite): check-plugin-teardown-shape --self-test (shallow clone), spec check:skill-examples (spec dist), check:dual-build-cjs-loads (dist), check:i18n-coverage (partial build). Nightly json-stdout-purity e2e: 1 pre-existing failure (migrate protocol absent from FAMILY on main), 121 passed incl. the new member. PR check-runs: pending at report time.",
      "mcp_calls": "0 MCP GitHub calls",
      "api_writes": "2 — relay pr_create (run 46847870239, assignees os-support-ai, no labels); this report comment (POST issues/39081/comments)",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: c · reach: nightly tier only · test/json-stdout-purity.e2e.test.ts FAMILY lacks migrate protocol on main, one assertion red under OS_TEST_TIERS=nightly · noted, not filed · dedupe words: json-stdout-purity migrate protocol family"
      ]
    }
  7. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

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

    Claim amendment · 2026-12-02T09:12Z · claim 7338631962, PR #39110, from the card thread's report 7340467668.
    File surface (added): content/docs/permissions/system-context.mdx, one row (45a). The system-context census gate requires every new system-context write site to be listed there, and the participants keeper's rewrite runs in system context under preserveAudit.

  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-02T09:51Z · claim 7338631962, PR #39110, following contract review FAIL 7341537444 (should-fix S1 and S2, being fixed on a new head).
    Acceptance reworded (seat ruling): the card's create-side wording, that a client-sent participants value is reported as dropped, is not met. The engine does not strip read-only sys_ fields on create, so on create the keeper replaces a client value silently, and droppedFields reports it on update only. Accepted as stated in the PR body: the stored value is always the derived one, and the create-side report is not owed by this card.
    Also accepted for the fix round: the keeper becomes eventually consistent. It re-derives after each write until a pass changes nothing (bounded) and reads a fresh updated_at just before writing; the docblock and changeset say so.

  9. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    Contributor

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

    Claim amendment · 2026-12-02T10:13Z · claim 7338631962, PR #39110, for contract review S1 (7341537444, closed by delta PASS 7342112334).
    File surface (added): packages/qa/dogfood/test/comment-thread-participants.dogfood.test.ts (new). An HTTP case for "threads involving me" with no thread_id in the filter, which is the cross-record form #39084 depends on. Dogfood shards skip on a pull request, so the PR's evidence is the card thread's local run against the built plugin (3 passed), and the merge queue runs it.

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