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
inbox feed: sys_notification_receipt and sys_inbox_message have no index on created_at, so the badge's window reads sort the user's whole history every poll #35530
Filing gate: ③ an out-of-scope finding of the #35410 dev (os-dev-report 7010857170, PR #35519 Acceptance notes), read in the object definitions and not measured. L1-a named it as owed (ACCEPT 7011659709). It is a follow-up of the #34211 page-load work and is nested under #34211.
Reader: domain:server (the messaging objects' index declarations). Suggested grade: p3 (not a landing block at the 20-row window; the cost grows with a user's receipt history).
Dedupe: notification receipt index created_at, inbox message index, sys_inbox_message index. No open card.
sys_notification_receipt indexes (notification_id, user_id, channel) (unique) and (user_id, state). sys_inbox_message declares none. Neither has created_at in an index, so each read sorts the user's rows.
Ask
Add a (user_id, channel, created_at) index on sys_notification_receipt and a (user_id, created_at) index on sys_inbox_message. Measure the two reads' query plan or time before and after on a user with a large history (e.g. a few thousand receipts). Check whether adding an index is a metadata-protocol or Clause-② change for these system objects and declare it.
Triage: lands in domain:server · pm:queue; rationale: area:data · Bug · Impeded (no created_at index on the receipt and inbox tables, so the badge's window read sorts the whole history) · users with large histories, read in definitions and not measured → p3 as set. Area moved from ux to data: the fix is an index declaration, not a screen.
Claim: PM loop round 1
Session: session_01L9qibvVRcFWKrfWeG5jzPb
Account: os-tesla
Branch: claude/issue-35530-inbox-created-at-index
Worktree: objectstack-issue-35530
Domain: domain:server
Seat: repo:objectstack#7
Area: d7-C
File surface: packages/services/service-messaging/src/objects/notification-receipt.object.ts, packages/services/service-messaging/src/objects/inbox-message.object.ts, their tests beside them or under packages/services/service-messaging/src/**/__tests__/, any generated baseline the index change moves (named in the report), and one .changeset/35530-*.md (stop on breach; explain in the report)
Container & model: M, mode:subagent, model: opus (default tier; no path-derived mandate for packages/services/service-messaging), effort: medium
Clause-②: no
Metadata-protocol: none
Responsibility: service-messaging system objects in objectstack | sys_notification_receipt indexes (notification_id,user_id,channel) and (user_id,state), sys_inbox_message declares none; the inbox badge reads both by user newest-first top 20 every 10 s | signed-in users with a large receipt/inbox history, reachable today
Thread-read: 7012603117
Premise: holds (origin/main 2ad42b5: notification-receipt.object.ts :113-116 has the two indexes above, no created_at; inbox-message.object.ts declares no indexes)
Serial constraints cleared: overlap-check probe over the two object files at origin/main 2ad42b5: VERDICT clean, 0 open PR heads share them
Pre-claim lane: packages/services/** (domain:server); area:data, seat 7 d7-C per Tesla 「5号只处理在手任务」.
Pre-claim deps: no Blocked-by:; #35410 closed, #35519 merged.
Prior rulings read: inbox,feed,sys_notification_receipt,sys_inbox_message,index,created_at,badge,window,reads,sort,user,whole (+2 more) → 230 hits; ADR-0030 Decision §2, ADR-0030 Decision §5, ADR-0036 Decision §1, ADR-0131 D13, ADR-0145 D2, ADR-0003 Decision §3; thread: none; repo: objectstack-ai/objectstack. ADR-0030 §5 (read-state lives in sys_notification_receipt per recipient×channel) stands; an index adds no field and moves no read path.
Owed review: L1 by L1-a; the card asks the dev to determine whether an index is a metadata-protocol or Clause-② change for these system objects; if it is, the claim is amended and the owed review re-graded.
{
"issue": 35530,
"status": "done",
"branch": "claude/issue-35530-inbox-created-at-index",
"pr": "https://github.com/objectstack-ai/objectstack/pull/35860",
"session": "session_01L9qibvVRcFWKrfWeG5jzPb",
"premise_still_valid": true,
"summary": "Added (user_id, channel, created_at) to sys_notification_receipt beside its two existing indexes, and (user_id, created_at) as sys_inbox_message's first declared index. check:keyed-text-bounds requires a bound on a keyed text column, so sys_inbox_message.user_id also declares maxLength 255, the sys_user id width and the bound sys_notification_receipt.user_id already carries. Added a pin file with 5 tests: the built declarations, the indexes schema sync creates on SqlDriver/better-sqlite3, and the SQLite plan of the SQL the engine actually emits for each bell read, which SEARCHes the new index. Added a patch changeset. Measurements (SQLite, real ObjectQL over SqlDriver; 28,000 inbox rows, 56,000 receipts; target user 5,000 rows of each kind spread over the timeline; a quiet user 3,000 rows all older than everyone else's; mean of 300 runs after ANALYZE). Receipt read: before, SEARCH idx_sys_notification_receipt_user_id_state (user_id=?) + USE TEMP B-TREE FOR ORDER BY, 3.07 ms (target) / 1.77 ms (quiet); after, SEARCH idx_sys_notification_receipt_user_id_channel_created_at (user_id=? AND channel=?) + USE TEMP B-TREE FOR LAST TERM OF ORDER BY (the id tie-breaker only), 0.10 / 0.11 ms. Inbox read: before, SCAN USING INDEX idx_sys_inbox_message_created_at_id, 0.77 / 4.66 ms; after, SEARCH idx_sys_inbox_message_user_id_created_at (user_id=?) + LAST TERM sort, 0.13 / 0.13 ms. A four-column variant ending in id removes the LAST TERM step but measured the same within noise (0.09 to 0.14 ms), and it would need a bound on the builtin id field, so the shipped shapes are the three-column ones the card asks for. PostgreSQL and MySQL were not measured: no server was available or set up. Protocol finding: Metadata-protocol none and Clause-② no, as the claim declared, so nothing stopped the push. packages/spec is untouched, indexes is an existing key, these are platform-shipped system objects, and no generated baseline or snapshot moves. The maxLength makes a user_id longer than 255 characters fail at the engine write seam. The data API answers 405 to writes on this object and the only writer stores a sys_user id, so no published accepted set narrows. File surface held: the two object files, one test file in src/objects, and one .changeset/35530-*.md. No generated baseline moved.",
"tests": "head f31a9c36f8 (final head 00e05a7e20 changes only the new test file: two `as any` casts removed). `pnpm --filter @objectstack/service-messaging exec vitest run --maxWorkers=2`: Test Files 75 passed (75), Tests 1020 passed (1020), lock VERDICT command-exit 0. New file re-run on the final content: Tests 5 passed (5), VERDICT command-exit 0. `pnpm --filter @objectstack/service-messaging typecheck`: exit 0, and tsc --listFiles includes the new test (1 hit). Ablation via scripts/ablation-replace.mjs (anchor 1 -> 0 proven on disk, restored with blob == HEAD and git diff HEAD empty; the test imports the objects from src, so there is no dist in the path): with the receipt index deleted, 3 failed / 2 passed (receipt declaration, sync, receipt plan); with the inbox index deleted, 3 failed / 2 passed (inbox declaration, sync, inbox plan: expected [ Array(1) ] to include 'SEARCH sys_inbox_message USING INDEX ...'). Measurement script (scratchpad, not committed): tsx measure.mts WORKTREE none|three|four|shipped, with WHO=usr_target|usr_quiet.",
"gates": "Local: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 66 families at 5b6498c76a/f31a9c36f8. All 66 ran with exit codes captured before any pipe. `--ran` reconciliation: 66 derived, 64 run, 2 NOT-MEASURED (DERIVED from recorded exit 3). Exit 0 includes check:keyed-text-bounds (186 judged / 186 bounded), check:nul-bytes, check:platform-object-tenancy-census, check:adr-0087-registration --base origin/main, check-changeset-no-major, check-empty-changeset, check:changeset-gate-self-tests, check:engine-double-contract, check:cross-package-test-inputs and check:test-source-alias; the test-reading ones were re-run on 00e05a7e20 (exit 0). check:query-options-erasure was first exit 1 (test surface 236 -> 238, from two `as any` casts on the find queries); the casts were removed and the re-run was exit 0 at 236. NOT MEASURED: check:dual-build-cjs-loads and check:i18n, both exit 3 PREREQUISITE NOT MET because they need the whole repo's dist/ and only the service-messaging closure was built. CI on 00e05a7e20 at report time: 23 check-runs, 5 completed/skipped (Schedule gate, Borrowed queue verdict, Queue verdict, 18.x upgrade harness opt-in, Packed-tarball smoke opt-in), the rest in_progress (Lint x7, Type Check x4, Check Changeset, Check PR Size, PR-body guards, Governed Surface Queue Guard, filter, Flag docs affected). Test Core and the other required contexts had not reported yet.",
"dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "2 relay writes + 2 git pushes. The relay writes are fleet-write pr_create (POST /repos/objectstack-ai/objectstack/pulls as a draft, plus the POST /issues/35860/assignees leg [os-tesla]) and post-stamped os-dev-report (POST /repos/objectstack-ai/objectstack/issues/35530/comments). The git pushes are the empty branch probe and the commits; they are not REST writes.",
"open_questions": [
{
"question": "Existing MySQL deployments: sys_inbox_message.user_id is TEXT there, and additive schema sync never rewrites a column type, so MySQL refuses the new (user_id, created_at) index. Reading the code, syncDeclaredIndexes logs the refusal on the durability channel and throws it with the TEXT explanation. This was not measured, because no MySQL server was available. Does that need more than the operator note in the changeset?",
"options": [
"A: land as is. The changeset tells the operator to MODIFY user_id varchar(255) NOT NULL, the same treatment the earlier keyed-text-bounds change gave its columns.",
"B: before landing, measure the boot on a MySQL upgrade fixture to confirm the object stays registered and served after the refusal."
],
"recommendation": "A, because this is the existing class the keyed-text-bounds precedent shipped under. The index is functional, not durability-bearing, and a fresh MySQL database builds it directly. B is worth a separate card only if the seat doubts that the refusal is per object rather than per boot."
}
],
"security_findings": "none",
"out_of_scope_findings": []
}
Claim amendment 1 (claim 7039713219). PR #35860 is narrowed to the receipt index by a seat ruling and now reads Part of #35530.
What the trace found. By reading origin/main 3c038eb152, the dev's trace shows that on an existing MySQL deployment sys_inbox_message.user_id is TEXT. The new (user_id, created_at) index would be refused, and the throw from syncDeclaredIndexes skips that object's remaining per-boot schema steps on every boot. The boot survives and the object stays registered and served, through the objectql per-object catch. No drift op converts TEXT to varchar.
What ships.sys_notification_receipt gains (user_id, channel, created_at). On SQLite the bell receipt read drops from about 3 ms to 0.1 ms. inbox-message.object.ts is restored to main.
The surface shrinks tonotification-receipt.object.ts, its pin file src/objects/inbox-feed-window-indexes.integration.test.ts and .changeset/35530-inbox-window-indexes.md.
PR #35860 merged 2026-11-20T14:40Z: sys_notification_receipt now declares (user_id, channel, created_at), and the bell's receipt window read is served by it. On SQLite the read went from about 3 ms to 0.1 ms.
The remaining ask, the sys_inbox_message(user_id, created_at) index, is parked behind #35862. On existing MySQL tables user_id is TEXT, and the index needs the driver-sql refusal-continue fix and the TEXT→varchar convergence first (claim amendment 7041110219). The claim is released, pm:dispatched is off, and pm:blocked is on.
Blocked-by: #35862
Activity
objectstack-fleet commentedon Nov 19, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in
domain:server·pm:queue; rationale: area:data · Bug · Impeded (nocreated_atindex on the receipt and inbox tables, so the badge's window read sorts the whole history) · users with large histories, read in definitions and not measured → p3 as set. Area moved fromuxtodata: the fix is an index declaration, not a screen.objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
Claim: PM loop round 1
Session:
session_01L9qibvVRcFWKrfWeG5jzPbAccount:
os-teslaBranch:
claude/issue-35530-inbox-created-at-indexWorktree:
objectstack-issue-35530Domain:
domain:serverSeat:
repo:objectstack#7Area:
d7-CFile surface:
packages/services/service-messaging/src/objects/notification-receipt.object.ts,packages/services/service-messaging/src/objects/inbox-message.object.ts, their tests beside them or underpackages/services/service-messaging/src/**/__tests__/, any generated baseline the index change moves (named in the report), and one.changeset/35530-*.md(stop on breach; explain in the report)Container & model:
M,mode:subagent,model: opus (default tier; no path-derived mandate for packages/services/service-messaging),effort: mediumClause-②: no
Metadata-protocol: none
Responsibility:
service-messaging system objects in objectstack | sys_notification_receipt indexes (notification_id,user_id,channel) and (user_id,state), sys_inbox_message declares none; the inbox badge reads both by user newest-first top 20 every 10 s | signed-in users with a large receipt/inbox history, reachable todayThread-read: 7012603117
Premise: holds (origin/main 2ad42b5: notification-receipt.object.ts :113-116 has the two indexes above, no
created_at; inbox-message.object.ts declares noindexes)Serial constraints cleared: overlap-check probe over the two object files at origin/main 2ad42b5: VERDICT clean, 0 open PR heads share them
Pre-claim lane:
packages/services/**(domain:server); area:data, seat 7 d7-C per Tesla 「5号只处理在手任务」.Pre-claim deps: no
Blocked-by:; #35410 closed, #35519 merged.Prior rulings read: inbox,feed,sys_notification_receipt,sys_inbox_message,index,created_at,badge,window,reads,sort,user,whole (+2 more) → 230 hits; ADR-0030 Decision §2, ADR-0030 Decision §5, ADR-0036 Decision §1, ADR-0131 D13, ADR-0145 D2, ADR-0003 Decision §3; thread: none; repo: objectstack-ai/objectstack. ADR-0030 §5 (read-state lives in
sys_notification_receiptper recipient×channel) stands; an index adds no field and moves no read path.Owed review: L1 by L1-a; the card asks the dev to determine whether an index is a metadata-protocol or Clause-② change for these system objects; if it is, the claim is amended and the owed review re-graded.
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
os-dev-report
{ "issue": 35530, "status": "done", "branch": "claude/issue-35530-inbox-created-at-index", "pr": "https://github.com/objectstack-ai/objectstack/pull/35860", "session": "session_01L9qibvVRcFWKrfWeG5jzPb", "premise_still_valid": true, "summary": "Added (user_id, channel, created_at) to sys_notification_receipt beside its two existing indexes, and (user_id, created_at) as sys_inbox_message's first declared index. check:keyed-text-bounds requires a bound on a keyed text column, so sys_inbox_message.user_id also declares maxLength 255, the sys_user id width and the bound sys_notification_receipt.user_id already carries. Added a pin file with 5 tests: the built declarations, the indexes schema sync creates on SqlDriver/better-sqlite3, and the SQLite plan of the SQL the engine actually emits for each bell read, which SEARCHes the new index. Added a patch changeset. Measurements (SQLite, real ObjectQL over SqlDriver; 28,000 inbox rows, 56,000 receipts; target user 5,000 rows of each kind spread over the timeline; a quiet user 3,000 rows all older than everyone else's; mean of 300 runs after ANALYZE). Receipt read: before, SEARCH idx_sys_notification_receipt_user_id_state (user_id=?) + USE TEMP B-TREE FOR ORDER BY, 3.07 ms (target) / 1.77 ms (quiet); after, SEARCH idx_sys_notification_receipt_user_id_channel_created_at (user_id=? AND channel=?) + USE TEMP B-TREE FOR LAST TERM OF ORDER BY (the id tie-breaker only), 0.10 / 0.11 ms. Inbox read: before, SCAN USING INDEX idx_sys_inbox_message_created_at_id, 0.77 / 4.66 ms; after, SEARCH idx_sys_inbox_message_user_id_created_at (user_id=?) + LAST TERM sort, 0.13 / 0.13 ms. A four-column variant ending in id removes the LAST TERM step but measured the same within noise (0.09 to 0.14 ms), and it would need a bound on the builtin id field, so the shipped shapes are the three-column ones the card asks for. PostgreSQL and MySQL were not measured: no server was available or set up. Protocol finding: Metadata-protocol none and Clause-② no, as the claim declared, so nothing stopped the push. packages/spec is untouched, indexes is an existing key, these are platform-shipped system objects, and no generated baseline or snapshot moves. The maxLength makes a user_id longer than 255 characters fail at the engine write seam. The data API answers 405 to writes on this object and the only writer stores a sys_user id, so no published accepted set narrows. File surface held: the two object files, one test file in src/objects, and one .changeset/35530-*.md. No generated baseline moved.", "tests": "head f31a9c36f8 (final head 00e05a7e20 changes only the new test file: two `as any` casts removed). `pnpm --filter @objectstack/service-messaging exec vitest run --maxWorkers=2`: Test Files 75 passed (75), Tests 1020 passed (1020), lock VERDICT command-exit 0. New file re-run on the final content: Tests 5 passed (5), VERDICT command-exit 0. `pnpm --filter @objectstack/service-messaging typecheck`: exit 0, and tsc --listFiles includes the new test (1 hit). Ablation via scripts/ablation-replace.mjs (anchor 1 -> 0 proven on disk, restored with blob == HEAD and git diff HEAD empty; the test imports the objects from src, so there is no dist in the path): with the receipt index deleted, 3 failed / 2 passed (receipt declaration, sync, receipt plan); with the inbox index deleted, 3 failed / 2 passed (inbox declaration, sync, inbox plan: expected [ Array(1) ] to include 'SEARCH sys_inbox_message USING INDEX ...'). Measurement script (scratchpad, not committed): tsx measure.mts WORKTREE none|three|four|shipped, with WHO=usr_target|usr_quiet.", "gates": "Local: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 66 families at 5b6498c76a/f31a9c36f8. All 66 ran with exit codes captured before any pipe. `--ran` reconciliation: 66 derived, 64 run, 2 NOT-MEASURED (DERIVED from recorded exit 3). Exit 0 includes check:keyed-text-bounds (186 judged / 186 bounded), check:nul-bytes, check:platform-object-tenancy-census, check:adr-0087-registration --base origin/main, check-changeset-no-major, check-empty-changeset, check:changeset-gate-self-tests, check:engine-double-contract, check:cross-package-test-inputs and check:test-source-alias; the test-reading ones were re-run on 00e05a7e20 (exit 0). check:query-options-erasure was first exit 1 (test surface 236 -> 238, from two `as any` casts on the find queries); the casts were removed and the re-run was exit 0 at 236. NOT MEASURED: check:dual-build-cjs-loads and check:i18n, both exit 3 PREREQUISITE NOT MET because they need the whole repo's dist/ and only the service-messaging closure was built. CI on 00e05a7e20 at report time: 23 check-runs, 5 completed/skipped (Schedule gate, Borrowed queue verdict, Queue verdict, 18.x upgrade harness opt-in, Packed-tarball smoke opt-in), the rest in_progress (Lint x7, Type Check x4, Check Changeset, Check PR Size, PR-body guards, Governed Surface Queue Guard, filter, Flag docs affected). Test Core and the other required contexts had not reported yet.", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "0", "api_writes": "2 relay writes + 2 git pushes. The relay writes are fleet-write pr_create (POST /repos/objectstack-ai/objectstack/pulls as a draft, plus the POST /issues/35860/assignees leg [os-tesla]) and post-stamped os-dev-report (POST /repos/objectstack-ai/objectstack/issues/35530/comments). The git pushes are the empty branch probe and the commits; they are not REST writes.", "open_questions": [ { "question": "Existing MySQL deployments: sys_inbox_message.user_id is TEXT there, and additive schema sync never rewrites a column type, so MySQL refuses the new (user_id, created_at) index. Reading the code, syncDeclaredIndexes logs the refusal on the durability channel and throws it with the TEXT explanation. This was not measured, because no MySQL server was available. Does that need more than the operator note in the changeset?", "options": [ "A: land as is. The changeset tells the operator to MODIFY user_id varchar(255) NOT NULL, the same treatment the earlier keyed-text-bounds change gave its columns.", "B: before landing, measure the boot on a MySQL upgrade fixture to confirm the object stays registered and served after the refusal." ], "recommendation": "A, because this is the existing class the keyed-text-bounds precedent shipped under. The index is functional, not durability-bearing, and a fresh MySQL database builds it directly. B is worth a separate card only if the seat doubts that the refusal is per object rather than per boot." } ], "security_findings": "none", "out_of_scope_findings": [] }objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
Claim amendment 1 (claim 7039713219). PR #35860 is narrowed to the receipt index by a seat ruling and now reads
Part of #35530.3c038eb152, the dev's trace shows that on an existing MySQL deploymentsys_inbox_message.user_idisTEXT. The new(user_id, created_at)index would be refused, and the throw fromsyncDeclaredIndexesskips that object's remaining per-boot schema steps on every boot. The boot survives and the object stays registered and served, through the objectql per-object catch. No drift op converts TEXT to varchar.sys_notification_receiptgains(user_id, channel, created_at). On SQLite the bell receipt read drops from about 3 ms to 0.1 ms.inbox-message.object.tsis restored to main.notification-receipt.object.ts, its pin filesrc/objects/inbox-feed-window-indexes.integration.test.tsand.changeset/35530-inbox-window-indexes.md.Clause-②: no · Metadata-protocol: none (unchanged).
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
PR #35860 merged 2026-11-20T14:40Z:
sys_notification_receiptnow declares(user_id, channel, created_at), and the bell's receipt window read is served by it. On SQLite the read went from about 3 ms to 0.1 ms.The remaining ask, the
sys_inbox_message(user_id, created_at)index, is parked behind #35862. On existing MySQL tablesuser_idis TEXT, and the index needs the driver-sql refusal-continue fix and the TEXT→varchar convergence first (claim amendment 7041110219). The claim is released, pm:dispatched is off, and pm:blocked is on.Blocked-by: #35862