Skip to content

SYSTEM Cited by 1 source

OpenRewrite

OpenRewrite (docs.openrewrite.org) is an OSS deterministic-refactoring framework that operates on a Lossless Semantic Tree (LST) representation of source code. Recipes (refactoring scripts written in YAML or Java) describe target source-code transformations; the framework applies them across large codebases, preserving formatting and producing human-reviewable diffs. Originally built at Netflix, now stewarded by Moderne.

This page is a stub created for cross-referencing from sources/2026-05-08-netflix-scaling-archunit-with-nebula-archrules, where OpenRewrite is named as the deterministic auto-remediation candidate for ArchRules failures.

Netflix's planned use

"Going forward, we will be exploring how to tie auto- remediation solutions into the ArchRules findings. ArchUnit currently provides very specific and detailed information about failures in reports, which makes a very strong input signal to an auto remediation tool. We will explore deterministic solutions such as OpenRewrite and non-deterministic solutions such as LLMs."sources/2026-05-08-netflix-scaling-archunit-with-nebula-archrules

The framing pairs ArchUnit's detection signal (rule + class + line + violation context) with OpenRewrite's deterministic fix application (recipe with explicit before/after pattern). The two halves of the pipeline:

  1. ArchUnit fires a rule, e.g. "this class still uses Guava Optional."
  2. OpenRewrite recipe transforms com.google.common.base.Optional to java.util.Optional across the codebase, with formatting preserved.

For non-deterministic / context-dependent fixes (e.g. "refactor this caller to use the new API surface"), Netflix explicitly names LLMs as the alternative path.

Distinct from LLM remediation

The post's framing deterministic vs non-deterministic is the core tradeoff:

  • OpenRewrite (deterministic): every input produces the same output; recipes are reviewable, version-controllable, testable; fix correctness is provable from the recipe.
  • LLM (non-deterministic): same input can produce different outputs; correctness is statistical; fix is whatever the model emits (potentially wrong, potentially over-eager, potentially introducing subtle bugs).

The choice between them is per-rule: simple syntactic fixes (import migration, deprecated-API call rewrite) are deterministic candidates; semantic refactors that need to understand the surrounding code's intent are LLM candidates.

Adjacent tools

  • JetBrains Structural Search and Replace — IDE-level template-based refactoring, similar in spirit but bound to IntelliJ.
  • Codemod / jscodeshift — JS/TS analog using AST transformation.
  • Eclipse JDT — earlier Java-AST refactoring framework.

Seen in

Last updated · 542 distilled / 1,571 read