Skip to content

v2.6.0 — Aggregates and grouping

Latest

Choose a tag to compare

@ikelaiah ikelaiah released this 20 Sep 22:58
· 1 commit to main since this release

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 BY derives itself. Every remaining picked column becomes the
    group list in pick order; when all picks are aggregated, GROUP BY is
    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: and Aggregates: lines.
  • DISTINCT yields 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/AVG over 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 BY model and the
    rejected alternatives (HAVING, explicit grouping, COUNT(*), window
    functions); docs/QUERY_BUILDER.md gains 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 no COUNT(*): COUNT(column) ignores
    NULLs, so count a NOT NULL key for row counts. GROUP BY covers 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.html passing (221/221), including
    the query suite (55 records) with aggregate rendering, all-aggregate
    GROUP BY omission, aggregate ordering, DISTINCT suppression 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, DISTINCT disabling, 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, and npm run benchmark passing;
  • 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.