fix(compass-agent): keep benign horizontal whitespace in marker rendering (RIG-1544) - #1262
Open
rigel-mintaka wants to merge 2 commits into
Open
rigel-mintaka wants to merge 2 commits into
rigel-mintaka wants to merge 2 commits into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Compass engineering docs preview: https://compass-agent-rig-1544-ask-w.compass-eng-docs.pages.dev Deployed from |
This was referenced Sep 17, 2026
…ring (RIG-1544) `flat` guards a marker LINE against an untrusted value breaking out of it, but it collapsed the whole `Cc`/`Zl`/`Zp`/`\s` class — including ordinary tabs and space runs. Ask content with meaningful internal spacing (aligned columns, code fragments) rendered flattened. Exempt tab and space only. Every control, line separator, paragraph separator, and the remaining `Zs` space separators still collapse: `Zs` matters because U+3000 and NBSP are invisible-wide characters that can forge alignment inside the marker line, and dropping `\s` alone would have re-admitted them. `flat` guards more than asks (forge notification bodies, comments, repo and host names), so the narrowing is deliberately minimal. Co-authored-by: Matt Wilkinson <matt@rigel.build>
…flat`
Review found the class swap silently un-collapsed U+FEFF: JS `\s` matches the
BOM but none of `Cc`/`Zs`/`Zl`/`Zp` do, so an invisible character reached the
marker line and could render two seamless well-fenced records.
Use `\p{Cf}` rather than naming the BOM. It covers the same character plus the
bidi overrides (U+202A-202E, U+2066-2069) and zero-width joiners, none of
which the original guard caught either.
Also bound long tab/space runs: `flat` runs before `flatTrunc`'s 500-char
budget, so a padded value pushed real content past the truncation on review and
comment bodies. A 12-char run collapses; aligned columns and code fragments
are unaffected.
The existing separator test could not fail — it passed against the old regex
too. Both tests now carry a payload that goes red without this fix.
Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-agent/rig-1544-ask-whitespace-fidelity
branch
from
September 17, 2026 02:42
82b7657 to
18fd8fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of a stack containing 3 PRs:
mainflatguards a marker LINE against an untrusted value breaking out of it,but it collapsed the whole
Cc/Zl/Zp/\sclass — including ordinarytabs and space runs. Ask content with meaningful internal spacing (aligned
columns, code fragments) rendered flattened.
Exempt tab and space only. Every control, line separator, paragraph
separator, and the remaining
Zsspace separators still collapse:Zsmatters because U+3000 and NBSP are invisible-wide characters that can forge
alignment inside the marker line, and dropping
\salone would havere-admitted them.
flatguards more than asks (forge notification bodies, comments, repo andhost names), so the narrowing is deliberately minimal.
Co-authored-by: Matt Wilkinson matt@rigel.build