@windyroad/voice-tone 0.5.10 → 0.5.11-preview.721

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,5 +123,5 @@
123
123
  }
124
124
  },
125
125
  "name": "wr-voice-tone",
126
- "version": "0.5.10"
126
+ "version": "0.5.11"
127
127
  }
@@ -54,8 +54,21 @@ surface = os.environ.get('EXTCOMMS_SURFACE', '')
54
54
  # changeset-author: strip the leading YAML frontmatter block + blank line.
55
55
  if surface == 'changeset-author':
56
56
  draft = re.sub(r'^---\n.*?\n---\n\n?', '', draft, count=1, flags=re.DOTALL)
57
- # Single canonical newline normalization: strip all trailing whitespace.
58
- draft = draft.rstrip()
57
+ # Substance-aware whitespace normalization (P276 / ADR-009 + ADR-028 amended
58
+ # 2026-06-06). Tolerate trivial PASS-class reformatting so a marker survives
59
+ # interior CRLF/CR line endings and per-line trailing whitespace — the same
60
+ # normalization _substance_normalize_then_hash (gate-helpers.sh) applies to
61
+ # the policy-file-drift gates. Conservative boundary preserved: single-numeral
62
+ # edits and frontmatter-key changes stay substantive (key changes → review
63
+ # re-fires), so the leak-detection guarantee is never weakened.
64
+ # 1. CRLF / CR -> LF
65
+ # 2. strip trailing whitespace per line
66
+ # 3. strip trailing whitespace of the whole draft (subsumes the prior
67
+ # single-canonical rstrip; NO trailing '\n' is appended here so the key
68
+ # shape sha256(normalize(draft) + '\n' + surface) is byte-stable for
69
+ # already-clean drafts — existing markers and keys do not shift).
70
+ draft = draft.replace('\r\n', '\n').replace('\r', '\n')
71
+ draft = '\n'.join(line.rstrip() for line in draft.split('\n')).rstrip()
59
72
  print(hashlib.sha256((draft + '\n' + surface).encode('utf-8')).hexdigest())
60
73
  " 2>/dev/null
61
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/voice-tone",
3
- "version": "0.5.10",
3
+ "version": "0.5.11-preview.721",
4
4
  "description": "Voice and tone enforcement for user-facing copy",
5
5
  "bin": {
6
6
  "windyroad-voice-tone": "./bin/install.mjs"