test(compliance): witness the five user-visible semantics with edge-case rows#1
Open
sfc-gh-wpugh wants to merge 1 commit into
Open
Conversation
…ase rows
Reviewer doubt on Semantic 1 ("no fact row is silently dropped") was
well-founded at the suite level: the only orphan test (t-061) was
status:planned, t-048 "null-foreign-key" contains no NULL FK, and the
multi-hop/composite fixtures have no orphans — so those tests pass
identically whether the planner emits LEFT or INNER, and the default
gate ran only 8 of 60 tests. The guarantee was effectively unasserted.
Add fixtures that actually carry the dropped-row cases (value-orphan,
literal NULL FK, broken multi-hop chain, composite partial-key miss,
1:1 orphan) and 27 active witness tests across all five semantics, so a
regression that reintroduced an orphan-dropping join would now fail.
The engine itself adheres to Semantic 1 (LEFT is structurally enforced;
INNER-promotion is gated behind deferred referential integrity). Two
Semantic 2 gaps (D-003 home-grain pre-aggregation; reverse cross-grain)
ship as status:planned tests with spec-correct gold. Full write-up in
compliance/foundation-v0.1/SEMANTIC_AUDIT.md.
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.
Stacked on apache#125 (Proposal semantics foundation) — base is
proposal-semantics-foundation, so this diff is only the audit delta.Why
Reviewer doubt on Semantic 1 — "no fact row is silently dropped" was well-founded at the suite level:
t-061) isstatus: planned(dormant);t-048-null-foreign-keycontains no NULL FK (its gold admits it runs "the same shape as T-001");f_chain/f_compositehave no orphan rows, so the multi-hop/composite tests pass identically whether the planner emitsLEFTorINNER;status: plannedand the default runner omits--include-planned, so the default gate ran only 8 tests — none witnessing Semantic 1.The guarantee was effectively unasserted.
What this adds
f_s1_star(value-orphan and literal NULL FK + a 1:1 table),f_s1_chain(broken FK at every hop),f_s1_composite(partial + full composite-key miss).tests/semantic{1..5}_*(default gate 8 → 27, 100% pass) that fail if a regression reintroduces an orphan-dropping join.status: plannedgap tests with spec-correct gold for the Semantic 2 deferrals found (D-003 home-grain pre-aggregation; reverse cross-grain).SEMANTIC_AUDIT.md— full findings + file:line references.Findings (no implementation changes here)
LEFTis structurally enforced (joins.py:489-491+ RI deferred atgraph.py:157-158/deferred.py:114-117); no Foundation path can pick an orphan-droppingINNER.E_UNSAFE_REAGGREGATION(planner.py:219-242) — a distributiveCOUNT/SUMsurvives decomposition, so that code is misleading.Tests generated by
scripts/gen_semantic_tests.py+scripts/copy_negative_witnesses.sh.🤖 Generated with Claude Code