Repository navigation
Commit 3a9a816
feat(web): the remaining six views, an SVG curve nobody has to see, and a stream that says when it stops (#550)
The bulk of the port: `/setup`, `/activity`, `/insights`, `/rules`, `/venues` and
`/gates` as client views over #534's API, plus the equity curve and live updates.
── PARITY IS ON THE INFORMATION, AND TWO MORE #548s TURNED UP ON THE WAY ──────
Every view is judged against the rendered pages AND `tests/commands/test_tui.py`,
and where those disagree the divergence is written into the view's docstring
rather than reproduced. Porting found two more instances of #548's pattern -- a
lookup that misses, defaulted, with nothing raised:
* `render.py::_STEP_KIND_NOTE` has three entries against `StepKind`'s four. The
missing one is `operator_input`, the kind of the real `credentials` step, so
the rendered `/setup` prints an EMPTY note on the step where "what may a
wizard do for you" matters most. `payload._STEP_KIND_NOTES` carries all four.
* `render.py::pct` appends `%` to four values that are FRACTIONS. The config
ships `max_total_dd_pct: 0.20` and rail 11 compares the raw drawdown against
it, so a 20% ceiling renders as "0.20%" on every rendered page and a 5%
drawdown as "0.05%" -- a hundredfold understatement of a risk limit.
`payload.ratio`'s docstring names this exact trap; the client shows its value.
── THE CHART: THE COORDINATES ARE COMPUTED IN PYTHON ──────────────────────────
`build_equity_curve` returns plot coordinates, not just figures, and that is the
decision rather than an accident of layering. Where a vertical axis starts is
what makes a $3 wobble look like a collapse; keel does not let a front-end decide
whether a number is bad, and the axis it is drawn against is the same delegation
wearing different clothes. So the baseline is always zero, in Python, where a
test can read it.
The consequence is checkable: `chart.js` needs no arithmetic, so the lexer scan
that guards `render.js` now runs over it too -- proven by mutation, not by
reading. The curve is `role="img"` named by its own `<figcaption>`, one string in
one element, with the journal table beside it for the figures.
── LIVE UPDATES: A DROPPED CONNECTION IS THE POINT ────────────────────────────
`/api/events` streams an envelope whose `data` holds one revision marker and no
figures at all -- `api.js` stays the only place data enters this client, which is
the property a reader audits by opening one file. The agent runs daily, so this
is not a feed: it is how a dead server stops looking like an unchanged one.
Driving it in a real browser found four bugs no test here could have:
* the marker watched `keel.db` only, and `keel serve` runs WAL (#470), so a
committed write moves nothing. The feature was inert and its own comment said
so approvingly. It watches `-wal` now, and not `-shm`, which readers touch.
* a tick repainted the banner green over a view saying the report could not be
built. The view's own read now wins; a loss of contact still shows fast.
* a sort press deferred itself, because the click focused a button inside the
view and the rebuild was waiting for focus to leave. Pressing a control and
watching nothing happen is indistinguishable from a broken control.
* `/activity` and `/gates` scrolled the document sideways at 360px -- on a log
path and a dotted call site, in two paragraphs, with every table already
scrolling correctly inside itself.
── `/setup` KEEPS ITS GATE, AND ITS ACTION SET IS UNCHANGED ───────────────────
`keel.commands.setup.ACTIONS` is a 0-line diff, `keel/web/security.py` is a
0-line diff, and nothing under `/api/*` answers a POST. The client lists every
action keel offers, with its inputs; the button stays on the page that holds the
write token, because `/api/setup` ships no CSRF token on purpose and inventing a
way to hand the client one would be widening the write surface. A client that
hides a button is not a gate, so nothing is hidden -- only the button is
elsewhere. #540 deletes that page, and where a browser client gets a write token
from is a decision that belongs to the milestone, not to this commit.
Claude-Session: https://claude.ai/code/session_01NyeggYtojNXCTHeD3JHxb6
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 268fe06 commit 3a9a816
15 files changed
Lines changed: 3469 additions & 156 deletions
File tree
- keel
- commands
- web
- static
- css
- js
- tests
- commands
- web
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
111 | 318 | | |
112 | 319 | | |
113 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
220 | 231 | | |
221 | 232 | | |
222 | 233 | | |
| |||
226 | 237 | | |
227 | 238 | | |
228 | 239 | | |
229 | | - | |
| 240 | + | |
230 | 241 | | |
231 | 242 | | |
232 | 243 | | |
| |||
0 commit comments