galangal-orchestrate 0.6.0__tar.gz → 0.12.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of galangal-orchestrate might be problematic. Click here for more details.

Files changed (109) hide show
  1. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/PKG-INFO +247 -8
  2. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/README.md +246 -7
  3. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/README.md +35 -0
  4. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/__init__.py +1 -1
  5. galangal_orchestrate-0.12.1/src/galangal/ai/__init__.py +166 -0
  6. galangal_orchestrate-0.12.1/src/galangal/ai/base.py +153 -0
  7. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ai/claude.py +155 -144
  8. galangal_orchestrate-0.12.1/src/galangal/ai/codex.py +347 -0
  9. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/cli.py +51 -98
  10. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/__init__.py +1 -16
  11. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/complete.py +54 -24
  12. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/github.py +33 -74
  13. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/pause.py +5 -11
  14. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/prompts.py +5 -14
  15. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/resume.py +6 -11
  16. galangal_orchestrate-0.12.1/src/galangal/commands/skip.py +58 -0
  17. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/start.py +159 -74
  18. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/status.py +8 -30
  19. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/config/defaults.py +24 -0
  20. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/config/loader.py +41 -2
  21. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/config/schema.py +50 -6
  22. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/core/artifacts.py +20 -0
  23. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/core/state.py +242 -12
  24. galangal_orchestrate-0.12.1/src/galangal/core/tasks.py +452 -0
  25. galangal_orchestrate-0.12.1/src/galangal/core/utils.py +118 -0
  26. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/core/workflow/core.py +257 -66
  27. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/core/workflow/tui_runner.py +413 -276
  28. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/github/__init__.py +13 -3
  29. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/github/client.py +23 -0
  30. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/github/images.py +42 -7
  31. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/github/issues.py +81 -0
  32. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/logging.py +2 -0
  33. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/builder.py +177 -51
  34. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/review.md +29 -6
  35. galangal_orchestrate-0.12.1/src/galangal/prompts/defaults/review_codex.md +99 -0
  36. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/results.py +32 -3
  37. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/console.py +5 -0
  38. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/app.py +9 -2
  39. galangal_orchestrate-0.12.1/src/galangal/validation/runner.py +1065 -0
  40. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/conftest.py +15 -3
  41. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/test_ai_claude.py +25 -0
  42. galangal_orchestrate-0.12.1/tests/test_ai_codex.py +376 -0
  43. galangal_orchestrate-0.12.1/tests/test_commands.py +308 -0
  44. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/test_results.py +5 -5
  45. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/test_validation_runner.py +19 -0
  46. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/test_workflow_core.py +4 -4
  47. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/test_workflow_integration.py +6 -114
  48. galangal_orchestrate-0.6.0/src/galangal/ai/__init__.py +0 -6
  49. galangal_orchestrate-0.6.0/src/galangal/ai/base.py +0 -63
  50. galangal_orchestrate-0.6.0/src/galangal/commands/approve.py +0 -187
  51. galangal_orchestrate-0.6.0/src/galangal/commands/skip.py +0 -215
  52. galangal_orchestrate-0.6.0/src/galangal/commands/stats.py +0 -155
  53. galangal_orchestrate-0.6.0/src/galangal/core/metrics.py +0 -264
  54. galangal_orchestrate-0.6.0/src/galangal/core/tasks.py +0 -169
  55. galangal_orchestrate-0.6.0/src/galangal/validation/runner.py +0 -658
  56. galangal_orchestrate-0.6.0/tests/test_commands.py +0 -242
  57. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/.github/workflows/publish.yml +0 -0
  58. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/.gitignore +0 -0
  59. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/LICENSE +0 -0
  60. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/architecture.md +0 -0
  61. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/cli-commands.md +0 -0
  62. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/configuration.md +0 -0
  63. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/extending.md +0 -0
  64. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/prompt-system.md +0 -0
  65. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/state-management.md +0 -0
  66. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/validation-system.md +0 -0
  67. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/versioning.md +0 -0
  68. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/local-development/workflow-pipeline.md +0 -0
  69. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/docs/pypi/RELEASE.md +0 -0
  70. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/pyproject.toml +0 -0
  71. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/__main__.py +0 -0
  72. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ai/gemini.py +0 -0
  73. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/init.py +0 -0
  74. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/list.py +0 -0
  75. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/reset.py +0 -0
  76. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/commands/switch.py +0 -0
  77. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/config/__init__.py +0 -0
  78. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/core/__init__.py +0 -0
  79. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/core/workflow/__init__.py +0 -0
  80. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/core/workflow/pause.py +0 -0
  81. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/exceptions.py +0 -0
  82. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/__init__.py +0 -0
  83. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/benchmark.md +0 -0
  84. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/contract.md +0 -0
  85. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/design.md +0 -0
  86. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/dev.md +0 -0
  87. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/docs.md +0 -0
  88. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/migration.md +0 -0
  89. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/pm.md +0 -0
  90. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/pm_questions.md +0 -0
  91. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/preflight.md +0 -0
  92. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/qa.md +0 -0
  93. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/security.md +0 -0
  94. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/prompts/defaults/test.md +0 -0
  95. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/__init__.py +0 -0
  96. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/__init__.py +0 -0
  97. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/adapters.py +0 -0
  98. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/entry.py +0 -0
  99. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/mixins.py +0 -0
  100. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/modals.py +0 -0
  101. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/styles/app.tcss +0 -0
  102. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/styles/modals.tcss +0 -0
  103. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/types.py +0 -0
  104. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/ui/tui/widgets.py +0 -0
  105. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/src/galangal/validation/__init__.py +0 -0
  106. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/__init__.py +0 -0
  107. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/test_config.py +0 -0
  108. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/test_discovery_qa.py +0 -0
  109. {galangal_orchestrate-0.6.0 → galangal_orchestrate-0.12.1}/tests/test_tui.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: galangal-orchestrate
