Repository navigation
Commit 44dfcb7
fix(store): childPath reads a parent stored as a byte-order mark alone as the empty name, as name() does - so a child under it is joined as joinPath and the old rule joined it, with one separator, and the cleanup walk and the query walk spell it alike (CI4 review F1.1)
CI4 made childPath choose the separator from the parent's stored bytes:
empty, or ending in the separator's byte. name() decodes with a
TextDecoder, which reads a leading byte-order mark as nothing, so a folder
stored as the mark alone (EF BB BF) is the empty name: its path ends with
the separator. The byte rule saw three bytes ending in 0xBF and joined a
second one - "/r//a" where the old endsWith rule, and joinPath, which the
cleanup walk joins a packed store's names with, give "/r/a". One node had
two spellings.
A parent whose stored name begins with the mark is now decided from its
name as name() reads it - empty, or ending with the separator - so
"/" is the separator alone and "" is a name that does not
end with one. It still never reads the parent path: decoding a name costs
the name's length, not the path's.
Test (tests/packedStore.test.ts, CI4's byte-for-byte differential): the
names now include "", "" + sep, "a" and "",
under every root and separator; RED before the fix on "a" under
"/r//" ("/r///a" against "/r//a"). The cleanup walk's
comment now cites the differential.
Mutants, each RED for the right reason, restored and checked by SHA-256:
no mark branch ("a" under "/r//"); no empty clause (same); no
ends-with clause ("a" under "/r///"); a mark-led name always empty
("a" under "/r/").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent edba986 commit 44dfcb7
3 files changed
Lines changed: 31 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1491 | 1491 | | |
1492 | 1492 | | |
1493 | 1493 | | |
1494 | | - | |
1495 | | - | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
1496 | 1497 | | |
1497 | 1498 | | |
1498 | 1499 | | |
| |||
1506 | 1507 | | |
1507 | 1508 | | |
1508 | 1509 | | |
1509 | | - | |
1510 | | - | |
1511 | 1510 | | |
1512 | 1511 | | |
1513 | | - | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1514 | 1526 | | |
1515 | 1527 | | |
1516 | 1528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
| |||
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
162 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
163 | 172 | | |
164 | 173 | | |
165 | 174 | | |
| |||
0 commit comments