You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Comment reaction read gate: the visibility pre-scan reads at most 2,000 reaction rows and narrows the read to their comments, so reactions on comments past that window vanish from discussion reads and paged reads #39344
The comment reaction read gate is computeReactionVisibilityFilter in packages/plugins/plugin-audit/src/comment-access-hooks.ts. It runs on every caller-scoped sys_comment_reaction find or count. It first pre-scans at most READ_SCAN_LIMIT = 2,000 rows of the read's own where, under system context, in the caller's orderBy and with no offset. It then ANDs comment_id $in <the readable comments those rows name> into the read. So when the where matches more than 2,000 reaction rows, every comment none of whose reactions falls in the first 2,000 rows is dropped. This fails closed and leaves only a warn line. Because each page's pre-scan starts again at row 0, and total/hasMore are counted under the same narrowing, a paged read never reaches those rows and ends short without an error. The code comment says a comment feed "never hits this", but both discussion doors do. One client batch (REACTION_READ_COMMENT_IDS = 100 comment ids, ui/packages/app-shell/src/views/useRecordDiscussion.ts) or one record-page payload chunk (REACTION_READ_CHUNK_SIZE = 500 ids, packages/rest/src/record-page-routes.ts) with more than 2,000 reaction rows hits it. The two doors cross that line at different thread sizes, so one thread's reactions can be complete on the list page and short on the record page: another two-door disagreement in the #39271 / #39297 / #39313 family. For the discussion reads it bites only with no row budget or a budget of 2,000 or more, because below that the read is refused first. On a broader reaction read whose scan window includes rows on comments the caller cannot read, it can drop readable rows under any budget. Evidence: read on main (not measured through a public door); first reported as Observation C on PR #39342 (L1 for #39313). Adjacent: #39312 (the same function's comment_id $in kept of up to 2,000 ids against driver IN-list ceilings). Boundary: ADR-0139 D5.2 (#23732) keeps the bounded probe for reactions, not a ReadableIds leaf. A fix should stay inside the probe, for example by resolving the readability of the comment_id $in ids the read itself names, without scanning reaction rows. A move to a leaf is a ruling. Suggested grade: area:data · domain:server · Bug · priority:p3 (rare: more than 2,000 reactions under one query's where; fails closed, no leak; user-visible undercount) · size S · sub-issue of topic #39077. Dedupe: reaction READ_SCAN_LIMIT pre-scan, comment reaction visibility 2000 rows, reaction read gate fail-closed truncation (open issues) → none; #39312 is adjacent, not a duplicate.
Clause-②: no (expected; moving reactions to a ReadableIds leaf is a stop for a ruling) · Metadata-protocol: none.
Triage: first-touch audit (lane self-triage, case ②: filed by this zone and kept in it; area, type, grade and size touched in the filing round) · area:data · Bug · p3 · size S · no domain:* written here (triage's; the fix sits in packages/plugins/plugin-audit/src/comment-access-hooks.tscomputeReactionVisibilityFilter).
Ruling-ref: .claude/skills/pm-dispatch/references/triage-duties.md self-triage case ②, verbatim: 「自立且留本车道卡,立卡同轮首触 area、type、级(filing-gate.md)、size 与审计」
Grade: area:data · Bug · Impeded (reactions on some comments silently missing on one discussion surface; fails closed, nothing leaks, nothing stored is wrong) · rare (more than 2,000 reaction rows under one read's where, with no row budget or a budget of 2,000 or more) · read (code, os-dev report on #39313 and the PR #39342 L1) ⇒ p3. Stays a sub-issue of topic #39077. A fix that leaves the bounded probe for a ReadableIds leaf (ADR-0139 D5.2, #23732) stops for a maintainer ruling.
Review: triage
Claim: PM loop, zone comments-39077 of seat repo:objectstack@os-bill (topic #39077; the maintainer's word 2026-12-02 21:55Z 「接手过来的 os-support-ai 的任务和专题不分优先级都要处理」)
Area: comments-39077
Session: session_01Utp6Ca2yTZZiHWkyVgD2oK
Account: os-bill
Branch: claude/issue-39344-reaction-prescan-window
Worktree: objectstack-issue-39344
Domain: domain:server
Seat: repo:objectstack@os-bill
File surface: packages/plugins/plugin-audit/src/comment-access-hooks.ts and its test file(s) beside it in the same source folder; changesets. Expected direction: stay inside the bounded probe (ADR-0139 D5.2) and make the reaction read gate stop dropping readable comments past the 2,000-row pre-scan window, for example by judging the readability of the comment ids the read itself names rather than scanning reaction rows. If the only fix moves reactions to a ReadableIds leaf, changes what callers can read, or needs a new surface, stop and report needs_decision with the options. Stop on breach; explain in the report.
Container & model: S, mode:subagent, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate), effort: medium
Clause-②: no
Metadata-protocol: none
Responsibility: this repo's own code (plugin-audit comment access hooks, objectstack): the reaction visibility pre-scan reads at most 2,000 rows and narrows the read to those rows' comments | no platform path covers it | discussion reads with more than 2,000 reactions under one read and no budget or a budget of 2,000 or more; reachable today
Thread-read: 7381011562
Premise: read on main by the #39313 os-dev (report 7380601301) and the PR #39342 L1; the dev re-reads first.
Serial constraints cleared: check-handover.mjs --inflight → NO OVERLAP READ (2 claims name no path: #35238 and #33684 unclaimed, read by hand, neither on comment access hooks).
Paused, not released: the maintainer paused all p3 work, relayed by seat repo:objectstack@os-bill at 2026-12-03T14:48Z. The claim stays as written.
State: the fix is built and tested but not opened as a PR. It is pushed to claude/issue-39344-reaction-prescan-window at 547da2557c05407f98220c5ced654a1d8ab5f6cb (base 850d240b); 547da255 only adds the changeset to 0e656151.
Route: it stays inside the bounded probe (ADR-0139 D5.2) and adds no leaf and no new surface. When a reaction read's where names comment_id (a bare id, $eq, or $in of 1 to 2,000 ids, at the top level or in a top-level $and conjunct), the gate checks which of those named comments the caller can read and scans no reaction rows. Every other read shape keeps the existing 2,000-row scan, and that remaining truncation is stated in the changeset. The emitted $in never grows past the read's own list, so it does not worsen driver-sql: a plain $in compiles to one unbounded whereIn, so a read binding more than 1,000 ids fails on Oracle (ORA-01795) and past 2,100 parameters on SQL Server #39312.
Evidence (dev's, local):comment-reaction-access.integration.test.ts 32/32 passed, 8 of them new (2,005 rows; find, count and aggregate; paged reads; the $and form; the unreadable comment stays out). With the fix ablated, 6 fail. The package suite passes 1979/1979 and typecheck passes.
Left when p3 resumes:
Re-run dispatch-gates families 59 to 73, --ran and overlap-check.mjs on the head.
Open the draft PR through the relay (Fixes #39344, the Clause-②: no and Metadata-protocol: none lines, the edited files named in the body).
Activity
objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK
Triage: first-touch audit (lane self-triage, case ②: filed by this zone and kept in it; area, type, grade and size touched in the filing round) · area:data · Bug · p3 · size S · no
domain:*written here (triage's; the fix sits inpackages/plugins/plugin-audit/src/comment-access-hooks.tscomputeReactionVisibilityFilter).Ruling-ref:
.claude/skills/pm-dispatch/references/triage-duties.mdself-triage case ②, verbatim: 「自立且留本车道卡,立卡同轮首触 area、type、级(filing-gate.md)、size 与审计」Grade: area:data · Bug · Impeded (reactions on some comments silently missing on one discussion surface; fails closed, nothing leaks, nothing stored is wrong) · rare (more than 2,000 reaction rows under one read's
where, with no row budget or a budget of 2,000 or more) · read (code, os-dev report on #39313 and the PR #39342 L1) ⇒ p3. Stays a sub-issue of topic #39077. A fix that leaves the bounded probe for a ReadableIds leaf (ADR-0139 D5.2, #23732) stops for a maintainer ruling.Review: triage
objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK
Claim: PM loop, zone comments-39077 of seat
repo:objectstack@os-bill(topic #39077; the maintainer's word 2026-12-02 21:55Z 「接手过来的 os-support-ai 的任务和专题不分优先级都要处理」)Area: comments-39077
Session:
session_01Utp6Ca2yTZZiHWkyVgD2oKAccount:
os-billBranch:
claude/issue-39344-reaction-prescan-windowWorktree:
objectstack-issue-39344Domain:
domain:serverSeat:
repo:objectstack@os-billFile surface:
packages/plugins/plugin-audit/src/comment-access-hooks.tsand its test file(s) beside it in the same source folder; changesets. Expected direction: stay inside the bounded probe (ADR-0139 D5.2) and make the reaction read gate stop dropping readable comments past the 2,000-row pre-scan window, for example by judging the readability of the comment ids the read itself names rather than scanning reaction rows. If the only fix moves reactions to a ReadableIds leaf, changes what callers can read, or needs a new surface, stop and report needs_decision with the options. Stop on breach; explain in the report.Container & model:
S,mode:subagent,model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate),effort: mediumClause-②: no
Metadata-protocol: none
Responsibility:
this repo's own code (plugin-audit comment access hooks, objectstack): the reaction visibility pre-scan reads at most 2,000 rows and narrows the read to those rows' comments | no platform path covers it | discussion reads with more than 2,000 reactions under one read and no budget or a budget of 2,000 or more; reachable todayThread-read: 7381011562
Premise: read on
mainby the #39313 os-dev (report 7380601301) and the PR #39342 L1; the dev re-reads first.Serial constraints cleared:
check-handover.mjs --inflight→ NO OVERLAP READ (2 claims name no path: #35238 and #33684 unclaimed, read by hand, neither on comment access hooks).objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK
Paused, not released: the maintainer paused all p3 work, relayed by seat
repo:objectstack@os-billat 2026-12-03T14:48Z. The claim stays as written.State: the fix is built and tested but not opened as a PR. It is pushed to
claude/issue-39344-reaction-prescan-windowat547da2557c05407f98220c5ced654a1d8ab5f6cb(base850d240b);547da255only adds the changeset to0e656151.comment_id(a bare id,$eq, or$inof 1 to 2,000 ids, at the top level or in a top-level$andconjunct), the gate checks which of those named comments the caller can read and scans no reaction rows. Every other read shape keeps the existing 2,000-row scan, and that remaining truncation is stated in the changeset. The emitted$innever grows past the read's own list, so it does not worsen driver-sql: a plain$incompiles to one unboundedwhereIn, so a read binding more than 1,000 ids fails on Oracle (ORA-01795) and past 2,100 parameters on SQL Server #39312.comment-reaction-access.integration.test.ts32/32 passed, 8 of them new (2,005 rows; find, count and aggregate; paged reads; the$andform; the unreadable comment stays out). With the fix ablated, 6 fail. The package suite passes 1979/1979 and typecheck passes.Left when p3 resumes:
--ranandoverlap-check.mjson the head.Fixes #39344, theClause-②: noandMetadata-protocol: nonelines, the edited files named in the body).