Adds the algebra to enable BI operations in a safe way#262
Draft
willpugh wants to merge 5 commits into
Draft
Conversation
…ning Extracts the closed algebra — the compiler's correctness core — from the foundation reference implementation (#125) into the ossie package, with the foundation types it needs (common/{identifiers,sql_expr,types}, errors), a hypothesis property/law + closure test suite, and the enforcement kit (mypy --strict, import-linter closure contract, file-size audit, mutmut config). Ships an AGENTS.md alongside the algebra with the directory-scoped closure rules (pointing to ARCHITECTURE.md). Reviewed against the foundational semantics spec (#246) and folded the fixes in: - The algebra's internal fan-out signal is E4001_EXPLOSION_UNSAFE, not the spec-reserved engine-wide opt-out E3011; the planner maps it to the user-facing code (E_UNSAFE_REAGGREGATION / E_FAN_OUT_IN_SCALAR_QUERY). - Holistic re-aggregation is blocked only over a *discharged* aggregate (new Column.is_discharged_aggregate), so a single-step holistic over a plain N:1 enriched dimension stays allowed per D-020. - ARCHITECTURE.md documents the algebra as necessary-not-sufficient for Semantic 4 (the planner owns chasm/stitch decomposition). - Doc references repointed to core-spec/foundational_semantics.md (Appendix A; #246 section numbering). 31 tests green; mypy --strict clean; import-linter contract kept. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
willpugh
force-pushed
the
willpugh/add_algebra
branch
from
July 24, 2026 15:41
9c22529 to
311194c
Compare
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.
Summary
This PR adds the algebra along with the rules for how to modify it. This is a closed algebra, with the idea of enforcing that any operation to the algebra will yield a safe BI query. It should disallow traps and many unsafe semantics through adherence to the API.
This is part of the effort described in ML to get the reference implementation.
Related Issues
Helps lmpelement the reference for: Foundational Semantics
This is stacked on #222
Checklist
Specification
core-spec/and follow the existing structureOntology
ontology/are consistent with spec changesConverters
converters/is updated to reflect spec or ontology changesValidation
validation/are updated if the spec changedDocumentation
docs/is updated to reflect any user-facing changesCONTRIBUTING.mdis updated if the contribution process changedExamples
examples/are added or updated for any new spec constructs or converter supportTests
pytest/ CI green)Compliance