Skip to content

[TICK 14-001] Add fava-trails install-jj subcommand - #7

Merged
timeleft-- merged 5 commits into
mainfrom
builder/tick-14-tick-001-jj-auto-install
Feb 27, 2026
Merged

timeleft-- merged 5 commits into
mainfrom
builder/tick-14-tick-001-jj-auto-install

Conversation

@timeleft--

Copy link
Copy Markdown
Member

Summary

  • Adds fava-trails install-jj CLI subcommand that downloads and installs the JJ binary (Linux x86_64/aarch64, macOS x86_64/arm64), eliminating the adoption cliff between pip install fava-trails and a working system
  • Updates all "jj not found" error messages in cli.py, jj_backend.py, and conftest.py to reference fava-trails install-jj instead of the non-packaged scripts/install-jj.sh
  • Adds 6 new tests; all 187 tests pass

Implementation Details

  • Platform check first: Windows prints winget install Jujutsu.Jujutsu and exits
  • Version-aware skip: exits 0 if installed version already matches target
  • --version flag to pin a specific JJ release
  • Safe tarball extraction via extractfile() + manual write (no tf.extract() path traversal risk)
  • Download uses urlopen(timeout=30) — no hanging on poor networks
  • Filesystem errors wrapped with actionable messages
  • Post-install PATH check with shell snippet if ~/.local/bin is not in PATH
  • Zero new PyPI dependencies (stdlib only)

Test plan

  • test_install_jj_skips_if_version_matches — already-installed short-circuit
  • test_install_jj_unsupported_platform — Windows winget guidance
  • test_install_jj_unsupported_arch — unsupported Linux arch exits 1
  • test_install_jj_downloads_and_installs — full download+extract+install flow
  • test_install_jj_custom_version — --version flag changes download URL
  • test_install_jj_in_help — subcommand appears in --help output
  • Existing test_doctor_missing_jj updated for new error text
  • Full suite: 187 tests pass

🤖 Generated with Claude Code

timeleft-- and others added 5 commits February 27, 2026 13:12
Closes the adoption cliff between `pip install fava-trails` and a working
system by adding a CLI subcommand that downloads the JJ binary from GitHub
releases. Updates all error messages to reference the new command.

Reviewed by Gemini 3 Pro — incorporated version-aware upgrades, Windows
winget detection, and post-install PATH verification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
codev/ was wiped in Spec 16 Phase 2 (git history rewrite for OSS launch).
Reinstalled via `codev update` to enable TICK builder spawning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@timeleft--

Copy link
Copy Markdown
Member Author

Architect Review

Risk: Low — ~275 LOC of implementation across 4 source files (cli.py, jj_backend.py, conftest.py, test_cli.py). Remaining 90+ files are codev protocol templates from codev update.

Assessment: Clean implementation that follows existing cli.py patterns.

Security:

  • Safe tarball extraction via extractfile() + manual write (no tf.extract() path traversal)
  • Download URL hardcoded to official github.com/jj-vcs/jj/releases
  • Default urllib SSL verification, timeout=30 on download
  • No hash verification on downloaded binary — acceptable for v1, worth adding in a follow-up

Code quality: Good error handling with actionable messages, proper platform detection, version-aware skip. Tests mock correctly with no network calls.

Follow-up suggestion: Add SHA256 checksum verification for downloaded tarballs in a future TICK.

APPROVE — builder may merge.


Architect review

@timeleft--
timeleft-- merged commit 7f77085 into main Feb 27, 2026
0 of 2 checks passed
@timeleft--
timeleft-- deleted the builder/tick-14-tick-001-jj-auto-install branch February 27, 2026 21:08
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