059-a-malformed-id-is-refused-not-a-panic
A malformed id is refused, not a panic
Lifecycle approvedImplementation completeVerification unknownQualification unknown
`detect_duplicates` reads a spec id's V-004 prefix as `&id[..id.len().min(3)]`, a byte slice. An id whose fourth byte falls inside a multi-byte character panics the process instead of diagnosing it, so `a日本-spec` exits 101 with a backtrace where the corpus should have been refused at exit 1 by V-012, the code that exists to name exactly that malformation. Spec 046 §4 found the defect, declined to fix it from inside a lint change, and asked for this spec. The fix reads the prefix the way spec 001 §3.2 already describes it, as a numeric prefix (`NNN`), using the character-safe leading-digit-run rule spec 046 established in `lint.rs`.
Read the full pinned specification ↗Relationships
Claimed units
- extends
{ "nature": "additive", "spec": "001-compile-registry", "unit": { "kind": "file", "path": "crates/spec-spine-core/src/compile.rs" } } - extends
{ "nature": "additive", "spec": "001-compile-registry", "unit": { "kind": "file", "path": "crates/spec-spine-core/tests/compile.rs" } }
Source headings
- 059: A malformed id is refused, not a panic
- 1. Purpose
- 2. Territory
- 3. Behavior
- 3.1 The numeric prefix is read by character, and only when numeric
- 3.2 An id with no numeric prefix is not a V-004 candidate
- 3.3 What must keep working
- 4. Out of scope
- 5. Resolved decisions
- Verification
Frozen anchors
No frozen anchors declared.