Skip to content

Change Control and Reproducible Environments

Regulators and auditors ask a simple question. If we rerun this analysis, do we get the same result, and can you show what was used? For R and Python that means controlling the interpreter version, the package versions, and the system libraries underneath.

Package Manager supports three strategies.1 Most regulated teams combine the second and third.

Strategy Who controls versions Mechanism Strength
Client side Each project renv.lock, requirements.txt against a repository with full history Flexible
Repository versioning Each project, by date Frozen snapshot URL (/cran/2026-06-15) One date pins every package
Locked down repository Admins and QA Curated source with an approved list at a snapshot date Central approval

Frozen snapshots

Every CRAN and PyPI repository in Package Manager can be addressed at a date. Replacing latest with a date freezes the repository at that day:2

https://packagemanager.example.com/cran/__linux__/rhel9/2026-06-15
https://packagemanager.example.com/pypi/2026-06-15/simple

Any install from that URL resolves to the same versions, on any day, on any machine. Pair it with renv for a lockfile per project:

options(repos = c(CRAN = "https://packagemanager.example.com/cran/__linux__/rhel9/2026-06-15"))
renv::init()

Date aliases like this only work for CRAN, Bioconductor, PyPI, and Open VSX sources. For Git, Curated CRAN, CRAN Snapshot, and local sources, a date reflects local sync or build activity, not an upstream release. Package Manager identifies a point in time in these sources with a transaction ID instead.2 Transaction IDs are installation specific, which is one reason Package Manager data must be migrated, not rebuilt, when content depends on them. See Migration.

Curated CRAN: an approved package list

A curated CRAN source serves only the packages (and dependencies) you approve, at the versions from a chosen snapshot date. This is the closest match to a validated package list.3

rspm create source --name=gxp-approved --type=curated-cran
rspm create repo --name=gxp --type=r --description='Validated packages (QA approved)'
rspm subscribe --repo=gxp --source=gxp-approved

The approved list

The approved list is a requirements.txt style file, one package per line, optionally with version constraints:

admiral
dplyr
haven
rtables
survival
xportr

Preview, then commit, against a snapshot date:4

rspm update --source=gxp-approved --file-in=/srv/gxp/requirements-2026Q3.txt --snapshot=2026-06-15
rspm update --source=gxp-approved --file-in=/srv/gxp/requirements-2026Q3.txt --snapshot=2026-06-15 --commit

The dry run shows every package and dependency that will be added. Attach that output to the change record.

rspm update replaces the list

Each rspm update --commit overwrites the source with exactly the packages in the file.4 Previous states stay available at their snapshot URLs, so frozen projects are unaffected. Keep the requirements file under version control as the system of record.

Dependency handling is set when you create the source, not on each update. --include defaults to depends,imports,linking-to; add suggests, or use all, for a broader set. --strict brings back the older snapshot behavior. With it, rspm update aborts when a requested package or version isn't available at the snapshot, instead of warning and skipping it.3

The same pattern exists for Python (curated-pypi) and VS Code extensions (curated-vsx).3

Release cycle

flowchart TD
    Request("Package request<br/>(change request)") --> Assess("Risk assessment<br/>(riskmetric / riskassessment)")
    Assess --> Dev("Add to candidate list<br/>in DEV Package Manager")
    Dev --> Test("OQ / PQ tests on<br/>DEV environment")
    Test --> Approve("QA approval")
    Approve --> Prod("rspm update --commit<br/>on PRD validated repo")
    Prod --> Record("Record snapshot date,<br/>file hash, approvals")

Releasing a few times a year, with emergency releases for security fixes, keeps the burden manageable.

Vulnerability and license blocking

Package Manager can report known vulnerabilities in CRAN, Bioconductor, and PyPI packages, synced from the OSV database.5 Blocklist rules can also block packages by vulnerability, license, or name. Full blocklist rules (name, license, and vulnerability) require the Advanced tier; blocking all known vulnerabilities alone is available at the Enhanced tier.6 Blocking is complementary to curation: curation decides what is allowed, blocking catches what should never be served anywhere.

rspm list blocklist-rules

R, Python, and OS versions

Packages are only half the environment.

Component Control
R Install from Posit's R binaries into /opt/R/<version>; never upgrade in place; retire versions through change control7
Python Same, under /opt/python/<version>
Connect version matching R.VersionMatching = exact and Python.VersionMatching = exact for validated content without a version constraint in its manifest89
System libraries Fixed OS minor release for the qualified period; patch through change control
Workbench sessions Restrict which R versions appear (/etc/rstudio/r-versions) in the validated environment10

Portable (manylinux) R binaries bundle their system libraries, which improves long term reproducibility across OS patches. The tradeoff is that security fixes in those libraries require reinstalling packages.11

Containers

Docker images help, but they are not reproducible by themselves: rebuilding an image that runs install.packages() against latest produces a different image next month. Build images from a frozen snapshot URL or an renv.lock, tag them immutably, and record the image digest in the validation package.

Connect deployments

For validated content on Connect:

  • Publish from a qualified Workbench (or a CI pipeline) using the validated repository
  • Keep enough bundles to reproduce any released version: set Applications.BundleRetentionLimit to match your retention SOP, or 0 (keep all) and manage disk12
  • Record the content GUID, bundle ID, and deployment date in the release record
  • Restrict who can publish to the validated Connect (publisher role only for approved programmers)13