Skip to content

Adds the algebra to enable BI operations in a safe way#262

Draft
willpugh wants to merge 5 commits into
mainfrom
willpugh/add_algebra
Draft

Adds the algebra to enable BI operations in a safe way#262
willpugh wants to merge 5 commits into
mainfrom
willpugh/add_algebra

Conversation

@willpugh

Copy link
Copy Markdown
Contributor

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

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have been discussed on the mailing list or in a linked issue
  • Breaking changes to the spec are clearly called out in the summary

Ontology

  • Ontology changes in ontology/ are consistent with spec changes
  • New or modified terms are defined and documented

Converters

  • Converter logic in converters/ is updated to reflect spec or ontology changes
  • New converters include tests under the converter's test directory

Validation

  • Validation rules in validation/ are updated if the spec changed
  • New validation cases are covered by tests

Documentation

  • docs/ is updated to reflect any user-facing changes
  • New features or behaviors are documented with examples where appropriate
  • CONTRIBUTING.md is updated if the contribution process changed

Examples

  • examples/ are added or updated for any new spec constructs or converter support

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests

Compliance

  • ASF license headers are present on all new source files
  • No third-party dependencies are added without PMC/IPMC approval

willpugh and others added 5 commits July 22, 2026 23:32
…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
willpugh force-pushed the willpugh/add_algebra branch from 9c22529 to 311194c Compare July 24, 2026 15:41
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