Repository navigation
test(orm): count documents scanned behind .filter() - #399
Conversation
countDocumentReads counted rows returned, never rows Convex read and a .filter() rejected, so read bounds on filter paths could not fail. Adds scanned alongside documents: reads the serialized plan off QueryImpl.state.query before the terminal consumes it, replays the source with no operators, and charges the walk. Early stop modelled, unrecognized plan shapes throw instead of under-reporting. Moves every read bound to scanned, re-seeds M4 at N=300. Fixes #384
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Conflict in convex/setup.testing.ts JSDoc: kept both sides. main's install-before-withOrm warning is retained, retargeted at reads.scanned. main added four read bounds on reads.documents (pipeline union, invite-member seats, relation-depth ceiling, comment tree). Moved them to scanned so the newest bounds do not carry the blindness #384 removed. comment-tree marginal cost is 80 scanned vs 60 returned, so its per-node constant goes 2 -> 3. The gap is real: todoComments indexes todoId and parentId separately, so parentId isNull runs as a Convex .filter() that reads every reply to find the roots.
|
Autoclosure receipt
|
Resolves the countDocumentReads collision flagged in PR #422: #399 landed a scanned-row counter on main that reads QueryImpl.state.query and walks a paginated range cursor by cursor. That is strictly better than this branch's chain-replay version, so convex/setup.testing.ts now matches main exactly and the cascade read-bound tests assert on main's counter. Both counters independently report 1100 scanned rows for the 100-child repro and 4214 for the byte-budget one, so the bounds are cross-validated, not tuned to one implementation. Red calibration re-run against main's pre-fix worker: all three cases still fail.
🐛 Fixes #384
🧭 Task plan:
docs/plans/2026-08-21-384-scan-aware-read-counting-for-filter-paths.md🟢 95-100% confidence
bun check✅ Outcome
countDocumentReadsreports returned documents and source rows scanned.scannedmetric.ORfull scans are measured, not optimized.🏗️ Design
🧪 Verified
bun check, including fixture parity and every runtime scenario.