Skip to content

Make the experimental Colab notebook a Gemini sandbox - #46

Merged
Jammy2211 merged 2 commits into
mainfrom
claude/gemini-autofit-sandbox-6sm1bv
Sep 15, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
claude/gemini-autofit-sandbox-6sm1bv

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Turns notebooks/experimental_colab.ipynb from a six-step guided tour into a two-cell setup plus a sandbox, and retargets the context it hands the Gemini sidebar.

Trim to a sandbox

Everything from ## 3. Inspect the bundled simulated data onwards is gone — data inspection, the model/likelihood check, the small fit, the results zip. What remains: install the pinned assistant stack, print the sidebar context, then a ## 3. Your sandbox section where the reader writes their own cells.

Retarget the context

The sidebar only ever sees what the notebook prints, so the payload is now chosen for a sandbox rather than for the deleted tour:

  • BYOL mode (modes/byol.md) plus a sandbox section built around it — paste your own likelihood, numerics untouched, nothing fitted before your go-ahead.
  • The skills a sandbox session reaches for next: af_configure_search, af_run_search, af_plot_fit, af_debug_fit_failure, alongside the existing af_compose_model and af_wrap_likelihood.
  • An excerpt of AGENTS.md (preamble, safety invariants, three-layer model, domain adaptation — 6.2 KB of 15.8) instead of the whole file. The omitted sections direct an agent that can read files and run commands, which the sidebar cannot; pasting them invites it to propose workflows that cannot run.
  • show(<path>) prints any other assistant file on demand, so the fixed paste does not have to be exhaustive. It runs show("skills/README.md") on execution, giving a one-line index of every skill.

Context goes from ~32 KB to ~58 KB (~14k tokens), all of it applicable.

Notes

  • scripts/experimental_colab.py is the source; the .ipynb is regenerated with python -m autoassistant.to_notebook and was byte-identical to the converter's output before this change, so the pair stays in sync.
  • agents_excerpt() selects sections by heading prefix and raises if one stops matching uniquely, so an upstream rename fails loudly rather than silently pasting nothing.
  • The runtime clone pins ASSISTANT_REF = 2026.9.15.1, so the context files are read from that tag, not from main. All nine paths exist there and the three heading prefixes each resolve uniquely in the tag's AGENTS.md (byte-identical to this branch's).
  • README's Colab section follows the new shape.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FS8ubAQEXFKyv4GxDaSpra


Generated by Claude Code

Keep only the two setup cells — install the pinned assistant stack, print the
Gemini sidebar context — and drop the guided tour (data inspection, model and
likelihood, the small fit, the results download). A short closing cell says the
notebook is now the reader's sandbox for working in PyAutoFit with Gemini.

Edited in scripts/experimental_colab.py and regenerated with
`python -m autoassistant.to_notebook`; README's Colab section follows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FS8ubAQEXFKyv4GxDaSpra
The sidebar only ever sees what the notebook prints, so pick that payload for a
sandbox rather than the deleted guided tour:

- add BYOL mode and a "3. Your sandbox" section built around it — paste your own
  likelihood, numerics untouched, nothing fitted before your go-ahead;
- add the skills a sandbox session reaches for next: configure_search, run_search,
  plot_fit, debug_fit_failure;
- send an excerpt of AGENTS.md (preamble, safety invariants, three-layer model,
  domain adaptation) instead of the whole file — the omitted sections direct an
  agent that can read files and run commands, which the sidebar cannot;
- add show(<path>) so any other assistant file can be printed and pasted when it
  is needed, rather than fixing everything in the one paste.

Context goes from ~32 KB to ~58 KB (~14k tokens), all of it applicable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FS8ubAQEXFKyv4GxDaSpra
@Jammy2211
Jammy2211 merged commit 92b79c4 into main Sep 15, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the claude/gemini-autofit-sandbox-6sm1bv branch September 15, 2026 08:13
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