Repository navigation
Commit 47a5bb6
committed
fix(presets): treat stale entries as unmet and unparseable versions as uncomparable
Addresses review feedback on #4250.
A registry entry is not proof the extension can contribute. When the entry
survives after .specify/extensions/<id> is removed, PresetResolver skips the
extension outright -- both template lookup and layer collection guard on
is_dir() -- so the preset is as inert as if it were never installed, while the
surviving entry read as satisfied. Report that state as a distinct "stale"
reason, ahead of the disabled and version checks, and remediate it with a
forced reinstall rather than a plain add.
The uncomparable-version guard also only covered non-string values. An
unparseable string such as "unknown" passed it and reached version_satisfies(),
which catches InvalidVersion and returns False -- reporting a mismatch against
a version that was never actually evaluated, and contradicting the documented
behaviour that unusable versions are not invented into mismatches. Check
parseability before comparing so only real comparisons reach the warning.
The test helper now creates the extension directory alongside the registry
entry, matching what the installer does, with an opt-out for the stale case.
Assisted-by: Claude Code (model: Claude Opus 5, autonomous)1 parent db9a90d commit 47a5bb6
4 files changed
Lines changed: 130 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
66 | 80 | | |
67 | 81 | | |
68 | 82 | | |
| |||
971 | 985 | | |
972 | 986 | | |
973 | 987 | | |
974 | | - | |
975 | | - | |
976 | | - | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
977 | 996 | | |
978 | 997 | | |
979 | 998 | | |
| |||
989 | 1008 | | |
990 | 1009 | | |
991 | 1010 | | |
992 | | - | |
| 1011 | + | |
| 1012 | + | |
993 | 1013 | | |
994 | 1014 | | |
995 | 1015 | | |
| |||
1003 | 1023 | | |
1004 | 1024 | | |
1005 | 1025 | | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1006 | 1037 | | |
1007 | 1038 | | |
1008 | 1039 | | |
| |||
1018 | 1049 | | |
1019 | 1050 | | |
1020 | 1051 | | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1025 | 1059 | | |
1026 | 1060 | | |
1027 | 1061 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1163 | 1163 | | |
1164 | 1164 | | |
1165 | 1165 | | |
1166 | | - | |
1167 | | - | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1168 | 1175 | | |
1169 | 1176 | | |
| 1177 | + | |
| 1178 | + | |
1170 | 1179 | | |
1171 | 1180 | | |
1172 | 1181 | | |
| |||
1282 | 1291 | | |
1283 | 1292 | | |
1284 | 1293 | | |
1285 | | - | |
1286 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
1287 | 1297 | | |
1288 | | - | |
1289 | | - | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
1290 | 1305 | | |
1291 | 1306 | | |
1292 | 1307 | | |
1293 | | - | |
| 1308 | + | |
1294 | 1309 | | |
1295 | 1310 | | |
1296 | 1311 | | |
| |||
1302 | 1317 | | |
1303 | 1318 | | |
1304 | 1319 | | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
1305 | 1376 | | |
1306 | 1377 | | |
1307 | 1378 | | |
| |||
0 commit comments