Repository navigation
Commit dc4d7ae
committed
feat: rename @strict-numeric-typing to @numeric-coercion, and fix the rule
The tag was named for a stricter rule than the specification actually wants, and
it was about to collide with a second vocabulary for the same property.
flagd is implementing an accepted numeric coercion ADR (open-feature/flagd#1996)
whose rule is that coercion is permitted when lossless and must fail with
TYPE_MISMATCH only when information would be lost: 10.0 requested as an integer
succeeds, 0.5 does not. This appendix said "does not coerce between integer and
float", which forbids the case the ADR requires to work. The existing scenario
survives the difference only by luck, because it asks about 0.5, which does have
a fractional part.
That work also introduces @numeric-coercion and @int32-bounded scenarios into
flagd's own testbed. Two capability vocabularies describing one property, written
in the same week, is the drift a shared vocabulary exists to prevent, so the tag
takes flagd's name rather than leaving the reference implementation and the
specification disagreeing about what a rule is called. Renaming now costs four
draft implementations an enum change; renaming later costs a published one.
Two gaps are recorded rather than closed. The lossless half of the contract has
no scenario, because the canonical flag set contains no integral float to ask it
of and adding one changes the flag set for every language at once -- so a provider
that wrongly rejects 10.0 as an integer still passes. And accessor width is not
modelled at all: the ADR distinguishes a 64-bit integer accessor from a 32-bit
one, which flagd tags @int32-bounded, and that is a real source of cross-language
disagreement this appendix is currently silent about.
This also settles an open question on #417. @strict-numeric-typing
was the one capability tracing to no numbered requirement, existing only because
flagd had a defect. It now has a definition to trace to, and can stop being a
known-deviation marker wearing a capability's clothes.
Signed-off-by: Simon Schrottner <[email protected]>1 parent 8454c9b commit dc4d7ae
2 files changed
Lines changed: 35 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 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 | + | |
185 | 204 | | |
186 | 205 | | |
187 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
0 commit comments