Repository navigation
Commit 74f5eb2
committed
Merge u4 head 416179d into the guard-core unit
Stacked-unit refresh: the previous merge carried b86511f, so this brings the
write-protocol head current and keeps one seam text under the guard-core unit.
Two regions conflicted and both have the same shape. This branch rewrote
src/services/file-safety/safeWriteText.ts into the guard-core design (conditional
failIfExist commit, directory-identity authorization, backup-orphan handling), while
the incoming head kept mechanisms from its own copy of the same module. Both sides
were read before resolving, and neither drop below is left silent.
1. Staging-file identity. The incoming side carries a (dev, ino) comparison that
refuses a staging path which is an alias of the target, because in backup mode the
failure handler would unlink the only remaining name. Measured: grepping this
branch's pre-merge head 33e9200 for "target itself" returns 0 lines tree-wide
in src, source and specs alike, while the incoming head carries the block at
src/services/file-safety/safeWriteText.ts:341-356. Resolution: this branch's
version, 23 incoming lines not taken. What remains here guards the staging path by
directory and by regular-file-not-link only, so the alias hazard is a gap to close
in the unit that owns the staging path rather than something to re-add inside a
refresh commit.
2. DACL inspection. The incoming side refuses to publish when the target exists but its
access rights could not be read (getErrorCode(error) !== "ENOENT" yields
DaclInspectionError before anything is committed). This branch's copy clears
daclDumpPath and publishes without DACL preservation instead. Measured:
DaclInspectionError has 0 references tree-wide at 33e9200, and no spec in
either lineage asserts an inspection-failure path. Resolution: this branch's
version, 3 lines kept and 5 incoming lines dropped. Stated plainly, the
consequence is that on win32 a target whose ACL this call could not read is
replaced without preserving its rights, where the incoming head failed first.
After the merge, 6 errorCode(...) call sites in this branch's added code had no
definition left, because the definition they used was the duplicate that 416179d
deletes. They now call the exported getErrorCode from src/utils/errorCode.ts, which
this file already imports. All 6 compare the returned code against a string code
literal, so the same equivalence argument recorded in 416179d covers them.
Gates, the mutation-cap measurement and the two gaps as review-visible text are in the
follow-up comment on PR #1914.2 files changed
Lines changed: 20 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | 266 | | |
269 | 267 | | |
270 | 268 | | |
| |||
310 | 308 | | |
311 | 309 | | |
312 | 310 | | |
313 | | - | |
| 311 | + | |
314 | 312 | | |
315 | 313 | | |
316 | 314 | | |
317 | 315 | | |
318 | 316 | | |
319 | 317 | | |
320 | | - | |
| 318 | + | |
321 | 319 | | |
322 | 320 | | |
323 | 321 | | |
324 | 322 | | |
325 | 323 | | |
326 | 324 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | 325 | | |
339 | 326 | | |
340 | 327 | | |
| |||
359 | 346 | | |
360 | 347 | | |
361 | 348 | | |
362 | | - | |
| 349 | + | |
363 | 350 | | |
364 | 351 | | |
365 | 352 | | |
| |||
391 | 378 | | |
392 | 379 | | |
393 | 380 | | |
394 | | - | |
| 381 | + | |
395 | 382 | | |
396 | 383 | | |
397 | 384 | | |
| |||
519 | 506 | | |
520 | 507 | | |
521 | 508 | | |
522 | | - | |
| 509 | + | |
523 | 510 | | |
524 | 511 | | |
525 | 512 | | |
| |||
538 | 525 | | |
539 | 526 | | |
540 | 527 | | |
541 | | - | |
| 528 | + | |
542 | 529 | | |
543 | 530 | | |
544 | 531 | | |
| |||
553 | 540 | | |
554 | 541 | | |
555 | 542 | | |
556 | | - | |
| 543 | + | |
557 | 544 | | |
558 | 545 | | |
559 | 546 | | |
560 | 547 | | |
561 | 548 | | |
562 | 549 | | |
563 | 550 | | |
564 | | - | |
| 551 | + | |
565 | 552 | | |
566 | 553 | | |
567 | 554 | | |
| |||
600 | 587 | | |
601 | 588 | | |
602 | 589 | | |
603 | | - | |
| 590 | + | |
604 | 591 | | |
605 | 592 | | |
606 | 593 | | |
| |||
619 | 606 | | |
620 | 607 | | |
621 | 608 | | |
622 | | - | |
| 609 | + | |
623 | 610 | | |
624 | 611 | | |
625 | 612 | | |
| |||
664 | 651 | | |
665 | 652 | | |
666 | 653 | | |
667 | | - | |
| 654 | + | |
668 | 655 | | |
669 | 656 | | |
670 | 657 | | |
| |||
682 | 669 | | |
683 | 670 | | |
684 | 671 | | |
685 | | - | |
| 672 | + | |
686 | 673 | | |
687 | 674 | | |
688 | 675 | | |
| |||
699 | 686 | | |
700 | 687 | | |
701 | 688 | | |
702 | | - | |
| 689 | + | |
703 | 690 | | |
704 | 691 | | |
705 | 692 | | |
| |||
712 | 699 | | |
713 | 700 | | |
714 | 701 | | |
715 | | - | |
| 702 | + | |
716 | 703 | | |
717 | 704 | | |
718 | 705 | | |
| |||
753 | 740 | | |
754 | 741 | | |
755 | 742 | | |
756 | | - | |
| 743 | + | |
757 | 744 | | |
758 | 745 | | |
759 | 746 | | |
| |||
789 | 776 | | |
790 | 777 | | |
791 | 778 | | |
792 | | - | |
| 779 | + | |
793 | 780 | | |
794 | 781 | | |
795 | 782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | 158 | | |
165 | 159 | | |
166 | 160 | | |
| |||
0 commit comments