Commit fe3a98b
committed
fix(placeholders): extract apmInputPrefix constant, consistent double-guard, and complete docs
- Extract apmInputPrefix = "${input:" constant to eliminate literal triplication at lines
84/112/149 and avoid silent skew if the prefix ever changes
- Apply consistent double-guard (Contains + MatchString) in MaskBodyTokens and
stripBodyTokens to match ContainsBodyToken, avoiding wasted regex work on malformed
prefixes like "${input:}" and closing the maintenance trap
- Remove WHAT comments on apmInputRe (CLAUDE.md: comment only when WHY is non-obvious)
- Add "malformed prefix unchanged" test case to drive the Contains guard red/green
- Add apm-input-token to MDS003 and MDS027 rows in opt-in rules table (both rules call
ContainsBodyToken which handles APMInputToken, so the table omission was misleading)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Cua8NLiPy6fhj58LvUWf11 parent b3647e8 commit fe3a98b
3 files changed
Lines changed: 9 additions & 7 deletions
File tree
- docs/background/concepts
- internal/placeholders
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| |||
0 commit comments