Skip to content

Validate template execution results#144

Open
Rishabh060105 wants to merge 1 commit into
accordproject:mainfrom
Rishabh060105:Rishabh060105/validate-execution-result
Open

Validate template execution results#144
Rishabh060105 wants to merge 1 commit into
accordproject:mainfrom
Rishabh060105:Rishabh060105/validate-execution-result

Conversation

@Rishabh060105
Copy link
Copy Markdown

@Rishabh060105 Rishabh060105 commented May 14, 2026

Fix TemplateArchiveProcessor execution result validation

This PR adds the runtime validation requested in #135 so TemplateArchiveProcessor fails fast when template logic returns malformed execution output.

Changes

  • Added runtime validation in TemplateArchiveProcessor.trigger() before returning execution results
  • Added runtime validation in TemplateArchiveProcessor.init() before returning execution results
  • Enforced that trigger() returns:
    • result as an object
    • state as an object
    • events as an array
  • Enforced that init() returns:
    • state as an object
  • Extended test/TemplateArchiveProcessor.test.ts with malformed output cases for:
    • missing result
    • missing state
    • non-array events

Flags

  • This PR follows the existing runtime contract used in this repository, where trigger() returns result, state, and events
  • Validation is covered using the real TemplateArchiveProcessor test suite rather than mock-only tests

Screenshots or Video

  • Not applicable

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from Rishabh060105/validate-execution-result

Validation

  • node --experimental-vm-modules node_modules/jest-cli/bin/jest.js test/TemplateArchiveProcessor.test.ts --runInBand

Signed-off-by: Rishabh Jain <rishabhj2005@email.com>
@Rishabh060105 Rishabh060105 requested a review from a team May 14, 2026 17:45
@Rishabh060105
Copy link
Copy Markdown
Author

Hi @mttrbrts , I reviewed the changes against the pointers provided in the original issue and updated the branch accordingly.

What changed

  • Added runtime validation in TemplateArchiveProcessor.trigger() so malformed execution output now fails fast instead of being returned unchecked
  • Added matching runtime validation in TemplateArchiveProcessor.init()
  • Covered the new behavior in the real TemplateArchiveProcessor test suite for:
    • missing result
    • missing state
    • non-array events

Validation

  • Ran the targeted processor suite:
    • node --experimental-vm-modules node_modules/jest-cli/bin/jest.js test/TemplateArchiveProcessor.test.ts --runInBand
  • Ran the full repo test command:
    • npm test

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