Skip to content

fix(probe): correct command-default-location flag, owner-only probe umask, robust binary resolution - #4

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/probe-flag-and-binary-resolution
Aug 4, 2026
Merged

fix(probe): correct command-default-location flag, owner-only probe umask, robust binary resolution#4
rldyourmnd merged 1 commit into
mainfrom
fix/probe-flag-and-binary-resolution

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Problem

install-cli failed on the pinned 2470.4 release with:

no such option --command-default-locations

Root cause — three independent defects

  1. Wrong CLI flag form. The probe and launch flag builder used --command-default-locations (plural), but Junie accepts --command-default-location (singular) for commands (config/mcp/skill/model stay plural). Verified against junie --help on 2470.4.

  2. Probe runtime state not private. Junie is a JVM app that writes ~/.junie under the isolated probe HOME. Under an ambient umask that state is not private and require_private_directory rejected it.

  3. resolve_junie_binary not robust. When versions/<v>/junie is the launcher script (a regular file), lstat on versions/<v>/junie/bin/junie raises NotADirectoryError, which escaped the candidate loop (it only caught FileNotFoundError).

Fix

  1. Use --command-default-location (singular) in the probe and the launch flag builder.
  2. Run the probe under an owner-only umask (0o077) via preexec_fn.
  3. Catch NotADirectoryError in the candidate loop so the launcher-script candidate is tried.

Verification

install-cli --target <isolated-target> --json
# { "software": { "version": "2470.4", "state": "installed" }, "software_changed": true }
A matching control-plane test (test_junie_cli_runtime_launch.py argv expectation) is updated in a separate commit. Two pre-existing failures on clean `main` (anchor split inode, bootstrap residue under non-sticky temp) are unchanged.

…mask, robust binary resolution

Three independent defects in install-cli's stage version probe and binary
resolution, all blocking install-cli on the pinned 2470.4 release:

1. The probe passed --command-default-locations (plural), which Junie's CLI
   does not accept. The supported flag is --command-default-location
   (singular) for commands, while config/mcp/skill/model stay plural. The
   probe and the launch flag builder both used the plural form, so the probe
   exited non-zero with 'no such option --command-default-locations'.

2. Junie is a JVM app that writes runtime state (~/.junie) under the
   isolated probe HOME. Under an ambient umask (e.g. 022) that state is not
   private, and require_private_directory rejected it. Run the probe under
   an owner-only umask (0o077) via preexec_fn so anything Junie creates is
   already private.

3. resolve_junie_binary only caught FileNotFoundError when probing candidate
   paths. When versions/<v>/junie is the launcher script (a regular file),
   lstat on versions/<v>/junie/bin/junie raises NotADirectoryError, which
   escaped the loop and crashed install-cli. Catch NotADirectoryError too so
   the next candidate (the launcher itself) is tried.
@rldyourmnd
rldyourmnd merged commit 7c3c937 into main Aug 4, 2026
6 checks passed
@rldyourmnd
rldyourmnd deleted the fix/probe-flag-and-binary-resolution branch August 4, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant