8000 Feature/published model consumption by christianbeil · Pull Request #1 · OP-TED/espd-demo · GitHub
[go: up one dir, main page]

Skip to content

Feature/published model consumption - #1

Open
christianbeil wants to merge 14 commits into
mainfrom
feature/published-model-consumption
Open

christianbeil wants to merge 14 commits into
mainfrom
feature/published-model-consumption

Conversation

@christianbeil
Copy link
Copy Markdown
Collaborator

Summary

The compiler and the neutral model sources moved out of the demo. It now vendors the published model and builds only its own presentation layers on top.

  • npm run model:sync verifies ESPD-EDM/model (envelope schema, every listed file exists, nothing stray, structure hash matches) and copies it verbatim to model/generated/: instance-data, xml-mapping, compiled, parts, registries and compiled-model.json. It also writes a small structure.json projection.
  • npm run model:compile runs the sync, then builds the demo's own layers: form-structure, UI bundle, validators, UI codelists, role lens and coverage report.
  • Removed: the local compiler, model/legacy, the neutral sidecars and registries, and model/parts/. The six part tests moved to model/parts-tests/ and run against the vendored copy.
  • roles.json is split into the published neutral registry and the demo's role-ui.json. Codelist governance is split into the published registry plus the demo's ui-codelists.json (useForUI), merged by governance.mjs.
  • The upstream location is a sibling ../ESPD-EDM checkout; ESPD_EDM_ROOT overrides it.
  • Docs updated; new roundtrip test over every published example.

Tested

npm run model:test: 407/407. npm test: 87/87. npm run build:pages produces public/model/generated/parts.

Notes for review

  • Merge after the ESPD-EDM PR, otherwise model:sync has nothing to read.
  • The branch carries 8 commits that were never on origin/main (the reorganisation steps), not only the latest.
  • Three roundtrip limitations of the published mappings are recorded in roundtrip-generated.test.mjs.
  • The sibling-checkout coupling is deliberately unchanged. A pinned release artifact is the follow-up.

The form-structure parity comparisons read hand-authored files from model/legacy. Replace them with baseline-free assertions (repeatable convictions[] fields for exg-crim-part; required-by-EA-cardinality fields for C31) and remove model/legacy/xml-mapping from the model:test script, in preparation for deleting model/legacy.
Delete the pre-compiler per-part artifacts (instance-data, form-structure, xml-mapping and their roundtrip tests). Nothing at runtime read them; they remain in git history. Update READMEs and reference docs, mark model-xml-mapping.md as historical, repoint part-I.md to model/parts, and correct the stale Part II representatives note in espd-ubl-profile.md.
roles.json keeps the implementer-neutral role facts (ids, documentType, exclusion dispositions, UBL role mapping, category map). Display text and per-role visible/editable Parts move to role-ui.json; roles.mjs joins them by role id, so the generated role lens is unchanged. Also: remove stale references to the deleted hand-authored part-IV/part-III form files from comments, add TODOs to codelist-attributes.json (duplicates the Schematron) and scheme-agency-profile.json (policy review), flag the CA/CE dispositions for review in roles.json, and document in model/README.md that the neutral model-sources are moving to espd-conceptual-model/enrichment.
The model compiler now lives in espd-tools/model-compiler and the enrichment in espd-conceptual-model/enrichment; ESPD-EDM publishes the result. This app vendors it verbatim under model/generated/ (npm run model:sync, which refuses a model that does not verify: schema, listed files, strays, structure hash) and builds only its own layers from it. Adds the sync, published-model access and a structure projection; model:compile now syncs then builds form lenses, UI bundle, validators, role lens and the coverage report. Removes the in-repo compiler modules, neutral registries, sidecars, hints and their tests. Realigns i18n keys with the current EA model (Part II/V criteria keyed by their own codes, exg-mis-misconduct, new not-registered-reasons leaf). Adds tests: roundtrip of every published example through the published mapping specs (three known limitations recorded), every i18n key resolves, vendored model consistency and form paths against the published schemas. Generator-focused probe tests were not ported (see model/README.md).
The first sync used a local stand-in whose codelists.json still said 5.0.0-alpha.2. Against ESPD-EDM's model/ the envelope reports ESPD 5.0.0 and its real source reference; every other vendored and generated file is unchanged.
docs/codelist-governance.md now only records what the app adds (useForUI and how it is used) and links to the doc next to the registry in espd-conceptual-model. The vendored model is re-synced with the published ESPD-EDM, which carries the registry status fields.
The published ESPD-EDM model now records the resolved espd-tools commit in sourceRef. No other file changed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0