Commit 1d7dfe5
committed
fix(pull): warn loudly when disk-form hash fallback fires; docs/cosmetic polish
Address B1 (single action item) from the 3-commit follow-up code review:
When `hashLocalResource` returns null after a successful writeResourceFile
(e.g. broken file extension, race with rm, parseResourceDataFromFile throw),
the silent fallback to `hashPayload(withCredNames)` reintroduces the exact
M1 in-memory-vs-disk asymmetry that commit f296173 fixed \u2014 with NO log line
for the next operator to find. They'd see phantom drift on the next pull
and have no breadcrumb explaining why.
Fix: capture diskHash separately, emit a `\u26a0\ufe0f` console.warn pointing at the
specific resource when the fallback fires, then use the same nullish-coalesce.
Bootstrap mode (no file written) is correctly excluded from the warning since
the fallback there is expected.
Also bundling 2 cosmetic nits from the same review:
- A1: canonicalizeForHash JSDoc said pipeline mismatches make `lastPulledHash`
disagree with the next read's `localHash`. The audit never writes
lastPulledHash \u2014 it reads it. Correct framing is platformHash recomputation
disagreeing with the stored lastPulledHash from a prior pull.
- C2: summarizeFindings rendered '1 info' next to '1 error(s)' / '1 warning(s)'
\u2014 inconsistent pluralization. Updated to '1 info finding(s)' for symmetry.
Adjacent test assertion updated.
Defer to follow-ups (non-blocking):
- B2 bootstrap + manually-placed files edge case (narrow audience)
- B3 perf measurement on 1000+-resource customers
- C1 --no-info flag (monitor; add if customer complaints surface)
- D1 split end-of-pull legend into 'skip reasons' + 'write outcomes'
Tests: 266/266 green; tsc --noEmit clean.1 parent 383018c commit 1d7dfe5
3 files changed
Lines changed: 24 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
568 | | - | |
| 568 | + | |
569 | 569 | | |
570 | 570 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
519 | | - | |
520 | | - | |
521 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| |||
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1021 | 1032 | | |
1022 | 1033 | | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
| 1034 | + | |
1026 | 1035 | | |
1027 | 1036 | | |
1028 | 1037 | | |
| |||
1110 | 1119 | | |
1111 | 1120 | | |
1112 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1113 | 1128 | | |
1114 | 1129 | | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
| 1130 | + | |
1118 | 1131 | | |
1119 | 1132 | | |
1120 | 1133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
591 | | - | |
| 591 | + | |
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
| |||
0 commit comments