From caac6735d95bddeb8c8bbe3ddc9d6c01787fc8e1 Mon Sep 17 00:00:00 2001 From: Morgan Lunt Date: Thu, 24 Sep 2026 21:07:24 -0700 Subject: code-modernization: pane wording, attention items and docs that match the code 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. --- .../code-modernization/hooks/reader/progress.ts | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'plugins/code-modernization/hooks/reader/progress.ts') diff --git a/plugins/code-modernization/hooks/reader/progress.ts b/plugins/code-modernization/hooks/reader/progress.ts index be1901a8..04064cff 100644 --- a/plugins/code-modernization/hooks/reader/progress.ts +++ b/plugins/code-modernization/hooks/reader/progress.ts @@ -260,7 +260,7 @@ function verifyStepOf(prefix: string, system: string, module: Pick module.dir.toLowerCase() === name)?.dir ?? name)}: NOT PROVEN${proof.reason === '' ? '' : `: ${proof.reason}`}`) + if (proof.state === 'not' || proof.state === 'partly') { + attention.push(`${track === 'uplift' ? 'the upgrade' : (modules.find(module => module.dir.toLowerCase() === name)?.dir ?? name)}: ${proof.verdict ?? ''}${proof.reason === '' ? '' : `: ${proof.reason}`}`) } } @@ -893,8 +894,15 @@ export async function readSnapshot( const wrong = Object.values(reviews).filter(entry => entry.verdict === 'wrong').length + // A P0 rule a reviewer sent to discussion stops the build commands until it is settled. + const discussing = rules.value.rules.filter(rule => rule.priority === 'P0' && reviews[rule.id]?.verdict === 'discuss').length + + if (discussing > 0) { + attention.push(`${discussing} high-priority rule${discussing === 1 ? '' : 's'} under discussion: the build waits`) + } + if (wrong > 0) { - attention.push(`${wrong} rule${wrong === 1 ? '' : 's'} marked wrong by a reviewer`) + attention.push(`${wrong} rule${wrong === 1 ? '' : 's'} marked wrong by a reviewer: no test is built on ${wrong === 1 ? 'it' : 'them'}`) } if (pending > 0) { @@ -948,8 +956,8 @@ export function oneLineOf(snapshot: Snapshot): string { const parts = snapshot.track === 'transform' - ? [`${snapshot.system}: analysis ${done}/5 steps done`] - : [`${snapshot.system}: ${TRACK_LABELS[snapshot.track]} ${done}/${countable.length} steps done`] + ? [`${snapshot.system}: analysis ${done}/5`] + : [`${snapshot.system}: ${TRACK_LABELS[snapshot.track]} ${done}/${countable.length}`] if (snapshot.brief !== null) { parts.push(snapshot.brief.approval.isSigned ? 'brief approved' : 'brief waiting for approval') @@ -959,7 +967,7 @@ export function oneLineOf(snapshot: Snapshot): string { parts.push( snapshot.track === 'reimagine' ? `${snapshot.modules.length} service${snapshot.modules.length === 1 ? '' : 's'} built` - : `${snapshot.totals.done} of ${snapshot.totals.modules} modules ${snapshot.track === 'uplift' ? 'match the baseline' : 'reviewed'}`, + : `${snapshot.totals.done}/${snapshot.totals.modules} modules ${snapshot.track === 'uplift' ? 'match the baseline' : 'reviewed'}`, ) } -- cgit