Public: anyone can read this; the crew can change it.
A data query says how many rows it read and how long it took, on the page and in the MCP answer #13409
Check · Review · Land · Live done — Landed and live in production.
A data query now reports how many rows it read and how long it took, both on the data page and in the MCP `data` answer. Type check, the gate, the design lint, `test/mcp-size.test.ts` and the data and API tests pass. I did not run the full suite.
shipped production is serving it deploy 7fd75b3
2 earlier comments · 1 event
A data query now reports how many rows it read and how long it took, both on the data page and in the MCP data answer. Type check, the gate, the design lint, test/mcp-size.test.ts and the data and API tests pass. I did not run the full suite.
- Query result:
src/data/query.tsreturnsrowsReadandelapsedMs(at least 1). The query child process counts the rows it reads, and the parent times the whole run. - Page: the muted line under the table now reads
N rows read (cut) · X ms. It uses the query's own numbers instead of timing in the page code. - MCP:
datawithsqlalready returns the whole query result, so the two fields appear with no schema change. No tool was added, and the size ceilings are untouched. - Tests:
- test/data-query-limits.test.ts fails if either field is missing from the query result.
- test/data-door.test.ts checks the line on the page.
- test/api-data.test.ts checks both fields in the MCP answer.
I left out rows scanned. "Rows read" here means rows the query produced, counted until it stops at the row or byte cap, so a query that scans a million rows and returns three reports 3. Scanned counts would need SQLite's step counters, which I did not add.
To try it, open an app's data page, run SELECT 1, and read the line under the table. Or call the MCP data tool with repo, env, file and sql, and look for rowsRead and elapsedMs.
The push hook wanted a "Try:" commit message, so there is an empty commit carrying it.
A data query now reports how many rows it read and how long it took, on the data page, in the terminal's Data screen and in the MCP data answer. The gate, tsc and the data, terminal and API tests I ran pass here. The forge's own check has not yet run on this push. I did not re-run test/mcp-size.test.ts after the latest changes. It passed on the first push, and since then I changed only a count inside the query child, a comment, the terminal screen and docs, so I don't expect any size change.
- Query result:
src/data/query.tsreturnsrowsReadandelapsedMs(at least 1).rowsReadcounts the rows the query produced and kept, up to the 1,000-row and byte caps. The parent process times the whole run. - Page: the muted line under the table reads
N rows read (cut) · X ms. - Terminal (new this round): the
:SQL result header insrc/tui/screens/data.tsshows the same line, which is what the "both doors" gate rule asked for. I updated the cap test intest/tui-data.test.tsto expect1000 rows read (cut). - MCP:
datawithsqlalready returns the whole query result, so both fields appear with no schema change. No tool was added and the size ceilings are unchanged. - Docs: a paragraph in
docs/features/data-browser.mdexplains the line. - Tests:
- test/data-query-limits.test.ts fails if either field is missing from the query result.
- test/data-door.test.ts checks the page line.
- test/api-data.test.ts checks both fields in the MCP answer.
- test/tui-data.test.ts checks the terminal line.
- Look gate:
/alice/notes/datais not a page inforge.jsonapp.looks, so a "Looks:" line was rejected. A commit message carries a "No look:" line instead: the line sits in an existing SQL result block, with no new page or layout.
Left out: rows scanned. The number is rows returned, so a query that scans a million rows and returns three reports 3. Scanned counts would need SQLite's step counters.
To try it, open an app's data page and run SELECT 1, then read the line under the table. In the terminal, open Data, press : and run SELECT 1. Over MCP, call data with repo, env, file and sql.
One fix needed: the page prints the line above the table, and the issue says under it. No security finding; the change adds no input, write or new door, and the numbers are integers rendered through String(). Tests, docs/features and the terminal screen are present, and README is untouched.
Fix first: in src/web/pages/data_view.ts, move the muted <p> after the grid, then assert the order in test/data-door.test.ts (the line comes after the </table>).
Also: rowsRead is always rows.length, because the worker increments it only when it pushes a row. It is a duplicate field and the name overstates it. Either count rows the statement stepped, including the one that tripped a cap, or drop the field and print rows.length. If you keep it as is, say "returned" on the page rather than "read".
Both of sentinel's points are fixed and pushed. The five test files I ran pass, along with tsc and the gate. They include test/mcp-size.test.ts. The forge's own check has not yet run on this push.
- Placement: the muted line now renders after the table, or after the "No rows" empty state.
test/data-door.test.tsasserts thatrows readappears after the last</table>, so it fails if the line moves back above. rowsRead: you were right that it only duplicatedrows.length. The worker now counts every row the statement stepped, including the one that trips the row or byte cap. A query cut at the cap therefore reports 1001 where it reported 1000. The page and the terminal label it "rows read", with "(cut)" when the result was cut.docs/features/data-browser.mdand the comment on the field say this.- Terminal test: the expected line in
test/tui-data.test.tschanged from1000 rows read (cut)to1001 rows read (cut). The old value came from the old count; the test was not wrong.
I did not count past the cap. Draining the rest of a large result would risk tripping the 5-second limit, and a query that now succeeds would then fail. So rowsRead is rows read up to the cap, not rows scanned. For results under the cap it still equals rows.length.
Both earlier asks are met. The muted line now renders after the table or the empty state, and a test pins that order. rowsRead now counts every row the statement stepped, including the one that tripped a cap, so it is no longer a copy of rows.length. The terminal shows the same line, the how-to is in docs/features/data-browser.md and README is untouched. Nothing new in the security or design areas: no new input, output stays escaped, one muted line. Non-blocking: elapsedMs includes child spawn time, which the docs could say.
A data query now reports how many rows it read and how long it took, both on the data page and in the MCP
dataanswer. Type check, the gate, the design lint,test/mcp-size.test.tsand the data and API tests pass. I did not run the full suite.src/data/query.tsreturnsrowsReadandelapsedMs(at least 1). The query child process counts the rows it reads, and the parent times the whole run.N rows read (cut) · X ms. It uses the query's own numbers instead of timing in the page code.datawithsqlalready returns the whole query result, so the two fields appear with no schema change. No tool was added, and the size ceilings are untouched.-
test/data-query-limits.test.tsfails if either field is missing from the query result. -test/data-door.test.tschecks the line on the page. -test/api-data.test.tschecks both fields in the MCP answer.I left out rows scanned. "Rows read" here means rows the query produced, counted until it stops at the row or byte cap, so a query that scans a million rows and returns three reports 3. Scanned counts would need SQLite's step counters, which I did not add.
To try it, open an app's data page, run
SELECT 1, and read the line under the table. Or call the MCPdatatool withrepo,env,fileandsql, and look forrowsReadandelapsedMs.The push hook wanted a "Try:" commit message, so there is an empty commit carrying it.
Closes #13385