switch to YAML split-file flow config and shared schema validation#59
Merged
switch to YAML split-file flow config and shared schema validation#59
Conversation
Member
jaromil
commented
Feb 22, 2026
- Added shared schema module (internal/schema) and reused it in agent + flow validation.
- Added flow DTO schemas + strict YAML codec (schema validation first, semantic validation second).
- Replaced single-file JSON repo with split-file YAML directory repo.
- Enforced YAML-only flow import/export API:
- Export: YAML attachment flows.yaml
- Import: only YAML content types, 415 for missing/unsupported types
- Updated Flow frontend import/export to YAML (.yaml,.yml) and raw YAML uploads.
- Added packaged default flow file in config/flows.
- Updated docs and AGENTS
There was a problem hiding this comment.
Pull request overview
This PR transitions flow configuration from a single-file JSON format to a split-file YAML directory structure, introducing a shared schema validation module that is reused across both agent and flow packages. The change enforces YAML-only flow import/export through the API while maintaining JSON for GET/PUT operations.
Changes:
- Introduced shared schema validation module (
internal/schema) with registry and caching support, now used by both agent and flow packages - Migrated flow persistence from single JSON file (
automations.json) to split YAML files (*.flow.yaml) stored inconfig/flowsdirectory - Enforced YAML-only flow import/export API with strict content-type validation (returns 415 for unsupported types including JSON)
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/schema/validator.go | New shared JSON schema validator with support for objects, arrays, primitives, anyOf, oneOf, and enum validation |
| internal/schema/validator_test.go | Comprehensive test coverage for validator including required fields, unknown fields, anyOf, oneOf, and enum validation |
| internal/schema/registry.go | Schema provider registry with caching for performance |
| internal/schema/registry_test.go | Tests for registry, cache, and provider lifecycle |
| internal/flow/schema_types.go | Flow DTO types (FlowFile, FlowBundle, FlowBinding) with JSON schema annotations |
| internal/flow/schema.go | Schema generation and registration for flow DTOs using jsonschema reflector |
| internal/flow/schema_test.go | Schema validation tests for flow file and bundle |
| internal/flow/codec_yaml.go | YAML encoding/decoding with schema validation for flow bundles and files |
| internal/flow/codec_yaml_test.go | Tests for YAML codec including schema and semantic validation errors |
| internal/flow/repository_dir_yaml.go | New directory-based repository that loads/saves flows as individual YAML files |
| internal/flow/repository_managed_files.go | Utilities for listing and cleaning up managed flow files with .flow.yaml suffix |
| internal/flow/repository_managed_files_test.go | Tests ensuring only managed files are deleted and unmanaged files are preserved |
| internal/flow/repository.go | Removed FileRepository, replaced with compatibility wrapper returning DirectoryRepository |
| internal/flow/repository_test.go | Updated tests for directory-based repository with YAML files |
| internal/flow/path.go | Flow ID normalization and filename collision detection |
| internal/flow/path_test.go | Tests for ID normalization and collision validation |
| internal/flow/service.go | Updated default config path from file to directory |
| internal/flow/bridge_test.go | Increased test timeout from 200ms to 500ms for stability |
| internal/api/rest_flow.go | Added YAML-only import with media type validation, returns 415 for unsupported types |
| internal/api/rest_flow_test.go | Updated tests for YAML import/export with multiple content types |
| internal/api/routes.go | Added flowService parameter to RegisterRoutes |
| internal/api/rest_test.go | Updated type signature for flow repository |
| internal/api/workflow_routes_test.go | Added nil flowService parameter to RegisterRoutes calls |
| internal/api/middleware_test.go | Added nil flowService parameter to RegisterRoutes call |
| internal/api/e2e_integration_test.go | Added nil flowService parameter to RegisterRoutes calls |
| internal/agent/validation.go | Refactored to use shared schema validation, retained helper functions for agent-specific error formatting |
| internal/agent/schemas/common.go | Refactored to use shared schema registry instead of local implementation |
| internal/config/extractor_test.go | Added test for flow file extraction with dist file handling |
| frontend/src/views/FlowView.svelte | Changed file input to accept .yaml/.yml and upload raw YAML text |
| frontend/src/lib/apiClient.js | Changed import to send raw YAML with text/yaml content type |
| frontend/tests/flowView.test.js | Added test for YAML file import |
| frontend/tests/apiClient.test.js | Updated test to verify YAML content type in import |
| docs/reference/http-api.md | Documented YAML-only import policy with supported media types and error codes |
| docs/configuration/prompts-skills-auth.md | Documented flow file storage location and format |
| config/flows/default-file-changed.flow.yaml | Added default packaged flow file |
| cmd/gestalt/server_command.go | Passed flowService to RegisterRoutes |
| cmd/gestalt/config_extract_test.go | Added assertion for extracted default flow file |
| cmd/gestalt/config_extract_flow_test.go | Added test for re-extracting missing default flow file |
| cmd/gestalt-send/integration_test.go | Added nil flowService parameter to RegisterRoutes call |
| AGENTS.md | Added documentation for YAML split-file flow implementation notes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ocation may overflow Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
🎉 This PR is included in version 1.18.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.