Repository navigation
fix(agent): keep the sign-in page template LF on Windows - #1484
Merged
Merged
Conversation
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>
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.
Problem
Scheduled CI has failed since #1447 landed, which keeps #1467 open. On Nov 5 and Nov 6,
agent-full-windowsfailed on the same test: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 namesstyle.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.exefrom master's signed build atc2136a07, 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:
<style>has no\r, and its hash is the allowedbEU9…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.lanes.pyalready classifies this path, so CI needs no change. A root.gitattributesfailstest_every_tracked_file_is_classified_and_ci_yml_matches.Testing
sign_in_page.rs:41:13withstyle. On the LF template it passes.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.rsnext to it still converts, so the rule covers only this file.MAPLE_HOOK_ONLY=repo, 562 tests pass.ci:windowslabel runs the full Windows suite on this PR, and that's the result to check before merging.I scoped the hook to
repobecause 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-helperson an apt CVE.b188b410already 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
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.