summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/assets
diff options
context:
space:
mode:
authorMorgan Lunt <morganl@anthropic.com>2026-09-24 21:18:46 -0700
committerMorgan Lunt <morganl@anthropic.com>2026-09-24 21:18:46 -0700
commitf45794fa4831636e7ae55f8081769c8ebf3f58c6 (patch)
treec8f103c571fb7d52c5fcf111f0a09e5c51d624b6 /plugins/code-modernization/assets
parentfc8adcf13fab336a810a622e8cf7be86be3a183b (diff)
code-modernization: an uplift is not proven by a typed baseline or edited tests
Three ways a same-technology uplift could come out PROVEN too easily: - The baseline came from a table someone typed. It now counts as measured only when the script can read per-test results (JUnit or TRX XML, a runner log with a summary line, or per-test JSON) from analysis/<system>/baseline/ or a "Recorded:" line of BASELINE.md; a counts-only file is ignored, two measured sources that disagree are a gap, and the typed table must match what was measured. - Tests edited during the uplift passed unnoticed. The pack now compares the legacy and working-copy test files (by walking files only) and lists what was added, removed or changed; a removed file, more than a quarter of the files changed, or no legacy tests to compare with is a gap, and it says plainly that weakened assertions cannot be detected. - A silent behavioral change with no test at its site. Each Behavioral-silent delta in the catalog must have a test file naming its site file, or the module is at most PARTLY PROVEN. The report's Proof section shows the three new checks, and an uplift pack that lacks any of them reads as PARTLY PROVEN. 214 script tests pass.
Diffstat (limited to 'plugins/code-modernization/assets')
-rw-r--r--plugins/code-modernization/assets/report-template.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/code-modernization/assets/report-template.html b/plugins/code-modernization/assets/report-template.html
index 0f632a17..a729dcdf 100644
--- a/plugins/code-modernization/assets/report-template.html
+++ b/plugins/code-modernization/assets/report-template.html
@@ -353,6 +353,25 @@ function proofModule(m) {
if (f) out.push(h('p', null, ['Fresh inputs: ' + fmt(f.inputs) + ' new input(s) counted from ' + fmt(f.executed) + ' comparisons: ' + fmt(f.same) + ' same' + within(f) + ', ' + fmt(f.differs) + ' differ, ' + fmt(f.missing) + ' missing.']));
if (f) (f.tolerances || []).forEach(tol);
if (b) out.push(h('p', null, ['Baseline comparison: ' + fmt(b.regressionsCount) + ' regressions, ' + fmt(b.newFailuresCount) + ' new failures, ' + fmt(b.fixedCount) + ' fixed, ' + fmt(b.missingCount) + ' missing.']));
+ if (m.uplift) {
+ var u = m.uplift, b = u.baseline, tc = u.testsChanged, dc = u.deltas, list = function (title, xs, fmtx) { out = out.concat(bullets(title, xs.map(fmtx))); };
+ if (b) {
+ out.push(h('p', null, [b.kind === 'measured' ? 'Baseline evidence: measured (' + b.sources.map(function (x) { return x.kind + (x.name ? ' ' + x.name : ''); }).join(', ') + ').' : b.kind === 'target-only' ? 'Baseline evidence: the baseline says target-only.' : 'Baseline evidence: typed by hand; no per-test result file, per-test results file or raw runner log backs it.']));
+ if (b.disagree) out.push(h('p', {class: 'note'}, ['The typed table disagrees with the measured results on ' + fmt(b.disagree) + ' test(s) or count(s): ' + b.examples.join('; ')]));
+ if (b.conflict) out.push(h('p', {class: 'note'}, ['The baseline sources disagree with each other: ' + b.conflictExamples.join('; ')]));
+ }
+ if (tc) {
+ out.push(h('p', null, [tc.checked ? 'Test files: ' + fmt(tc.legacyTests) + ' in the legacy tree, ' + fmt(tc.workTests) + ' in the working copy: ' + fmt(tc.counts.removed) + ' removed, ' + fmt(tc.counts.added) + ' added, ' + fmt(tc.counts.changed) + ' changed. Weakened assertions cannot be detected, only that files changed.' : 'Test files were not compared: ' + tc.why]));
+ list('Removed test files', tc.removed, function (x) { return x.path + ' (' + fmt(x.lines) + ' lines)'; });
+ list('Changed test files', tc.changed, function (x) { return x.path + ' (+' + fmt(x.added) + ' -' + fmt(x.removed) + ' lines' + (x.note ? '; ' + x.note : '') + ')'; });
+ list('Added test files', tc.added, function (x) { return x.path + ' (' + fmt(x.lines) + ' lines)'; });
+ }
+ if (dc) {
+ out.push(h('p', null, [dc.parsed ? fmt(dc.parsed) + ' delta(s) in the catalog; ' + fmt(dc.silent) + ' Behavioral-silent: ' + fmt(dc.coveredCount) + ' have a test naming their site, ' + fmt(dc.uncoveredCount) + ' do not.' : 'No delta could be read: ' + dc.why]));
+ list('Not named by any test', dc.uncovered, function (x) { return x.id + ' ' + x.title + (x.why ? ' (' + x.why + ')' : ''); });
+ list('At a build or configuration file (for a person)', dc.config, function (x) { return x.id + ' ' + x.title + ' (' + x.sites.join(', ') + ')'; });
+ }
+ }
(m.canary || []).forEach(function (k) { out.push(h('p', {class: 'note'}, ['Canary' + (k.shown ? '' : ' (claimed only, no result file shows it)') + ': ' + k.change + ': ' + fmt(k.testsFailed) + ' tests failed.'])); });
out = out.concat(bullets('Caveats', m.caveats || []), bullets('What this does not prove', m.notProven || []));
var people = (m.people || []).map(function (i) { return '☐ ' + i.text + (i.where ? ' [' + i.where + ']' : ''); }).concat((m.needsPerson || []).map(function (i) { return '☐ ' + i; }));