Repository navigation
Commit 82cfbf2
committed
fix(editor): withdraw the preview observation on every exit path (port)
Port of the sibling unit's security fix to the copy this unit owns: the
preview-observation rule was applied only on saveChanges(..., "edit").
On every other exit path the partial preview entry stayed in
task.observationRegistry, so a rejected full-file save left an entry
that could authorize the model's next targeted edit for a file the
model never read.
open() records the token its preview wrote; performFinalReset() - the
single execution point behind reset(), which every tool catch reaches
and revertChanges reaches through finalizeSession - forgets the entry
while it still holds that token AND the preview's incomplete flag. A
successful publish replaces the token first, and a model read_file
records complete: true, so earned observations survive both ways.
Three tests ported: the trigger sequence (preview -> rejected update ->
leftover asserted -> finalization withdraws) and the two survival cases
pinning the guard's conditions. Negative control: disabling the
withdrawal reddens exactly the trigger test (1 failed | 165 passed);
the survival mutants are killed by their own tests on the sibling
copy's identical logic.
166/166 green, eslint clean, prettier clean, tsc adds nothing beyond
the known local donor drift.1 parent c6b3e86 commit 82cfbf2
2 files changed
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
163 | 170 | | |
164 | 171 | | |
165 | 172 | | |
| |||
259 | 266 | | |
260 | 267 | | |
261 | 268 | | |
| 269 | + | |
262 | 270 | | |
263 | 271 | | |
264 | 272 | | |
| |||
1862 | 1870 | | |
1863 | 1871 | | |
1864 | 1872 | | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
1865 | 1890 | | |
1866 | 1891 | | |
1867 | 1892 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1527 | 1527 | | |
1528 | 1528 | | |
1529 | 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 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
1530 | 1579 | | |
1531 | 1580 | | |
1532 | 1581 | | |
| |||
0 commit comments