Context
static/schemas/ was vendored as a test fixture (see tests/verify_xsd_fixture.py). The schemas also contain rich domain vocabularies (DDD: AggregateRoot, BoundedContext, Entity, Repository; IEEE 29148: StakeholderRequirement, SystemRequirement, etc.) that could materially strengthen our concept_graph plugin's labeling quality.
Today, L3 concepts are produced purely from identifier splitting — purely lexical. After this work, a bundle of a DDD-style codebase would surface concepts tagged with cbml3:conceptKind = domain-primitive and cbml3:broaderCollection = ddd_v3_ontology, unlocking MCP queries like "show me every DDD aggregate root in this repo."
Scope
Add scripts/seed_vocab_from_xsd.py that:
- Walks
static/schemas/*.xsd and parses each with xml.etree.ElementTree (or lxml if added).
- Extracts
<xs:element name="…">, <xs:complexType name="…">, <xs:attribute name="…">, and <xs:simpleType name="…"> declarations.
- Normalizes names (split camelCase, lowercase, dedup) per the existing
concept_graph splitter rules so the extracted terms align with what splitter produces from identifiers.
- Writes new SKOS collections into
codebase_mapper/vocab/ — one per source XSD:
ddd_v3_ontology (from ddd/v3_0_0/*.xsd)
ieee_29148_ontology (from ieee_29148.xsd)
ieee_12207_ontology (from ieee_12207.xsd)
iec_5055_ontology, eic_ontology, c4_v2_ontology, ast_ontology
python_metacode_ontology, ddd_python_bridge_ontology, bridge_ast_treesitter_ontology
- Each concept tagged with:
skos:inScheme <collection>
cbml3:conceptKind "domain-primitive"
cbm:source pointing at the XSD path (provenance)
- Idempotent — re-running over the same input produces byte-identical output.
Subtasks
Blockers
Acceptance
After this lands, python scripts/seed_vocab_from_xsd.py produces N new vocab YAMLs and python scripts/run_l3.py over any DDD-style codebase tags AggregateRoot-shaped identifiers with cbml3:broaderCollection ddd_v3_ontology.
Tier classification
Per session analysis: this is Tier 2 — the genuinely proposition-strengthening move. Tier 1 (fixture wiring) already landed.
Context
static/schemas/was vendored as a test fixture (seetests/verify_xsd_fixture.py). The schemas also contain rich domain vocabularies (DDD:AggregateRoot,BoundedContext,Entity,Repository; IEEE 29148:StakeholderRequirement,SystemRequirement, etc.) that could materially strengthen ourconcept_graphplugin's labeling quality.Today, L3 concepts are produced purely from identifier splitting — purely lexical. After this work, a bundle of a DDD-style codebase would surface concepts tagged with
cbml3:conceptKind = domain-primitiveandcbml3:broaderCollection = ddd_v3_ontology, unlocking MCP queries like "show me every DDD aggregate root in this repo."Scope
Add
scripts/seed_vocab_from_xsd.pythat:static/schemas/*.xsdand parses each withxml.etree.ElementTree(orlxmlif added).<xs:element name="…">,<xs:complexType name="…">,<xs:attribute name="…">, and<xs:simpleType name="…">declarations.concept_graphsplitter rules so the extracted terms align with what splitter produces from identifiers.codebase_mapper/vocab/— one per source XSD:ddd_v3_ontology(fromddd/v3_0_0/*.xsd)ieee_29148_ontology(fromieee_29148.xsd)ieee_12207_ontology(fromieee_12207.xsd)iec_5055_ontology,eic_ontology,c4_v2_ontology,ast_ontologypython_metacode_ontology,ddd_python_bridge_ontology,bridge_ast_treesitter_ontologyskos:inScheme <collection>cbml3:conceptKind "domain-primitive"cbm:sourcepointing at the XSD path (provenance)Subtasks
scripts/seed_vocab_from_xsd.pytests/verify_vocab_xsd_seed.py— runs seeder against a small fixture, asserts known concepts present (e.g.aggregate_root,bounded_context)docs/vocabulary.md— section "Seeded collections" describing source + regeneration procedurepyproject.toml[tool.setuptools.package-data]sostatic/schemas/*.xsdand the seeded YAMLs ship with the wheel (if external consumers need to re-run the seeder)## Controlled vocabularysection to mention seeded collectionsBlockers
Acceptance
After this lands,
python scripts/seed_vocab_from_xsd.pyproduces N new vocab YAMLs andpython scripts/run_l3.pyover any DDD-style codebase tagsAggregateRoot-shaped identifiers withcbml3:broaderCollection ddd_v3_ontology.Tier classification
Per session analysis: this is Tier 2 — the genuinely proposition-strengthening move. Tier 1 (fixture wiring) already landed.