Skip to content

feat(installer): add lean bootstrap planner#494

Closed
kvandre12-commits wants to merge 2 commits into
mpfaffenberger:mainfrom
kvandre12-commits:feature/lean-bootstrap-installer
Closed

feat(installer): add lean bootstrap planner#494
kvandre12-commits wants to merge 2 commits into
mpfaffenberger:mainfrom
kvandre12-commits:feature/lean-bootstrap-installer

Conversation

@kvandre12-commits

Copy link
Copy Markdown

Summary

This PR addresses the dependency-bloat problem on constrained environments (especially Android/Termux) by moving the decision point from runtime fallback handling to install-time bootstrap planning.

Instead of importing the full runtime path and then gracefully degrading after unsupported dependencies have already been attached, this introduces a lightweight bootstrap entrypoint (code-puppy-bootstrap) that detects the target environment first, selects an install profile, and emits a lean install/reattach plan before optional capabilities are attached.

Fixes

What's Changed

  • Added code_puppy/bootstrap.py as a lightweight bootstrap CLI entrypoint.
  • Added code_puppy/bootstrap_profiles.py for environment detection and profile-based planning.
  • Added builtin install profiles:
    • core
    • android-termux-lean
    • desktop-browser
    • developer-full
  • Added optional manifest-driven overrides for deployment policy:
    • extras_add
    • extras_remove
    • notes
    • package_name
  • Added a new console script entrypoint:
    • code-puppy-bootstrap
  • Updated the README to document the lean bootstrap planning flow.
  • Added tests/test_bootstrap.py covering:
    • environment/profile routing
    • manifest override behavior
    • JSON CLI output
    • bootstrap/runtime separation

Design Notes

The bootstrap path is intentionally stdlib-only and decoupled from cli_runner, so installation planning can happen without pulling in the heavier runtime CLI import graph.

That separation is the main design goal of this change:

  • detect first
  • install lean
  • reattach optional capability later when the target environment actually supports it

Validation

Local validation for this PR slice:

  • ruff format --check .
  • ruff check .
  • python -m pytest tests/test_bootstrap.py -q -o addopts='' (8 passed)

Additional regression coverage previously re-run against this changeset also passed locally:

  • tests/test_cli_runner.py
  • tests/test_cli_runner_coverage.py
  • tests/test_tools_registration.py
  • tests/test_tools_init_full_coverage.py
  • tests/test_uvx_detection.py

Note on Current Upstream Test Noise

While doing a full local python -m pytest tests/ validation on the current checkout, there are unrelated failures outside this PR's change surface:

  • tests/plugins/test_ollama_plugin.py
    • failing because mocks expect OpenAIProvider on code_puppy.plugins.ollama.register_callbacks
  • tests/plugins/test_shell_safety_callbacks.py
    • failing because mocks expect get_global_model_name on code_puppy.plugins.shell_safety.register_callbacks

These failures appear unrelated to the bootstrap installer changes in this PR and look like existing test/module drift in other plugin areas.

Why This Approach

This change prefers install-time capability planning over post-install graceful degradation.

That gives constrained environments a cleaner default path:

  • no unnecessary optional dependency attachment up front
  • no pretending unsupported environments are "fine" after the expensive bits already landed
  • a clearer reattach story once the target platform is known-good

@kvandre12-commits
kvandre12-commits force-pushed the feature/lean-bootstrap-installer branch from b70ffbe to d6543a2 Compare June 20, 2026 21:01
@mpfaffenberger

Copy link
Copy Markdown
Owner

Can you add instructions to install / run Code Puppy on native Android / Termux in the README.md using this new system?

@kvandre12-commits

Copy link
Copy Markdown
Author

Closing this one as superseded by #496.

#494 captured the lean bootstrap planner direction, but #496 is now the cleaner upstream lane because it keeps that Android/Termux bootstrap intent while also fixing the actual native dependency blockers found by real installs:

  • Playwright moved out of the base install path
  • PyPI ripgrep moved out of the base install path
  • bootstrap/lite installer work carried forward there
  • verified on Android/Termux with real install checks, not just dry-run resolution

Follow-up / active PR: #496

@kvandre12-commits

Copy link
Copy Markdown
Author

Superseded by #496, which carries the lean Android/Termux bootstrap path plus the native dependency fixes needed for a minimal working Code Puppy install.

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.

2 participants