3
- Version: 0.6.0
3
+ Version: 0.12.1
4
4
  Summary: AI-driven development workflow orchestrator
5
5
  Project-URL: Homepage, https://github.com/Galangal-Media/galangal-orchestrate
6
6
  Project-URL: Repository, https://github.com/Galangal-Media/galangal-orchestrate
@@ -97,7 +97,7 @@ galangal status
97
97
  | **PREFLIGHT** | Environment validation | PREFLIGHT_REPORT.md |
98
98
  | **DEV** | Implementation | Code changes |
99
99
  | **MIGRATION*** | Database migration checks | MIGRATION_REPORT.md |
100
- | **TEST** | Test implementation | TEST_PLAN.md |
100
+ | **TEST** | Test implementation | TEST_PLAN.md, TEST_SUMMARY.md |
101
101
  | **CONTRACT*** | API contract validation | CONTRACT_REPORT.md |
102
102
  | **QA** | Quality assurance | QA_REPORT.md |
103
103
  | **BENCHMARK*** | Performance validation | BENCHMARK_REPORT.md |
@@ -107,6 +107,15 @@ galangal status
107
107
 
108
108
  *Conditional stages - skipped automatically if not relevant
109
109
 
110
+ ### Validation Artifacts
111
+
112
+ When validation commands run (tests, linters, etc.), Galangal creates debugging artifacts:
113
+
114
+ - **VALIDATION_REPORT.md** - Full output from all validation commands, useful for debugging failures
115
+ - **TEST_SUMMARY.md** - Concise test results (pass/fail counts, failed test names, coverage) included in downstream stage prompts
116
+
117
+ These artifacts help you understand what failed without digging through logs, and give downstream stages (QA, REVIEW) context about test results without bloating prompts with verbose output.
118
+
110
119
  ## Task Types
111
120
 
112
121
  Choose the right workflow for your task:
@@ -167,6 +176,32 @@ After analyzing your task, the PM stage outputs a `STAGE_PLAN.md` recommending w
167
176
 
168
177
  The progress bar updates dynamically to show only relevant stages.
169
178
 
