feat(actions): JSON Schema validation, CLI validate command, and agent-facing capabilities#220
Open
feat(actions): JSON Schema validation, CLI validate command, and agent-facing capabilities#220
Conversation
Introduces a hand-written JSON Schema builder and a CLI command (`tenderly actions schema`) so users can get editor autocomplete and validation for tenderly.yaml via VS Code or JetBrains.
- Fix PeriodicTrigger: move properties to top level so additionalProperties works with oneOf
- Add minimum filter constraint (anyOf) on TransactionFilter requiring at least one of from/to/function/eventEmitted/logEmitted
- Fix Hex64 pattern from permissive ^0x to ^0x[0-9a-fA-F]+$
- Use case-insensitive address/signature regex in schema to accept EIP-55 checksummed addresses
- Add cron field pattern validation (5-field format)
- Make execution_type optional in ActionSpec (defaults to sequential)
- Add action name pattern validation via patternProperties
- Add parameters field to FunctionValue (now supported in CLI)
- Support StrValue {exact, not} object form in ParameterCondValue.string
Two-phase validation using the generated JSON Schema: 1. JSON Schema validation (structure, types, enums, required fields) 2. Go-level validation (cross-field constraints, regex, cron parsing) No login required. Supports --project flag for single-project validation.
Init command now generates tenderly-schema.json alongside tenderly.yaml and sets $schema reference for IDE auto-detection.
- New `tenderly actions capabilities` command outputs a JSON manifest with available commands, trigger types, runtimes, enums, and the embedded JSON Schema for agent/tooling discovery. - Add --json flag to `tenderly actions validate` for structured output with schema_errors and trigger_errors arrays.
- Switch jsonschema/v6 to v5 to keep go.mod at Go 1.18 (no breaking change) - Promote StrValue to named $def for consistency with all other composite types - Split validate into runValidation() + separate text/JSON renderers - Capabilities: lightweight by default, full schema behind --include-schema flag - Add .gitignore entry for generated tenderly-schema.json - Add 7 integration tests for ValidateConfig (valid, invalid runtime, missing filter constraint, bad action name, both interval+cron, checksummed address, function with parameters)
- Replace MustGetActions() with direct YAML parsing in validate to avoid os.Exit inside runValidation (returns errors instead) - Add capabilities output tests (JSON shape, schema inclusion, enum sync)
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.
Summary
Adds offline validation tooling and machine-readable interfaces for
tenderly.yamlactions configuration, making the CLI usable by both humans and AI agents.Schema alignment with runtime
Validated the JSON Schema against
actions-trigger-service(tenderly-core) and official docs to close gaps where the schema would accept configs the runtime rejects:PeriodicTriggeradditionalPropertiesinteraction withoneOfanyOfenforcing the minimum filter constraint (from/to/function/eventEmitted/logEmitted)Hex64pattern, address/signature regex (case-insensitive for EIP-55)patternPropertiesparameterstoFunctionValue,{exact, not}form toParameterCondValue.stringexecution_typeoptional (defaults to sequential)New commands
tenderly actions validatetenderly actions validate --json{valid, schema_errors, trigger_errors}output for programmatic consumptiontenderly actions capabilitiesIDE integration
tenderly actions initnow generatestenderly-schema.jsonand sets$schemaintenderly.yamlfor automatic IDE autocomplete (VS Code, JetBrains)Why this matters for AI agents
AI agents building web3 actions previously had to reverse-engineer valid configs from Go source code or deploy and parse failures. This PR creates a proper machine interface:
tenderly actions capabilitiesreturns all valid enums, trigger types, and the full JSON Schema in one call. An agent can generate correct configs without reading docs.tenderly actions validate --jsonprovides structured errors that agents can parse and act on programmatically, enabling write-validate-fix cycles without human intervention.Tested on a real project
Ran both commands against a test project (7 actions with transaction triggers, event parameters, function filters, NOT conditions, int ranges):
Test plan
go test ./model/actions/...— 55 tests pass (24 schema tests)tenderly actions validate— text output on valid/invalid configstenderly actions validate --json— structured JSON output, exit 0/1tenderly actions capabilities | jq .— valid JSON with all fieldstenderly actions schema -o schema.json+ external validator (ajv-cli) against sample configs