[PR #4440] [CLOSED] build(nix): add a pinned development shell #6244

Closed
opened 2026-10-31 01:12:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4440
Author: @Dementor430
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: build/nix-dev-shell


📝 Commits (3)

  • 6625bca build(nix): add a pinned development shell
  • f272aba build(nix): limit procps and util-linux to Linux
  • f2a1c08 Update shell.nix

📊 Changes

2 files changed (+93 additions, -0 deletions)

View changed files

📝 CONTRIBUTING.md (+8 -0)
➕ shell.nix (+85 -0)

📄 Description

Summary

Adds an optional, pinned Nix development shell (shell.nix) so contributors using Nix get the toolchain from .nvmrc and package.json#packageManager without nvm, and can opt into the bring-your-own providers for local verification. No linked issue; this is a small development-tooling addition.

Problem and expected behavior

Contributors on Nix (including setups without channels, where <nixpkgs> does not resolve) have no reproducible way to get Node.js 24 with npm 11.16.0, nor the provider tools that real-provider checks need. With this change:

  • nix-shell provides Node.js 24, npm 11.16.0 (packaged from the npm registry tarball, since nixpkgs ships a newer npm), Python 3, Git, procps (ps for the Linux owned-process prerequisite) and util-linux (prlimit), and runs npm ci when node_modules is missing. If node_modules exists but scripts/check-dependency-install.mjs reports it stale, it prints a hint instead of reinstalling.
  • nix-shell --arg withProviders true additionally provides JDK 21, Ghidra 12.1.4, the pinned jadx-headless-mcp-0.7.1-all.jar (fetched with the SHA-256 from docs/android-analysis.md), Binwalk 3.1.0 and Unblob 26.6.4, and exports GHIDRA_INSTALL_DIR, JAVA_HOME, REA_JADX_MCP_JAR, REA_BINWALK_COMMAND, REA_UNBLOB_COMMAND and REA_FIRMWARE_PRLIMIT_COMMAND.

Change and scope

  • shell.nix: nixpkgs is pinned to a fixed nixos-unstable revision via fetchTarball with a content hash (nixos-26.05 only has Ghidra 12.0.x; the docs require 12.1.x).
  • CONTRIBUTING.md: one paragraph in the development setup section.

Intentionally not included: a flake, CI wiring, and any change to rea setup or packaging. The shell is development tooling only; REA's installers and its bring-your-own provider policy are unchanged.

Open design question for maintainers: the shell hook runs npm ci automatically when node_modules is missing. Happy to change that to a hint only if preferred.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: development environment only (repository root shell.nix); no source changes.
  • Contribution scope fit and linked maintainer decision: development tooling; no new provider or capability, so not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none at runtime. The provider shell supplies provider binaries for local development only.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none. shell.nix is not in package.json#files.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

(Entering the shell downloads nixpkgs, npm, the JADX JAR and npm dependencies from their registries; it does not interact with analysis targets.)

Evidence and regression coverage

  • Tests added or updated: none (development tooling).
  • Base reproduction or other evidence: executed on Ubuntu 24.04 under WSL2, Nix 2.33.3, x86_64-linux, based on 781d575; see Validation performed.
  • User-visible CLI/MCP output (if applicable): not applicable.
  • Remaining proof gaps:
    • Not run on NixOS itself. npm installs prebuilt native binaries (for example oxlint, oxfmt, turbo, esbuild, node-pty) that expect a standard dynamic loader; on NixOS these likely need nix-ld or similar. Not verified.
    • Not run on macOS or aarch64-linux; whether every provider package in the pinned revision supports those platforms is not verified.
    • Hopper and IDA are not provided (proprietary).

Validation performed

  • nix-instantiate --parse shell.nix — parses.
  • nixfmt shell.nix (nixfmt 1.5.0) — no changes.
  • rm -rf node_modules && nix-shell — hook ran npm ci (548 packages); node --version v24.21.0, npm --version 11.16.0.
  • npm run build:cached — succeeded.
  • npm run check:fast — 2/2 tasks successful; the pre-push hook also passed.
  • npx oxfmt --check CONTRIBUTING.md — correctly formatted.
  • npm run docs:check — passed, including tests/conformance/readmeConsistency.test.ts (5 tests).
  • npm run test:python — 35 and 71 tests OK.
  • nix-shell --arg withProviders true --run 'node scripts/rea.mjs doctor --json' — node, ghidra, ghidra-version (12.1.4), ghidra-headless, ghidra-native_decompiler, ghidra-java (JDK 21.0.12.1) and jadx checks all pass.
  • In the provider shell, binwalk --version reports binwalk 3.1.0 and unblob --version reports 26.6.4; both were also used successfully on a firmware image during local work.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: real Ghidra 12.1.4 and JADX bridge checked via rea doctor on x86_64 Linux (WSL2); no Ghidra analysis lane was run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: the shell only adds tools to PATH and exports provider variables within the shell session; nothing is installed system-wide. All downloads are pinned by hash (nixpkgs tarball, npm tarball, JADX JAR).

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4440 **Author:** [@Dementor430](https://github.com/Dementor430) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `build/nix-dev-shell` --- ### 📝 Commits (3) - [`6625bca`](https://github.com/morluto/rea/commit/6625bca5985536286da956c3f7cfd66534bb794c) build(nix): add a pinned development shell - [`f272aba`](https://github.com/morluto/rea/commit/f272abad4f3c4f2d0fc457df8d3ee27b3fb6fa5a) build(nix): limit procps and util-linux to Linux - [`f2a1c08`](https://github.com/morluto/rea/commit/f2a1c08eb9f320b898ee55803726bebf8001a326) Update shell.nix ### 📊 Changes **2 files changed** (+93 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTING.md` (+8 -0) ➕ `shell.nix` (+85 -0) </details> ### 📄 Description ## Summary Adds an optional, pinned Nix development shell (`shell.nix`) so contributors using Nix get the toolchain from `.nvmrc` and `package.json#packageManager` without nvm, and can opt into the bring-your-own providers for local verification. No linked issue; this is a small development-tooling addition. ## Problem and expected behavior Contributors on Nix (including setups without channels, where `<nixpkgs>` does not resolve) have no reproducible way to get Node.js 24 with npm 11.16.0, nor the provider tools that real-provider checks need. With this change: - `nix-shell` provides Node.js 24, npm 11.16.0 (packaged from the npm registry tarball, since nixpkgs ships a newer npm), Python 3, Git, procps (`ps` for the Linux owned-process prerequisite) and util-linux (`prlimit`), and runs `npm ci` when `node_modules` is missing. If `node_modules` exists but `scripts/check-dependency-install.mjs` reports it stale, it prints a hint instead of reinstalling. - `nix-shell --arg withProviders true` additionally provides JDK 21, Ghidra 12.1.4, the pinned `jadx-headless-mcp-0.7.1-all.jar` (fetched with the SHA-256 from `docs/android-analysis.md`), Binwalk 3.1.0 and Unblob 26.6.4, and exports `GHIDRA_INSTALL_DIR`, `JAVA_HOME`, `REA_JADX_MCP_JAR`, `REA_BINWALK_COMMAND`, `REA_UNBLOB_COMMAND` and `REA_FIRMWARE_PRLIMIT_COMMAND`. ## Change and scope - `shell.nix`: nixpkgs is pinned to a fixed nixos-unstable revision via `fetchTarball` with a content hash (nixos-26.05 only has Ghidra 12.0.x; the docs require 12.1.x). - `CONTRIBUTING.md`: one paragraph in the development setup section. Intentionally not included: a flake, CI wiring, and any change to `rea setup` or packaging. The shell is development tooling only; REA's installers and its bring-your-own provider policy are unchanged. Open design question for maintainers: the shell hook runs `npm ci` automatically when `node_modules` is missing. Happy to change that to a hint only if preferred. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. ## Contract and boundary impact - Semantic owner and earliest changed stage: development environment only (repository root `shell.nix`); no source changes. - Contribution scope fit and linked maintainer decision: development tooling; no new provider or capability, so not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: none at runtime. The provider shell supplies provider binaries for local development only. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. `shell.nix` is not in `package.json#files`. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. (Entering the shell downloads nixpkgs, npm, the JADX JAR and npm dependencies from their registries; it does not interact with analysis targets.) ## Evidence and regression coverage - Tests added or updated: none (development tooling). - Base reproduction or other evidence: executed on Ubuntu 24.04 under WSL2, Nix 2.33.3, x86_64-linux, based on `781d575`; see Validation performed. - User-visible CLI/MCP output (if applicable): not applicable. - Remaining proof gaps: - Not run on NixOS itself. npm installs prebuilt native binaries (for example oxlint, oxfmt, turbo, esbuild, node-pty) that expect a standard dynamic loader; on NixOS these likely need `nix-ld` or similar. Not verified. - Not run on macOS or aarch64-linux; whether every provider package in the pinned revision supports those platforms is not verified. - Hopper and IDA are not provided (proprietary). ## Validation performed - `nix-instantiate --parse shell.nix` — parses. - `nixfmt shell.nix` (nixfmt 1.5.0) — no changes. - `rm -rf node_modules && nix-shell` — hook ran `npm ci` (548 packages); `node --version` v24.21.0, `npm --version` 11.16.0. - `npm run build:cached` — succeeded. - `npm run check:fast` — 2/2 tasks successful; the pre-push hook also passed. - `npx oxfmt --check CONTRIBUTING.md` — correctly formatted. - `npm run docs:check` — passed, including `tests/conformance/readmeConsistency.test.ts` (5 tests). - `npm run test:python` — 35 and 71 tests OK. - `nix-shell --arg withProviders true --run 'node scripts/rea.mjs doctor --json'` — `node`, `ghidra`, `ghidra-version` (12.1.4), `ghidra-headless`, `ghidra-native_decompiler`, `ghidra-java` (JDK 21.0.12.1) and `jadx` checks all pass. - In the provider shell, `binwalk --version` reports `binwalk 3.1.0` and `unblob --version` reports `26.6.4`; both were also used successfully on a firmware image during local work. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: real Ghidra 12.1.4 and JADX bridge checked via `rea doctor` on x86_64 Linux (WSL2); no Ghidra analysis lane was run. - Package or release metadata impact: none. - Security, privacy, process, or containment review: the shell only adds tools to `PATH` and exports provider variables within the shell session; nothing is installed system-wide. All downloads are pinned by hash (nixpkgs tarball, npm tarball, JADX JAR). ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: <!-- @GitHub-handle --> - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6244
No description provided.