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
Record discussion reactions: the row budget counts the whole thread in the record page payload but each 100-comment batch in the client's direct read, so one thread's reactions can be declined on one surface and shown on another #39313
立卡门类别:① 评审发现的同族缺陷(PR #39308 与 PR #39309 的 L1 评审)。Source: #39297
Part of #39077 · family of #39271, #39296, #39297 (one discussion read, two doors)
定级:area:data · Bug · priority:p3 · size S–M · reach: a deployment with OS_DATA_QUERY_ROW_BUDGET, a thread over 100 comments, and reactions near the budget · evidence: read (code)
On a deployment with OS_DATA_QUERY_ROW_BUDGET, the record page payload (answerDiscussion → readReactions, packages/rest/src/record-page-routes.ts) refuses the reactions part when the thread's reaction rows together exceed the budget. That is #39309's cross-chunk walked, and it keeps the single-$in semantics main already had. The client's direct read (readCommentReactionRows in ui/packages/app-shell/src/views/useRecordDiscussion.ts) reads REACTION_READ_COMMENT_IDS = 100 ids per batch, in parallel. Each batch is its own query against its own budget (#39308 cuts each batch's last page at the budget and rejects past it), and any batch rejection drops all reactions (records = null). So for a thread of more than 100 comments whose total reactions exceed the budget while no 100-comment batch does, the record page shows the comments without reactions, while a surface that mounts the discussion without the payload (for example the list-page comments entry of #39077, or the phone comments page) shows them all. The reverse also holds: a thread with one heavy 100-batch is declined on the client while the payload can still answer it if the total fits. User-visible, but rare: it needs a configured budget, a thread over 100 comments, and reactions near the budget. It exists on main today (single $in against 100-batches); #39309 preserves it and does not introduce it. Fix: one rule for what the budget bounds on a chunked discussion read, either the logical stream (the server's choice) or each query, applied on both sides with matching or irrelevant batch sizes. If the rule changes what the budget means for the data door's consumers, it is a maintainer ruling.
Acceptance: on a double with a budget and a thread over the client batch size, both doors give the same reactions answer (all shown, or both declined); a test pins it and goes red without the fix.
Clause-②: no (expected; a change to what the budget bounds for other data-door consumers is a stop for a ruling) · Metadata-protocol: none.
Dedupe: reaction batch row budget, REACTION_READ_COMMENT_IDS budget, record page payload vs direct read reactions declined (open issues) → none; adjacent #39296 (per-read last-page cut).
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–M · no domain:* written here (triage's; the fix spans ui/packages/app-shell/src/views/useRecordDiscussion.ts and possibly packages/rest/src/record-page-routes.ts).
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 shown on one surface and declined on another; nothing stored is wrong) · rare configuration (row budget set, thread over 100 comments, reactions near the budget) · read (code, two L1 traces) ⇒ p3. Stays a sub-issue of topic #39077. If the fix changes what the budget bounds for other data-door consumers, the builder stops for a maintainer ruling.
Review: triage
Triage: lands in area:data · domain:server · Bug · p3 · pm:queue · size S–M, touched 2026-12-03T12:13Z. Rationale: the filer's grade stands. The record-page payload and the direct client read count the row budget differently for reactions, so a rare edge of one discussion can render at one door and be refused at the other. It is in the #39077 family. If the fix changes what the row budget means, the lane puts that to the maintainer first, as the card already says.
Grade: area:data · Bug · p3 · budget deployments, threads over 100 comments with reactions near the budget · read (code).
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-39313-reaction-budget-scope
Worktree: objectstack-issue-39313
Domain: domain:server
Seat: repo:objectstack@os-bill
File surface: ui/packages/app-shell/src/views/useRecordDiscussion.ts; ui/packages/app-shell/src/views/useRecordDiscussion.test.tsx; packages/rest/src/record-page-routes.ts; packages/rest/src/record-page-routes.test.ts; changesets. Expected direction: the client's batched reaction read applies the same rule the payload already applies (the budget bounds the thread's reaction rows as one logical read, counted across batches), so the data door's budget meaning does not change. If the only fix changes what the row budget bounds for other data-door consumers, or needs a new client/server 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 prints no path-derived mandate), effort: medium
Clause-②: no
Metadata-protocol: none
Responsibility: this repo's own code (ui/packages/app-shell + packages/rest, objectstack): the payload counts the reaction budget across the whole thread, the client per 100-comment batch | no platform path covers it | record discussion on a budget deployment, threads over 100 comments with reactions near the budget; reachable today
Thread-read: 7377848037
Premise: holds on main2417d66 by the L1 traces on PR #39308 and PR #39309; the dev re-reads first.
Serial constraints cleared: check-handover.mjs --inflight → NO OVERLAP READ; PR #39308 and PR #39309 (same files) merged 2026-12-03 12:12Z and 12:33Z.
{
"issue": 39313,
"status": "done",
"branch": "claude/issue-39313-reaction-budget-scope",
"pr": "https://github.com/objectstack-ai/objectstack/pull/39342",
"session": "session_01Utp6Ca2yTZZiHWkyVgD2oK",
"premise_still_valid": true,
"summary": "Premise re-read on main 6b2e5960 (includes #39308 and #39309): it holds. The payload's readReactions counts every chunk's rows against OS_DATA_QUERY_ROW_BUDGET through the walked count. The client's readCommentReactionRows reads 100-id batches in parallel, and the door judges each batch alone. Fix, client only, with no new surface and no change to what the door's budget means: when more than one batch answered rows, the client sends one walk read of the last answering batch at $skip = (rows read together) - 1, $top = 1. The door refuses that read before running it exactly when the rows together are past the budget, the same rule budgetRefusalOfWalk applies server side. A budget refusal, any other refusal or a failure rejects, and the caller shows the comments without reactions, as the payload's refused part does. A non-budget 400 leaves the rows standing. The client never learns the budget number. record-page-routes.ts is unchanged: its test file gains the twin case table, so both doors are pinned to the same answers. Observation C (READ_SCAN_LIMIT pre-scan) is confirmed by reading and reported below, not changed.",
"tests": "At fb3b009e: `pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/useRecordDiscussion.test.tsx packages/app-shell/src/views/ObjectView.phoneCommentsPage-39086.test.tsx`: Test Files 2 passed, Tests 40 passed. The 7 RecordDetailView suites that read sys_comment_reaction: Test Files 7 passed, Tests 71 passed. `pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/record-page-routes.test.ts`: Tests 60 passed (-t 39313 --reporter=verbose: 6 passed, 54 skipped). Typechecks: @object-ui/app-shell type-check (tsc src + tsconfig.test.json) exit 0, after building its dependency closure with turbo --filter='@object-ui/app-shell^...' (72 tasks); @objectstack/rest typecheck (tsc + check:test-typecheck) exit 0. Ablation, with the fix committed first, through scripts/ablation-replace.mjs: the anchor 'if (answering.length > 1) {' was replaced by 'if (answering.length > 1 && false) {' (anchor x1 to x0, blob 6a0a0938 to b8619467). Result: Tests 3 failed | 21 passed. The two 'rows together past the budget, no batch past it' cases (unpaged and page 4) and the walk-window test went red. Restored: blob == HEAD, git diff HEAD empty. app-shell tests resolve source, so the ablation needed no dist.",
"gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at fb3b009e: 68 commands. Each ran with its exit code captured before any pipe, and --ran reconciliation reported: 68 derived, 66 run, 2 NOT-MEASURED, 0 UNRUN. NOT MEASURED, both exit 3 PREREQUISITE NOT MET: check-plugin-teardown-shape.mjs --self-test (a shallow clone cannot reach its pinned fixture commit) and check:dual-build-cjs-loads (no dist for about 35 packages; it needs a full build). Three commands that hit a 200 s per-command cap were rerun alone and exited 0: check:query-options-erasure, check-comment-mask-corpus.mjs (24945 files, 0 disagree, 214 s) and ui vitest scripts/ (172 files passed, run with --maxWorkers=2). overlap-check.mjs: VERDICT clean exit 0 against origin/main 170f9f82, 0 PR heads. origin/main moved 3 commits past the base, none on the touched surfaces, so no merge was made. The control-byte grep over the 4 edited files had 0 hits. CI check-runs: not awaited per contract (PR opened at fb3b009e; families such as Lint & Repo Gates, Test UI, Type Check UI and Test Core are CI's).",
"mcp_calls": "0",
"api_writes": "2 relay dispatches, each POST /repos/objectstack-ai/objectstack/dispatches. 1: pr_create, executed as POST /repos/objectstack-ai/objectstack/pulls (draft forced) + POST /repos/objectstack-ai/objectstack/issues/39342/assignees [os-bill]; read-back 6783 bytes sent and stored, identical. 2: this os-dev-report comment, POST /repos/objectstack-ai/objectstack/issues/39313/comments via post-stamped.mjs. git push is not counted.",
"classifier_refusals": [],
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"class: a (candidate) · reach: NOT MEASURED, read only, no public-door run · evidence: computeReactionVisibilityFilter in packages/plugins/plugin-audit/src/comment-access-hooks.ts pre-scans at most READ_SCAN_LIMIT = 2,000 sys_comment_reaction rows of the read's where, in the caller's orderBy, under system context. It then narrows the read to comment_id in the comments those rows name, so a comment none of whose reactions falls in the first 2,000 candidate rows is filtered out (fail closed, one warn line). Its own comment says a comment feed 'never hits this', but one client batch (100 comment ids) or one payload chunk (REACTION_READ_CHUNK_SIZE = 500 ids) with more than 2,000 reaction rows does, and the two doors cross that line at different thread sizes: another two-door disagreement. A paged read past row 2,000 also loses rows, because the pre-scan has no offset. It bites only with no row budget or a budget over 2,000. Confirms reviewer observation C; nothing changed (outside the file surface) · dedupe words: reaction READ_SCAN_LIMIT pre-scan, comment reaction visibility 2000 rows, reaction read gate fail-closed truncation · carrier: seat repo:objectstack@os-bill, zone comments-39077 (topic #39077) · noted, not filed"
]
}
2026-12-03T14:54Z · Close-out · PR #39342 merged (2026-12-03T14:54Z, merge commit ac14a744b7), closing this card as Fixes #39313 intended.
Delivered: the client's batched reaction read now counts the row budget across its 100-id batches the way the record page payload does. When more than one batch answered rows, one extra one-row walk read lets the door refuse exactly when the rows together pass the budget. The client still never learns the budget number. Both doors are pinned to the same case table. ACCEPT 7381463285.
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–M · no
domain:*written here (triage's; the fix spansui/packages/app-shell/src/views/useRecordDiscussion.tsand possiblypackages/rest/src/record-page-routes.ts).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 shown on one surface and declined on another; nothing stored is wrong) · rare configuration (row budget set, thread over 100 comments, reactions near the budget) · read (code, two L1 traces) ⇒ p3. Stays a sub-issue of topic #39077. If the fix changes what the budget bounds for other data-door consumers, the builder stops for a maintainer ruling.
Review: triage
objectstack-fleet commentedon Dec 3, 2026
triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in area:data · domain:server · Bug · p3 · pm:queue · size S–M, touched 2026-12-03T12:13Z. Rationale: the filer's grade stands. The record-page payload and the direct client read count the row budget differently for reactions, so a rare edge of one discussion can render at one door and be refused at the other. It is in the #39077 family. If the fix changes what the row budget means, the lane puts that to the maintainer first, as the card already says.
Grade: area:data · Bug · p3 · budget deployments, threads over 100 comments with reactions near the budget · read (code).
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-39313-reaction-budget-scopeWorktree:
objectstack-issue-39313Domain:
domain:serverSeat:
repo:objectstack@os-billFile surface:
ui/packages/app-shell/src/views/useRecordDiscussion.ts;ui/packages/app-shell/src/views/useRecordDiscussion.test.tsx;packages/rest/src/record-page-routes.ts;packages/rest/src/record-page-routes.test.ts; changesets. Expected direction: the client's batched reaction read applies the same rule the payload already applies (the budget bounds the thread's reaction rows as one logical read, counted across batches), so the data door's budget meaning does not change. If the only fix changes what the row budget bounds for other data-door consumers, or needs a new client/server 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 prints no path-derived mandate),effort: mediumClause-②: no
Metadata-protocol: none
Responsibility:
this repo's own code (ui/packages/app-shell + packages/rest, objectstack): the payload counts the reaction budget across the whole thread, the client per 100-comment batch | no platform path covers it | record discussion on a budget deployment, threads over 100 comments with reactions near the budget; reachable todayThread-read: 7377848037
Premise: holds on
main2417d66 by the L1 traces on PR #39308 and PR #39309; the dev re-reads first.Serial constraints cleared:
check-handover.mjs --inflight→ NO OVERLAP READ; PR #39308 and PR #39309 (same files) merged 2026-12-03 12:12Z and 12:33Z.objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK
os-dev-report
{ "issue": 39313, "status": "done", "branch": "claude/issue-39313-reaction-budget-scope", "pr": "https://github.com/objectstack-ai/objectstack/pull/39342", "session": "session_01Utp6Ca2yTZZiHWkyVgD2oK", "premise_still_valid": true, "summary": "Premise re-read on main 6b2e5960 (includes #39308 and #39309): it holds. The payload's readReactions counts every chunk's rows against OS_DATA_QUERY_ROW_BUDGET through the walked count. The client's readCommentReactionRows reads 100-id batches in parallel, and the door judges each batch alone. Fix, client only, with no new surface and no change to what the door's budget means: when more than one batch answered rows, the client sends one walk read of the last answering batch at $skip = (rows read together) - 1, $top = 1. The door refuses that read before running it exactly when the rows together are past the budget, the same rule budgetRefusalOfWalk applies server side. A budget refusal, any other refusal or a failure rejects, and the caller shows the comments without reactions, as the payload's refused part does. A non-budget 400 leaves the rows standing. The client never learns the budget number. record-page-routes.ts is unchanged: its test file gains the twin case table, so both doors are pinned to the same answers. Observation C (READ_SCAN_LIMIT pre-scan) is confirmed by reading and reported below, not changed.", "tests": "At fb3b009e: `pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/useRecordDiscussion.test.tsx packages/app-shell/src/views/ObjectView.phoneCommentsPage-39086.test.tsx`: Test Files 2 passed, Tests 40 passed. The 7 RecordDetailView suites that read sys_comment_reaction: Test Files 7 passed, Tests 71 passed. `pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/record-page-routes.test.ts`: Tests 60 passed (-t 39313 --reporter=verbose: 6 passed, 54 skipped). Typechecks: @object-ui/app-shell type-check (tsc src + tsconfig.test.json) exit 0, after building its dependency closure with turbo --filter='@object-ui/app-shell^...' (72 tasks); @objectstack/rest typecheck (tsc + check:test-typecheck) exit 0. Ablation, with the fix committed first, through scripts/ablation-replace.mjs: the anchor 'if (answering.length > 1) {' was replaced by 'if (answering.length > 1 && false) {' (anchor x1 to x0, blob 6a0a0938 to b8619467). Result: Tests 3 failed | 21 passed. The two 'rows together past the budget, no batch past it' cases (unpaged and page 4) and the walk-window test went red. Restored: blob == HEAD, git diff HEAD empty. app-shell tests resolve source, so the ablation needed no dist.", "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at fb3b009e: 68 commands. Each ran with its exit code captured before any pipe, and --ran reconciliation reported: 68 derived, 66 run, 2 NOT-MEASURED, 0 UNRUN. NOT MEASURED, both exit 3 PREREQUISITE NOT MET: check-plugin-teardown-shape.mjs --self-test (a shallow clone cannot reach its pinned fixture commit) and check:dual-build-cjs-loads (no dist for about 35 packages; it needs a full build). Three commands that hit a 200 s per-command cap were rerun alone and exited 0: check:query-options-erasure, check-comment-mask-corpus.mjs (24945 files, 0 disagree, 214 s) and ui vitest scripts/ (172 files passed, run with --maxWorkers=2). overlap-check.mjs: VERDICT clean exit 0 against origin/main 170f9f82, 0 PR heads. origin/main moved 3 commits past the base, none on the touched surfaces, so no merge was made. The control-byte grep over the 4 edited files had 0 hits. CI check-runs: not awaited per contract (PR opened at fb3b009e; families such as Lint & Repo Gates, Test UI, Type Check UI and Test Core are CI's).", "mcp_calls": "0", "api_writes": "2 relay dispatches, each POST /repos/objectstack-ai/objectstack/dispatches. 1: pr_create, executed as POST /repos/objectstack-ai/objectstack/pulls (draft forced) + POST /repos/objectstack-ai/objectstack/issues/39342/assignees [os-bill]; read-back 6783 bytes sent and stored, identical. 2: this os-dev-report comment, POST /repos/objectstack-ai/objectstack/issues/39313/comments via post-stamped.mjs. git push is not counted.", "classifier_refusals": [], "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "class: a (candidate) · reach: NOT MEASURED, read only, no public-door run · evidence: computeReactionVisibilityFilter in packages/plugins/plugin-audit/src/comment-access-hooks.ts pre-scans at most READ_SCAN_LIMIT = 2,000 sys_comment_reaction rows of the read's where, in the caller's orderBy, under system context. It then narrows the read to comment_id in the comments those rows name, so a comment none of whose reactions falls in the first 2,000 candidate rows is filtered out (fail closed, one warn line). Its own comment says a comment feed 'never hits this', but one client batch (100 comment ids) or one payload chunk (REACTION_READ_CHUNK_SIZE = 500 ids) with more than 2,000 reaction rows does, and the two doors cross that line at different thread sizes: another two-door disagreement. A paged read past row 2,000 also loses rows, because the pre-scan has no offset. It bites only with no row budget or a budget over 2,000. Confirms reviewer observation C; nothing changed (outside the file surface) · dedupe words: reaction READ_SCAN_LIMIT pre-scan, comment reaction visibility 2000 rows, reaction read gate fail-closed truncation · carrier: seat repo:objectstack@os-bill, zone comments-39077 (topic #39077) · noted, not filed" ] }objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK
2026-12-03T14:54Z · Close-out · PR #39342 merged (2026-12-03T14:54Z, merge commit
ac14a744b7), closing this card asFixes #39313intended.pm:dispatchedremoved in this stroke;domain:*andarea:*stay.