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

1 Commits

Author SHA1 Message Date
unkin-agent 629721a71f 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
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
2026-09-06 23:15:30 +10:00