Commit e3fdaf2
committed
feat(admin): the insights artifact -- one page for topology and spend (issue #175)
The fourth insights slice, the one the series exists for: /dispatch
insights html [7d|30d|mtd] writes <graphDir>/insights.html, one
self-contained file:// document -- the trigger/flow topology with spend
badged onto its triggers, beside the cost fold drawn as hand-rolled
inline SVG charts (KPI tiles, plan verdict cards, a daily spend column
chart, the four breakdown bar lists).
- graph-html.mjs gains exports, not loads: buildGraphScene is the
normalize+layout+SVG-emission half of buildGraphHtml extracted whole
(behavior-preserving; every existing pin green untouched), plus
escapeHtml/embedJson/fmt/PAGE_JS/legendHtml/bannersHtml/PAGE_THEME.
The purity pin is substring-level and directional on purpose: the
module may be a source of truth for a sibling emitter, it may never
load one itself.
- insights-html.mjs: two loads only (graph-html, panel), so the money
strings come from the REAL fmtCost -- a plan-covered bucket draws a
plan:<id> chip and NO dollar bar, estimates are dashed and
translucent beside their ~ est. text (hue never the sole encoding),
floors carry >= on the chart, gap days render as baseline ticks, a
null byTrigger renders 'not computed'. Byte-deterministic under
permutation, total on junk, allowlist-normalized, one script element,
no fetching, no innerHTML, textContent-only tips, row->node
cross-highlight by replaying a guarded synthetic click so PAGE_JS
keeps sole ownership of selection. The topology pane takes the
scene's own aspect ratio (a fixed pane letterboxed a flat topology
into a mostly-empty band; caught by a headless-Chrome screenshot).
- index.ts: the insights subcommand (bare insights answers usage; the
artifact IS the feature), USAGE/KNOWN_SUBCOMMANDS/description in
step, completion for insights html <window>, assembleInsights
composing the two existing assemblers, insightsHtmlCommand as
graphHtmlCommand's structural twin (atomic stable path, URL first,
headless skip-and-say, write-failure never opens). Default window
30d, deliberately not costs' mtd: the topology half is pinned at a
30d record window and one page's halves should agree.
Specs in the same PR: NEW REQ-INSIGHTS-HTML-EXPORT;
REQ-COST-ANALYTICS amended one sentence (the artifact joins the named
surfaces; rules (a)-(g) unchanged); DES-ADMIN-VIA-PI-EXTENSION amended
with the factoring facts and rejections (shared third emitter,
duplication, in-place folding, a charting dependency);
REQ-GRAPH-HTML-EXPORT UNCHANGED, checked (graph html stays the lighter
topology-only export); REQ-TOPOLOGY-GRAPH UNCHANGED, checked;
DES-GRAPH-EDGE-DERIVATION UNCHANGED, checked; DES-COST-FOLD-BY-SCAN
UNCHANGED, checked. New docs/insights.md; cross-links in docs/graph.md
and docs/costs.md.
Suite green in the CI posture: 2224 tests, 0 skipped, live Valkey.
Signed-off-by: Rob Boerman <robboerman@live.nl>1 parent 2de0208 commit e3fdaf2
11 files changed
Lines changed: 1775 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
96 | 112 | | |
97 | 113 | | |
98 | 114 | | |
| |||
114 | 130 | | |
115 | 131 | | |
116 | 132 | | |
117 | | - | |
| 133 | + | |
118 | 134 | | |
119 | 135 | | |
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
123 | 139 | | |
124 | | - | |
| 140 | + | |
125 | 141 | | |
126 | 142 | | |
127 | 143 | | |
| |||
130 | 146 | | |
131 | 147 | | |
132 | 148 | | |
133 | | - | |
| 149 | + | |
134 | 150 | | |
135 | 151 | | |
136 | 152 | | |
| |||
908 | 924 | | |
909 | 925 | | |
910 | 926 | | |
911 | | - | |
| 927 | + | |
912 | 928 | | |
913 | 929 | | |
914 | 930 | | |
| |||
938 | 954 | | |
939 | 955 | | |
940 | 956 | | |
941 | | - | |
| 957 | + | |
942 | 958 | | |
943 | 959 | | |
944 | 960 | | |
| |||
976 | 992 | | |
977 | 993 | | |
978 | 994 | | |
979 | | - | |
| 995 | + | |
980 | 996 | | |
981 | 997 | | |
982 | 998 | | |
| |||
1166 | 1182 | | |
1167 | 1183 | | |
1168 | 1184 | | |
1169 | | - | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1170 | 1194 | | |
1171 | 1195 | | |
1172 | 1196 | | |
| |||
1222 | 1246 | | |
1223 | 1247 | | |
1224 | 1248 | | |
1225 | | - | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1226 | 1254 | | |
1227 | 1255 | | |
1228 | 1256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | | - | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| |||
217 | 219 | | |
218 | 220 | | |
219 | 221 | | |
| 222 | + | |
| 223 | + | |
220 | 224 | | |
221 | | - | |
| 225 | + | |
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| |||
944 | 948 | | |
945 | 949 | | |
946 | 950 | | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
947 | 962 | | |
948 | 963 | | |
949 | 964 | | |
| |||
1147 | 1162 | | |
1148 | 1163 | | |
1149 | 1164 | | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
1150 | 1238 | | |
1151 | 1239 | | |
1152 | 1240 | | |
| |||
1742 | 1830 | | |
1743 | 1831 | | |
1744 | 1832 | | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
1745 | 1843 | | |
1746 | 1844 | | |
1747 | 1845 | | |
| |||
0 commit comments