feat(accumulator): min/max/product aggregate operations (A2) - #51
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A2 — aggregate operations beyond sum
Extends
AccumulatorEngineto accumulatemin/max/productnumerics in addition tosum, via a newAggregateOpStrEnum validated at model construction.What changed
AggregateOp(StrEnum)(sum/min/max/product— commutative reducers only;replace/coalesceare explicit non-goals) inengines/accumulator/aggregate.py; exported from the package root.Aggregate.operationretypedstr → AggregateOp— invalid operations now raiseValidationErrorat construction (fail-fast) rather thanValueErrorat build.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.mdupdated.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 principlenull-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-timeValidationError.🤖 Generated with Claude Code