Skip to content

fix(messages): remove baked source indentation from lost string continuations - #531

Draft
MichaelTaylor3d wants to merge 3 commits into
mainfrom
loop/526-lost-continuations
Draft

fix(messages): remove baked source indentation from lost string continuations#531
MichaelTaylor3d wants to merge 3 commits into
mainfrom
loop/526-lost-continuations

Conversation

@MichaelTaylor3d

@MichaelTaylor3d MichaelTaylor3d commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

DO NOT MERGE — gate round has not returned.

Closes #526

The defect

A Rust string literal continued with a trailing \ renders correctly. When that backslash is
lost — cargo fmt rejoining it, or a regex repair — the literal keeps the source's leading
indentation
, so the emitted text carries a 14-22 space run in the middle of a sentence. It
compiles, every test stays green, and the mangled and correct forms are indistinguishable in a
normal diff. The only witness is a person reading the emitted text.

Two corrections to the ticket, both measured

The two guards #526 says already pin this class do not exist.
every_operator_facing_line_reads_as_a_sentence and the_refusal_messages_read_as_sentences
return zero hits repo-wide. #501 is still OPEN — its repairs and guards are on its branch,
not on origin/main. The ticket was written against that branch's state as though it had merged.

The count is eight, not seven. service.rs:1692 is an operator-facing WARN carrying two
18-space runs. It sits inside a multi-line literal, which is why a line-oriented sweep does
not see it.

Sites fixed — 8 sites, 11 space runs

site runs surface
pairing.rs:146 2 x 18 JSON-RPC error body returned to a client
service.rs:1692 2 x 18 operator-facing WARN (not in the ticket)
cli.rs:255 2 x 22 test assertion message
meta.rs:1751 1 x 22 test assertion message
service.rs:2630 1 x 22 test assertion message
control.rs:6081 1 x 14 test assertion message
logging.rs:261 1 x 14 assertion message of the guard for this very class
meta.rs:1743 1 x 14 test assertion message

Fixed with concat!, never by re-wrapping — re-wrapping is what caused every one of these,
and cargo fmt would do it again. No message is reworded; only the space run is removed.

Deliberately out of scope

Six live sites in mirror/advertise.rs (:94, :97, :116 — three of them production
tracing output
), mirror/pass.rs (:794, :1067) and mirror/runner.rs (:1374).
Open PR #501 changes all four of those files; repairing them from here would duplicate that
work and conflict. Recorded on #501 instead. The guard carries a named mirror/ exclusion
citing #501, to be deleted when it merges — at which point the guard holds those sites too.

The guard

A source scan, not a const-set walk: six of the eight sites are inline test assertion messages
that no const-set walk can reach without hoisting them. It skips comment lines structurally
(never by rewording, which would just move the trap to the next author), ignores leading
indentation, and refuses any run of 2+ spaces or any control character inside a literal.

The existing reference — wallet_env.rs:608 the_announcements_have_no_lost_string_continuation — is too weak on all three of the ticket's
acceptance points: it tests contains(" ") (four spaces, so it misses a 2- or 3-space
run), asserts no count, and has no non-vacuity control. This guard asserts a floor on files
scanned, so a scan that reads nothing FAILS rather than passes.

pairing.rs:146's corrected body is asserted through the JSON-RPC error path a client
receives
, not at the literal.

Blast radius

Message text only — no control flow, no signature, no wire shape. The one exclusion that is a
judgement call rather than a fact is service.rs's sc qc output fixture, which must stay
byte-identical to real sc.exe output.

Lane anchor for #526. Bumps the workspace version
so the branch exists on the remote before any implementation work, per
the push-early rule -- a session that dies mid-task must not lose state.

Co-Authored-By: Claude <noreply@anthropic.com>
MichaelTaylor3d and others added 2 commits September 3, 2026 05:35
…ard (WIP)

Uncommitted work from the dead lane on #526, committed as-is so it
survives; compile + guard-coverage verification follow.

Co-Authored-By: Claude <noreply@anthropic.com>
…52.82)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lost \ string continuations still bake source indentation into seven shipped messages

1 participant