Repository navigation
Commit 76d29af
committed
P-005 D5.3 / P1a: curated BCL fresh-factory table (producer side of Tier B)
C+D first slice — the producer half of the boundary contract. A leaked BCL
factory result (`var s = File.OpenRead(p)`) was invisible because there is no
first-party body to infer `fresh` from; now a curated table makes it owned.
- ownir.py: `_BCL_FRESH_FACTORIES` (File.OpenRead/OpenText/OpenWrite/Open/Create/
CreateText/AppendText) + `_is_bcl_fresh_factory` (matches `Type.Method`, so a
namespace-qualified callee resolves on its last two segments). New
`_callee_returns_fresh` centralises the "does this call yield a fresh owned
result?" decision (Tier A first-party summary OR Tier B BCL table) and is now
the single source of truth shared by the leak pre-scan, the branch-hoist
safety walk, and the flow lowering — so all three agree.
- A leaked factory result is OWN001 at the call; disposed is clean;
use-after-dispose is OWN002; it composes with the P-015 codeFlows slice (the
finding anchors at the factory call). Pure factories only — overload-ambiguous
wrappers that adopt an arg (`new StreamReader(stream)`) stay out (sink/T4).
- The leaveOpen *sink* breadth rides the existing $consume/$borrow channel and is
extractor-side (the bool literal is a per-call-site fact), so it is CI/C#-only;
documented as the remaining half in d5-ownership-transfer.md §7.
Tests: leak / disposed-clean / use-after-dispose / namespace-qualified / a
non-disposable `File.ReadAllText` making no claim. ownir 174/174; ruff + mypy clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkpSWNx7ARLpQeAs13kkyA1 parent 1e8bb8b commit 76d29af
3 files changed
Lines changed: 95 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
337 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
338 | 354 | | |
339 | 355 | | |
340 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
1098 | 1134 | | |
1099 | 1135 | | |
1100 | 1136 | | |
| |||
1327 | 1363 | | |
1328 | 1364 | | |
1329 | 1365 | | |
1330 | | - | |
1331 | | - | |
| 1366 | + | |
1332 | 1367 | | |
1333 | 1368 | | |
1334 | 1369 | | |
| |||
1396 | 1431 | | |
1397 | 1432 | | |
1398 | 1433 | | |
1399 | | - | |
1400 | | - | |
| 1434 | + | |
1401 | 1435 | | |
1402 | 1436 | | |
1403 | 1437 | | |
| |||
1561 | 1595 | | |
1562 | 1596 | | |
1563 | 1597 | | |
1564 | | - | |
| 1598 | + | |
1565 | 1599 | | |
1566 | 1600 | | |
1567 | 1601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1513 | 1513 | | |
1514 | 1514 | | |
1515 | 1515 | | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
1516 | 1554 | | |
1517 | 1555 | | |
1518 | 1556 | | |
| |||
0 commit comments