summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/agents
diff options
context:
space:
mode:
authorMorgan Lunt <morganl@anthropic.com>2026-09-24 21:01:36 -0700
committerMorgan Lunt <morganl@anthropic.com>2026-09-24 21:01:36 -0700
commit0c186cf8c54bdf925cb2572e871ec16d04aa8425 (patch)
treeb0e6fc47714312dd21a2d1b977c5dde1c6a8011a /plugins/code-modernization/agents
parent2efd715aeb081a965df3b2c871706c3577210e98 (diff)
code-modernization: people's verdicts on rules reach the build, and safer baselines
A reviewer's "this rule is wrong" never reached the plan or the rewrite: the pane wrote a review ledger that no command read, and without the pane there was no way to write one. /code-modernization:modernize-review asks about the rules that need judgement (P0 rules with a defect, an SME question or less than High confidence) in a pop-up, or takes verdicts typed in the request, and writes the same RULE_REVIEWS.json/.md with an optional note. brief, transform, reimagine and the test engineer read it: a rule marked wrong is not an oracle and a P0 rule under discussion blocks. Running the old system to record a baseline is now limited to the local machine or a test environment the person named; production or third-party services, new accounts and real data are off limits unless the approved plan names them, a token in a recorded response is replaced before anything is saved, and every command stops the servers it started. Also: the front door asks in two pop-ups within the four-option limit, every command points a missing-code user to /modernize <name> --source <path>, the status inventory and next-step order include review and verify, the assessment says what Rehost and Replace mean, preflight notes the Windows python name, and the plugin and marketplace descriptions match what it does.
Diffstat (limited to 'plugins/code-modernization/agents')
-rw-r--r--plugins/code-modernization/agents/test-engineer.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/code-modernization/agents/test-engineer.md b/plugins/code-modernization/agents/test-engineer.md
index 2583831f..247d2a55 100644
--- a/plugins/code-modernization/agents/test-engineer.md
+++ b/plugins/code-modernization/agents/test-engineer.md
@@ -17,6 +17,11 @@ someone thinks it should do) so that a rewrite can be proven equivalent.
- **Concrete over abstract.** Every test has literal input values and literal
expected outputs. No "should calculate correctly" — instead "given balance
1250.00 and APR 18.5%, returns 19.27".
+- **Name the rule each test pins.** When `analysis/<system>/BUSINESS_RULES.md`
+ exists, each test or golden case names the `RULE-NNN` id(s) it pins, in its
+ display name, in its method name where a hyphen is not allowed
+ (`rule017_emptyInput`), or in a one-line comment. `modernize-verify` finds
+ tests by that id: a test that names no rule counts for no rule.
- **Cover the edges the legacy covers.** Read the legacy code's branches.
Every IF/EVALUATE/switch arm gets at least one test case. Boundary values
(zero, negative, max, empty) get explicit cases.
@@ -37,6 +42,12 @@ someone thinks it should do) so that a rewrite can be proven equivalent.
comparison), confirm at least one test goes red, and restore it. If nothing
fails, the tests do not pin the behavior: add cases until something does.
+## Human verdicts on rules
+
+If `analysis/<system>/RULE_REVIEWS.json` exists, honor it: a rule a person marked `wrong` is not
+an oracle (write the test from the reviewer's note, or ask what is right), and a P0 rule marked
+`discuss` is not settled: raise it instead of guessing.
+
## Secret handling (mandatory)
Never copy credential-like literals — passwords, API keys, tokens,
@@ -45,6 +56,11 @@ the deliverable codebase and get committed. Substitute clearly-fake values
of the same shape and length and note the substitution in a comment.
Anything a test genuinely needs live (e.g. a real database connection for
a dual-run harness) is read from an environment variable, never inlined.
+The same holds for recorded responses and captured output: a token, password or
+session cookie in one is replaced with a fixed fake value before it is saved. Record
+baselines only from the legacy code running locally or from a test environment the
+person named; never call a production or third-party service or create an account
+to do it unless the plan the person approved names that target.
## Output