Commit 1b9657f
committed
Three more forward-locking contracts for the figure system
Continuing the audit pass, three more invariants currently hold but
aren't asserted. Lock them in so a future change can't silently break
the registry without CI catching it.
Contract 6 — anchor coverage (FigureAnchorContract): every cell-N
attachment anchor in ATTACHMENTS resolves to a real cell in the
example's walkthrough. Catches typos and stale attachments left
behind after a markdown example loses a cell.
Contract 7 — score validity (FigureScoreContract): every SCORES entry
is a (number-in-[0,10], non-empty commentary) tuple. Locks the
rubric range and catches type drift if the dict shape changes.
Contract 8 — banner-fit (FigureSizeContract): every figure's
intrinsic width (Canvas.w + 2 * PAD_X) fits the 440px ceiling that
.cell-banner--1 enforces in public/site.css. A figure that exceeds
the ceiling renders scaled-down on every page, magnifying or
shrinking text in ways the paint code didn't plan for.
All three pass on the current codebase; they exist to prevent
regressions, not to fix anything today. Suite is now 52 tests.
Sweeps that found nothing actionable (no contract added)
- prose duplication: 3 hits were diagrammatic labels (`__getattr__`,
`yield from inner`, `execution continues`) that naturally appear
in the caption too; not the prose-in-SVG anti-pattern the v2
rubric bans.
- text crossing lines: 8 hits were intentional (dashed strikes
through `.append`, signature dividers, struck-through erased
names, type-alias old name).
- text overlapping circles: 10 hits were node labels (the `?` in
branch-fork, `in`/`out` in context-bowtie, operators in
expression-tree) — labels belong inside their circles.
- placeholder captions: 13 false positives — all "placeholders"
were dunder names (__init__, __dict__, __cause__, etc.).1 parent 8470b42 commit 1b9657f
1 file changed
Lines changed: 86 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
331 | 417 | | |
332 | 418 | | |
0 commit comments