Skip to content

fix(matrix): named refusals and whole-pixel floors; POST body reaches every field - #7

Merged
eli64s merged 1 commit into
mainfrom
fix/matrix-stabilization
Sep 15, 2026
Merged

eli64s merged 1 commit into
mainfrom
fix/matrix-stabilization

Conversation

@eli64s

@eli64s eli64s commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Seven bugs survived the matrix repair on main because nothing tested for them. Two are user-facing: a headline chip wider than the masthead ran outside the frame with no error, and POST /v1/compose accepted 24 of the 46 ComposeSpec fields and ignored the rest in silence. All seven now have tests.

Changes

  • Headline chip: Raises MatrixCapacityError with the space needed and the space available. Next to a title, the chip leaves room for the gap and the title's shortest truncation.
  • Declared widths: A width narrower than the column's content is widened to fit, with a declared-width diagnostic. The matrix refuses only when the columns cannot fit 900px at their narrowest.
  • Whole-pixel widths: text_floor rounds up. A column set to its own minimum used to truncate the text that minimum came from, because the two differed by a fraction of a pixel.
  • Fitter: truncate_to_width returns nothing when even does not fit. fit_line and fit report the overflow.
  • Axis ticks: The axis reads 1k · 2k · 3k instead of 1000k. Millions stay M. _fmt_tick is replaced by format_compact_number with a lower_k option.
  • Unused config: metric_text_x, text_inset, and strip_metric_text_x are deleted. Nothing read them.
  • Specimen fixtures: 13 fixtures pointed at a moved directory, so they skipped instead of failing. The suite now fails when a specimen is missing.
  • POST body: ComposeRequest gains 13 fields including font_mode, on the inline and envelope paths. Unknown keys return in warnings, or X-HW-Warning for svg. The other 13 fields are internal and listed in tests/serve/test_compose_body.py, so adding one forces a choice.
  • Housekeeping: _test_*.svg ignored, connectors example regenerated, corpus re-recorded.

Validation

Gate Result
Seven new tests against main 7 failed
Matrix layout · input · frame · spatial 238 passed
Specimens 127 passed, 0 skipped (was 13 skipped)
POST body contract 14 passed
HTTP · surfaces · integration · MCP 717 passed
ruff check · ruff format --check · ty check clean
Full just qa 6,328 passed, 105 skipped (was 6,289 / 118)

Nothing visible moved. 14 measurements shifted by at most 1px and the connectors asset by 0.05px.

Notes

  • format is reported but ignored on inline svg and json. It works on envelope and report, which serve a file at url.

@eli64s
eli64s merged commit c8e85dd into main Sep 15, 2026
6 checks passed
@eli64s
eli64s deleted the fix/matrix-stabilization branch September 15, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant