Conversation
krlmlr
added this pull request to stack #256
September 13, 2026 21:48
krlmlr
force-pushed
the
claude/readme-determinism
branch
from
September 13, 2026 21:48
98e4211 to
5ab8900
Compare
This README builds a demo package with `usethis::create_package()` and prints its `DESCRIPTION`, which records whichever roxygen2 created it: `RoxygenNote` on a release build, `Config/roxygen2/version` on a development one. The rendered README therefore depends on the machine that rendered it, not just on this repository. That is invisible today, because nothing re-renders automatically. It stops being invisible once the README render moves into CI: the runner's roxygen2 would decide the line, and every re-render on a differently provisioned machine would rewrite it and commit the churn. The existing `clean_output()` hook already normalises this class of noise -- the random temporary directory, pointer addresses -- so the line is dropped there. The demo package's roxygen2 version is not something this README is demonstrating. The match is deliberately loose. This is a `document` hook, so it runs before the colour is stripped, and the field name arrives wrapped in SGR escapes. Two consecutive renders are byte-identical, as before; what changes is that a render on a machine with a different roxygen2 now agrees too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
`usethis::create_package()` reads `options(usethis.description)`, `cli` renders its check marks according to `cli.unicode`, and the temporary directory reaches the output in more than one spelling. All three made the rendered README depend on the machine that rendered it. - Pin `usethis.description` to the maintainer's `Authors@R` and a `License`, so the demo DESCRIPTION shows what it means to show instead of whatever the rendering session's `.Rprofile` holds. This also drops the `Date:` of the render day and this package's own `URL:`, which that option was contributing to a DESCRIPTION that is not this package's. - Substitute every spelling of the temporary directory, longest first. On macOS `/var` is a symlink to `/private/var`, so usethis prints the unnormalised path on the "Creating" line and the resolved one on "Setting active project"; Windows adds a backslashed spelling. - Pin `cli.unicode`, so a render under a non-UTF-8 locale keeps the Unicode check marks instead of downgrading each of them to `v`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
krlmlr
force-pushed
the
claude/readme-determinism
branch
from
September 14, 2026 05:57
b5c37a0 to
7dd212d
Compare
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.
Replaces #248, which had its head on a fork and so could not join the pull request stack. Same branch, same commits.
This README builds a demo package with
usethis::create_package()and prints itsDESCRIPTION, which records whichever roxygen2 created it:RoxygenNoteon a release build,Config/roxygen2/versionon a development one. The rendered README therefore depends on the machine that rendered it, not just on this repository.I hit this by accident. Re-rendering here produced a hunk that had nothing to do with the change in hand:
That is invisible today, because nothing re-renders automatically. It stops being invisible once the README render moves into CI (cynkra/cynkratemplate#118): the runner's roxygen2 would decide the line, and every re-render on a differently provisioned machine would rewrite it and commit the churn.
The existing
clean_output()hook already normalises exactly this class of noise — the random temporary directory, pointer addresses — so the line is dropped there. The demo package's roxygen2 version is not something this README is demonstrating.The match is deliberately loose: this is a
documenthook, so it runs before the colour is stripped and the field name arrives wrapped in SGR escapes. An anchored pattern matchedREADME.mdand silently missedindex.md.Two consecutive renders are byte-identical, as before. What changes is that a render on a machine with a different roxygen2 now agrees too.
Stacked on #247, which this PR targets.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Generated by Claude Code