Skip to content

refactor: hide autonerves behind Colab bootstrap #194

Closed

Description

@Jammy2211

Overview

Stop teaching workspace users to import setup_colab directly from autonerves. Product-level re-exports already exist, but fresh Colab runtimes must still use autonerves privately to install the correct package stack before the product package is available.

This is phase 1 of 2: update and verify the bootstrap generator first, then regenerate all six workspace/HowTo repositories.

Plan

  • Map every Colab project to its public autofit, autogalaxy, or autolens package.
  • Keep autonerves as a private, Colab-only bootstrap implementation.
  • Update generator tests to enforce the public/private boundary.
  • Keep PyAutoHeart's end-to-end Colab simulation aligned with the generated cell.
  • Follow with the six-repository workspace rollout.
Detailed implementation plan

Affected Repositories

  • PyAutoHands (primary)
  • PyAutoHeart

Work Classification

Library/infrastructure phase; workspace rollout follows separately.

Branch Survey

Repository Current Branch Dirty?
./PyAutoHands main Untracked run_logs/
./PyAutoHeart main Clean

At survey time both repositories were claimed by test-results-relayout on
feature/test-results-relayout; that task shipped before issue creation and
the claims are now clear.

Suggested branch: feature/hide-autonerves-colab-bootstrap

Worktree root: ~/Code/PyAutoLabs-wt/hide-autonerves-colab-bootstrap

Implementation Steps

  1. Update PyAutoHands/autohands/build_util.py:

    • Replace the project set with a project-to-product mapping.
    • On Colab, continue installing autonerves --no-deps and load its setup
      implementation privately.
    • Outside Colab, resolve setup_colab through the mapped product package.
    • Preserve the existing project registry call, workspace clone, configuration
      setup, and version-selection behaviour.
  2. Update PyAutoHands/tests/test_inject_colab_setup.py:

    • Verify all six project mappings.
    • Reject generated from autonerves import setup_colab imports.
    • Assert the private Colab bootstrap still installs and invokes autonerves.
    • Preserve idempotency, insertion-position, and handwritten-setup coverage.
  3. Update PyAutoHeart/heart/checks/verify_install.sh:

    • Replace check F's verbatim injected cell with the revised template.
    • Continue exercising the fake-Colab path, stack installation,
      version-matched clone, configuration setup, and real notebook cell.
  4. Validate:

    • Run the focused PyAutoHands injection tests.
    • Run shell syntax checks for the Heart driver.
    • Run PyAutoHeart verify-install check F.
    • Confirm no generated public import exposes autonerves.setup_colab.
  5. After this phase lands, start the dependent six-workspace rollout.

Key Files

  • PyAutoHands/autohands/build_util.py — generated Colab setup cell.
  • PyAutoHands/tests/test_inject_colab_setup.py — generator contract tests.
  • PyAutoHeart/heart/checks/verify_install.sh — end-to-end Colab simulation.

Original Prompt

Click to expand starting prompt

autonerves should not be user facing API, but it is in many workspace examples: from autonerves import setup_colab , update it so its not, but make sure the colab install still uses it as it needs the right install rhere I think.

this is prob requied for PyautoGalaxy too

Activity

  1. Jammy2211 commented on Jul 24, 2026

    @Jammy2211
    CollaboratorAuthor

    Library PRs Created

    Validation:

    • PyAutoHands: 216 tests passed.
    • PyAutoHeart: 289 tests passed.
    • verify_install.sh F: PASS — private autonerves bootstrap, coherent stack install, version-tagged workspace clone, configuration setup, and real 209x209 imaging dataset load.
    • Product-level setup_colab re-exports verified for PyAutoFit, PyAutoGalaxy, and PyAutoLens.

    Workspace impact

    This is an API-usage migration for generated/user-facing material. The census found 527 direct public imports across the six Colab-enabled repositories: 12 source scripts and 515 generated notebooks. No affected path is hidden in no_run.yaml.

    Next: run start_dev on draft/refactor/workspaces/hide_autonerves_colab_workspace_rollout.md, then regenerate the notebooks through the accepted PyAutoHands implementation.

    Heart was YELLOW for the pre-existing workspace-validation/stale-script reasons recorded at ship time; the human explicitly acknowledged them before PR creation.

  2. Jammy2211 commented on Jul 24, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped — 2026-07-24

    PRs

    Summary

    The shared notebook generator and Colab install verification now keep autonerves behind the product setup APIs. All AutoGalaxy, AutoFit, and AutoLens workspace/tutorial rollouts are merged with targeted smoke evidence; fresh Colab still installs and imports the private backend correctly.

    Session Notes

    Ten curated real-output Markdown pages—four AutoGalaxy and six AutoLens—were explicitly deferred by the user to avoid expensive real-output rendering in this rollout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions