Skip to content

fix(agent): keep the sign-in page template LF on Windows - #1484

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-crlfpage-maple
Nov 6, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-crlfpage-maple

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Scheduled CI has failed since #1447 landed, which keeps #1467 open. On Nov 5 and Nov 6, agent-full-windows failed on the same test:

sign_in_page::tests::the_security_policy_allows_the_pages_own_script_and_style
panicked at crates\maple-agent\src\sign_in_page.rs:41:13: style

Root cause

The test hashes the template's raw bytes, but browsers don't. Windows Git converts the template to CRLF on checkout, which changes the hash of the multi-line <style> block. The <script> block is one line, so it still matches, and that's why the panic only names style.

Users are not affected

Windows builds do embed the CRLF bytes, but the page still loads its styles. I found the CRLF style block in maple-agent.exe from master's signed build at c2136a07, with a raw hash the policy doesn't list. That looked like a product bug until I tested it in a browser.

I served the real template with its real CSP header in Chromium 152:

Variant Result
LF bytes Hash allowed
CRLF bytes, the Windows build Styled, no CSP error. The parsed <style> has no \r, and its hash is the allowed bEU9…
Control, style text changed Blocked with a CSP error, so the policy was being enforced

The HTML parser normalizes newlines before the browser hashes the element's text. Only Chromium was tested; other browsers should behave the same, since this comes from the HTML and CSP specs. So this PR doesn't need to reach users urgently, but the Windows CI failure is real.

Fix

Add apps/maple-agent/.gitattributes, pinning this one template to LF in every checkout. Every OS then embeds the bytes the hash was computed from, and the test stays strict.

  • Why not change the test: hashing normalized text would also work, but it would leave Windows embedding different bytes from every other OS.
  • Why not a repo-wide rule: nothing else needs it, and it would change the checked-out bytes of every text file on Windows.
  • Why in the Agent tree: lanes.py already classifies this path, so CI needs no change. A root .gitattributes fails test_every_tracked_file_is_classified_and_ci_yml_matches.

Testing

  • Real test, this Mac: on a temporary CRLF template it panics at the same sign_in_page.rs:41:13 with style. On the LF template it passes.
  • Checkout with core.autocrlf=true: master gives 63 of 63 CRLF lines and the disallowed hash. This branch gives 0 of 63 and the allowed hash. sign_in_page.rs next to it still converts, so the rule covers only this file.
  • Repo checks: MAPLE_HOOK_ONLY=repo, 562 tests pass.
  • Windows: not yet proven. The ci:windows label runs the full Windows suite on this PR, and that's the result to check before merging.

I scoped the hook to repo because the Agent tests can't pass on this Mac until #1460 is fixed. This commit doesn't change any compiled bytes on macOS or Linux, and the PR's Agent lanes still run.

Other failures in #1467

Nov 5 also failed os-helpers on an apt CVE. b188b410 already fixed that, and those jobs passed on Nov 6. I left the closing keyword off this PR so the nightly report closes #1467 after a green night.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The nightly Windows suite fails the sign-in page's CSP test. The test
hashes the template's raw bytes, and Windows checkouts convert them to
CRLF, so its multi-line style block no longer matches the pinned hash.
Browsers normalize newlines before hashing, so the page itself still
loads its styles; only the test was wrong. Pin this one file to LF in
every checkout, so each OS embeds the bytes the hash was computed from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnthonyRonning AnthonyRonning added the ci:windows Run Windows checks on this PR label Nov 6, 2026
@AnthonyRonning
AnthonyRonning merged commit f690997 into master Nov 6, 2026
25 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-crlfpage-maple branch November 6, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:windows Run Windows checks on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly CI failures

1 participant