-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Context
Split from #33 (CLI meta-issue). This issue adds flow validation commands to the CLI established in #44.
What to do
1. validate command
chainweaver validate <file> validates a flow definition file (YAML/JSON):
chainweaver validate flows/my_flow.flow.yaml
- Loads the flow from file using serialization from Implement flow serialization and deserialization (YAML + JSON) #14
- Validates structure (required fields, valid step references)
- Reports errors with file, line context
- Exit code: 0 = valid, 1 = validation errors, 2 = file not found
2. check command
chainweaver check <directory> validates all .flow.yaml / .flow.json files in a directory:
chainweaver check flows/
- Scans directory for flow files
- Validates each one
- Summary output: N valid, M invalid
--quietflag for CI (exit code only)
3. Output formatting
--format jsonfor machine-readable output (list of validation results)--format tablefor human-readable table (default)
Files to modify
chainweaver/cli.py— addvalidateandchecksubcommandstests/test_cli.py— add validation command tests
Acceptance Criteria
-
chainweaver validate <file>validates a flow file and reports errors -
chainweaver check <dir>validates all flow files in a directory - Invalid flows produce clear error messages with details
- Exit codes: 0 = all valid, 1 = validation errors, 2 = file/dir not found
-
--format jsonproduces machine-readable output -
--quietsuppresses output (exit code only) - At least 4 test cases: validate valid flow, validate invalid flow, check directory, file not found
Out of Scope
inspectcommand (→ Implement CLI entry point withinspectcommand #44)vizcommand (→ separate issue)- Schema chain compatibility checking against registered tools (requires executor context)
Dependencies
- Implement CLI entry point with
inspectcommand #44 (CLI entry point must exist first) - Implement flow serialization and deserialization (YAML + JSON) #14 (flow serialization — needed to load flow files from disk)
- Add compile-time flow validation (tool existence + schema chain compatibility) #7 (compile-time validation — the validation logic itself)
Part of CLI split from #33. See also: #44 (CLI entry + inspect), viz CLI.
Reactions are currently unavailable