No description
  • Rust 96.1%
  • Makefile 3.9%
Find a file
Shawn Hurley 65f9f8bce7
feat: add --goose-timeout and --goose-max-families CLI flags
Add configurable timeout and family-based chunking controls to prevent
goose subprocess timeouts on complex files with many structural migrations.

--goose-timeout (default: 120s): Replaces the hardcoded GOOSE_TIMEOUT_SECS
constant, allowing users to increase the per-invocation timeout for files
that need more processing time.

--goose-max-families (default: 2): Limits the number of distinct component
family rules (e.g., family:Dropdown, family:Page) per goose chunk. Family
rules are complex structural migrations that dominate LLM processing time.
Non-family rules (simple renames, import swaps) are not counted against
this limit. A secondary guard of max 8 total rules per chunk is retained.
2026-04-23 14:56:26 -04:00
.forgejo/workflows chore: centralize konveyor-core as workspace dep, add js-fix to release workflow 2026-04-17 13:41:02 -04:00
crates feat: add --goose-timeout and --goose-max-families CLI flags 2026-04-23 14:56:26 -04:00
src feat: add --goose-timeout and --goose-max-families CLI flags 2026-04-23 14:56:26 -04:00
.gitignore chore: bump version to 0.0.2, track Cargo.lock (#1) 2026-04-17 14:45:26 -04:00
Cargo.lock feat: overhaul CLI experience with progress reporting, error tracking, and flag cleanup 2026-04-23 12:34:20 -04:00
Cargo.toml feat: overhaul CLI experience with progress reporting, error tracking, and flag cleanup 2026-04-23 12:34:20 -04:00
CROSS-COMPILATION.md feat: add cross-compilation Makefile and guide 2026-04-17 11:34:31 -04:00
Makefile feat: add cross-compilation Makefile and guide 2026-04-17 11:34:31 -04:00
README.md feat: overhaul CLI experience with progress reporting, error tracking, and flag cleanup 2026-04-23 12:34:20 -04:00

fix-engine

Generic fix engine for applying pattern-based and LLM-assisted code migration fixes.

Takes Konveyor analysis output and applies automated fixes to your codebase — deterministic pattern-based renames, attribute removals, import rewrites, and LLM-assisted structural transformations.

Quick Start

# Build
cargo build --release

# Apply fixes (default behavior — writes to disk)
fix-engine fix ./my-project -i analysis.yaml

# Preview changes as a diff without writing
fix-engine fix ./my-project -i analysis.yaml --dry-run

# With fix strategies
fix-engine fix ./my-project -i analysis.yaml \
  --strategies rules/fix-strategies.json \
  --strategies output/fix-strategies.json

Installation

cargo install --path .

Cross-compilation

See CROSS-COMPILATION.md for building Linux binaries on macOS.

Usage

Basic

# Apply all fixes to the project
fix-engine fix ./project -i konveyor-output.yaml

# Preview what would change (unified diff)
fix-engine fix ./project -i konveyor-output.yaml --dry-run

With LLM-assisted fixes

# Use local goose CLI for complex fixes
fix-engine fix ./project -i output.yaml --llm-provider goose

# Use a remote OpenAI-compatible endpoint
fix-engine fix ./project -i output.yaml \
  --llm-provider openai \
  --llm-endpoint https://api.openai.com/v1/chat/completions

With fix strategies

Strategy files are JSON maps of rule ID to fix strategy. They can come from two sources:

  • Hand-written — bundled alongside rule YAML files
  • Auto-generated — produced by semver-analyzer's konveyor command

Pass multiple files with --strategies; later files override earlier ones on key conflicts:

fix-engine fix ./project -i output.yaml \
  --strategies rules/fix-strategies.json \
  --strategies output/fix-strategies.json

CI/CD integration

# JSON output for machine parsing
fix-engine fix ./project -i output.yaml --dry-run --output-format json

# Quiet mode (errors + summary only)
fix-engine fix ./project -i output.yaml -q

# Disable colors for log files
fix-engine fix ./project -i output.yaml --color never

Shell completions

# Generate and install (zsh example)
fix-engine completions zsh > ~/.zsh/completions/_fix-engine

# Other shells: bash, fish, elvish, powershell
fix-engine completions bash > /etc/bash_completion.d/fix-engine

CLI Reference

fix-engine fix [OPTIONS] --input <INPUT> <PROJECT>
Flag Short Description
<PROJECT> Path to the project to fix (positional, required)
--input -i Path to Konveyor analysis output — YAML or JSON (required)
--dry-run Preview changes as a unified diff without writing to disk
--llm-provider LLM provider: goose (local CLI) or openai (remote endpoint)
--llm-endpoint LLM endpoint URL (required when --llm-provider=openai)
--strategies Fix strategies JSON file(s) — can be repeated, later overrides earlier
--log-dir Directory to save goose prompts/responses for debugging
--verbose -v Show detailed output
--quiet -q Suppress progress, show only errors and summary
--output-format Output format: text (default) or json
--color Color mode: auto (default), always, or never

Environment variables

Variable Description
RUST_LOG Control log verbosity (e.g., RUST_LOG=debug). Default: info. Log output is routed through the progress display so it won't clobber active spinners.

Architecture

The project is a Cargo workspace with four crates:

Crate Description
fix-engine-cli CLI binary — argument parsing, progress reporting, orchestration
fix-engine-core Core types — text edits, fix plans, strategies, fix result
fix-engine Engine — pattern-based planning/applying, goose/LLM clients
fix-engine-js-fix JS/TS language provider — prop removal, import dedup, lockfile management

Fix pipeline

  1. Load — Parse Konveyor analysis output (YAML or JSON)
  2. Plan — Map each violation to a fix strategy (pattern, LLM, or manual)
  3. Apply patterns — Deterministic renames, removals, import rewrites
  4. Apply LLM fixes — Send complex structural changes to goose or OpenAI
  5. Report — Show results, manual review items, and summary

License

Apache-2.0