179
+ ### Workflow Preview
180
+
181
+ After PM approval, you'll see a preview showing exactly which stages will run and why others are skipped:
182
+
183
+ ```
184
+ Workflow Preview
185
+
186
+ Stages to run:
187
+ PM → DESIGN → PREFLIGHT → DEV → TEST → QA → REVIEW → DOCS
188
+
189
+ Skipping:
190
+ MIGRATION (no files match: **/migrations/*)
191
+ CONTRACT (no files match: **/api/*, **/openapi.*)
192
+ BENCHMARK (task type: bug_fix)
193
+ SECURITY (PM: simple UI change, no security impact)
194
+
195
+ Controls during execution:
196
+ ^N Skip stage ^B Back ^E Pause for edit ^I Interrupt
197
+ ```
198
+
199
+ Skip reasons include:
200
+ - **Task type** - Based on the workflow template (e.g., bug fixes skip DESIGN)
201
+ - **Config** - Stages listed in `stages.skip` configuration
202
+ - **PM recommendation** - From STAGE_PLAN.md analysis
203
+ - **skip_if condition** - No changed files match the glob pattern
204
+
170
205
  ## Commands
171
206
 
172
207
  | Command | Description |
@@ -403,6 +438,9 @@ validation:
403
438
  - name: "Integration tests"
404
439
  command: "pytest tests/integration"
405
440
  optional: true # Don't fail if integration tests missing
441
+ # Use array form for paths with spaces or special characters
442
+ - name: "Task-specific tests"
443
+ command: ["pytest", "{task_dir}/tests"] # {task_dir} is substituted
406
444
 
407
445
  # Contract stage (API compatibility)
408
446
  contract:
@@ -458,21 +496,37 @@ ai:
458
496
  # Default backend to use
459
497
  default: claude
460
498
 
461
- # Available backends
499
+ # Available backends with customizable CLI flags
462
500
  backends:
463
501
  claude:
464
- command: claude
465
- args:
466
- - "-p"
467
- - "{prompt}"
502
+ command: claude # CLI command to invoke
503
+ args: # Arguments with {placeholder} substitution
468
504
  - "--output-format"
469
505
  - "stream-json"
470
506
  - "--verbose"
507
+ - "--max-turns"
508
+ - "{max_turns}" # Replaced with max_turns value
509
+ - "--permission-mode"
510
+ - "acceptEdits"
471
511
  max_turns: 200 # Maximum conversation turns per stage
512
+ read_only: false # If true, backend cannot write files
513
+
514
+ codex:
515
+ command: codex
516
+ args:
517
+ - "exec"
518
+ - "--full-auto"
519
+ - "--output-schema"
520
+ - "{schema_file}" # Replaced with schema file path
521
+ - "-o"
522
+ - "{output_file}" # Replaced with output file path
523
+ max_turns: 50
524
+ read_only: true # Codex runs in read-only sandbox
472
525
 
473
526
  # Use different backends for specific stages
474
527
  stage_backends:
475
- # qa: gemini # Use Gemini for QA stage (when supported)
528
+ REVIEW: codex # Use Codex for code review
529
+ # QA: gemini # Use Gemini for QA (when supported)
476
530
 
477
531
  # =============================================================================
478
532
  # DOCUMENTATION CONFIGURATION
@@ -569,6 +623,112 @@ stage_context:
569
623
  - Secrets must use environment variables
