Commit 896956d
fix(unvalidated_lookup_chain): suppress dict write FP
Dict writes (collection[var] = value, ctx=Store) never raise KeyError —
only reads can. Also treat a write as an implicit guard so subsequent
reads of collection[var] on the next lines are not flagged.
Eliminates ~17 false positives in tadata-org/fastapi_mcp where
properties[param_name] = copy() was flagged then properties[param_name]["title"] = ...
was also flagged as unvalidated even though the key was just created.
Adds test: test_unvalidated_lookup_chain_dict_write_not_flagged (170 tests total).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 8b472e6 commit 896956d
2 files changed
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1341 | 1341 | | |
1342 | 1342 | | |
1343 | 1343 | | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1344 | 1351 | | |
1345 | 1352 | | |
1346 | 1353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
1443 | 1474 | | |
1444 | 1475 | | |
1445 | 1476 | | |
| |||
0 commit comments