Skip to content

fix(compass-agent): keep benign horizontal whitespace in marker rendering (RIG-1544) - #1262

Open
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-agent/rig-1544-ask-whitespace-fidelity
Open

rigel-mintaka wants to merge 2 commits into
mainfrom
compass-agent/rig-1544-ask-whitespace-fidelity

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 3 PRs:

  1. main
  2. "fix(compass-agent): keep benign horizontal whitespace in marker rendering (RIG-1544)" (this PR)
  3. docs(compass): describe the agent's real session protocol, not ACP (RIG-1329) #1266
  4. ci(dogfood-e2e): hand the file-command files to podman instead of a+rw (RIG-2131) #1267

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

@trunk-io

trunk-io Bot commented Sep 17, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

RIG-1544

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-agent-rig-1544-ask-w.compass-eng-docs.pages.dev

Deployed from compass-agent/rig-1544-ask-whitespace-fidelity at 18fd8fe.

rigel-mintaka and others added 2 commits September 16, 2026 22:40
…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
rigel-mintaka force-pushed the compass-agent/rig-1544-ask-whitespace-fidelity branch from 82b7657 to 18fd8fe Compare September 17, 2026 02:42
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.

1 participant