570
624
  ```
571
625
 
626
+ ## AI Backend Customization
627
+
628
+ Galangal invokes AI backends (like Claude Code CLI) using configurable commands and arguments. This allows you to customize CLI flags without modifying code.
629
+
630
+ ### Default Behavior
631
+
632
+ By default, Galangal invokes Claude with:
633
+ ```bash
634
+ cat prompt.txt | claude --output-format stream-json --verbose --max-turns 200 --permission-mode acceptEdits
635
+ ```
636
+
637
+ ### Customizing CLI Flags
638
+
639
+ Override any flags in `.galangal/config.yaml`:
640
+
641
+ ```yaml
642
+ ai:
643
+ backends:
644
+ claude:
645
+ command: claude
646
+ args:
647
+ - "--output-format"
648
+ - "stream-json"
649
+ - "--verbose"
650
+ - "--max-turns"
651
+ - "{max_turns}"
652
+ - "--permission-mode"
653
+ - "acceptEdits"
654
+ - "--model" # Add custom flags
655
+ - "opus"
656
+ max_turns: 300 # Increase max turns
657
+ ```
658
+
659
+ ### Placeholder Reference
660
+
661
+ Arguments can include placeholders that are substituted at runtime:
662
+
663
+ | Placeholder | Backend | Description |
664
+ |-------------|---------|-------------|
665
+ | `{max_turns}` | claude | Maximum conversation turns |
666
+ | `{schema_file}` | codex | Path to JSON schema file |
667
+ | `{output_file}` | codex | Path for structured output |
668
+
669
+ ### Common Customizations
670
+
671
+ **Use a specific model:**
672
+ ```yaml
673
+ ai:
674
+ backends:
675
+ claude:
676
+ args:
677
+ - "--output-format"
678
+ - "stream-json"
679
+ - "--model"
680
+ - "sonnet" # Use Sonnet instead of default
681
+ - "--max-turns"
682
+ - "{max_turns}"
683
+ ```
684
+
685
+ **Increase turn limit for complex tasks:**
686
+ ```yaml
687
+ ai:
688
+ backends:
689
+ claude:
690
+ max_turns: 500 # Default is 200
691
+ args:
692
+ - "--output-format"
693
+ - "stream-json"
694
+ - "--max-turns"
695
+ - "{max_turns}" # Will use 500
696
+ ```
697
+
698
+ **Use different backends per stage:**
699
+ ```yaml
700
+ ai:
701
+ default: claude
702
+ stage_backends:
703
+ REVIEW: codex # Use Codex for code review
704
+ ```
705
+
706
+ ### Adding a Custom Backend
707
+
708
+ Define any CLI tool as a backend:
709
+
710
+ ```yaml
711
+ ai:
712
+ backends:
713
+ my-backend:
714
+ command: my-ai-tool
715
+ args:
716
+ - "--prompt-file"
717
+ - "-" # Read from stdin
718
+ - "--json-output"
719
+ max_turns: 100
720
+ read_only: true # Cannot write files directly
721
+ ```
722
+
723
+ Then use it:
724
+ ```yaml
725
+ ai:
726
+ default: my-backend
727
+ # Or per-stage:
728
+ stage_backends:
729
+ QA: my-backend
730
+ ```
731
+
572
732
  ## Customizing Prompts
573
733
 
574
734
  Galangal uses a layered prompt system:
@@ -630,6 +790,45 @@ Create any of these in `.galangal/prompts/`:
630
790
 
631
791
  ## Troubleshooting
632
792
 
793
+ ### Debug Mode
794
+
795
+ When something goes wrong and you need to see what happened:
796
+
797
+ ```bash
798
+ # Enable debug logging (writes to logs/galangal_debug.log)
799
+ galangal --debug start "task description"
800
+ galangal --debug resume
801
+
802
+ # Alternative: set environment variable
803
+ GALANGAL_DEBUG=1 galangal start "task description"
804
+ ```
805
+
806
+ Debug mode creates two log files:
807
+ - `logs/galangal_debug.log` - Human-readable debug trace with timestamps
808
+ - `logs/galangal.jsonl` - Structured JSON logs for programmatic analysis
809
+
810
+ **Example debug log:**
811
+ ```
812
+ [14:32:15.123] GitHub integration failed: HTTPError: 401 Unauthorized
813
+ [14:32:15.124] Traceback:
814
+ File "/path/to/start.py", line 138, in task_creation_thread
815
+ check = ensure_github_ready()
816
+ ...
817
+ ```
818
+
819
+ ### Structured Logging Configuration
820
+
821
+ Enable structured logging in `.galangal/config.yaml`:
822
+
823
+ ```yaml
824
+ logging:
825
+ enabled: true # Enable logging
826
+ level: debug # debug, info, warning, error
827
+ file: logs/galangal.jsonl
828
+ json_format: true # JSON for parsing, false for console format
829
+ console: false # Also output to stderr
830
+ ```
831
+
633
832
  ### Tests Hang at TEST Stage
634
833
 
635
834
  Test frameworks must run non-interactively. Common issues:
@@ -673,10 +872,50 @@ If the TEST stage keeps retrying instead of rolling back to DEV:
673
872
  2. If tests fail due to implementation bugs, the AI should report FAIL (not try to fix the code)
674
873
  3. Check that test commands exit with proper exit codes (0 for success, non-zero for failure)
675
874
 
875
+ **Note:** As of v0.12.0, when artifact markers are unclear (missing PASS/FAIL), Galangal prompts you to manually approve or reject instead of retrying indefinitely. You'll see the artifact content and can make the decision yourself.
876
+
676
877
  ### "Galangal has not been initialized" Error
677
878
 
678
879
  Run `galangal init` in your project root before using other commands.
679
880
 
881
+ ### Task Exits Without Error Message
882
+
883
+ If a task quits unexpectedly with no visible error:
884
+
885
+ 1. **Enable debug mode** and re-run:
886
+ ```bash
887
+ galangal --debug start "your task"
888
+ ```
889
+
890
+ 2. **Check the debug log** for the actual error:
891
+ ```bash
892
+ tail -50 logs/galangal_debug.log
893
+ ```
894
+
895
+ 3. **Common causes**:
896
+ - GitHub authentication failed (run `gh auth status`)
897
+ - Network timeout fetching issues
898
+ - Missing permissions for the repository
899
+ - Invalid issue number or no issues with `galangal` label
900
+
901
+ ### GitHub Integration Fails Silently
902
+
903
+ If `galangal start` from a GitHub issue exits without creating a task:
904
+
905
+ ```bash
906
+ # Check GitHub CLI is working
907
+ gh auth status
908
+ gh repo view
909
+
910
+ # Try with debug mode
911
+ galangal --debug start --issue 123
912
+ ```
913
+
914
+ Check `logs/galangal_debug.log` for specific errors like:
915
+ - `401 Unauthorized` - Re-authenticate with `gh auth login`
916
+ - `404 Not Found` - Issue doesn't exist or wrong repo
917
+ - `No issues with 'galangal' label` - Add the label to an issue first
918
+
680
919
  ## License
681
920
 
682
921
  MIT License - see LICENSE file.
@@ -61,7 +61,7 @@ galangal status
61
61
  | **PREFLIGHT** | Environment validation | PREFLIGHT_REPORT.md |
62
62
  | **DEV** | Implementation | Code changes |
63
63
  | **MIGRATION*** | Database migration checks | MIGRATION_REPORT.md |
64
- | **TEST** | Test implementation | TEST_PLAN.md |
64
+ | **TEST** | Test implementation | TEST_PLAN.md, TEST_SUMMARY.md |
65
65
  | **CONTRACT*** | API contract validation | CONTRACT_REPORT.md |
66
66
  | **QA** | Quality assurance | QA_REPORT.md |
67
67
  | **BENCHMARK*** | Performance validation | BENCHMARK_REPORT.md |
@@ -71,6 +71,15 @@ galangal status
71
71
 
72
72
  *Conditional stages - skipped automatically if not relevant
73
73
 
74
+ ### Validation Artifacts
75
+
76
+ When validation commands run (tests, linters, etc.), Galangal creates debugging artifacts:
77
+
78
+ - **VALIDATION_REPORT.md** - Full output from all validation commands, useful for debugging failures
79
+ - **TEST_SUMMARY.md** - Concise test results (pass/fail counts, failed test names, coverage) included in downstream stage prompts
80
+
81
+ These artifacts help you understand what failed without digging through logs, and give downstream stages (QA, REVIEW) context about test results without bloating prompts with verbose output.
82
+
74
83
  ## Task Types
75
84
 
76
85
  Choose the right workflow for your task:
@@ -131,6 +140,32 @@ After analyzing your task, the PM stage outputs a `STAGE_PLAN.md` recommending w
131
140
 
132
141
  The progress bar updates dynamically to show only relevant stages.
133
142
 
143
+ ### Workflow Preview
144
+
145
+ After PM approval, you'll see a preview showing exactly which stages will run and why others are skipped:
146
+
147
+ ```
148
+ Workflow Preview
149
+
150
+ Stages to run:
151
+ PM → DESIGN → PREFLIGHT → DEV → TEST → QA → REVIEW → DOCS
152
+
153
+ Skipping:
154
+ MIGRATION (no files match: **/migrations/*)
155
+ CONTRACT (no files match: **/api/*, **/openapi.*)
156
+ BENCHMARK (task type: bug_fix)
157
+ SECURITY (PM: simple UI change, no security impact)
158
+
159
+ Controls during execution:
160
+ ^N Skip stage ^B Back ^E Pause for edit ^I Interrupt
161
+ ```
162
+
163
+ Skip reasons include:
164
+ - **Task type** - Based on the workflow template (e.g., bug fixes skip DESIGN)
165
+ - **Config** - Stages listed in `stages.skip` configuration
166
+ - **PM recommendation** - From STAGE_PLAN.md analysis
167
+ - **skip_if condition** - No changed files match the glob pattern
168
+
134
169
  ## Commands
135
170
 
136
171
  | Command | Description |
@@ -367,6 +402,9 @@ validation:
367
402
  - name: "Integration tests"
368
403
  command: "pytest tests/integration"
369
404
  optional: true # Don't fail if integration tests missing
405
+ # Use array form for paths with spaces or special characters
406
+ - name: "Task-specific tests"
407
+ command: ["pytest", "{task_dir}/tests"] # {task_dir} is substituted
370
408
 
371
409
  # Contract stage (API compatibility)
372
410
  contract:
@@ -422,21 +460,37 @@ ai:
422
460
  # Default backend to use
423
461
  default: claude
424
462
 
425
- # Available backends
463
+ # Available backends with customizable CLI flags
426
464
  backends:
427
465
  claude:
428
- command: claude
429
- args:
430
- - "-p"
431
- - "{prompt}"
466
+ command: claude # CLI command to invoke
467
+ args: # Arguments with {placeholder} substitution
432
468
  - "--output-format"
433
469
  - "stream-json"
434
470
  - "--verbose"
471
+ - "--max-turns"
472
+ - "{max_turns}" # Replaced with max_turns value
473
+ - "--permission-mode"
474
+ - "acceptEdits"
435
475
  max_turns: 200 # Maximum conversation turns per stage
476
+ read_only: false # If true, backend cannot write files
477
+
478
+ codex:
479
+ command: codex
480
+ args:
481
+ - "exec"
482
+ - "--full-auto"
483
+ - "--output-schema"
484
+ - "{schema_file}" # Replaced with schema file path
485
+ - "-o"
486
+ - "{output_file}" # Replaced with output file path
487
+ max_turns: 50
488
+ read_only: true # Codex runs in read-only sandbox
436
489
 
437
490
  # Use different backends for specific stages
438
491
  stage_backends:
439
- # qa: gemini # Use Gemini for QA stage (when supported)
492
+ REVIEW: codex # Use Codex for code review
493
+ # QA: gemini # Use Gemini for QA (when supported)
440
494
 
441
495
  # =============================================================================
442
496
  # DOCUMENTATION CONFIGURATION
@@ -533,6 +587,112 @@ stage_context:
533
587
  - Secrets must use environment variables
534
588
  ```
