Tier 16: WS2 burndown sub-tier 4 — fact_order_events DDL (final sub-tier) - #18
Merged
Merged
Conversation
Final sub-tier of WS2 phantom-table burndown. Builds
gold.fact_order_events across all four dialects, appended to
the ddl/equity/ files created in Tiers 13-15.
Largest fact table in the equity Gold layer: 72 columns (59
spec + 9 framework + 4 lineage). Covers 24 distinct equity
order event codes across CAT IM v4.1.0r15 sections 4.1, 4.2,
4.3 (route family), 4.4, 4.5 (internal route family),
4.6 (child order family), 4.7 (modified family), 4.8, 4.9
(cancel family), 4.14 (Order Effective). Trade events
(MEOT/MEOTS) intentionally excluded - they live on
fact_execution_events.
Two CHECK constraints:
- event_type_code IN (MENO, MENOS, MEOR, MEORS, MEMR,
MEMRS, MECR, MECRS, MEOA, MEIR, MEIM, MEIC, MEIMR, MEICR,
MECO, MECOM, MECOC, MEOM, MEOMS, MEOMR, MEOJ, MEOC, MEOCR,
MEOE) -- 24 codes, widest CHECK in the repo
- action_type IN (NEW, FRC, RPR) -- section 4.1 row 1
Replaces legacy fact_cat_order_events (which compressed
59 spec fields into ~12 generic columns; only 7 overlapped).
Validator update (guardrails/validate_check_constraints.py):
- event_type_code mapped to cat_im_event_types.csv (same as
cat_event_code; equity order tables use the column name
from the field mapping CSV).
- action_type added to KNOWN_UNMAPPED_COLUMNS (fixed 3-value
spec enum, no separate primary-source CSV).
Allowlist:
known_field_mapping_gaps.csv: 151 -> 92 rows (-59)
F3.1 phantom-table rows: 0 (was 120; all cleared
across Tiers 13-16)
F3.2 missing-column rows: 92 (unchanged - next target)
Tables in 2+ dialects: 42 (was 41)
All 8 guardrails pass.
6 tasks
jamezycesar-collab
added a commit
that referenced
this pull request
Jun 18, 2026
) First sub-tier of WS2 F3.2 follow-on (the 92 missing-column rows remaining after the WS2 phantom-table burndown completed in Tier 16). Adds 3 spec-mapping columns to gold.fact_option_executions across all four dialects (Delta, Hive, Fabric Lakehouse, Fabric Warehouse): - trade_key_date TIMESTAMP CAT IM v4.1.0r15 sec 5.1.11 row 6 (MOOT) - fill_key_date TIMESTAMP CAT IM v4.1.0r15 sec 5.1.12.1 row 6 (MOOF/MOOFS) - prior_fill_key_date TIMESTAMP CAT IM v4.1.0r15 sec 5.1.12.3 row 9 (MOFA) All three are natural-key timestamps grouped with the existing trade_id, fulfillment_id, prior_fulfillment_id identifiers. Mapping CSV section-ref corrections (atomic with the DDL): - fill_key_date: sec 5.1.13.1 -> sec 5.1.12.1 - prior_fill_key_date: sec 5.1.14 -> sec 5.1.12.3 Both were PDF-verified via verify_cat_im_v3.py against the CAT IM v4.1.0r15 PDF. Allowlist: known_field_mapping_gaps.csv: 92 -> 89 rows (-3) F3.2 remaining: 89 (was 92) F3.1 phantom-table: 0 (unchanged, cleared in Tier 13-16) CHANGELOG: removed leftover stash-pop merge-conflict markers that were committed inadvertently with PR #18; both pre-conflict sections (Tier 15 banner + Tier 16 entry) preserved. All 8 guardrails pass.
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
Final sub-tier of WS2 phantom-table burndown. Builds
fact_order_eventsacross all four dialects, completing the 120-row F3.1 phantom-table closure that started in Tier 13.Files changed
ddl/equity/02_equity_gold_delta.sql- add fact_order_events (Delta)ddl/equity/04_equity_gold_hive.sql- add fact_order_events (Hive)ddl/equity/05_equity_gold_fabric_lakehouse.sql- add fact_order_events (Fabric Lakehouse)ddl/equity/06_equity_gold_fabric_warehouse.sql- add fact_order_events (T-SQL)guardrails/known_field_mapping_gaps.csv- 151 → 92 rowsguardrails/validate_check_constraints.py- register event_type_code + action_typeCHANGELOG.md- Tier 16 entrySchema
fact_order_events(72 columns — largest fact in the equity Gold layer):order_event_skBIGINT IDENTITY (PK)event_dts/event_datedate_sk,instrument_sk,party_sk,venue_sk(nullable),event_type_skaction_type(CHECK ⊂ {NEW,FRC,RPR}) — Section 4.1 row 1event_type_code(CHECK ⊂ 24 equity order codes) — widest CHECK in the repoSpec coverage
CAT IM v4.1.0r15 sections:
Trade events (MEOT/MEOTS, §4.11.1/§4.11.2) intentionally excluded — already on
fact_execution_events.Why Option B over retrofit
Legacy
fact_cat_order_eventscompressed the 59-field order lifecycle into ~12 generic columns. Only 7 spec columns overlap. Building fresh keeps each spec field as a discrete column for spec-fidelity, query ergonomics, and CAT JSON submission file generation.Coverage
WS2 burndown — COMPLETE
fact_execution_eventsfact_allocationsfact_quotesfact_order_eventsTest plan
fact_order_eventsmapping rows now resolve in DDLaction_type(NEW/FRC/RPR) per Section 4.1 row 1fact_cat_order_eventssemantically (24-code coverage vs 1-table legacy)