Skip to content

feat(cli): standalone binary with self-update and checksum verification - #23

Merged
f3rdy merged 7 commits into
masterfrom
feature/self-update-binary
Mar 13, 2026
Merged

f3rdy merged 7 commits into
masterfrom
feature/self-update-binary

Conversation

@f3rdy

@f3rdy f3rdy commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add vaultctl self-update command that downloads the latest release from GitHub
  • SHA256 checksum verification before replacing the binary (checksums.sha256 asset)
  • Release workflow builds standalone PyInstaller binaries for linux-amd64, macos-amd64, macos-arm64
  • Graceful fallback when no checksums available (older releases)
  • Temp file cleanup on checksum mismatch or download failure

Closes #23

Test plan

  • 16 unit tests for self-update module (platform detection, checksum verification, update flow)
  • Full test suite passes (190 tests, 85% coverage)
  • Bandit security scan clean
  • Verify PyInstaller binary build in CI
  • Verify checksums.sha256 uploaded to release

f3rdy added 7 commits March 13, 2026 09:02
Add standalone binary self-update mechanism that downloads the latest
release from GitHub and verifies SHA256 checksums before replacing the
binary. Release workflow now builds PyInstaller binaries for
linux-amd64, macos-amd64, and macos-arm64 with checksums.
…ms, downgrade protection

- Add sys.frozen check to prevent pip users from overwriting their Python interpreter
- Make SHA256 checksum verification mandatory (no silent skip)
- Add semantic version comparison to prevent downgrades
- Create __main__.py entry point for PyInstaller
- Add hidden imports to PyInstaller build (yaml, importlib.metadata)
- Preserve original binary permissions instead of hardcoded 755
- Add packaging dependency for version comparison
…etection

When init finds an existing vault file, it now enters import mode:
scans all keys, generates a vault-keys.yml metadata skeleton, and
runs local heuristic type detection. No secrets leave the process.
…omplexity check

Update ruff (0.8.4→0.15.5), bandit (1.8.0→1.9.4), commitizen (4.9.1→4.13.9)
to match actual installed versions. Add radon cyclomatic complexity hook that
warns on CC grade D or worse. Update CI to show complexity analysis inline.
Extract apply logic into detection_ops.py, confidence filter into
detect.py, key import into keys.py, and value resolution + output
formatters into separate functions in cli.py.

detect_types: CC 23 (D) → 12 (C)
_import_existing_vault: CC 15 (C) → 13 (C)
set: CC 14 (C) → below threshold

No Grade D functions remain. Radon hook now blocks on CC > 20.
@f3rdy
f3rdy merged commit e49710c into master Mar 13, 2026
2 checks passed
@f3rdy
f3rdy deleted the feature/self-update-binary branch March 13, 2026 11:49
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