No description
  • Rust 97.3%
  • Makefile 2.7%
Find a file
Shawn Hurley 4adcaefffe
Some checks failed
CI / Check & Test (push) Failing after 1m20s
feat: Java fix improvements — proactive deps, marker imports, annotation fallthrough, config renames
- Implement plan_proactive_java_dependency(): scan Gradle/Maven manifests for
  old_package substring and replace with new coordinate+version. Handles both
  Maven coordinate prefixes and Java package name patterns.
- Implement plan_config_file_fqn_renames(): scan XML/properties/YAML config
  files for FQN strings and replace them
- Add resolve_pending_imports(): marker-based import insertion that runs in
  post_process_lines after all edits are applied, avoiding conflicts with
  namespace migration edits on adjacent import lines
- Library type fall-through: AnnotationParamRewrite removes edits for library
  types (org.hibernate.*) so incidents fall through to LLM for correct
  replacement (e.g., NumericBooleanType → @JdbcTypeCode)
- Short type name guard: require FQN to contain dots before adding import
  (prevents invalid 'import yes_no;' for Hibernate shorthand type names)
- Wire up plan_proactive_dependency and plan_config_file_renames trait
  implementations on JavaFixProvider
2026-05-07 11:56:34 -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: Java fix improvements — proactive deps, marker imports, annotation fallthrough, config renames 2026-05-07 11:56:34 -04:00
src feat: add --test-command flag for LLM test execution feedback loop 2026-05-07 11:56:34 -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: wire up post-LLM syntax validation to detect and restore Unicode normalization regressions 2026-05-07 11:56:34 -04:00
Cargo.toml feat: add --test-command flag for LLM test execution feedback loop 2026-05-07 11:56:34 -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