From ffa01ef52f175dfe3abe19171f4714fe496082db Mon Sep 17 00:00:00 2001 From: Morgan Lunt Date: Wed, 23 Sep 2026 19:01:51 -0700 Subject: code-modernization: keep RULE-NNN headings and the rule-render script A run numbered rules with domain-coded ids (BR-D7 and similar), which broke the tools that find rules by their RULE-NNN heading. The Rule Card section now says the heading is exactly that form, numbered sequentially. The script that renders BUSINESS_RULES.md and DATA_OBJECTS.md from the workflow result was being written to /tmp, so the documents could not be regenerated. It is now saved as analysis//render_rules.py, next to the result it reads. --- .../code-modernization/commands/modernize-extract-rules.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'plugins/code-modernization') diff --git a/plugins/code-modernization/commands/modernize-extract-rules.md b/plugins/code-modernization/commands/modernize-extract-rules.md index 8e5afa74..6efcdf40 100644 --- a/plugins/code-modernization/commands/modernize-extract-rules.md +++ b/plugins/code-modernization/commands/modernize-extract-rules.md @@ -187,8 +187,11 @@ Cards, de-duplicating by `source` + name). ### 4. Render When it returns, **you** write the artifacts from the structured result — -the extraction agents are read-only by design (see "Untrusted code" in the -plugin README); nothing they produced touches disk until this step: +the extraction agents are read-only by design (see "Safety notes" in the +plugin README); nothing they produced touches disk until this step. Save the +result as `analysis/$system/rules_result.json` and write one script, +`analysis/$system/render_rules.py` (never `/tmp`), that reads it, so the +documents can be regenerated: 1. Render every entry in `confirmedRules` as a Rule Card (exact format below) into `analysis/$system/BUSINESS_RULES.md`, grouped by category, with the @@ -262,6 +265,10 @@ For each distinct rule, write a **Rule Card** in this exact format (in **Source* **Confidence:** High | Medium | Low — ``` +The heading is exactly `### RULE-NNN: `, numbered sequentially +(`RULE-001`, `RULE-002`, …) — never domain-coded ids such as `BR-D7`: later +commands and tools find rules by that pattern. + Priority heuristic — default to **P1**. Assign **P0** if the rule moves money, enforces a regulatory/compliance requirement, or guards data integrity (and flag P0 rules at