Initial Foundational Semantics Spec - #246
Conversation
4fba0e0 to
4ebfd2c
Compare
…e fixes Documentation: - Add compliance/ARCHITECTURE.md (spec<->impl<->suite contract, harness runtime + adapter flow diagrams, test anatomy, conformance model). - Rewrite compliance/README.md as the install/run entry point; refresh the harness and foundation READMEs. Tooling: - Make compliance/ a single uv workspace (pyproject.toml + uv.lock, members harness + foundation, dev group for pytest) so `uv sync` installs everything and `uv run` works from anywhere. Ignore *.egg-info/. Spec alignment (point at core-spec/foundational_semantics.md, per #246): - Repoint every proposals/foundation/Proposed_OSI_Semantics.md and foundation-v0.1 reference to core-spec/foundational_semantics.md and core-spec/expression_language.md across SPEC.md, decisions.yaml, proposals.yaml, conformance.yaml, DATA_TESTS.md, metadata.yaml, proposals_check.py, and test_registry_yaml.py. - Remap anchors to #246's structure: deferred features -> section 3, determinism (D-014) -> sections 5.1/6.10.2; error codes -> Appendix A (decisions are inline, no Appendix B/C). - Fix DATA_TESTS format drift (gold_rows.json -> gold.sql). Harness: - Implement decisions_coverage.md report (write_decisions_coverage in reporter.py, wired into run_suite) so every run surfaces D-NNN coverage gaps. Add test_reporter_coverage.py. Note conformance.yaml levels are declarative for now. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e fixes Documentation: - Add compliance/ARCHITECTURE.md (spec<->impl<->suite contract, harness runtime + adapter flow diagrams, test anatomy, conformance model). - Rewrite compliance/README.md as the install/run entry point; refresh the harness and foundation READMEs. Tooling: - Make compliance/ a single uv workspace (pyproject.toml + uv.lock, members harness + foundation, dev group for pytest) so `uv sync` installs everything and `uv run` works from anywhere. Ignore *.egg-info/. Spec alignment (point at core-spec/foundational_semantics.md, per #246): - Repoint every proposals/foundation/Proposed_OSI_Semantics.md and foundation-v0.1 reference to core-spec/foundational_semantics.md and core-spec/expression_language.md across SPEC.md, decisions.yaml, proposals.yaml, conformance.yaml, DATA_TESTS.md, metadata.yaml, proposals_check.py, and test_registry_yaml.py. - Remap anchors to #246's structure: deferred features -> section 3, determinism (D-014) -> sections 5.1/6.10.2; error codes -> Appendix A (decisions are inline, no Appendix B/C). - Fix DATA_TESTS format drift (gold_rows.json -> gold.sql). Harness: - Implement decisions_coverage.md report (write_decisions_coverage in reporter.py, wired into run_suite) so every run surfaces D-NNN coverage gaps. Add test_reporter_coverage.py. Note conformance.yaml levels are declarative for now. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e fixes Documentation: - Add compliance/ARCHITECTURE.md (spec<->impl<->suite contract, harness runtime + adapter flow diagrams, test anatomy, conformance model). - Rewrite compliance/README.md as the install/run entry point; refresh the harness and foundation READMEs. Tooling: - Make compliance/ a single uv workspace (pyproject.toml + uv.lock, members harness + foundation, dev group for pytest) so `uv sync` installs everything and `uv run` works from anywhere. Ignore *.egg-info/. Spec alignment (point at core-spec/foundational_semantics.md, per #246): - Repoint every proposals/foundation/Proposed_OSI_Semantics.md and foundation-v0.1 reference to core-spec/foundational_semantics.md and core-spec/expression_language.md across SPEC.md, decisions.yaml, proposals.yaml, conformance.yaml, DATA_TESTS.md, metadata.yaml, proposals_check.py, and test_registry_yaml.py. - Remap anchors to #246's structure: deferred features -> section 3, determinism (D-014) -> sections 5.1/6.10.2; error codes -> Appendix A (decisions are inline, no Appendix B/C). - Fix DATA_TESTS format drift (gold_rows.json -> gold.sql). Harness: - Implement decisions_coverage.md report (write_decisions_coverage in reporter.py, wired into run_suite) so every run surfaces D-NNN coverage gaps. Add test_reporter_coverage.py. Note conformance.yaml levels are declarative for now. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…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>
|
Will — read the full document. Strong support, both for the content and for the foundational-first approach: As discussed in #46, full support from an SAP perspective. The five user-visible semantics — especially Semantic 5 (typed error, never a plausible-but-wrong number) and Semantic 1's NULL-bucketing of unmatched fact rows — address the query-time family of what we saw in the field. The NULL determinism work (§5.1 ordering defaults, §6.11 empty/NULL aggregate behaviour, NULL-safe stitch merges) pins down the places where observed engines quietly disagree. Adding composite keys as first-class citizens in relationships ( The worst losses we measured were not query-time — they were transport-time: an observed ontology platform (Fabric) accepted parts of our semantic model with a success response and silently discarded them. We only caught it by re-reading what was stored. The Foundation guarantees no silently wrong answer; nothing yet guarantees no silently dropped model construct. A conformance rule in the same spirit — an implementation MUST either represent a construct, reject it with a typed error, or explicitly report it as unsupported (never accept-and-drop) — would extend Semantic 5's philosophy to interchange itself, and would have caught every silent loss in our audit. The working draft's reference to a conformance suite (§11.1) looks like this rule's natural home. If useful, I'm happy to share the anonymized loss table as test material. In SAP, there are 2 validations
Two editorial catches: (1) the body references §9, §10, §11, §12 (SQL-interface proposal, deferred-features registry, extension flags + conformance suite, vendor comparison incl. "§12.A divergence note") — none of which exist in the committed file or, as far as I can see, in the working draft either. As committed, readers hit dangling anchors; either trimming the references or landing stub sections would tighten it. (2) The working draft's §4.6.1 explicitly pins quoted-identifier case-sensitivity ( One clarifying question: the ontology layer's Happy to turn any of the above into concrete test fixtures — that's the form feedback is most useful in. |
Summary
Related Issues
This is MD version of the foundational semantics spec. It started in Google Docs: Proposed Foundational Semantics.
This follows from the discussions in the expression language slack group, and mail
NOTE: There were two comments in the original doc around join direction behaviour (to not lose fact table rows) and null safe joins. These have been addressed in this version, by being explicit about when null safe joins are required and being explicit about joining from the fact tables out.
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