"""Load the declarative spec files in core/spec/.""" from functools import lru_cache from pathlib import Path import yaml SPEC_DIR = Path(__file__).resolve().parent.parent / "spec" @lru_cache(maxsize=None) def load(name): """The parsed contents of core/spec/.yaml (cached; treat as read-only).""" with open(SPEC_DIR / f"{name}.yaml", encoding="utf-8") as f: return yaml.safe_load(f) def form(): return load("form")