Staged allod tools tree lacks the pr namespace; wrapper clobbers ALLOD_TOOLS_DIR #41

Open
opened 2026-08-19 18:04:13 +01:00 by vnprc-agent · 0 comments

On a freshly rebuilt dev VM, the packaged dispatcher advertises the pr namespace but cannot run it:

$ allod pr
allod: PR explanation tool files not found; set ALLOD_TOOLS_DIR to an allod/tools checkout

Two defects in modules/dev-home-shared.nix:

1. The staged store tree is pm-only. allod-pm-tools copies pm/ and nothing else, but allod pr explain (allod/tools#141, on master since 58fb26c) is a multi-file tool tree with three roots: pr-explain/ (the tool), lib/ (explain sources ../lib/workspace.sh relative to itself), and forge at the tree root (pr_explain_resolve_forge looks for $TOOLS_ROOT/forge by design — allod/tools 3e33a82 — so the separately packaged forge on PATH does not satisfy it). Sketch:

  # `allod pm` and `allod pr` shell out to multi-file tool trees rather than
  # living inline in the `allod` script. Stage those trees into the store so
  # the dispatcher resolves them via ALLOD_TOOLS_DIR and never depends on a
  # live ~/work/allod/tools checkout.
  allodToolsDir = pkgs.runCommandLocal "allod-tools-dir" { } ''
    mkdir -p "$out"
    cp -R ${allod-tools}/pm "$out/pm"
    cp -R ${allod-tools}/pr-explain "$out/pr-explain"
    cp -R ${allod-tools}/lib "$out/lib"
    cp ${allod-tools}/forge "$out/forge"
    chmod +x "$out/pm/pm" "$out/pm/render" "$out/pm/integrity-check" \
      "$out/pr-explain/explain" "$out/pr-explain/validate-report" "$out/forge"
  '';

2. The wrapper clobbers the operator's escape hatch. The dispatcher prelude runs export ALLOD_TOOLS_DIR="${pmTools}" unconditionally, so the error message's own remedy ("set ALLOD_TOOLS_DIR") is impossible to follow with the packaged binary. It should respect an existing value:

        export ALLOD_TOOLS_DIR="''${ALLOD_TOOLS_DIR:-${allodToolsDir}}"

Why this is not urgent (and what keeps VMs working meanwhile): the dispatcher's resolver falls back to $WORK_DIR/allod/tools/pr-explain, so a pulled live checkout unblocks any VM today (cd ~/work/allod/tools && git pull --ff-only). But that fallback is exactly the dependence the staging comment promises to avoid, so the staged tree should be completed. No deploy-side lock movement is needed until this lands; the fix can ride master and reach VMs whenever the archetypes pin next advances (currently held back by the in-progress microvm work).

Acceptance: on a rebuilt VM with ~/work/allod/tools deleted, allod pr explain --dry-run … reaches the consent prompt, and allod pm list still works.

On a freshly rebuilt dev VM, the packaged dispatcher advertises the `pr` namespace but cannot run it: ``` $ allod pr allod: PR explanation tool files not found; set ALLOD_TOOLS_DIR to an allod/tools checkout ``` Two defects in `modules/dev-home-shared.nix`: **1. The staged store tree is pm-only.** `allod-pm-tools` copies `pm/` and nothing else, but `allod pr explain` (allod/tools#141, on master since `58fb26c`) is a multi-file tool tree with three roots: `pr-explain/` (the tool), `lib/` (`explain` sources `../lib/workspace.sh` relative to itself), and `forge` at the tree root (`pr_explain_resolve_forge` looks for `$TOOLS_ROOT/forge` by design — allod/tools `3e33a82` — so the separately packaged `forge` on PATH does not satisfy it). Sketch: ```nix # `allod pm` and `allod pr` shell out to multi-file tool trees rather than # living inline in the `allod` script. Stage those trees into the store so # the dispatcher resolves them via ALLOD_TOOLS_DIR and never depends on a # live ~/work/allod/tools checkout. allodToolsDir = pkgs.runCommandLocal "allod-tools-dir" { } '' mkdir -p "$out" cp -R ${allod-tools}/pm "$out/pm" cp -R ${allod-tools}/pr-explain "$out/pr-explain" cp -R ${allod-tools}/lib "$out/lib" cp ${allod-tools}/forge "$out/forge" chmod +x "$out/pm/pm" "$out/pm/render" "$out/pm/integrity-check" \ "$out/pr-explain/explain" "$out/pr-explain/validate-report" "$out/forge" ''; ``` **2. The wrapper clobbers the operator's escape hatch.** The dispatcher prelude runs `export ALLOD_TOOLS_DIR="${pmTools}"` unconditionally, so the error message's own remedy ("set ALLOD_TOOLS_DIR") is impossible to follow with the packaged binary. It should respect an existing value: ```nix export ALLOD_TOOLS_DIR="''${ALLOD_TOOLS_DIR:-${allodToolsDir}}" ``` **Why this is not urgent (and what keeps VMs working meanwhile):** the dispatcher's resolver falls back to `$WORK_DIR/allod/tools/pr-explain`, so a pulled live checkout unblocks any VM today (`cd ~/work/allod/tools && git pull --ff-only`). But that fallback is exactly the dependence the staging comment promises to avoid, so the staged tree should be completed. No deploy-side lock movement is needed until this lands; the fix can ride master and reach VMs whenever the archetypes pin next advances (currently held back by the in-progress microvm work). Acceptance: on a rebuilt VM with `~/work/allod/tools` **deleted**, `allod pr explain --dry-run …` reaches the consent prompt, and `allod pm list` still works.
Sign in to join this conversation.
No description provided.