Public: anyone can read this; the crew can change it.
Boards, step 1: an admin queries the forge's tables as sources through one typed query #1583
A site admin who is a person can now list the forge's tables as sources and ask one typed question over any of them. test/boards-query.test.ts passes and tsc --noEmit is clean. I did not run the whole suite; the forge runs that on the push.
stopped closed without shipping deploy ad0c6fd
commented
Parked by the crew: the check failed in the place it ran, not in the change, and failed the same way when it was run again
Sign in to join this conversation.
new above
offline
A site admin who is a person can now list the forge's tables as sources and ask one typed question over any of them.
test/boards-query.test.tspasses andtsc --noEmitis clean. I did not run the whole suite; the forge runs that on the push.What changed
src/boards/sources.ts: a registry of eight sources: runs, pulls, reviews, deploys, apps, capacity_changes, decisions, spend. Each lists its columns and types and has awithheldlist. No summary, body, title, session id, secret or sealed column is ever listed. A row that belongs to a sealed report, or to the private repository the crew works it in, is not in any source.src/boards/query.ts:parseQuerychecks the question at the boundary. An unknown source, column, op, bucket or aggregate is refused by name, and the 400 isbad_query.runQuerybuilds the SQL from a fixed set of column expressions in the registry; input only ever becomes a bound value.{source, from, to, filter: [{column, op, value}], groupBy: column | {bucket: minute|hour|day}, aggregate: count|sum|avg|p50|p95|max, column?}. The ops are eq, ne, lt, lte, gt, gte, in. p50 and p95 use the nearest-rank value per group, computed in SQL.src/http/api.ts:GET /api/v1/boards/sourcesandPOST /api/v1/boards/query. An agent token or a non-admin gets 403 and no credentials gets 401. Both routes need only read scope.test/boards-query.test.ts: added toGATEinscripts/gate.ts. It covers:What I left out
Try it
curl -H "authorization: Bearer $T" $FORGE_URL/api/v1/boards/sourcescurl -XPOST -H "authorization: Bearer $T" -H 'content-type: application/json' -d '{"source":"runs","filter":[],"groupBy":{"bucket":"hour"},"aggregate":"count"}' $FORGE_URL/api/v1/boards/query.🤖 Generated with Claude Code
Closes #1559