535
589
 
590
+ ## AI Backend Customization
591
+
592
+ Galangal invokes AI backends (like Claude Code CLI) using configurable commands and arguments. This allows you to customize CLI flags without modifying code.
593
+
594
+ ### Default Behavior
595
+
596
+ By default, Galangal invokes Claude with:
597
+ ```bash
598
+ cat prompt.txt | claude --output-format stream-json --verbose --max-turns 200 --permission-mode acceptEdits
599
+ ```
600
+
601
+ ### Customizing CLI Flags
602
+
603
+ Override any flags in `.galangal/config.yaml`:
604
+
605
+ ```yaml
606
+ ai:
607
+ backends:
608
+ claude:
609
+ command: claude
610
+ args:
611
+ - "--output-format"
612
+ - "stream-json"
613
+ - "--verbose"
614
+ - "--max-turns"
615
+ - "{max_turns}"
616
+ - "--permission-mode"
617
+ - "acceptEdits"
618
+ - "--model" # Add custom flags
619
+ - "opus"
620
+ max_turns: 300 # Increase max turns
621
+ ```
622
+
623
+ ### Placeholder Reference
624
+
625
+ Arguments can include placeholders that are substituted at runtime:
626
+
627
+ | Placeholder | Backend | Description |
628
+ |-------------|---------|-------------|
629
+ | `{max_turns}` | claude | Maximum conversation turns |
630
+ | `{schema_file}` | codex | Path to JSON schema file |
631
+ | `{output_file}` | codex | Path for structured output |
632
+
633
+ ### Common Customizations
634
+
635
+ **Use a specific model:**
636
+ ```yaml
637
+ ai:
638
+ backends:
639
+ claude:
640
+ args:
641
+ - "--output-format"
642
+ - "stream-json"
643
+ - "--model"
644
+ - "sonnet" # Use Sonnet instead of default
645
+ - "--max-turns"
646
+ - "{max_turns}"
647
+ ```
648
+
649
+ **Increase turn limit for complex tasks:**
650
+ ```yaml
651
+ ai:
652
+ backends:
653
+ claude:
654
+ max_turns: 500 # Default is 200
655
+ args:
656
+ - "--output-format"
657
+ - "stream-json"
658
+ - "--max-turns"
659
+ - "{max_turns}" # Will use 500
660
+ ```
661
+
662
+ **Use different backends per stage:**
663
+ ```yaml
664
+ ai:
665
+ default: claude
666
+ stage_backends:
667
+ REVIEW: codex # Use Codex for code review
668
+ ```
669
+
670
+ ### Adding a Custom Backend
671
+
672
+ Define any CLI tool as a backend:
673
+
674
+ ```yaml
675
+ ai:
676
+ backends:
677
+ my-backend:
678
+ command: my-ai-tool
679
+ args:
680
+ - "--prompt-file"
681
+ - "-" # Read from stdin
682
+ - "--json-output"
683
+ max_turns: 100
684
+ read_only: true # Cannot write files directly
685
+ ```
686
+
687
+ Then use it:
688
+ ```yaml
689
+ ai:
690
+ default: my-backend
691
+ # Or per-stage:
692
+ stage_backends:
693
+ QA: my-backend
694
+ ```
695
+
536
696
  ## Customizing Prompts
