Repository navigation
Conversation
calm validate now loads the schema at each node interface's definition-url and checks the interface config against it. A definition that cannot be loaded or compiled gives a warning, so architectures that validated before do not start to fail. Closes finos#1994 Signed-off-by: Toyenzo <64788123+Toyenzo@users.noreply.github.com>
Toyenzo
requested review from
a team,
LeighFinegold,
Thels,
aidanm3341,
grahampacker-ms,
jpgough-ms,
lbulanti-ms,
markscott-ms,
rocketstack-matt and
willosborne
as code owners
November 5, 2026 03:33
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
calm validatenow checks each node interface that has adefinition-url. It loads the schema at that URL and validates the interfaceconfigagainst it. Before this change, a config could leave out a property that the definition requires and validation still passed (the example in the issue).The new check is a SEMANTIC rule beside the controls rule and works the same way. It loads the schema through the
SchemaDirectoryand checks the config with AJV. Each error is reported at the path of the config property, e.g./nodes/0/interfaces/0/config/prop2. The rule runs on detailed sub-architectures too, because node-details validation runs the full engine again on each one.One decision for review: if the definition cannot be loaded or compiled, the result is a warning (
interface-definition-unresolved), not an error. Controls give an error for this. But interface definitions are often hosted somewhere else (the beginner tutorial usescalm-hub.example.com), and before this change those architectures passed. An error would make them fail with no change to the document. I can change it to an error if you prefer.The beginner interfaces tutorial said that validation "does not yet ensure" definitions are followed. That sentence is updated, and so is the validation technical spec.
Closes #1994
AI-assisted: drafted with Claude Code; reviewed and tested by me.
Type of Change
Affected Components
cli/)calm/)calm-ai/)calm-hub/)calm-hub-ui/)calm-server/)calm-widgets/)docs/)shared/)calm-plugins/vscode/)Commit Message Format ✅
Testing
I have tested my changes locally
I have added/updated unit tests
All existing tests pass
New e2e spec (
validate-interfaces.e2e.spec.ts) runs the realvalidate()with the issue's example: a definition that requiresprop1(string) andprop2(integer). Before the change, 3 of its 4 tests failed (missing property, wrong type and unloadable definition were all silent). After the change, all 4 pass.New unit tests cover these cases: a loader that throws, a definition that does not compile, interface types with no
definition-url(skipped), an architecture that cannot be parsed, and the index path when the node has more than one interface. The rule wiring is tested inrules.spec.ts.npm run build:clipasses.npm run lintgives 0 errors (the 8 warnings are in calm-hub-ui and were there before).npm test --workspace shared: 1492 passed, 4 skipped, 5 failed. All 5 failures were timeouts on a heavily loaded machine (load average about 15). They are in the logger barrel, mermaid export, the docusaurus peer-dependency install, a network hook and the cyclic node-details e2e. The logger and node-details specs pass when run alone.npm test --workspace cli: 975 passed. The only failures were hook timeouts. When run alone with longer hook timeouts,cli.specanddocument-loader-config.specpass (117 tests) and the packed-CLIcli.e2e.specpasses 59/59.Checklist
🤖 Generated with Claude Code