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
materializer/src/index.ts open-codes each scenario template at four sites:
The template emission loop (one block per template, ~10 lines each, around lines 562–599) wiring scenariosDir → output dir → emitter constructor by hand.
Imports of each per-template emitter at the top of the file.
Comments that enumerate the supported templates.
Adding a 5th ScenarioTemplate to configs/<config>/ontology/scenario-templates.json therefore requires:
An ABox entry (ontology — correct).
A new emitter implementation under materializer/src/templateEmitters/ (correct — emitters render Playwright code, not data, so a new template shape may need new emission logic).
Three separate edits in index.ts to wire it in (wrong — this is mechanical glue that should not require touching the orchestrator).
buildCoverage() takes TEMPLATE_REGISTRY directly — the templateOutputDirs argument disappears.
Adding a template is one entry, one place.
Step 2 (optional, larger) — derive the registry from the ontology
Read configs/<config>/ontology/scenario-templates.json and look up each template's emitter by name from a small materializer/src/templateEmitters/registry.ts:
Problem
materializer/src/index.tsopen-codes each scenario template at four sites:scenariosDir→ output dir → emitter constructor by hand.templateOutputDirsmap (added in feat: suppress feature specs covered by scenario-template ontology #332 for coverage collection, around line 485) duplicating the template-name → output-dir mapping.Adding a 5th
ScenarioTemplatetoconfigs/<config>/ontology/scenario-templates.jsontherefore requires:materializer/src/templateEmitters/(correct — emitters render Playwright code, not data, so a new template shape may need new emission logic).index.tsto wire it in (wrong — this is mechanical glue that should not require touching the orchestrator).Surfaced during review of #332 / #331.
Proposal
Step 1 — hoist a single registry
Create
materializer/src/templateRegistry.ts:Then:
TEMPLATE_REGISTRY.buildCoverage()takesTEMPLATE_REGISTRYdirectly — thetemplateOutputDirsargument disappears.Step 2 (optional, larger) — derive the registry from the ontology
Read
configs/<config>/ontology/scenario-templates.jsonand look up each template's emitter by name from a smallmaterializer/src/templateEmitters/registry.ts:Then adding a template is:
TEMPLATE_EMITTERS.The orchestrator stays untouched.
Out of scope
edgeLifecycleEmitter, etc.). Those genuinely encode template-shape-specific Playwright rendering.coverage.jsonis consumed by L3 invariants.Acceptance
materializer/src/index.tsno longer references any template name.{ name, outputDir, emitter }triple to one registry file is sufficient to wire a new template into both emission and coverage.camunda-ocaconfig).Refs
templateOutputDirshardcode this refactor removes)