Skip to content

docs: Drop the demo package's roxygen2 version from the README - #253

Open
krlmlr wants to merge 2 commits into
claude/sembrfrom
claude/readme-determinism
Open

krlmlr wants to merge 2 commits into
claude/sembrfrom
claude/readme-determinism

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 13, 2026

Copy link
Copy Markdown
Member

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 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.

I hit this by accident. Re-rendering here produced a hunk that had nothing to do with the change in hand:

-#> RoxygenNote: 8.1.0
+#> Config/roxygen2/version: 8.1.0.9000

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 document hook, so it runs before the colour is stripped and the field name arrives wrapped in SGR escapes. An anchored pattern matched README.md and silently missed index.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

@krlmlr
krlmlr added this pull request to stack #256 September 13, 2026 21:48
@krlmlr
krlmlr force-pushed the claude/readme-determinism branch from 98e4211 to 5ab8900 Compare September 13, 2026 21:48
krlmlr and others added 2 commits September 14, 2026 05:56
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
krlmlr force-pushed the claude/readme-determinism branch from b5c37a0 to 7dd212d Compare September 14, 2026 05:57
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.

2 participants