Surfaced while implementing #110 (wave 2 of #102).
The legibility check added in wave 2 needs each component's effective font size. For badge, that meant duplicating the size→font-size table (sm 12 / md 14 / lg 18) inside crates/rustmotion-cli/src/commands/geometry.rs, because BadgeSize::params() is private to crates/rustmotion-components/src/badge.rs.
Two copies of one table, in different crates, with nothing tying them together. When badge's table changes, the validator will keep measuring against the old numbers and no test will notice.
Note the audit that started this chantier found the documentation had drifted from the code for exactly this reason — a fact duplicated in two places where only one is maintained. This is the same shape, in code.
Fix: expose the badge sizing table (make params() public, or move the mapping somewhere both crates can read) and delete the copy in geometry.rs.
Acceptance: one definition of the table, referenced by both. A test that would fail if they diverged.
Surfaced while implementing #110 (wave 2 of #102).
The legibility check added in wave 2 needs each component's effective font size. For
badge, that meant duplicating the size→font-size table (sm 12 / md 14 / lg 18) insidecrates/rustmotion-cli/src/commands/geometry.rs, becauseBadgeSize::params()is private tocrates/rustmotion-components/src/badge.rs.Two copies of one table, in different crates, with nothing tying them together. When badge's table changes, the validator will keep measuring against the old numbers and no test will notice.
Note the audit that started this chantier found the documentation had drifted from the code for exactly this reason — a fact duplicated in two places where only one is maintained. This is the same shape, in code.
Fix: expose the badge sizing table (make
params()public, or move the mapping somewhere both crates can read) and delete the copy ingeometry.rs.Acceptance: one definition of the table, referenced by both. A test that would fail if they diverged.