The old Architect checks the model after it loads. It reports broken model rules (for example database names that are too long) and file problems (missing references, orphaned files, objects stored in wrongly named files). The new HTML Architect doesn’t show any of this, so a broken model goes unnoticed until something fails later.
We’d like to add a “Validate model” action to the HTML Architect. It would run the same checks on demand and list the problems in a tab, with a way to jump to each item in the model tree. The button would also show the result of the last run.
A single broken part of the model, such as a folder reference that points nowhere, shouldn’t stop the whole validation or break search. It should just be reported with the other problems.
What do you think?
Adds a Validate model action to the top bar. It runs the model rules and the file system checks on demand and shows the results in a dedicated tab.
Backend (Origam.Architect.Server)
- New
ModelCheckService + ModelCheckController:
POST /ModelCheck/Run runs ModelRules.GetErrors and FilePersistenceProvider.GetFileErrors on an independent persistence service (ignores .git and l10n).
GET /ModelCheck/Result returns the last result, which is cached in the singleton.
- Only one run at a time. Needs an active package. Failures come back as user errors.
- Rule violations reuse
SearchService.BuildResult, so they carry the same columns and tree navigation as search results. If an item can’t be described, it’s still reported as an orphaned row.
- Removed the unused model check that ran at startup in
Workbench (it computed errors and threw them away).
/Test/Reset also clears the cached result.
- User errors (420) now return only
{ message }.
Robustness fixes
SearchService: a broken group reference (a group id that no longer resolves) no longer breaks the search result. The item is still returned, just without a folder.
FilePersistenceProvider: if one file checker throws, it’s reported as its own section (“ Could Not Finish”) and the other checkers keep running.
XmlReferencePropertyChecker: missing references are detected via Has() instead of RetrieveInstance, which threw.
Frontend (architect-html)
ModelCheckButtonHOC in the top bar has a spinner while running and a badge afterwards (a check mark when clean, otherwise the problem count, with the last check time as a tooltip).
- Results tab
ModelCheckResultsView:
- Summary pills.
- Rule violations table.
- Collapsible file problem sections. File paths are split into folder and file name, and GUIDs are shown as chips.
- New shared
SchemaItemResultsTable. SearchResultsView was switched to it, and the table localization keys were renamed to schema_item_results_*.
- After a reload, the last result is lns if it was open (the open state iskept in
UiState / localStorage).
httpClient shows user errors (420)with status" prefix.
- Added a Vite proxy for
/ModelCheck.
Tests (Playwright, test/architect-html-e2e)
New model-validation.spec.ts (serialdel files on disk):
- A clean model reports no problems and the badge shows a check mark.
- An overlong column name is reported on.
- A reference to a non-existent id appears under “Invalid References Between Origam Files”.
- A file that no model element referene.
- An object saved in a file with a different name is reported as a misnamed file.
- A rule violation on an item whose gr columns and isn’t orphaned.
- Several problems at once: the summary counts them and the badge shows 3.
- A second run on a repaired model rep
- There’s no badge or tab before the first run.
- The results reopen after a reload.
- A closed tab stays closed after a reload.
search.spec.ts has a new test: full-text search still finds items whose group is missing.
Test helpers:
support/modelDefects.ts plants def (missing reference, overlongidentifier, orphan file, misnamed file, broken group reference).
resetBackend.ts has a new `reloadBckend without restoring the files first, so the planted damage reaches the live model.