Skip to content

switch to YAML split-file flow config and shared schema validation#59

Merged
jaromil merged 29 commits intomainfrom
default-flows-config
Feb 23, 2026
Merged

switch to YAML split-file flow config and shared schema validation#59
jaromil merged 29 commits intomainfrom
default-flows-config

Conversation

@jaromil
Copy link
Member

@jaromil 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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in config/flows directory
  • 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.

@jaromil jaromil merged commit 43f2c19 into main Feb 23, 2026
6 checks passed
@jaromil jaromil deleted the default-flows-config branch February 23, 2026 08:36
@github-actions
Copy link

🎉 This PR is included in version 1.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants