Commit 65a1a1c
fix(logging): name stripControlChars' param for the reference, and TEST the wiring
typescript is the ONE port that already had this right: `Logger.log` calls
`stripControlChars(serialized)` before merging (Logger.ts:339), so the scrub was
genuinely on the emission path. rust, cpp and java each shipped the same function
with ZERO call sites — public, correct, and protecting nothing. This commit does
not change ts behaviour; it closes the two gaps around it.
1. PARAM NAME. The reference's public contract is `strip_control_chars(event_dict)`
(logging_config.py:33); this port recorded `data`. Renamed the parameter to
`eventDict` — the enumerator's camelCase->snake_case fold turns that into
`event_dict`, so the recorded signature now matches the oracle with NO
rename-table entry needed. Verified by regenerating port_signatures.json:
signalwire.core.logging_config [('event_dict', 'any')]
The alternative was a free-function param-rename table, which does not exist in
enumerate-signatures.ts (its rename tables are keyed by CLASS). Renaming in the
port source is the smaller, more honest change: nothing about the reference is
being reconciled away, the port simply says what it means. All three call sites
are positional, so nothing else moved.
2. NO TEST COVERED THE WIRING. The protection was real but unguarded — the exact
state in which rust/cpp/java's scrub rotted into a no-op without any gate
noticing. The new test reads what the logger ACTUALLY emitted (via the existing
console spies) rather than calling stripControlChars directly, so it fails when
the wiring is removed. Verified by deleting the call from Logger.log — RED:
× strips control characters from emitted log data
Tests 1 failed | 48 passed (49)
A helper-only test passes against that same break.
The second test asserts tab/newline/CR SURVIVE: a scrub that ate them would
satisfy "no control chars" while mangling every multi-line message.
Verified: run-tests.sh -> exit 0, 136 files / 2884 tests (2882 before; +2 new).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KKwgPbehDoAMdG3hPL79oi1 parent 740fb79 commit 65a1a1c
3 files changed
Lines changed: 36 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5440 | 5440 | | |
5441 | 5441 | | |
5442 | 5442 | | |
5443 | | - | |
| 5443 | + | |
5444 | 5444 | | |
5445 | 5445 | | |
5446 | 5446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
236 | 239 | | |
237 | | - | |
| 240 | + | |
238 | 241 | | |
239 | | - | |
240 | | - | |
| 242 | + | |
| 243 | + | |
241 | 244 | | |
242 | 245 | | |
243 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
472 | 473 | | |
473 | 474 | | |
474 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
475 | 502 | | |
0 commit comments