Guard aggregates at the query dispatch, not per route #19

Merged
benvin merged 1 commits from benvin/central-aggregate-guard into main 2026-09-07 13:57:04 +10:00
Member

A merged route that forgets the parseAggregate check silently returns one backend's rows: an aggregate row carries no certname, hash or name, so it collapses into a single bucket in the identity-keyed merges. That is how /facts/ shipped broken, and a check at each call site means every future route opts out by omission.

  • Resolve every /pdb/query/v4 request through one route table
  • Sum extract/function queries in handleQuery, before any route handler runs
  • Make each route that is not summed name its reason; the zero value is guarded
  • Assert the guard over the route table, so a new route inherits the assertion
A merged route that forgets the parseAggregate check silently returns one backend's rows: an aggregate row carries no certname, hash or name, so it collapses into a single bucket in the identity-keyed merges. That is how /facts/<name> shipped broken, and a check at each call site means every future route opts out by omission. - Resolve every /pdb/query/v4 request through one route table - Sum extract/function queries in handleQuery, before any route handler runs - Make each route that is not summed name its reason; the zero value is guarded - Assert the guard over the route table, so a new route inherits the assertion
unkin-agent added 1 commit 2026-09-06 23:15:49 +10:00
Guard aggregates at the query dispatch, not per route
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
629721a71f
A merged route that forgets the parseAggregate check silently returns one
backend's rows: an aggregate row carries no certname, hash or name, so the
identity-keyed merges collapse every backend's numbers into one. That is how
/facts/<name> shipped broken.

- Resolve every /pdb/query/v4 request through one route table
- Sum extract/function queries in handleQuery, before any route's handler runs
- Make each route that is not summed name its reason; the zero value is guarded
- Assert the guard over the route table, so a new route inherits the assertion
benvin merged commit e889cf8f7f into main 2026-09-07 13:57:04 +10:00
benvin deleted branch benvin/central-aggregate-guard 2026-09-07 13:57:04 +10:00
Sign in to join this conversation.