feat(runtime): validate logic payloads against Concerto models#164
Merged
mttrbrts merged 2 commits intoJul 11, 2026
Merged
Conversation
bdf5ca6 to
587f007
Compare
- Instantiates Concerto Serializer in init and trigger pipelines - Validates data, request, and state inputs before logic execution - Validates result, state, and events outputs after logic execution - Adds unit tests to ensure invalid inputs are properly rejected Signed-off-by: Harshit Kumar <10harshitkumar@gmail.com>
587f007 to
1a99ce6
Compare
mttrbrts
approved these changes
Jul 11, 2026
…ailures Signed-off-by: Harshit Kumar <10harshitkumar@gmail.com>
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
This PR addresses the upstream engine requirements for US-07: Runtime Payload Validation Against Concerto Models. It ensures that any logic executed by the
TemplateArchiveProcessorstrictly adheres to the underlying Concerto models, both before and after execution.Changes Made
Input Validation: Added Concerto Serializer to
init()andtrigger(). Payloads (data,request,state) are rigorously validated viaserializer.fromJSON()before they are passed to theJavaScriptEvaluator.Output Validation: Extracted result, state, and events from the evaluated response and validated them after execution to ensure the logic layer did not mutate them into an invalid schema.
Type Checking: Because we use
serializer.fromJSON(), this guarantees that the $class discriminators strictly match the declared models in theModelManager.Testing: Added unit tests to
TemplateArchiveProcessor.test.tsto verify that invalid payloads (e.g. missing required fields or having wrong data types) throw immediate, descriptive validation errors.Note on
cicero-coretypingI had to add a quick
// @ts-ignoreover theScriptimport inTemplateArchiveProcessor.ts. Recent version ofcicero-coreseems to have stopped publicly exporting the internaltypes/src/scriptpath, so TypeScript couldn't find the type definition. I can open a small PR incicero-coreto export it from the root index so we can remove this ignore soon.Related Issues
Related to template-playground #903