<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claude-plugins-official.git/plugins/code-modernization/scripts/render_rules.py, branch bump/stackhawk-api</title>
<subtitle>Official Claude Code plugin directory
</subtitle>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/'/>
<entry>
<title>code-modernization: make rule consolidation auditable and injection-safe</title>
<updated>2026-09-25T04:22:06+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T04:22:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=ff833bd7231262a8521ab3728c5625dc6c4f4a1d'/>
<id>ff833bd7231262a8521ab3728c5625dc6c4f4a1d</id>
<content type='text'>
Follow-ups from review of the consolidation pass:

- The agent is a restricted type with the same read-only wording as its
  siblings, and every field on its numbered list is a single bounded line, so
  a rule name containing a newline cannot fake another entry.
- A group with any number out of range or not an integer is rejected whole
  instead of being coerced into a different merge.
- A merge keeps the most conservative review state: the highest priority, the
  lowest confidence, and every suspected defect and SME question of the folded
  rules.
- Every folded rule is returned with the rule it went into, and the rules
  document lists them under "Rules folded into another", so nothing disappears
  untraceably. Extra citations show as "Also cited" without the joining word.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow-ups from review of the consolidation pass:

- The agent is a restricted type with the same read-only wording as its
  siblings, and every field on its numbered list is a single bounded line, so
  a rule name containing a newline cannot fake another entry.
- A group with any number out of range or not an integer is rejected whole
  instead of being coerced into a different merge.
- A merge keeps the most conservative review state: the highest priority, the
  lowest confidence, and every suspected defect and SME question of the folded
  rules.
- Every folded rule is returned with the rule it went into, and the rules
  document lists them under "Rules folded into another", so nothing disappears
  untraceably. Extra citations show as "Also cited" without the joining word.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: harden the numeric tolerance and say what Rehost and Replace mean</title>
<updated>2026-09-25T03:34:21+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T03:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=5b8ec4b30f45b5e8b4c8a6efd63719730cf1a5ad'/>
<id>5b8ec4b30f45b5e8b4c8a6efd63719730cf1a5ad</id>
<content type='text'>
Follow-ups from review of the tolerance check: an absolute tolerance above
1e-6 is refused like a relative one above 1%, numbers are compared as exact
decimals rather than doubles, dotted runs such as 1.2.3 or 10.0.0.1 are text
that must match exactly, and the self-check now changes the leading digit of
every sampled number to prove the tolerance cannot hide a real change.

The business-rules header says how many rules there were at extraction, since
later steps add rules. The assessment says what to do when it recommends
Rehost or Replace, which change no code and so have no build command.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow-ups from review of the tolerance check: an absolute tolerance above
1e-6 is refused like a relative one above 1%, numbers are compared as exact
decimals rather than doubles, dotted runs such as 1.2.3 or 10.0.0.1 are text
that must match exactly, and the self-check now changes the leading digit of
every sampled number to prove the tolerance cannot hide a real change.

The business-rules header says how many rules there were at extraction, since
later steps add rules. The assessment says what to do when it recommends
Rehost or Replace, which change no code and so have no build command.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: keep one citation per rule when rendering business rules</title>
<updated>2026-09-25T03:29:13+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T03:29:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=e662d6d338a7abb1a03ba97e1a47fb98d669c81f'/>
<id>e662d6d338a7abb1a03ba97e1a47fb98d669c81f</id>
<content type='text'>
The extractor is told to cite a single file range per rule, but on a large
Perl codebase it kept returning two or three files and a sentence of
explanation in the source field, which the report and the pane cannot
resolve to a line. The renderer now takes the first path:line-range as the
rule's citation and puts anything after it on an "Also cited" line.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The extractor is told to cite a single file range per rule, but on a large
Perl codebase it kept returning two or three files and a sentence of
explanation in the source field, which the report and the pane cannot
resolve to a line. The renderer now takes the first path:line-range as the
rule's citation and puts anything after it on an "Also cited" line.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: rate rules by what the system is for, and make live runs finish</title>
<updated>2026-09-25T03:15:45+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T03:15:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=696904602b2bdf3e0ddd07ae1221f9eb3e3b8e62'/>
<id>696904602b2bdf3e0ddd07ae1221f9eb3e3b8e62</id>
<content type='text'>
Two problems from running the commands on real repositories:

- The P0 definition was money- and regulation-shaped, so a music-library
  tool got no P0 rules and its behavior contract came out empty. P0 now
  means the system's core purpose depends on the rule, or a wrong result is
  costly or irreversible (money, legal, data integrity, security or safety,
  or the central calculation or decision the system exists to perform).
- Citations came back as lists of ranges, and the rule renderer numbered
  RULE-NNN in a different order from the document. Each rule now cites one
  range and the numbers read in sequence.

Commands that start subagents now say to run them in the foreground and
wait, because a headless session ends when the model stops talking even if
it said it was waiting for a background agent.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two problems from running the commands on real repositories:

- The P0 definition was money- and regulation-shaped, so a music-library
  tool got no P0 rules and its behavior contract came out empty. P0 now
  means the system's core purpose depends on the rule, or a wrong result is
  costly or irreversible (money, legal, data integrity, security or safety,
  or the central calculation or decision the system exists to perform).
- Citations came back as lists of ranges, and the rule renderer numbered
  RULE-NNN in a different order from the document. Each rule now cites one
  range and the numbers read in sequence.

Commands that start subagents now say to run them in the foreground and
wait, because a headless session ends when the model stops talking even if
it said it was waiting for a background agent.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: extract-rules uses a shard builder and a rules renderer that ship with the plugin</title>
<updated>2026-09-25T01:26:30+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T01:26:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=b10dab2f5ad83f642a03b5f800dea71651830beb'/>
<id>b10dab2f5ad83f642a03b5f800dea71651830beb</id>
<content type='text'>
The command used to carry a 35-line shard-building script inline and asked
the model to write a rules renderer on every run, so the shard list and the
BUSINESS_RULES.md layout varied from run to run and could not be tested.

scripts/make_shards.py builds the shard list from topology.json when the map
has run, and from the directory tree when it has not (skipping vendored,
generated and test-fixture directories, one shard per directory, split at 25
files or about 5,000 lines). scripts/render_rules.py turns the workflow's
result into BUSINESS_RULES.md and DATA_OBJECTS.md with RULE-NNN headings, the
SME section and the coverage gaps, and writes every value from the analysis as
plain text.

The workflow takes an optional sourceDir, so the code can live outside the
workspace, and shard files are kept relative to it. The command drops from 305
to about 150 lines.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The command used to carry a 35-line shard-building script inline and asked
the model to write a rules renderer on every run, so the shard list and the
BUSINESS_RULES.md layout varied from run to run and could not be tested.

scripts/make_shards.py builds the shard list from topology.json when the map
has run, and from the directory tree when it has not (skipping vendored,
generated and test-fixture directories, one shard per directory, split at 25
files or about 5,000 lines). scripts/render_rules.py turns the workflow's
result into BUSINESS_RULES.md and DATA_OBJECTS.md with RULE-NNN headings, the
SME section and the coverage gaps, and writes every value from the analysis as
plain text.

The workflow takes an optional sourceDir, so the code can live outside the
workspace, and shard files are kept relative to it. The command drops from 305
to about 150 lines.
</pre>
</div>
</content>
</entry>
</feed>
