code-modernization: interactive topology map, preflight command, persona flows

modernize-map previously rendered the call graph and data lineage as
static Mermaid diagrams, which become unreadable once a node has ~10+
edges — exactly the shape of real legacy systems. It now builds an
interactive viewer from a shipped template (assets/topology-viewer.html):
a zoomable circle-pack of domains/modules sized by LOC, rendered to
canvas with level-of-detail reveal, dependency edges with per-kind
toggles, search with fly-to, a per-node detail sidebar, and a flow
walkthrough mode. Small domain-level .mmd exports remain for docs.

- topology.json now has a documented schema (hierarchy + edges + entry
  points + observations + flows) consumed by the viewer
- map traces 2-4 business flows anchored to personas (claimant,
  operator, auditor), each step in plain business language mapped to
  the modules that implement it; the viewer plays them as numbered
  paths
- brief gains a Business Walkthroughs section connecting each persona
  flow to the phase that replaces it
- new modernize-preflight command: detects the stack, checks analysis
  tooling, smoke-compiles a real source file with the legacy toolchain,
  inventories missing copybooks/descriptors/binary-only artifacts, and
  writes a per-command readiness verdict
- transform now verifies legacy + target toolchains before its plan
  gate instead of failing at test time
- README: commands updated, optional-tooling section reframed as 'what
  to give Claude'
This commit is contained in:
Morgan Lunt
2026-06-08 14:54:22 -07:00
parent bbbff6ab54
commit 1c4a5cfded
6 changed files with 684 additions and 45 deletions

View File

@@ -9,7 +9,24 @@ equivalence.
This is a surgical, single-module transformation — one vertical slice of the
strangler fig. Output goes to `modernized/$1/$2/`.
## Step 0 — Plan (HITL gate)
## Step 0aToolchain check (fail fast)
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.
## Step 0b — Plan (HITL gate)
Read the source module and any business rules in `analysis/$1/BUSINESS_RULES.md`
that reference it. Then **enter plan mode** and present: