summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/hooks
AgeCommit message (Collapse)Author
2026-09-25code-modernization: count failures and the machine's python, once per versionmorganl/code-modernization-consolidatedMorgan Lunt
Usage counts now say what the plugin runs on (system, python status and version, path problems) and which kind of failure happens: a missing or placeholder python, a permission block, a model error, or an error in the plugin's own script. Failures are classified on the machine into a fixed list and only the code is sent, once per kind per session. A session-start ping, once per plugin version, counts machines where nobody gets as far as typing a command. When python cannot run, the shell wrapper reports that itself, and on Windows it falls back to python or the py launcher.
2026-09-25code-modernization: version 1.0.0, usage counts and a README results tableMorgan Lunt
The plugin now has a version and a changelog. Two hooks record whole-number usage counts (which command ran, how far a system got, how many rules and proofs) through the CLI's own telemetry: counts from 100 up are rounded, nothing is sent when the plugin is not in use, and any of three switches turns it off. The README documents every key and lists what the plugin was tried on, checked against the run files.
2026-09-25code-modernization: rename the pane's rule review command to ↵Morgan Lunt
/modernize-review-pane The pane's bare /modernize-review took the name of the plugin's own review command, so typing the short form in a pane-enabled session opened the pane's cards instead of the pop-up review. The pane's version is now /modernize-review-pane, and /modernize-review always runs the plugin command. Both still write the same review file.
2026-09-25code-modernization: a rule is tested only if a test that ran backs itMorgan Lunt
A rule named only by a skipped or pending test no longer counts as covered. It is listed as "named, not run" and fails the rules check. A test-only folder is listed as tooling and gets no verdict. The verify command tries malformed records only when the person asked for exact behavior, so a proof loop has an end. The report parses rule headings and fields in linear time, and the report and pane show the new status.
2026-09-24code-modernization: pane wording, attention items and docs that match the codeMorgan Lunt
The pane's button reads "put in prompt" (it never runs the command), the refresh button is gone (the pane already refreshes after writes, at turn end and every 20 seconds while idle), the summary line fits a 120-column bar, and the next-step reasons are short enough to read. A P0 rule under discussion is listed under Attention ("the build waits"), and a module that is not proven shows its first reason there. In an uplift, finished modules list before merely edited ones. hooks/README.md now names every button and label as the code does, documents the plugin's /code-modernization:modernize-review command (which writes the same ledger for people without the pane) and how it differs from the pane's own /modernize-review, and says which pictures use sample text. 141 engine tests pass and the type check is clean.
2026-09-24code-modernization: make the live pane work below 144 columns and show the proofMorgan Lunt
Found by exercising the pane against the real outputs of finished runs: - Below 144 columns the engine holds an unasked pane back; the pane ignored that, so it drew no pane, no show bar, and the panel command "hid" a pane that was never there. - A symlinked legacy/<name> lists as another kind of entry, so the source link that preflight now creates was never recognized as a system. - Uplift and reimagine next steps were placeholders with no button. - The refresh debounce was starved while agents ran, so the map froze. - Hostile lines in the brief, rules and baseline could take seconds to match; lines are now capped. The rule-review ledger is validated on read and merged on save, and keeps a reviewer's note. - A baseline with no row read as "the baseline had 0"; one-module baseline totals now count as that module's row. New: a verdict chip with words on every built module, a verify-first next step, and a readable palette that follows the terminal theme. 140 engine tests pass and the type check is clean.
2026-09-24code-modernization: simpler commands, a source option, a report page and an ↵Morgan Lunt
equivalence check Commands hardcoded legacy/<system>, so code too big to copy, or living at an absolute path, needed a hand-made symlink. Preflight now takes --source <path> and makes the legacy/<system> link for you (a junction on Windows); nothing is copied, and every command says where the link points before it starts. The harden patch is applied with patch -p1 -d. Each command ends by naming the next command to run, and the commands are about a third shorter with no step removed: - map accepts an existing dependency graph (--graph) or the stack's own tooling, maps very large estates in resumable chunks, records reflection targets as unresolved instead of dead, asks before describing more than 40 nodes, and never gives two nodes the same location. - transform can take its module and target from the brief, counts the equivalence cases that executed (zero is a failure and a comparison never skips), shows the tests can fail with a deliberate one-line break, and hands "same or different" to a script when both systems can run. - brief writes each phase in one fixed shape: one command, module ids as in the map, and criteria written as conditions a build command may tick but not reword. - reimagine reuses the discovery artifacts instead of extracting them again. - status names the exact command to paste next. scripts/build_report.py turns whatever the commands wrote into one self-contained, offline REPORT.html (Mermaid is vendored, all text from the analysis is escaped, the quarantined secrets file is never read), and scripts/compare.py decides byte-for-byte whether two outputs match, records why, and checks it can fail. The shard builder ignores symbolic links and paths that leave the source, matches a plain name against what lies beneath it, and falls back to the directory tree when the map's modules share a location. The README drops from 275 to about 100 lines; the pane's reference moves to hooks/README.md.
2026-09-24code-modernization: mark the pane's notes as data and clean the names in themMorgan Lunt
The pane adds two kinds of text to what the model reads: a note about the file it just read (names, rule titles and delta ids from the analysis files) and a one-line state. Those names were written by analysis agents from the legacy code, so a hostile comment could reach the model through them. Each such value is now cut to one short plain line: control, invisible and bidirectional characters, backticks, angle and square brackets and double quotes are replaced, and long values are trimmed. A note opens by saying its contents are data, never instructions, and closes with an end line no value can forge. The state line says it is a status line and not an instruction, and the next-step command names a module only when the module id is one plain token. The pane lists only system directories whose names the plugin's workflows accept.
2026-09-24code-modernization: add an optional live progress paneMorgan Lunt
Adds a hooks module, off unless the CLI's early-access function hooks are enabled, that draws a pane beside the transcript while the commands run: the system, which steps are done, a map of its code, each unit of work and where it stands, what needs attention, and the next command. It reads only the artifacts the commands write and the legacy tree, so it works for any language and for a rewrite, a same-stack uplift or a greenfield rebuild. The map comes from topology.json when there is one and from the source tree when there is not. In an uplift each module is set against the baseline; tests are read from JUnit XML, .trx reports or the runs a session sees; a button shows and hides the pane, and /modernize-panel does the same from the keyboard. The same module adds x-ray context on legacy reads, a review deck for business rules (/modernize-review), a sign-off dialog (/modernize-sign) and a fleet view that spots one failure repeating across agents. It only watches: it never blocks, rewrites or restores an edit, and it runs no program inside the trees it reads. An uplift's changed modules are found by comparing the working copy with the tree by file name and size through the file API. Its options are the plugin's userConfig. Without the flag nothing loads and the commands, agents and workflows behave as before. 91 tests in tests/ run with "claude plugin test"; plugin validate passes on the release build with the flag on and off.