forge
Explore
Log in

Don't you dare go Hollow

📏 say what the refusal-code guard cannot catch

Browse files at this commit

f27ac0a0dd5e84fa40bcc63b9bc13596d42b130dAhmet Kaan GümüşParent: 82c0ee2
  • docs
    • 📏 say what the refusal-code guard cannot catch
Show full message
docs: 📏 say what the refusal-code guard cannot catch

The comment claimed a code documented on no surface at all would fail
the test. It would not: the three lists it compares against are
hand-kept, so a code this file has never heard of passes every
assertion. What actually holds that end is the exhaustive match plus
the per-axis unit test, and adding a code means editing both.
tests/spec_bounds.rsmodified+10 -2
@@ -1201,8 +1201,16 @@ async fn the_class_refusal_codes_stay_published() {
1201 }1201 }
1202 1202
1203 // …and the closed set itself, on the one field that explains all of it: the1203 // …and the closed set itself, on the one field that explains all of it: the
1204- // union of both routes plus the pump, so a code documented on no surface at1204+ // union of both routes plus the pump, so a code documented on one surface
1205- // all still fails here.1205+ // but missing from the field that collects them all still fails here.
1206+ //
1207+ // What this cannot catch: a code this file has never heard of. The three
1208+ // lists above are hand-kept, so a new `Attached` variant reaches the API
1209+ // documented nowhere and every assertion here still passes. The compiler
1210+ // holds that end instead — `refusal_code`'s match is exhaustive, so the
1211+ // variant cannot be added without a code — and
1212+ // `class_blueprint::tests::each_axis_names_the_ceiling_it_actually_hit`
1213+ // pins what that code is per axis. Adding one means editing both.
1206 let reason =1214 let reason =
1207 spec["components"]["schemas"]["SkipResponse"]["properties"]["reason"]["description"]1215 spec["components"]["schemas"]["SkipResponse"]["properties"]["reason"]["description"]
1208 .as_str()1216 .as_str()