ProcFlow v2.6.0 — Aggregates and grouping
Released as the aggregate milestone. The query builder now answers grouped
questions — orders per customer, totals per product — without leaving the
declared-evidence model or hand-writing GROUP BY.
Highlights
- Aggregate any picked column. Each chip carries a selector:
—,
COUNT, COUNT DISTINCT, SUM, AVG, MIN, MAX. GROUP BYderives itself. Every remaining picked column becomes the
group list in pick order; when all picks are aggregated,GROUP BYis
omitted and the query returns one row. No second multi-select, no invalid
states.- Aggregates read like SQL. Deterministic aliases
(count_orderheader_orderid), sorting an aggregated column orders by the
expression (ORDER BY COUNT(...) DESC), and the provenance header records
Grouped by:andAggregates:lines. DISTINCTyields to grouping. While an aggregate is set the toggle is
disabled and the SQL omits the clause, with a header note explaining why.- Fan-out honesty. A plan tip warns that
SUM/AVGover a one-to-many
join can multiply unless the detail rows are pre-aggregated. - Versioned files stay compatible. Query files move to version 2;
version-1 files from v2.5.0 load and migrate forward with an empty aggregate
map, and newer versions are rejected with a diagnostic. Aggregates are
saved, exported, restored, and pruned with their picks. - Documentation. ADR-003 records the derived-
GROUP BYmodel and the
rejected alternatives (HAVING, explicit grouping,COUNT(*), window
functions);docs/QUERY_BUILDER.mdgains an aggregates section.
Accuracy and limits
- No analysis or join semantics changed. Joins still use declared foreign-key
evidence only; taught joins and self-join copies remain labelled not
declared; the generated SQL stays read-only. - No
HAVING, no window functions, and noCOUNT(*):COUNT(column)ignores
NULLs, so count aNOT NULLkey for row counts.GROUP BYcovers picked
columns only. - Unknown aggregate functions are ignored, never guessed.
Verification
The final local verification recorded for this release includes:
- golden browser assertions on
tests/index.htmlpassing (221/221), including
the query suite (55 records) with aggregate rendering, all-aggregate
GROUP BYomission, aggregate ordering,DISTINCTsuppression and header
notes, unknown-function tolerance, version-1 file migration, and storage and
pruning coverage; - the ERD query UI suite passing 68/68 over HTTP, including the aggregate
selector, function rendering,GROUP BY,DISTINCTdisabling, the plan
tip, and reset; - the Firefox smoke page passing 10/10 critical paths;
npm run typecheck,npm run build,npm run test:file,npm run metrics,
npm run package:smoke, andnpm run benchmarkpassing;- runtime archive structure and local-file startup smoke passing
(procflow-v2.6.0.zip).
Upgrade and distribution
The runtime is self-contained. Use npm run package:runtime to produce the
versioned ZIP and verify .release/SHA256SUMS.txt before distributing it.
Layouts, workspaces, and version-1 query files saved by earlier releases remain
readable.