Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Blanket text normalization can corrupt binary artifacts (nit)

Failure scenario: a future commit adds a binary file (e.g., *.png, *.tgz, *.woff2) and * text=auto eol=lf causes Git to normalize CRLF→LF or treat the blob as text, corrupting the checked-out bytes or the packed npm tarball hash.

The diff adds .gitattributes with * text=auto eol=lf with no binary exceptions. Existing repo contains no binary allowlist and prepareArtifacts hashes tarball bytes exactly. Corrupted checkout would cause manifest shasum/integrity mismatches or broken images/fonts.

Checked: read .gitattributes, listed docs/, grepped for existing binary handling. No counterevidence of *.tgz binary or linguist overrides was found; neighbors ci.yml/publish.yml do not set it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text=auto preserves Git's binary detection; it does not force all files to text. See the documented text=auto behavior: https://git-scm.com/docs/gitattributes#_text . The current package inventory only publishes metadata, README/LICENSE and generated JavaScript/declarations, and tarballs are ignored. No current tracked binary corruption is demonstrated. An exception for a future unusual binary file belongs with that actual file if Git misclassifies it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 New .gitattributes eol=lf normalization can change the working-tree bytes of previously committed files, shifting release tarball bytes (risk)

A fresh checkout of an unchanged commit can now produce different file bytes than before, which directly conflicts with this PR's "exact tarball bytes" guarantee.

Concrete scenario: the new .gitattributes declares * text=auto eol=lf. Any text blob committed before this attribute existed whose content was stored with CRLF endings (or that git's text detection treats differently under the new attribute) will be materialized with LF endings on every subsequent checkout, including the release-preparation and publish checkouts. The tarball is packed from the checked-out working tree, so the same commit can yield different tarball bytes than a checkout made before this attribute existed — invalidating previously recorded prepared-artifact hashes and any byte-level continuity claims in docs/RELEASING.md and docs/BOOTSTRAP.md. It also produces spurious whole-file diffs in developers' working copies.

Evidence: the file is new (* text=auto eol=lf, line 1). I did not get to grep the repository history for CRLF-containing text blobs before the deadline, so the proof gap is whether any pre-existing blob is affected; if none is, the practical cost is zero and this can be closed. The release scripts' byte-precision claims make even the possibility worth checking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked all 45 tracked text blobs at the exact base a444e21: zero contain CRLF. Renormalization produced no application-source diff. The new attribute is itself part of a new commit; fresh checkouts of the old commit do not acquire it. The release guarantee transfers one prepared artifact and compares its exact registry bytes; it does not reuse hashes across different source commits or rebuild old artifacts under changed local configuration. Agent Access is still unpublished. This closes the stated historical-byte proof gap.

26 changes: 26 additions & 0 deletions .github/actions/setup-release-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Set up reviewed release npm
description: Verify and extract the pinned npm CLI without installing project dependencies.
runs:
using: composite
steps:
- name: Verify and extract pinned npm
shell: bash
env:
NPM_VERSION: 11.18.0
NPM_TARBALL_SHA256: 73f6155215ebabf4ed96dca1f567c2372cc713c33af2e5b9b62fde4e92373e2e
run: |
set -euo pipefail
tarball="${RUNNER_TEMP}/npm-${NPM_VERSION}.tgz"
npm_root="${RUNNER_TEMP}/release-npm-${NPM_VERSION}"
curl --fail --silent --show-error --location --retry 3 \
"https://registry.npmjs.org/npm/-/npm-${NPM_VERSION}.tgz" \
--output "${tarball}"
echo "${NPM_TARBALL_SHA256} ${tarball}" | sha256sum --check --strict --quiet
mkdir "${npm_root}"
tar --extract --gzip --file "${tarball}" --directory "${npm_root}"
npm_cli="${npm_root}/package/bin/npm-cli.js"
if [[ "$(node "${npm_cli}" --version)" != "${NPM_VERSION}" ]]; then
echo "::error::The reviewed npm version is not active"
exit 1
fi
printf 'RELEASE_NPM_CLI=%s\nRELEASE_NPM_VERSION=%s\n' "${npm_cli}" "${NPM_VERSION}" >> "${GITHUB_ENV}"
Loading
Loading