Provision the shadowenv Ruby in install-deps and run bundler under it - #69
Merged
Conversation
Headless boxes (CI, runner services) reach `dev install-deps` before any dev.yml command has run CommandRunner's provisioning, and their service PATH has no shadowenv hook — so the builtin neither installed the pinned Ruby nor targeted it: bundle/gem resolved to whatever Ruby the host carried (macOS system 2.6 in the reproducing case). - ShadowenvRuby.ensure!: the guarded provisioned?-then-setup! step, shared by CommandRunner and the up/install-deps builtins. - install_locked_deps provisions the pinned Ruby before installing. - BundlerIntegration and GemSkillLinker run bundle/gem through `shadowenv exec` in the project root, the same env dev.yml commands get. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4 tasks
The suite stubbed ensure_shadowenv_provisioned! everywhere, leaving the switch to the shared guarded helper unexercised (the codecov patch miss). Co-authored-by: Cursor <cursoragent@cursor.com>
The mid-body requires were a hand-rolled cli-kit-style lazy-loading pattern; none of the loaded files are expensive, so the dispatch-cost argument doesn't hold and the org's top-level-requires skill applies. The one deliberate exception stays: Deps::CliUI's `require "cli/ui"` is an optional-gem probe (rescue LoadError with plain-text fallbacks) on the stdlib-only bootstrap chain. Co-authored-by: Cursor <cursoragent@cursor.com>
JPDuchesne
added a commit
that referenced
this pull request
Jul 31, 2026
32e4836 Merge pull request #72 from d3mlabs/jpd/ci-rename 882f47b Rename test.yml to ci.yml and split typecheck into its own job a2dc24c Merge pull request #69 from d3mlabs/jpd/headless-deps-provisioning 7272267 Hoist lazy requires to file tops per top-level-requires 2e53f69 Cover CommandRunner's provisioning delegation to ShadowenvRuby.ensure! dc2942b Provision the shadowenv Ruby in install-deps and run bundler under it 32c59cd Merge pull request #68 from d3mlabs/jpd/caller-pull-request-review 3e59620 Subscribe the ai-flow caller to pull_request_review (submitted) b0822e9 Merge pull request #67 from d3mlabs/ai/58-learnings-index-format-learnings-index-m 7939c97 ai-flow /build: Learnings index format (learnings-index.mdc) + dev repo seeds (RSpock invariant line, gitlink-exclusion learning, architecture section) + capture-learning skill 91ab491 Merge pull request #66 from d3mlabs/jpd/release-abort-on-failure 42376f3 Abort the release when any step fails
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.
Summary
dev install-deps(and theupbuiltin) never provisioned the shadowenv Ruby — that only happened in CommandRunner's pre-exec step for dev.yml commands — andBundlerIntegration/GemSkillLinkershelled out to barebundle/gemon the parent process's PATH. On a headless box (CI, runner service, any shell without the shadowenv hook) that resolves to the host's Ruby: the reproducing case was macOS system Ruby 2.6 failinggem install bundlermid-dev up.ShadowenvRuby.ensure!(guardedprovisioned?→setup!) is shared by CommandRunner andinstall_locked_deps, so the builtins provision the pinned Ruby before installing against it.BundlerIntegrationandGemSkillLinkernow runbundle/gemthroughshadowenv execin the project root — the same environment every dev.yml command gets.This unblocks the ai-flow runner design (d3mlabs/ai-flow sorbet adoption): workflows run
dev install-depsin the.ai-flowcheckout and a fresh box self-provisions Ruby + gems with no manual Ruby prerequisite.Test plan
install-depsprovisions before installing (runner_test), bundler subprocesses run under shadowenv (bundler_integration_test, gem_skill_linker_test),ensure!fast path (shadowenv_ruby_test)dev test: 742 tests, 0 failuresdev tcanddev stylecleanbin/dev install-depsin the ai-flow checkout from a hook-less shell provisions Ruby 3.3.10 + gems;dev checkreports state in syncMade with Cursor