You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(xsd): scope local elements per-owner; link xsd-builtin symbols to profile; drop em dash
Three review-flagged correctness gaps before flipping ENABLE_OOXML_TOOLS.
P1 - Local element symbols collapsed across complexTypes.
Inline <xsd:element name="X" type="..."/> declared inside two different
complexTypes was deduped under (vocabulary, name, kind), keeping only the
first-seen type_ref. Real WML hits this on tblGrid alone: declared as
CT_TblGridBase inside CT_TblGridChange and as CT_TblGrid inside CT_Tbl.
ooxml_children("w:tblGrid") would have followed CT_TblGridBase and missed
the CT_TblGrid children.
Migration 0004 adds xsd_symbols.parent_symbol_id (nullable) and replaces
the 3-tuple unique with a 4-tuple UNIQUE NULLS NOT DISTINCT (vocab,
local_name, kind, parent_symbol_id). Top-level decls keep parent NULL and
still collide on name; local decls are scoped to their owner. ingest.ts
passes the owning symbol id when upserting local element symbols.
P2 - xsd-builtin symbols had no profile membership.
The on-demand inheritance pass created xsd:string / xsd:boolean / etc.
via upsertSymbol but never called linkSymbolToProfile, so lookupSymbol
(which JOINs xsd_symbol_profiles) returned null. Following an element's
type_ref into a W3C built-in silently failed. Now also ensure the
xs/xsd namespace exists and link the built-in symbol into the target
profile.
P3 - Em dash in code comment.
scripts/ingest-xsd/qname.ts line 12 used "—". Replaced with "-".
Tests:
- New "local element symbols are scoped per-owner (no cross-CT collapse)"
against a CT_OuterA / CT_OuterB fixture mirroring the WML tblGrid
pattern: each `shared` element resolves to its own symbol with the
correct per-owner type_ref.
- New "xsd-builtin symbols have profile membership" verifies
lookupSymbolByTypeRef succeeds for {...XMLSchema}string.
- Existing fixture and WML smoke counts adjusted.
41 / 0 across db / ingest / mcp-server.
0 commit comments