Commit 9702540
harvest: scrub wrapped reminders with their own token, not a fixed constant
Deviation found while validating the first real --pin (capture s-633915a8,
n=26->28): scrubText collapsed every <system-reminder>-wrapped block to the
literal constant "REDACTED", regardless of its real content. That breaks
insertion-normalization's wrap/unwrap cross-identity check
(findSuppressibleDuplicate/unwrapVolatileText, proxy/extensions/
insertion-normalization.mjs) -- CC sometimes migrates a reminder OUT of its
wrapper into a standalone duplicate message, and suppression fires only
when the wrapped original's stripped bytes hash-match the standalone
duplicate's bytes. Under the fixed constant, the wrapped original always
hashed to "REDACTED" while the unwrapped duplicate hashed its real text
independently, so the two never matched post-scrub.
Measured directly: replaying the sanitized n=26->28 fixture through the
real pipeline gave suppressed=0 / outputForm="splice@31" (the pre-fix
defect shape) instead of the live capture's suppressed=1 /
outputForm="append". The committed pinned fixture would have silently
reproduced stale, wrong behaviour once the live capture rotated away --
worse than the SKIP it was meant to replace.
Fix: a wrapped reminder now re-wraps scrubText's own recursive token for
its inner text instead of a fixed placeholder. The wrapper tags still
survive verbatim (any check that only tests for wrapper PRESENCE is
unaffected -- verified against test/harvest.test.mjs's existing
"wrappers survive" test, unchanged and still green), and two reminders
with equal real bytes -- wrapped or not -- now hash equal after scrubbing,
matching what the sanitizer already guarantees for ordinary text.
Verified: test/harvest.test.mjs (14/14, no regression), and the fixed
scrubber's output re-run through the actual pipeline (findMitigationGaps,
findSafetyViolations) reproduces the live capture's real values exactly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit fda83cc)1 parent 7e38919 commit 9702540
1 file changed
Lines changed: 29 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| |||
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
97 | | - | |
| 103 | + | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
102 | 126 | | |
103 | 127 | | |
104 | | - | |
| 128 | + | |
| 129 | + | |
105 | 130 | | |
106 | 131 | | |
107 | 132 | | |
| |||
0 commit comments