Skip to content

Read the roster lock the same on either line ending - #47

Merged
bitcoinuniverseadmin merged 2 commits into
developfrom
fix/lock-reads-either-line-ending
Aug 31, 2026
Merged

Read the roster lock the same on either line ending#47
bitcoinuniverseadmin merged 2 commits into
developfrom
fix/lock-reads-either-line-ending

Conversation

@bitcoinuniverseadmin

Copy link
Copy Markdown

Found within minutes of #40 merging, by merging a branch on this Windows checkout where git writes CRLF.

The protocol roster gate failed.
  - # Every protocol id this explorer has published. is in PROTOCOL-ROSTER.lock
    but no longer in the pinned manifest.
  - # The gate fails when one of these stops appearing in the pinned manifest, so a
    is in PROTOCOL-ROSTER.lock but no longer in the pinned manifest.
  - # removal has to be a deliberate edit here rather than a quiet absence.
    is in PROTOCOL-ROSTER.lock but no longer in the pinned manifest.

JavaScript counts a carriage return as a line terminator. The dot in /#.*$/ will not cross one, and $ without the multiline flag cannot assert an end after one, so on a CRLF checkout the comment stripper matched nothing and every comment line was read as a protocol id that had gone missing.

node -e "console.log(JSON.stringify('# comment.\r'.replace(/#.*$/, '')))"
"# comment.\r"

Linux CI never sees it, because Linux checkouts are LF. So the gate would have stayed green forever while being unusable for anyone developing on Windows, which is where this repository is developed.

The lock is now normalised before it is parsed, the way every other file this gate reads already is. One case renders the lock with CRLF and asserts the same answer as LF. 25 cases pass.

🤖 Generated with Claude Code

Bitcoin Universe and others added 2 commits August 30, 2026 21:48
Found by merging on a Windows checkout, where git writes CRLF. JavaScript
counts a carriage return as a line terminator, so the dot in `/#.*$/` will
not cross one and `$` cannot assert an end after one. The comment
stripper matched nothing, and the gate reported all three comment lines
of PROTOCOL-ROSTER.lock as protocols that had disappeared:

  # Every protocol id this explorer has published. is in
  PROTOCOL-ROSTER.lock but no longer in the pinned manifest.

Linux CI never saw it, because Linux checkouts are LF, so the gate would
have stayed green while being unusable for anyone developing on Windows.
The lock is normalised before it is parsed, the way every other file this
gate reads already is, and a case renders the lock with CRLF and asserts
the same answer as LF.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bitcoinuniverseadmin
bitcoinuniverseadmin merged commit d924a69 into develop Aug 31, 2026
5 of 11 checks passed
@bitcoinuniverseadmin
bitcoinuniverseadmin deleted the fix/lock-reads-either-line-ending branch August 31, 2026 00:01
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