537
697
 
538
698
  Galangal uses a layered prompt system:
@@ -594,6 +754,45 @@ Create any of these in `.galangal/prompts/`:
594
754
 
595
755
  ## Troubleshooting
596
756
 
757
+ ### Debug Mode
758
+
759
+ When something goes wrong and you need to see what happened:
760
+
761
+ ```bash
762
+ # Enable debug logging (writes to logs/galangal_debug.log)
763
+ galangal --debug start "task description"
764
+ galangal --debug resume
765
+
766
+ # Alternative: set environment variable
767
+ GALANGAL_DEBUG=1 galangal start "task description"
768
+ ```
769
+
770
+ Debug mode creates two log files:
771
+ - `logs/galangal_debug.log` - Human-readable debug trace with timestamps
772
+ - `logs/galangal.jsonl` - Structured JSON logs for programmatic analysis
773
+
774
+ **Example debug log:**
775
+ ```
776
+ [14:32:15.123] GitHub integration failed: HTTPError: 401 Unauthorized
777
+ [14:32:15.124] Traceback:
778
+ File "/path/to/start.py", line 138, in task_creation_thread
779
+ check = ensure_github_ready()
780
+ ...
781
+ ```
782
+
783
+ ### Structured Logging Configuration
784
+
785
+ Enable structured logging in `.galangal/config.yaml`:
786
+
787
+ ```yaml
788
+ logging:
789
+ enabled: true # Enable logging
790
+ level: debug # debug, info, warning, error
791
+ file: logs/galangal.jsonl
792
+ json_format: true # JSON for parsing, false for console format
793
+ console: false # Also output to stderr
794
+ ```
795
+
597
796
  ### Tests Hang at TEST Stage
