Skip to content

feat(accumulator): min/max/product aggregate operations (A2) - #51

Merged
discreteds merged 2 commits into
developfrom
feature/accumulator-aggregate-ops
Jul 20, 2026
Merged

feat(accumulator): min/max/product aggregate operations (A2)#51
discreteds merged 2 commits into
developfrom
feature/accumulator-aggregate-ops

Conversation

@discreteds

Copy link
Copy Markdown
Member

A2 — aggregate operations beyond sum

Extends AccumulatorEngine to accumulate min/max/product numerics in addition to sum, via a new AggregateOp StrEnum validated at model construction.

What changed

  • AggregateOp(StrEnum) (sum/min/max/product — commutative reducers only; replace/coalesce are explicit non-goals) in engines/accumulator/aggregate.py; exported from the package root.
  • Aggregate.operation retyped str → AggregateOp — invalid operations now raise ValidationError at construction (fail-fast) rather than ValueError at build.
  • Fold dispatch in engine._expand_level: SUM→add, MIN→ma.least, MAX→ma.greatest, PRODUCT→mul — all backend-pure (no new native imports, no new # allow: tags).
  • CLAUDE.md updated.

Provenance

Split out of the A1+A2 accumulator-core-extensions work (spec docs/superpowers/specs/2026-07-19-accumulator-core-extensions-design.md). A2 is independent and lands on its own; A1 (set coalescing) is deferred — a whole-branch review found the null-list wildcard representation breaks the frontier self-join across backends, so A1 is being redesigned around in-band sentinels (see mountainash-central principle null-is-not-a-portable-sentinel).

Tests

  • tests/accumulator/test_aggregate.py — enum + model validation.
  • tests/accumulator/test_engine.py::TestAggregateOperations — min/max/product/sum folds over a {R1,R2} combination (prime products 2/3/6).
  • tests/accumulator/test_edge_cases.py — unsupported-op now asserts construction-time ValidationError.
  • Full quick suite: 812 passed, 36 skipped, 31 xfailed; ruff + backend-purity green.

🤖 Generated with Claude Code

discreteds and others added 2 commits July 20, 2026 10:49
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@discreteds
discreteds merged commit cffa8bd into develop Jul 20, 2026
5 of 6 checks passed
@discreteds
discreteds deleted the feature/accumulator-aggregate-ops branch July 20, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant