summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/hooks/xray
diff options
context:
space:
mode:
authorMorgan Lunt <morganl@anthropic.com>2026-09-24 20:52:27 -0700
committerMorgan Lunt <morganl@anthropic.com>2026-09-24 20:52:27 -0700
commit51b1ae9e20486d62b839ed9f37e1cfc7d55bf85c (patch)
treeeb31cc4964d84b4a82b8032452739fe1e9b37d3f /plugins/code-modernization/hooks/xray
parent5b8ec4b30f45b5e8b4c8a6efd63719730cf1a5ad (diff)
code-modernization: make the live pane work below 144 columns and show the proof
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.
Diffstat (limited to 'plugins/code-modernization/hooks/xray')
-rw-r--r--plugins/code-modernization/hooks/xray/xray.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/code-modernization/hooks/xray/xray.ts b/plugins/code-modernization/hooks/xray/xray.ts
index a26db5be..77bf9b1b 100644
--- a/plugins/code-modernization/hooks/xray/xray.ts
+++ b/plugins/code-modernization/hooks/xray/xray.ts
@@ -4,7 +4,7 @@ import { unitOfPath } from '../reader/estate-model'
import type { Snapshot } from '../reader/progress'
import type { Rule } from '../reader/rules'
import { stateWord } from '../map/estate'
-import { baselineKeyOf } from '../reader/uplift'
+import { baselineRowOf } from '../reader/uplift'
import { nodeOfFile, type TopoNode, type Topology } from '../reader/topology'
/**
@@ -92,7 +92,7 @@ function upliftXray(snapshot: Snapshot, request: XrayRequest): XrayNote | null {
const estate = snapshot.estate
const unit = estate !== null ? unitOfPath(estate, null, request.fileRel) : null
const deltas = (snapshot.uplift?.catalog?.byFileBase.get(baseName(request.fileRel).toLowerCase()) ?? []).map(id => plain(id, 24))
- const row = unit?.dir !== undefined ? (snapshot.uplift?.baseline?.rows.get(baselineKeyOf(unit.dir)) ?? null) : null
+ const row = unit?.dir !== undefined ? baselineRowOf(snapshot.uplift?.baseline ?? null, unit.dir) : null
const module = unit !== null ? snapshot.byNode.get(unit.id) : undefined
if (deltas.length === 0 && row === null && module === undefined) {
@@ -238,7 +238,7 @@ export function xrayOf(snapshot: Snapshot, request: XrayRequest): XrayNote | nul
if (verdicts.length > 0) {
lines.push(
- `A reviewer disputed: ${some(verdicts.map(entry => `${plain(entry.rule.id, 24)} (${plain(entry.review?.verdict, 16)})`), 6)}. Do not treat those as settled.`,
+ `A reviewer disputed: ${some(verdicts.map(entry => `${plain(entry.rule.id, 24)} (${plain(entry.review?.verdict, 16)})`), 6)}. A rule marked wrong is not an oracle to pin, and a P0 rule under discussion stops the build: do not treat any of these as settled.`,
)
}
}