From ecc5139c30dccfec6df8e9801f1ad101140213a4 Mon Sep 17 00:00:00 2001 From: Morgan Lunt Date: Mon, 8 Jun 2026 17:35:40 -0700 Subject: [PATCH] code-modernization: legacy toolchain is advisory, not a transform blocker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Legacy code often cannot build locally by nature — CICS/IMS programs have no local translator and the real runtime may be a mainframe the user doesn't have. Stopping transform on a failed legacy smoke compile would block exactly those systems. - transform Step 0a: the target toolchain remains required (its tests cannot run without it); a failed or impossible legacy compile no longer stops the run — the equivalence strategy switches to recorded traces / golden-master fixtures, and that downgrade is stated in the plan and in TRANSFORMATION_NOTES.md so reviewers know the strength of the proof - preflight: a red legacy toolchain now yields Ready-with-gaps for transform/reimagine instead of Not-ready --- .../commands/modernize-preflight.md | 7 ++-- .../commands/modernize-transform.md | 33 ++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/plugins/code-modernization/commands/modernize-preflight.md b/plugins/code-modernization/commands/modernize-preflight.md index 21d27ab1..ed283ea3 100644 --- a/plugins/code-modernization/commands/modernize-preflight.md +++ b/plugins/code-modernization/commands/modernize-preflight.md @@ -87,8 +87,11 @@ followed by a **Ready / Ready-with-gaps / Not ready** verdict per command: - `assess` + `map` + `extract-rules` — need Checks 1–2 green-ish and Check 4's missing-include count low - `brief` — needs only the three discovery artifacts; no tooling -- `transform` + `reimagine` — additionally need Check 3 green for both - legacy and target stacks +- `transform` + `reimagine` — additionally need Check 3 green for the + **target** stack. A red legacy toolchain downgrades these to + Ready-with-gaps, not Not-ready: equivalence testing falls back to + recorded traces / golden-master fixtures instead of dual execution + (common and expected for CICS/IMS code that has no local runtime) - `harden` — needs Check 2 plus any stack-specific SAST tooling found Print the table in the session too, and end with the single most diff --git a/plugins/code-modernization/commands/modernize-transform.md b/plugins/code-modernization/commands/modernize-transform.md index 139c354d..8183fd46 100644 --- a/plugins/code-modernization/commands/modernize-transform.md +++ b/plugins/code-modernization/commands/modernize-transform.md @@ -9,22 +9,31 @@ equivalence. This is a surgical, single-module transformation — one vertical slice of the strangler fig. Output goes to `modernized/$1/$2/`. -## Step 0a — Toolchain check (fail fast) +## Step 0a — Toolchain check (fail fast on target, adapt on legacy) Verify the build environment **before** planning, not when the tests first run: -- **Target stack ($3):** runtime, package manager, and test framework all - respond (`java -version` + `mvn -v`, `node -v` + `npm -v`, - `python3 -V` + `pytest --version`, …). -- **Legacy stack (if equivalence tests will execute legacy code):** the - compiler/interpreter works on this codebase — run a syntax-only compile - of the module being transformed (e.g. `cobc -fsyntax-only`). - -If anything is missing or the smoke compile fails, stop and report what -to install or fix — suggest `/modernize-preflight $1 $3` for the full -readiness report. Don't enter plan mode on a machine that can't run the -proof. +- **Target stack ($3) — required.** Runtime, package manager, and test + framework all respond (`java -version` + `mvn -v`, `node -v` + `npm -v`, + `python3 -V` + `pytest --version`, …). If any are missing, stop and + report what to install — the new code and its tests cannot run without + them, so a plan gate now would just defer the failure an hour. Suggest + `/modernize-preflight $1 $3` for the full readiness report. +- **Legacy stack — advisory, never a blocker.** Try a syntax-only compile + of the module being transformed (e.g. `cobc -fsyntax-only`). Legacy + code often *cannot* build locally by nature, not by misconfiguration — + CICS/IMS programs have no local translator, and the real runtime may be + a mainframe you don't have. A failed or impossible legacy compile does + **not** stop the transform; it changes the equivalence strategy: + - dual-execution proof is off the table — characterization tests + assert against **recorded traces / golden-master fixtures** (real + production outputs, captured reports/screens, SME-confirmed + examples) instead of live legacy runs + - say so explicitly in the Step 0b plan and later in + TRANSFORMATION_NOTES.md ("equivalence is trace-based; legacy was not + executable in this environment"), so reviewers know the strength of + the proof they're approving ## Step 0b — Plan (HITL gate)