Skip to content

Feat/echo aggregation mirror - #34

Merged
hyperpolymath merged 6 commits into
mainfrom
feat/echo-aggregation-mirror
Oct 20, 2026
Merged

hyperpolymath merged 6 commits into
mainfrom
feat/echo-aggregation-mirror

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Closes #

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (would change existing behaviour)
  • 🕳️ Soundness fix (fixes a checker/proof false-negative)
  • 📖 Documentation
  • 🧹 Refactor / tech debt (behaviour-preserving)
  • ⚡ Performance
  • 🔧 Build / CI / tooling

How has this been verified?

Checklist

  • My commits are signed (git commit -S).
  • I ran the project's own checks/tests locally and they pass.
  • New files carry the correct SPDX-License-Identifier (code/config MPL-2.0,
    prose CC-BY-SA-4.0); I did not relicense existing files.
  • Docs are updated, and no public claim now overstates what the code does.
  • I have not introduced a soundness hole (or I have flagged where I might have).

Notes for reviewers

…types#175)

Finite-domain shadow of echo-types EchoAggregation.agda at 703dd77:
Monoid, GroupAggregator, the fold and its homomorphism law
(aggregation-as-fold), the sum/count/max/min instances, the generic
no-canonical-disaggregation, and the macro Example-PairSum instance.

Laws are checked on samples, never proved; the Agda stays the source of
truth. avg is absent (not a monoid), as upstream. Adds 27 assertions
(258 -> 285), including a negative control showing monoid_laws_hold can
return false. No version bump; that is left to the owner.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV
- monoid_laws_hold: materialise samples once (one-shot iterators work) and
  reject an empty sample instead of returning a vacuous true.
- oplus_fold: document that it is a right fold, matching Agda's foldr.
- min_inf: type the nothing-first method's second argument as
  Union{Nothing,Integer} so the domain is closed.
- README: name both provenance commits (eed4250 for the existing rows,
  703dd77 for EchoAggregation); test count 285 -> 290.

Adds 5 assertions covering the one-shot iterator, the empty-sample error,
the closed min_inf domain and the right-fold direction.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV
oplus_fold_append_holds and aggregation_as_fold_holds used vcat on their
inputs. vcat of two generators nests them as elements instead of
concatenating, so the former threw a MethodError and the latter returned a
false counterexample on inputs that satisfy the law. Both now materialise
their inputs once; oplus_fold does too, so one-shot iterables work.

Adds 4 assertions (generator, filtered generator, aggregation over
generators, fold of a filtered generator); 290 -> 294. Each failed before
the change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV
collect preserves array shape, and vcat of two matrices stacks rows instead
of appending their iteration sequences, so with a non-commutative monoid
(string concatenation) oplus_fold_append_holds returned false on inputs
that satisfy the law. Inputs now go through a small _items helper
(vec(collect(xs))), used by oplus_fold, oplus_fold_append_holds and
aggregation_as_fold_holds. Arrays are read in column-major iteration order.

Adds 3 assertions (294 -> 297); the append check failed before the change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV
…(Codex P2 x2)

- oplus_fold_append_holds / aggregation_as_fold_holds joined their inputs
  with vcat, which promotes element types (an Int next to a Float64 is
  converted, and can round). With an exact non-promoting max this reported a
  false counterexample on a lawful monoid. They now use _concat, which
  keeps each element as given.
- pair_sum and pair_sum_is_fold accepted any Integer tuple, but sum_monoid's
  unit is an Int, so Int8 inputs overflowed in the direct sum but not in the
  fold and pair_sum_is_fold returned false. The example models N as
  non-negative Int, so both methods are restricted to Tuple{Int,Int}.

Both reproduced before the change. Adds 5 assertions (297 -> 302).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T22:28:01.721474Z dc1dd40 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 56597ca4-4118-4f21-9c74-e0933e0aba22
📥 Commits

Reviewing files that changed from the base of the PR and between 94b598f and dc1dd40.

📒 Files selected for processing: 3
  • README.adoc
  • src/EchoTypes.jl
  • test/runtests.jl
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath
hyperpolymath merged commit 83a2ad8 into main Oct 20, 2026
14 checks passed
@hyperpolymath
hyperpolymath deleted the feat/echo-aggregation-mirror branch October 20, 2026 22:27
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.

2 participants