598
797
 
599
798
  Test frameworks must run non-interactively. Common issues:
@@ -637,10 +836,50 @@ If the TEST stage keeps retrying instead of rolling back to DEV:
637
836
  2. If tests fail due to implementation bugs, the AI should report FAIL (not try to fix the code)
638
837
  3. Check that test commands exit with proper exit codes (0 for success, non-zero for failure)
639
838
 
839
+ **Note:** As of v0.12.0, when artifact markers are unclear (missing PASS/FAIL), Galangal prompts you to manually approve or reject instead of retrying indefinitely. You'll see the artifact content and can make the decision yourself.
840
+
640
841
  ### "Galangal has not been initialized" Error
641
842
 
642
843
  Run `galangal init` in your project root before using other commands.
643
844
 
845
+ ### Task Exits Without Error Message
846
+
847
+ If a task quits unexpectedly with no visible error:
848
+
849
+ 1. **Enable debug mode** and re-run:
850
+ ```bash
851
+ galangal --debug start "your task"
852
+ ```
853
+
854
+ 2. **Check the debug log** for the actual error:
855
+ ```bash
856
+ tail -50 logs/galangal_debug.log
857
+ ```
858
+
859
+ 3. **Common causes**:
860
+ - GitHub authentication failed (run `gh auth status`)
861
+ - Network timeout fetching issues
862
+ - Missing permissions for the repository
863
+ - Invalid issue number or no issues with `galangal` label
864
+
865
+ ### GitHub Integration Fails Silently
866
+
867
+ If `galangal start` from a GitHub issue exits without creating a task:
868
+
869
+ ```bash
870
+ # Check GitHub CLI is working
871
+ gh auth status
872
+ gh repo view
873
+
874
+ # Try with debug mode
875
+ galangal --debug start --issue 123
876
+ ```
877
+
878
+ Check `logs/galangal_debug.log` for specific errors like:
879
+ - `401 Unauthorized` - Re-authenticate with `gh auth login`
880
+ - `404 Not Found` - Issue doesn't exist or wrong repo
881
+ - `No issues with 'galangal' label` - Add the label to an issue first
882
+
644
883
  ## License
