Refactor experimental RLM checkout caching#1202
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b0ec724. Configure here.
rasdani
approved these changes
Apr 20, 2026
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.

Description
rlm_refChanges:
verifiers.envs.experimental.utils.git_checkout_cachefor ref resolution, commit-keyed cache materialization, and stale-checkout pruningverifiers.envs.experimental.utils.file_locksfor shared/exclusive path locks during archive creation and cleanuprlm_ref(defaultmain) instead of branch-keyed cache resolutionlocal_checkoutas a validation-only bypass for an existing checkoutComposableEnvarchive creation to hold a shared lock while reading local upload dirsType of Change
Testing
uv run pytestlocally.Checklist
Note
Medium Risk
Changes how git checkouts are mirrored, materialized, and pruned, and adds filesystem locking around uploads; mistakes could cause flaky caching behavior or unintended deletion of cached worktrees. Scope is limited to experimental harness/utilities but touches subprocess/git and concurrency-sensitive paths.
Overview
Refactors experimental RLM checkout resolution to use a new shared
verifiers.envs.experimental.utilspackage, including genericfile_locksand agit_checkout_cachethat maintains a repo mirror plus per-commit worktrees and supports branch/tag/full-SHA refs.Updates the RLM harness API from
rlm_branchtorlm_ref, treatslocal_checkoutas a validation-only bypass, memoizes the resolved checkout per harness instance, and prunes stale cached worktrees when they are not locked for upload.Adds upload-time shared locking in
ComposableEnv._build_dir_archiveto avoid pruning/races while archiving local directories, and expandstest_rlm_composable_env.pyto cover ref-to-commit materialization, per-instance pinning vs. new instance updates, lock-protected stale checkout retention, and GH token redaction on clone errors.Reviewed by Cursor Bugbot for commit 6f0d86b. Bugbot is set up for automated code reviews on this repo. Configure here.