Commit Graph
7 Commits
Author SHA1 Message Date
Joseph Magly 2a0abae1f8 fix(viewer,evaluator,presets): close #661/#663 review follow-ups
The results viewer formats -0 and non-finite values like Python, survives
engines without toFixed(100), and shows an error when readAsText throws. CSV
export writes an empty metric name as `metric:` and orders columns by name
across all rows. StudyConfig rejects `metrics: []` at parse. The evaluator logs
the position_ids fallback and matches more rejection wordings, runs in eval
mode (restoring module modes afterwards), and handles left padding in
classification. Preset getters return deep copies.

Fixes #666
2026-11-25 09:59:06 -05:00
Joseph Magly 13e49f799a fix(reporting): namespace ablation CSV change columns and round viewer numbers half to even
Ablation CSV change columns are now delta:<metric> and pct_change:<metric>;
metrics whose names are reserved are written as metric:<name>, so no metric
can overwrite another column. The results viewer formats numbers half to even
like Python (12.25% shows as +12.2%), with tests for a stale read error after a
demo load and readAsText throwing; the report fallback comment says name order.

Fixes #648
Fixes #650
2026-11-25 02:46:38 -05:00
Joseph Magly a4af133c90 fix(viewer,report): linear-time trim, real-pair deltas, and an error state for failed loads
Codex review r3 for #618: the viewer trims ASCII whitespace by scanning
instead of a backtracking regex; report availability, plotted deltas, the
heatmap and the summary compute changes from each metric's own value and
baseline so generated column names cannot collide with raw metric names;
failed uploads clear the results and show an error; strict JSON (no NaN or
Infinity tokens) is documented as the shared input contract.
2026-11-24 19:48:43 -05:00
Joseph Magly 86407c7760 fix(viewer,report): render results as text, mirror plot metric selection, write plots atomically
Codex review r1 for #618: the results viewer builds its stats, chart and
table with DOM nodes and text only (no innerHTML), so a crafted results.json
cannot inject markup; its impact-metric selection mirrors save_plots exactly
(string primary only, measured baseline plus at least one measured ablation);
every render clears all result regions. Plots are written to a temp file and
moved into place only on success, figures are always closed, and a fallback
metric is labelled on the chart. A node-based test exercises the viewer.
2026-11-24 18:31:18 -05:00
Joseph Magly c0c174a05b fix(report): preserve the study impact metric and report only plots written
Record the study's chosen impact metric as an optional `primary_metric` key
in results.json so `report` replays the same chart; files without the key
keep the first-metric behaviour. Write the impact and heatmap plots
independently, fall back to a metric with a measured change, and print only
the files written in this run, flagging stale plots from earlier runs.

Fixes #606
Fixes #607
Fixes #604
2026-11-24 14:44:28 -05:00
Joseph Magly b80c1a1694 test: enforce research integrity contracts 2026-08-14 13:38:14 -04:00
pliny 66ea4a6f86 Add files via upload 2026-03-05 00:50:44 -08:00