645
884
 
646
885
  MIT License - see LICENSE file.
@@ -72,6 +72,41 @@ galangal start "my test task" --type bug_fix
72
72
 
73
73
  This is useful when you want to quickly run a command without activating the environment, or when you have a global install and want to explicitly use the local version.
74
74
 
75
+ ## Global Install from Local Code
76
+
77
+ If you want to replace your global pipx install with the local development version (so `galangal` works everywhere without activating a venv):
78
+
79
+ ### Install globally in editable mode
80
+
81
+ ```bash
82
+ # Uninstall the PyPI version first
83
+ pipx uninstall galangal-orchestrate
84
+
85
+ # Install from local code in editable mode
86
+ pipx install -e /path/to/galangal-orchestrate
87
+ ```
88
+
89
+ Now `galangal` is available globally and uses your local source code. Any changes you make take effect immediately.
90
+
91
+ ### Verify it's using local code
92
+
93
+ ```bash
94
+ # Should show your local path
95
+ pipx list | grep galangal
96
+
97
+ # Test the CLI
98
+ galangal --help
99
+ ```
100
+
101
+ ### Switch back to PyPI version
102
+
103
+ When you want to go back to the released version:
104
+
105
+ ```bash
106
+ pipx uninstall galangal-orchestrate
107
+ pipx install galangal-orchestrate
108
+ ```
109
+
75
110
  ## Testing Changes
76
111
 
77
112
  ### Using a sandbox directory
@@ -19,7 +19,7 @@ from galangal.logging import (
19
19
  workflow_logger,
20
20
  )
21
21
 
22
- __version__ = "0.6.0"
22
+ __version__ = "0.12.1"
23
23
 
24
24
  __all__ = [
25
25
  # Exceptions