feat(toolchain): add devenv-cli source resolver tool (RIG-2546) - #666
Open
rigel-mintaka wants to merge 1 commit into
Open
feat(toolchain): add devenv-cli source resolver tool (RIG-2546)#666rigel-mintaka wants to merge 1 commit into
rigel-mintaka wants to merge 1 commit into
Conversation
|
Compass engineering docs preview: https://dependencies-rig-2809-devenv.compass-eng-docs.pages.dev Deployed from |
Build tools/toolchain/devenv-cli/, the single place that resolves the devenv CLI source from a named devenv.lock. Parity-gate shape: pure resolution in core.ts (lock JSON -> validated owner/repo/rev -> `github:<owner>/<repo>/<rev>#devenv` flakeref; argv -> parsed request), a thin exec shell in index.ts, unit tests in core.test.ts. Two modes: `--mode flakeref` prints the flakeref (pure, no build/network) for the caller to `nix run`; `--mode bin-dir` runs `nix build --no-link --print-out-paths` and exposes a single-`devenv`-symlink shim dir (RD-3: never the raw closure bin dir, which could shadow the parity-pinned toolchain on PATH). devenvSource() ignores the `dir` field some locks carry (the `#devenv` flake attribute is selected, not a source subdir) and throws loudly on missing node / non-github type / non-40-hex rev, the same fail-loud posture as refresh-devenv-nixpkgs.core.ts. This is RIG-2546 T1, the prerequisite tool; T2/T3 rewire renovate.yml and ci.yml onto it. Register the project in .moon/workspace.yml (explicit map, no glob). Dependency-free (bun/node builtins + ./core only, enforced by a static import-hygiene test). Verified: moon run devenv-cli:ci green (17 tests), tsc clean, biome clean; smoke-tested against both real locks (root -> cachix flakeref, agent-image -> RigelBuild fork flakeref) and error paths (missing lock / bad mode exit 1). Spec-impact: none Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
dependencies/rig-2809-devenv-cli
branch
from
August 27, 2026 03:21
ebae208 to
b6e5582
Compare
rigel-mintaka
marked this pull request as ready for review
August 27, 2026 03:22
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.
Build tools/toolchain/devenv-cli/, the single place that resolves the devenv
CLI source from a named devenv.lock. Parity-gate shape: pure resolution in
core.ts (lock JSON -> validated owner/repo/rev ->
github:<owner>/<repo>/<rev>#devenvflakeref; argv -> parsed request), a thin exec shell in index.ts, unit tests in
core.test.ts.
Two modes:
--mode flakerefprints the flakeref (pure, no build/network) forthe caller to
nix run;--mode bin-dirrunsnix build --no-link --print-out-pathsand exposes a single-devenv-symlink shim dir (RD-3: neverthe raw closure bin dir, which could shadow the parity-pinned toolchain on
PATH). devenvSource() ignores the
dirfield some locks carry (the#devenvflake attribute is selected, not a source subdir) and throws loudly on missing
node / non-github type / non-40-hex rev, the same fail-loud posture as
refresh-devenv-nixpkgs.core.ts.
This is RIG-2546 T1, the prerequisite tool; T2/T3 rewire renovate.yml and
ci.yml onto it. Register the project in .moon/workspace.yml (explicit map, no
glob). Dependency-free (bun/node builtins + ./core only, enforced by a static
import-hygiene test).
Verified: moon run devenv-cli:ci green (17 tests), tsc clean, biome clean;
smoke-tested against both real locks (root -> cachix flakeref, agent-image ->
RigelBuild fork flakeref) and error paths (missing lock / bad mode exit 1).
Spec-impact: none
Co-authored-by: Matt Wilkinson matt@rigel.build
Review disposition (self-review loop — sole review of record)
Two-round
reviewloop (Opus, every lens), all findings dispositioned:nix buildswallowed nix's stderr inbin-dir— addedstdio: ['ignore','pipe','inherit']so the real build diagnostic streams through; stdout stays piped for the out-path capture.revis strict-hex — added charset guards (owner/^[A-Za-z0-9-]+$/,repo/^[A-Za-z0-9._-]+$/) to close a flakeref-reshaping surface (/,#,?, whitespace). Not shell-injectable (arg-array exec), but could redirect the fetch / defeat the#devenvattr selection.owner: "a/b#x") throw tests.import()/require().$GITHUB_PATH, needed post-exit).cachix/devenv,RigelBuild/devenv) confirmed to still resolve under the M2 guards; no regression. The one low (hygiene scan omitted theexport … fromre-export form) fixed post-all-clear (added a fourth regex; verified live it catchesexport */{}/typere-exports).Verified:
moon run devenv-cli:cigreen (20 tests / 26 expect), tsc + biome clean, M2 red-green confirmed. No finding deferred.