feat: implement workflow visualization command for #60#77
Merged
Conversation
Add comprehensive test suite for workflow visualization command: - Command existence and structure (workflow inspect) - Built-in strategy support (fast/balanced/sensitive) - Torch directory path support - ASCII diagram rendering with boxes and connections - Conditional branch visualization - Task parameter display (default and --verbose) - WDL parsing error handling - Integration tests with existing workflows All tests currently FAILING as expected (RED phase). Feature implementation will make these tests pass. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add workflow inspection command 'torchbase workflow inspect' that renders WDL workflow pipelines as ASCII box diagrams. Supports built-in strategy names (fast/balanced/sensitive) and torch directory paths. Includes: - WDL parser for extracting workflow structure, task flows, and conditionals - ASCII diagram renderer with task boxes and flow visualization - Support for conditional branches with clear notation (├──[condition]──┐) - Task names and key parameters displayed by default - Verbose flag for full parameter details including defaults and optional markers - Error detection for WDL syntax errors and import issues - Three built-in workflow definitions for fast/balanced/sensitive strategies All 48 tests pass, covering command existence, built-in strategies, torch paths, ASCII rendering, conditionals, parameters, verbose mode, WDL errors, and output format. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PR #64 already merged the complete balanced typing workflow implementation
Import paths in WDL are relative to the WDL file location, not the CWD. The overly strict validation was rejecting valid relative imports. Let the WDL engine handle import resolution during execution.
- Add import path validation in WDLParser._validate_syntax() - Pass wdl_dir to WDLParser to enable relative import resolution - Update fast_typing.wdl and sensitive_typing.wdl to match main branch (use task imports instead of inlined tasks) - All 48 workflow_inspect tests now pass Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
# Conflicts: # torchbase/workflows/builtin/fast_typing.wdl # torchbase/workflows/builtin/sensitive_typing.wdl
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
Implement
torchbase workflow inspectcommand that renders WDL workflow pipelines as ASCII box diagrams showing task flow, conditionals, and key parameters.Changes
WDL Parser Module (
torchbase/workflow_inspect.py):WDLParser: Extracts workflow structure, task definitions, inputs/outputs, and conditionalsWorkflowDiagramRenderer: Generates ASCII box diagrams with configurable verbosityinspect_workflow(): Main interface supporting strategy names and torch pathsCLI Enhancement (
torchbase/cli.py):workflowcommand groupworkflow inspectsubcommand with--verboseflagBuilt-in Workflows (
torchbase/workflows/builtin/):fast_typing.wdl: MinHash-only pipelinebalanced_typing.wdl: MinHash with conditional alignmentsensitive_typing.wdl: Full alignment-based pipelineFeatures
├──[condition]──┐notation--verboseflag shows full details including default values and optional parameter markers (?)Test Coverage
All 48 acceptance tests pass:
Test Plan
pytest torchbase/tests/test_workflow_inspect.py -vflake8 torchbase/workflow_inspect.pytorchbase workflow inspect fastGenerated with Claude Code