Skip to content

docs(AGENTS): fix reproducibility guidance (sandbox sets SOURCE_DATE_EPOCH) - #266

Merged
bryan-minimal merged 1 commit into
mainfrom
bryan/agents-repro-wording
Jun 18, 2026
Merged

docs(AGENTS): fix reproducibility guidance (sandbox sets SOURCE_DATE_EPOCH)#266
bryan-minimal merged 1 commit into
mainfrom
bryan/agents-repro-wording

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Jun 17, 2026

Copy link
Copy Markdown
Member

What

Corrects the Reproducibility (required) guidance added in #259, which had two factual errors and one framing issue that caused real fallout.

Why

The build sandbox already exports SOURCE_DATE_EPOCH=0 and PYTHONHASHSEED=0, and minimal-check's build script disallowed-patterns checker actively rejects re-setting them in a build.sh. But the merged guidance said the opposite:

  • It claimed "the sandbox does not pin the clock" — false.
  • It told authors to export SOURCE_DATE_EPOCH=0 (and PYTHONHASHSEED=0) — which fails CI.

This already bit us: the nspr reproducibility PR followed the guidance, added export SOURCE_DATE_EPOCH=0, and failed minimal-check. CodeRabbit also cited the guidance to (incorrectly) request the same export on an unrelated PR.

A secondary issue: the bullets read as a universal checklist, so the C/autotools items (e.g. libtool .la cleanup) got applied to non-C packages.

Changes

  • State that the sandbox provides SOURCE_DATE_EPOCH=0 / PYTHONHASHSEED=0 and must not be set in build.sh.
  • Replace the "export SOURCE_DATE_EPOCH=0" bullet with the correct pattern for builds that ignore SOURCE_DATE_EPOCH: pin the specific stamp (with nspr's SH_DATE/SH_NOW as the worked example).
  • Fold the libtool .la cleanup into the C/C++ bullet (where it belongs) and make explicit that authors apply only the bullet for their build system, not all of them.

🤖 Generated with Claude Code

Summary by CodeRabbit

Documentation

  • Updated build determinism and reproducibility guidance with clarified environment variable configuration in the build sandbox
  • Refined C/C++ build recipes with improved cleanup procedures for better reproducibility
  • Expanded recommendations for projects with embedded timestamps, including practical implementation examples

…_EPOCH

The sandbox already exports SOURCE_DATE_EPOCH=0 and PYTHONHASHSEED=0, and
minimal-check's disallowed-patterns checker rejects re-setting them. The
guidance from #259 wrongly told authors to export them (and claimed the
sandbox does not pin the clock), which made the nspr repro PR fail CI.

- State the sandbox provides both; do not set them in build.sh.
- Replace the bad export bullet with the correct pattern (pin the
  specific stamp; nspr SH_DATE/SH_NOW as the example).
- Fold libtool .la cleanup into the C/C++ bullet; make explicit that
  authors apply only the bullet for their build system.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d5d39b1b-aca6-4a2c-8d92-9a5eea03bd4c

📥 Commits

Reviewing files that changed from the base of the PR and between 8144780 and 7c18e0b.

📒 Files selected for processing (1)
  • AGENTS.md

📝 Walkthrough

Walkthrough

Updates the "Reproducibility (required)" section of AGENTS.md to note that the build sandbox already exports SOURCE_DATE_EPOCH=0 and PYTHONHASHSEED=0 and that minimal-check rejects user-set duplicates. Folds *.la libtool archive removal into the C/C++ recipe and replaces the old embedded-timestamps bullet with wall-clock bake-in guidance including an nspr pinning example.

Changes

Determinism documentation update

Layer / File(s) Summary
Sandbox env vars, build recipes, and embedded timestamp guidance
AGENTS.md
Preface updated to document sandbox-exported SOURCE_DATE_EPOCH=0/PYTHONHASHSEED=0 and minimal-check rejection of user re-setting. *.la removal added to the C/C++ autotools recipe. Old "Embedded timestamps" bullet removed; replaced with guidance for builds that bake wall-clock time despite SOURCE_DATE_EPOCH, with an nspr stamp-variable pinning example.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • gominimal/pkgs#259: Directly overlaps — also a documentation-only edit to AGENTS.md's determinism guidance covering the same SOURCE_DATE_EPOCH/PYTHONHASHSEED embedded-timestamps and C/C++ libtool .la cleanup recipe details.

Suggested reviewers

  • msample
  • norrietaylor

Poem

🐇 A sandbox already knows the time is zero,
No need to set what's set — the build's the hero!
Libtool archives? Delete them with glee,
And nspr stamps pinned for reproducibility.
The rabbit hops on, deterministic and free! 🏗️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: correcting reproducibility guidance documentation by clarifying that the sandbox already sets SOURCE_DATE_EPOCH.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bryan/agents-repro-wording

Comment @coderabbitai help to get the list of available commands and usage tips.

@edge-delta edge-delta Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good fix — the old guidance was actively causing CI failures and confusing both humans and bots. The factual corrections and the "only apply your bullet" framing are solid improvements.\n\nLeft two minor nits on the nspr example bullet (clarity, not correctness). Neither is a blocker.

Comment thread AGENTS.md
Comment on lines +658 to +661
- **A build that bakes in its own wall-clock time** despite `SOURCE_DATE_EPOCH` (version
strings, generated headers): pin that specific stamp rather than re-exporting
`SOURCE_DATE_EPOCH`. For example `nspr` overrides the make variables its version header
is generated from (`SH_DATE` from `$SOURCE_DATE_EPOCH`, `SH_NOW=` to omit the build time).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: The other bullets show the exact flags/exports to paste into build.sh, but this one describes the strategy without a concrete snippet. A one-liner example (even pseudo-code) would make it as copy-pasteable as the rest:

# nspr example: derive SH_DATE from the sandbox-provided epoch; suppress SH_NOW
make SH_DATE="$(date -u -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %T')" SH_NOW= ...

Optional — the prose is accurate as-is, but the worked example would lower the bar for new contributors.

Comment thread AGENTS.md
- **A build that bakes in its own wall-clock time** despite `SOURCE_DATE_EPOCH` (version
strings, generated headers): pin that specific stamp rather than re-exporting
`SOURCE_DATE_EPOCH`. For example `nspr` overrides the make variables its version header
is generated from (`SH_DATE` from `$SOURCE_DATE_EPOCH`, `SH_NOW=` to omit the build time).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ultra-nit: `SH_NOW=` reads as if the value was accidentally omitted. Consider `SH_NOW=""` (or `SH_NOW=` (empty)) to make it visually explicit that the empty string is intentional, not a typo. Readers unfamiliar with nspr's Makefile may stumble here.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit b265510 Jun 18, 2026
4 checks passed
@bryan-minimal
bryan-minimal deleted the bryan/agents-repro-wording branch June 18, 2026 17:33
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