From 75e944bd15cc170ded72d69b4c5406084d93ec05 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Fri, 23 Oct 2026 12:42:12 +0100 Subject: [PATCH] docs: link the PyAutoLabs AI options page; retire OpenCode/Gemini/chat legacy (#87) Shorter README setup block linking the shared AI options page; drop the Colab + Gemini experiment (notebook, script, README section), the docs/setup pages (now on the shared page), docs/archive/ and .gemini/settings.json; AI_OPTIONS.md stub; AGENTS.md, llms.txt and maintainer wording updated. Co-Authored-By: Claude Fable 5.1 --- .gemini/settings.json | 5 - AGENTS.md | 8 +- AI_OPTIONS.md | 5 + README.md | 68 ++---- docs/archive/README.md | 15 -- docs/archive/chat/chatgpt_paid_connector.md | 63 ------ docs/archive/chat/claude_chat_paid.md | 69 ------ docs/setup/claude_code.md | 47 ----- docs/setup/codex_cli.md | 52 ----- docs/setup/opencode_cli.md | 59 ------ llms.txt | 6 +- modes/maintainer.md | 5 +- notebooks/experimental_colab.ipynb | 222 -------------------- scripts/experimental_colab.py | 170 --------------- skills/start-new-project.md | 3 +- 15 files changed, 35 insertions(+), 762 deletions(-) delete mode 100644 .gemini/settings.json create mode 100644 AI_OPTIONS.md delete mode 100644 docs/archive/README.md delete mode 100644 docs/archive/chat/chatgpt_paid_connector.md delete mode 100644 docs/archive/chat/claude_chat_paid.md delete mode 100644 docs/setup/claude_code.md delete mode 100644 docs/setup/codex_cli.md delete mode 100644 docs/setup/opencode_cli.md delete mode 100644 notebooks/experimental_colab.ipynb delete mode 100644 scripts/experimental_colab.py diff --git a/.gemini/settings.json b/.gemini/settings.json deleted file mode 100644 index 5e535b2..0000000 --- a/.gemini/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "context": { - "fileName": ["AGENTS.md", "GEMINI.md"] - } -} diff --git a/AGENTS.md b/AGENTS.md index 569aeb2..adb957e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,8 +2,8 @@ You are working inside **autofit_assistant**, the PyAutoFit AI Assistant: an agent workspace combining instructions, skills, wiki content, and science-project machinery for real Bayesian -inference. **This file is the canonical, agent-agnostic source of truth.** `CLAUDE.md` imports -it and `.gemini/settings.json` points here; never maintain a parallel copy. +inference. **This file is the canonical, agent-agnostic source of truth.** Claude Code, Codex +and other agents read it directly; never maintain a parallel copy. **What makes this assistant different.** PyAutoFit is domain-agnostic: it fits *your* model to *your* data with *your* likelihood. Unlike a domain assistant (e.g. `autolens_assistant`, @@ -50,8 +50,8 @@ never-rewrite-history. and blocks ones written from memory. If blocked, don't guess — grep `skills/` or introspect `dir()`, then re-run. Claude Code and Codex both register this hook from their project config. In Codex, review and trust the current project-hook hash with `/hooks`; - changed or untrusted hooks are skipped. **On any other harness (OpenCode, Gemini CLI, - an IDE agent) self-enforce it**: run + changed or untrusted hooks are skipped. **On any other harness (GitHub Copilot CLI, + OpenCode, an IDE agent) self-enforce it**: run `python autoassistant/audit_skill_apis.py --code ""` (or `--file `) on generated PyAuto\* code before executing it. Codex registers the PreToolUse safety gates, not the separate Claude remote-session Python bootstrap; use `source activate.sh` normally. diff --git a/AI_OPTIONS.md b/AI_OPTIONS.md new file mode 100644 index 0000000..6b48d71 --- /dev/null +++ b/AI_OPTIONS.md @@ -0,0 +1,5 @@ +# PyAutoLabs AI Options + +PyAutoLabs uses one AI options page across all of its assistants. + +Read the [PyAutoLabs AI Options](https://github.com/PyAutoLabs/PyAutoScientist/blob/main/AI_OPTIONS.md) page. diff --git a/README.md b/README.md index ce1a868..601d0e7 100644 --- a/README.md +++ b/README.md @@ -34,36 +34,26 @@ written out so you can read ahead or work through them on your own. ## Setting up the assistant -The assistant runs inside an **AI coding agent** — a tool that reads this repository, executes Python on your -computer and inspects the results. That is what lets it install **PyAutoFit**, wrap your likelihood code, run -searches and look at the plots they produce. You do not have to run anything to use it: discussing a model, choosing -priors, planning an analysis or learning in Teacher Mode all happen inside the same agent. - -1. **Choose Claude Code or Codex.** These are the two recommended agents. Codex discovery and safety adapters have - focused validation; full science fits depend on the local environment — see [Claude Code](docs/setup/claude_code.md) and [Codex](docs/setup/codex_cli.md). For sustained - scientific work expect to pay for one of them, but how depends on your situation: a personal subscription, access - through your institution or team, or usage-based API billing. Check the provider's current plans rather than - assuming a subscription is the only route. The setup below uses the CLI; the linked smoke record describes - its tested coverage. -2. **Open the assistant workspace.** Clone this repository and start the agent inside it — the instructions load - automatically, and the assistant installs PyAutoFit for you if it is missing: - - ```bash - git clone https://github.com/PyAutoLabs/autofit_assistant.git - cd autofit_assistant - claude # or: codex - ``` - -3. **Submit the starting prompt — the tour begins.** Paste the prompt at the top of this README and the assistant - opens the guided tour at step 1. (If you already have likelihood code, the "Bring Your Own Likelihood" prompt - under [Your own project](#bring-your-own-likelihood-byol) starts **BYOL mode** instead, running the same - workflow from your code.) - -**Experimental alternative.** [OpenCode](docs/setup/opencode_cli.md) is an open-source coding agent whose client is -free; the model you connect it to is a separate choice with its own cost and capability, free offerings are often -time-limited, and no provider/model configuration has yet been validated against this assistant — treat it as -compatible, not tested. Browser chats with a GitHub connector are **no longer supported** (retired 2026-09-10; the old -pages are archived with a notice under [`docs/archive/`](docs/archive/README.md)). +The assistant runs inside an **AI coding agent**: a tool that reads this repository, runs Python on your computer and +inspects the results. That is what lets it install **PyAutoFit**, wrap your likelihood code, run searches and look at +the plots they produce. You do not have to run anything to use it: discussing a model, choosing priors, planning an +analysis or learning in Teacher Mode all happen inside the same agent. + +Claude Code and Codex are recommended. Free options and chat use are on the +[PyAutoLabs AI options page](https://github.com/PyAutoLabs/PyAutoScientist/blob/main/AI_OPTIONS.md). + +Clone this repository and start the agent inside it. The instructions load automatically, and the assistant installs +PyAutoFit for you if it is missing: + +```bash +git clone https://github.com/PyAutoLabs/autofit_assistant.git +cd autofit_assistant +claude # or: codex +``` + +Then paste the prompt at the top of this README and the assistant opens the guided tour at step 1. (If you already +have likelihood code, the "Bring Your Own Likelihood" prompt under [Your own project](#bring-your-own-likelihood-byol) +starts **BYOL mode** instead, running the same workflow from your code.) ## The tour, step by step @@ -466,24 +456,6 @@ the priors, picking the non-linear search, and how to read the posterior. So I come away understanding the workflow, not just the commands. ``` -## Experimental: Google Colab + Gemini - -[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/PyAutoLabs/autofit_assistant/blob/main/notebooks/experimental_colab.ipynb) - -Two cells in a fresh CPU runtime: one installs the assistant's PyAutoFit stack, -one prints the context to copy into Colab's Gemini sidebar — the safety -invariants, teacher and BYOL modes, and the skills for composing a model, -wrapping a likelihood, running a search, plotting a fit and debugging one that -fails. After that the notebook is your sandbox: write your own cells, paste your -own likelihood, and print any other assistant file on demand with `show(...)`. - -This is experimental: cloning the assistant does not automatically load its -instructions into Gemini. Follow the notebook's explicit context step. Gemini -availability depends on your Google account and Colab settings. Save a notebook -copy and download anything you want to keep before the runtime resets; this is a -small browser experiment, with larger inference projects continuing in the full -assistant. - ## License The assistant ships agent instructions and reference material derived from the public diff --git a/docs/archive/README.md b/docs/archive/README.md deleted file mode 100644 index c5d22eb..0000000 --- a/docs/archive/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# docs/archive — retired material (unsupported) - -Kept **for reference only**; not maintained and not linked from active onboarding. - -## Conversational chat routes (retired 2026-09-10) - -The assistant is supported **only inside an AI coding agent** (Claude Code or Codex; OpenCode as an experimental -alternative). Browser-chat routes were retired because a chat that cannot execute code or read data cannot enforce -the assistant's safeguards — verifying the current PyAutoFit API, inspecting the data before fitting, checking a -fit's outputs, and never silently altering the user's likelihood code. - -| Archived page | What it was | -|---|---| -| [`chat/chatgpt_paid_connector.md`](chat/chatgpt_paid_connector.md) | ChatGPT paid plans via the GitHub connector | -| [`chat/claude_chat_paid.md`](chat/claude_chat_paid.md) | Claude chat paid plans via the GitHub connector or Project knowledge | diff --git a/docs/archive/chat/chatgpt_paid_connector.md b/docs/archive/chat/chatgpt_paid_connector.md deleted file mode 100644 index 7050b2d..0000000 --- a/docs/archive/chat/chatgpt_paid_connector.md +++ /dev/null @@ -1,63 +0,0 @@ - - -> **Archived and unsupported (2026-09-10).** This describes a retired conversational-chat route. See the -> [README](../../../README.md) for the supported agentic setup. - -# ChatGPT — paid plans (GitHub sync) - -Run the assistant inside ChatGPT on a **paid plan** (Plus/Pro/Team) by connecting this -repository through ChatGPT's GitHub connector. The assistant reads the repository directly, -always sees current content, and grounds every PyAutoFit symbol in the live API surface. - -ChatGPT's connectors are **paid-plan only**, which is why this route has no free equivalent. - -## Setup (~2 minutes) - -1. In ChatGPT, open **Settings → Connectors** and connect **GitHub**. Authorise access to - public repositories (this repo is public — you don't need to grant anything of your own). -2. Start a chat with this bootstrap prompt: - -```text -Use the autofit_assistant repository: https://github.com/PyAutoLabs/autofit_assistant - -Start by reading its front door: -https://raw.githubusercontent.com/PyAutoLabs/autofit_assistant/main/llms.txt - -Follow its read order (AGENTS.md → skills/README.md → the relevant skill → wiki/) and -its API rules. First tell me whether you can actually read llms.txt — if you can't, say -so plainly and don't answer from memory. -``` - -**Naming `llms.txt` explicitly matters** — connectors do not reliably find it on their own, -and answers are markedly better when it is pointed there first. The final sentence is a -deliberate honesty check: if the assistant can't read the file, you want to know immediately, -not after it writes you a script from an old API. - -## What it can and can't do - -In chat the assistant does the thinking work — planning models, writing current-API scripts -for you to run, explaining concepts, reviewing errors and figures. It **cannot** run fits or -read your data files; for that, use a coding agent such as [Codex CLI](../../setup/codex_cli.md), which -shares your ChatGPT subscription. - -## Your first prompt - -You're set up — copy and paste this to start (the 1D Gaussian dataset ships with the -repository, so it works immediately): - -```text -Use the autofit_assistant repository: https://github.com/PyAutoLabs/autofit_assistant - -Start by reading its front door: -https://raw.githubusercontent.com/PyAutoLabs/autofit_assistant/main/llms.txt - -Follow its read order (AGENTS.md → skills/README.md → the relevant skill → wiki/) and -its API rules. First tell me whether you can actually read llms.txt — if you can't, say -so plainly and don't answer from memory. - -Then walk me through fitting the bundled dataset in dataset/gaussian_x1/ with a 1D -Gaussian: the model, the priors, the likelihood, the search, and how to read the results. -``` diff --git a/docs/archive/chat/claude_chat_paid.md b/docs/archive/chat/claude_chat_paid.md deleted file mode 100644 index 6182806..0000000 --- a/docs/archive/chat/claude_chat_paid.md +++ /dev/null @@ -1,69 +0,0 @@ - - -> **Archived and unsupported (2026-09-10).** This describes a retired conversational-chat route. See the -> [README](../../../README.md) for the supported agentic setup. - -# Claude chat — paid plans (GitHub connector) - -Run the assistant inside claude.ai on a **paid plan** (Pro/Max/Team) by connecting this -repository through Claude's GitHub connector. The assistant reads the repository directly, -always sees current content, and grounds every PyAutoFit symbol in the live API surface. -The higher usage limits leave room for long modelling conversations, deep concept dives and -multi-script planning sessions. - -## Setup (~2 minutes) - -1. In Claude, open **Settings → Connectors** and connect **GitHub**. Authorise access to - public repositories (this repo is public — you don't need to grant anything of your own), - then attach `https://github.com/PyAutoLabs/autofit_assistant`. -2. Start a chat with this bootstrap prompt: - -```text -Use the autofit_assistant repository: https://github.com/PyAutoLabs/autofit_assistant - -Start by reading its front door: -https://raw.githubusercontent.com/PyAutoLabs/autofit_assistant/main/llms.txt - -Follow its read order (AGENTS.md → skills/README.md → the relevant skill → wiki/) and -its API rules. First tell me whether you can actually read llms.txt — if you can't, say -so plainly and don't answer from memory. -``` - -**Naming `llms.txt` explicitly matters** — connectors do not reliably find it on their own, -and answers are markedly better when it is pointed there first. The final sentence is a -deliberate honesty check: if the assistant can't read the file, you want to know immediately, -not after it writes you a script from an old API. - -**Prefer uploading to connecting?** Project knowledge is a fine alternative: create a Claude -Project and add `llms.txt` and `AGENTS.md` to its knowledge, then open with the same prompt. -On a paid plan the higher limits leave room for your own papers, data notes and analysis logs -in the same project knowledge. - -## What it can and can't do - -In chat the assistant does the thinking work — planning models, writing current-API scripts -for you to run, explaining concepts, reviewing errors and figures. It **cannot** run fits or -read your data files; for that, pair it with a coding agent such as -[Claude Code](../../setup/claude_code.md), which shares your Claude subscription. - -## Your first prompt - -You're set up — copy and paste this to start (the 1D Gaussian dataset ships with the -repository, so it works immediately): - -```text -Use the autofit_assistant repository: https://github.com/PyAutoLabs/autofit_assistant - -Start by reading its front door: -https://raw.githubusercontent.com/PyAutoLabs/autofit_assistant/main/llms.txt - -Follow its read order (AGENTS.md → skills/README.md → the relevant skill → wiki/) and -its API rules. First tell me whether you can actually read llms.txt — if you can't, say -so plainly and don't answer from memory. - -Then walk me through fitting the bundled dataset in dataset/gaussian_x1/ with a 1D -Gaussian: the model, the priors, the likelihood, the search, and how to read the results. -``` diff --git a/docs/setup/claude_code.md b/docs/setup/claude_code.md deleted file mode 100644 index 5c57209..0000000 --- a/docs/setup/claude_code.md +++ /dev/null @@ -1,47 +0,0 @@ -# Claude Code (coding agent — recommended) - -The **primary, most thoroughly exercised** harness for the assistant. Claude Code is Anthropic's -coding agent (terminal, desktop app and IDE extensions): it reads the repository's instructions -through `CLAUDE.md`, runs the code-gate hook that blocks stale PyAutoFit API written from memory, -and can install PyAutoFit, run fits end-to-end and inspect the results. - -**Access.** Claude Code is a paid product. Anthropic's [cost page](https://code.claude.com/docs/en/costs) -describes the routes: a Claude subscription (Pro / Max, or a Team / Enterprise seat through your -institution), usage-based billing through the Claude Console (API), or a cloud provider your -institution already uses (Amazon Bedrock, Google Cloud, Microsoft Foundry). Sustained inference -work is heavy use, so budget for it rather than assuming a personal subscription is the only or -best option. - -## Setup - -1. Install Claude Code — follow the official instructions at - [code.claude.com/docs](https://code.claude.com/docs). -2. Clone this repository and start the agent inside it: - -```bash -git clone https://github.com/PyAutoLabs/autofit_assistant.git -cd autofit_assistant -claude -``` - -The assistant configures itself on your first prompt, and will install PyAutoFit for you if -it isn't already installed. - -## Your first prompt - -You're set up — copy and paste this to start (the 1D Gaussian dataset ships with the -repository, so it works immediately): - -Example Natural Language Prompt for Claude Code, Codex or other AI coding agent - -```text -Fit the bundled dataset in dataset/gaussian_x1/ with a 1D Gaussian. -Explain the model, priors, likelihood, search and results as we go. -``` - -New to Bayesian inference? Start the prompt with `Teacher mode.` and the assistant explains -the concepts as it goes — or just ask, the start-here tour takes questions at every step. You do -not have to let it run anything: ask it to plan the analysis and discuss the model and priors -before any search is submitted. - -Experimental alternative if you cannot use Claude Code or Codex: [OpenCode](opencode_cli.md). diff --git a/docs/setup/codex_cli.md b/docs/setup/codex_cli.md deleted file mode 100644 index 834c112..0000000 --- a/docs/setup/codex_cli.md +++ /dev/null @@ -1,52 +0,0 @@ -# Codex (coding agent — recommended) - -OpenAI's coding agent (CLI, IDE extension and cloud). It reads the shared -`AGENTS.md` instructions, and this repository exposes its canonical `skills/*.md` -through generated, project-level `.codex/skills/` adapters. Discovery was checked -with an installed Codex CLI; adapter validation and fixture guard tests cover the -setup, while scientific fits still need to be exercised in the user's environment. -See the [harness smoke record](https://github.com/PyAutoLabs/PyAutoBrain/blob/main/docs/agent_harness_smoke.md) -for the measured scope. - -The tracked `.codex/hooks.json` registers the API and end-at-deliverable guards. -Review and trust its current hash in `/hooks` after cloning and after changes; -Codex skips project hooks until that hash is trusted. The separate Claude -remote-session Python bootstrap is not registered for Codex, so use -`source activate.sh` for local development setup. - -**Access.** Check [OpenAI's Codex pricing page](https://developers.openai.com/codex/pricing/) -for current plans and API billing. - -## Setup - -1. Install Codex — follow the official instructions at - [developers.openai.com/codex](https://developers.openai.com/codex). -2. Clone this repository and start the agent inside it: - -```bash -git clone https://github.com/PyAutoLabs/autofit_assistant.git -cd autofit_assistant -codex -``` - -The assistant configures itself on your first prompt, and will install PyAutoFit for you if -it isn't already installed. - -## Your first prompt - -You're set up — copy and paste this to start (the 1D Gaussian dataset ships with the -repository, so it works immediately): - -Example Natural Language Prompt for Claude Code, Codex or other AI coding agent - -```text -Fit the bundled dataset in dataset/gaussian_x1/ with a 1D Gaussian. -Explain the model, priors, likelihood, search and results as we go. -``` - -New to Bayesian inference? Start the prompt with `Teacher mode.` and the assistant explains -the concepts as it goes — or just ask, the start-here tour takes questions at every step. You do -not have to let it run anything: ask it to plan the analysis and discuss the model and priors -before any search is submitted. - -Experimental alternative if you cannot use Claude Code or Codex: [OpenCode](opencode_cli.md). diff --git a/docs/setup/opencode_cli.md b/docs/setup/opencode_cli.md deleted file mode 100644 index d8a635f..0000000 --- a/docs/setup/opencode_cli.md +++ /dev/null @@ -1,59 +0,0 @@ -# OpenCode (coding agent — experimental alternative) - -[OpenCode](https://github.com/sst/opencode) is an **open-source** coding agent. The client is -free; you connect it to a model provider of your choice. It reads `AGENTS.md` from the repository -root, so the assistant's instructions, skills and wiki all apply, and it can install PyAutoFit, -wrap your likelihood, run searches and inspect results **if the model you connect can drive the -workflow**. - -## What "free" does and does not mean - -- **The client is free; the model is not OpenCode's.** Cost, capability, rate limits and - availability belong to the provider you configure. OpenCode's own docs recommend new users start - with its hosted provider (OpenCode Zen), which is pay-as-you-go with a handful of models offered - at no cost — and OpenCode describes those free models as available *for a limited time*. Do not - plan a project around a free model staying free. -- **Not every model can run the assistant.** The workflow needs a model that follows multi-step - tool use reliably, does not hallucinate PyAutoFit API faster than the self-enforced audit can - catch it, and can **look at figures** — checking a fit means inspecting the plots it wrote. Many - free models have no image input, which rules them out for the full workflow. -- **Nothing is validated yet.** As of 2026-09-10 **no provider/model configuration has been - tested against this assistant's benchmarks**, so there is no default free model to recommend. - Treat OpenCode as *compatible* rather than *supported*; the evaluation protocol maintainers use - is the sibling assistant's - [`docs/evaluation/agent_evaluation.md`](https://github.com/PyAutoLabs/autolens_assistant/blob/main/docs/evaluation/agent_evaluation.md). - -## Setup - -1. Install OpenCode and configure a model provider — follow the official instructions at - [github.com/sst/opencode](https://github.com/sst/opencode). Pick a model that supports **tool - use and image input**; check the provider's model card, not the model's name. -2. Clone this repository and start the agent inside it (running from the repository root is what - lets it discover `AGENTS.md`): - -```bash -git clone https://github.com/PyAutoLabs/autofit_assistant.git -cd autofit_assistant -opencode -``` - -3. OpenCode has no PreToolUse hook, so the code gate is self-enforced: the assistant should run - `python autoassistant/audit_skill_apis.py --file ` on generated PyAutoFit code - before executing it. If the model skips this, ask it to. - -## Your first prompt - -Example Natural Language Prompt for Claude Code, Codex or other AI coding agent - -```text -Fit the bundled dataset in dataset/gaussian_x1/ with a 1D Gaussian. -Explain the model, priors, likelihood, search and results as we go. -``` - -Then a quick capability check before trusting it with your own science: ask it to plot the fit -and *describe what it sees in the figure*. A model that describes the code instead cannot run -the full workflow. - -Please [open an issue](https://github.com/PyAutoLabs/autofit_assistant/issues) with the -provider, model, date and what worked or failed — user reports are how a configuration -graduates from "compatible" to "tested". diff --git a/llms.txt b/llms.txt index ee69d8d..c3b9e29 100644 --- a/llms.txt +++ b/llms.txt @@ -4,15 +4,15 @@ ## How to use it -The assistant is supported **only inside an AI coding agent** that can read this repository and execute Python: **Claude Code** or **Codex** (recommended and tested), or **OpenCode** as an experimental alternative. Clone the repository and open the agent inside it — `AGENTS.md` (via `CLAUDE.md` for Claude Code) loads automatically: +The assistant is supported **only inside an AI coding agent** that can read this repository and execute Python: **Claude Code** or **Codex** (recommended and tested). Free options (GitHub Copilot CLI, OpenCode) are on the [PyAutoLabs AI options page](https://github.com/PyAutoLabs/PyAutoScientist/blob/main/AI_OPTIONS.md). Clone the repository and open the agent inside it; `AGENTS.md` loads automatically: ```bash git clone https://github.com/PyAutoLabs/autofit_assistant.git cd autofit_assistant -claude # or: codex / opencode +claude # or: codex ``` -Then paste the starting prompt from the [README](./README.md) (or its "Bring Your Own Likelihood" prompt). Setup pages: [`docs/setup/claude_code.md`](./docs/setup/claude_code.md) · [`docs/setup/codex_cli.md`](./docs/setup/codex_cli.md) · [`docs/setup/opencode_cli.md`](./docs/setup/opencode_cli.md). Desktop and IDE versions of these agents are fine when they provide the same repository and execution access. Browser chats with a GitHub connector are **no longer supported** (retired 2026-09-10; see [`docs/archive/`](./docs/archive/README.md)). +Then paste the starting prompt from the [README](./README.md) (or its "Bring Your Own Likelihood" prompt). Setup for every agent: the [PyAutoLabs AI options page](https://github.com/PyAutoLabs/PyAutoScientist/blob/main/AI_OPTIONS.md). Desktop and IDE versions of these agents are fine when they provide the same repository and execution access. Browser chats with a GitHub connector can read the repository for discussion but cannot run code; see the AI options page. Agentic does not mean autonomous: you can discuss a model, choose priors, plan an analysis or learn in **Teacher Mode** without running anything — say so in your prompt. diff --git a/modes/maintainer.md b/modes/maintainer.md index 0a5e83c..e89cfbb 100644 --- a/modes/maintainer.md +++ b/modes/maintainer.md @@ -68,15 +68,14 @@ The embedded report template/invitation remain owned by Brain. `skills/README.md`, `skills/start-new-project*`, `skills/contribute-upstream*`) **and the `af_*` generic inference skills**, the `autoassistant/` tooling (API gate, wiki-currency, benchmark runner), `sources.yaml`, `.github/` workflows, the harness mirrors (`.claude/`, - `.gemini/`), `wiki/README.md`, `wiki/project/*`, **`wiki/core/`** — because here + `.codex/hooks.json`), `wiki/README.md`, `wiki/project/*`, **`wiki/core/`** — because here `wiki/core/` teaches *statistics and inference*, not a specific science, so it is generic reference every domain keeps — **and `wiki/literature/`**, which ships near-empty *by design*: its schema files and empty index are the generic scaffold every domain assistant starts from (a domain *reference* like `autolens_assistant` instead ships a filled corpus here, so there it is domain — the seam differs). - **Domain-specific content** — regenerated or stubbed per clone, never copied blind: - the bundled Gaussian examples in `scripts/start_here/*` and the paired - `scripts/experimental_colab.py` / `notebooks/experimental_colab.ipynb` experiment; + the bundled Gaussian examples in `scripts/start_here/*`; `dataset/*` (the example datasets), `README.md` (science framing + example prompts), `hpc/*` (the example batch recipes), and `benchmarks/prompts/*` + `benchmarks/runs/*` + `benchmarks/RESULTS.md` (each domain writes its own prompt cards and regenerates the diff --git a/notebooks/experimental_colab.ipynb b/notebooks/experimental_colab.ipynb deleted file mode 100644 index e990f2f..0000000 --- a/notebooks/experimental_colab.ipynb +++ /dev/null @@ -1,222 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Experimental: PyAutoFit assistant in Colab\n", - "\n", - "Install the assistant's PyAutoFit stack in a **fresh CPU runtime** and give Colab's\n", - "Gemini sidebar its context, then experiment in your own cells. Run the first two\n", - "cells in order; installation can take a few minutes.\n", - "\n", - "This is a notebook experiment, not the full CLI assistant or an HPC service.\n", - "Cloning the repository does **not** make Gemini read its instructions. Step 2\n", - "provides context to copy into the sidebar explicitly. Gemini availability depends\n", - "on your Google account and Colab settings.\n", - "\n", - "Save a copy of this notebook in Drive to keep your edits. Runtime files disappear\n", - "when Colab resets: download anything you want to keep before disconnecting.\n", - "\n", - "__Contents__\n", - "\n", - "1. Setup\n", - "2. Gemini context\n", - "3. Your sandbox" - ], - "id": "cell-0" - }, - { - "cell_type": "code", - "metadata": {}, - "source": [ - "import os\n", - "from pathlib import Path\n", - "import subprocess\n", - "import sys\n", - "\n", - "# The public release includes the model, likelihood and assistant context used here.\n", - "ASSISTANT_REF = \"2026.9.15.1\"\n", - "STACK_VERSION = \"2026.9.15.1\"\n", - "COLAB_HOME = Path(\"/content\")\n", - "repo = COLAB_HOME / \"autofit_assistant\"\n", - "if not repo.exists():\n", - " subprocess.run(\n", - " [\"git\", \"clone\", \"--depth\", \"1\", \"--branch\", ASSISTANT_REF,\n", - " \"https://github.com/PyAutoLabs/autofit_assistant.git\", str(repo)],\n", - " check=True,\n", - " )\n", - "else:\n", - " actual = subprocess.check_output(\n", - " [\"git\", \"-C\", str(repo), \"describe\", \"--tags\", \"--exact-match\"], text=True\n", - " ).strip()\n", - " if actual != ASSISTANT_REF:\n", - " raise RuntimeError(\"This folder has another assistant version; use a fresh runtime.\")\n", - "\n", - "subprocess.run(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", f\"autofit=={STACK_VERSION}\",\n", - " f\"autonerves=={STACK_VERSION}\"], check=True,\n", - ")\n", - "os.environ.setdefault(\"NUMBA_CACHE_DIR\", \"/tmp/numba_cache\")\n", - "os.environ.setdefault(\"MPLCONFIGDIR\", \"/tmp/matplotlib\")\n", - "os.chdir(repo)\n", - "sys.path.insert(0, str(repo))\n", - "\n", - "import autofit as af\n", - "import autonerves\n", - "\n", - "print(\"Assistant:\", subprocess.check_output(\n", - " [\"git\", \"rev-parse\", \"HEAD\"], text=True).strip())\n", - "print(\"PyAutoFit:\", af.__version__, \"PyAutoNerves:\", autonerves.__version__)" - ], - "execution_count": null, - "outputs": [], - "id": "cell-1" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 2. Give Gemini the assistant context\n", - "\n", - "Run this cell, then **copy its printed text into the Gemini sidebar**. Ask Gemini\n", - "to acknowledge the supplied context before you start work. The context comes from\n", - "this pinned assistant checkout; no API key or Gemini SDK is needed.\n", - "\n", - "What it sends: the parts of `AGENTS.md` a sidebar session can actually act on,\n", - "teacher and BYOL modes, and the skills for composing a model, wrapping a\n", - "likelihood, configuring and running a search, plotting a fit and debugging one\n", - "that fails. The rest of the assistant is left out deliberately — much of it\n", - "directs an agent that can read files and run commands, which the sidebar cannot.\n", - "Section 3 prints any other file on demand.\n", - "\n", - "Only the text you supply is guaranteed to be part of that conversation. Sidebar\n", - "access to notebook content can vary: include the cell or error in your message\n", - "when needed." - ], - "id": "cell-2" - }, - { - "cell_type": "code", - "metadata": {}, - "source": [ - "# The sidebar has no filesystem, so only what is pasted is in context. These\n", - "# AGENTS.md sections carry the invariants and the map; the omitted ones describe\n", - "# session start-up, commit cadence and maintainer workflows that cannot run here.\n", - "agents_sections = [\n", - " \"Safety invariants\",\n", - " \"The three-layer model\",\n", - " \"Domain adaptation\",\n", - "]\n", - "context_paths = [\n", - " \"modes/teacher.md\",\n", - " \"modes/byol.md\",\n", - " \"skills/af_compose_model.md\",\n", - " \"skills/af_wrap_likelihood.md\",\n", - " \"skills/af_configure_search.md\",\n", - " \"skills/af_run_search.md\",\n", - " \"skills/af_plot_fit.md\",\n", - " \"skills/af_debug_fit_failure.md\",\n", - "]\n", - "\n", - "\n", - "def agents_excerpt(wanted):\n", - " \"\"\"Return the named `## ` sections of AGENTS.md, plus its preamble, in file order.\"\"\"\n", - " blocks = {\"__preamble__\": []}\n", - " heading = \"__preamble__\"\n", - " for line in Path(\"AGENTS.md\").read_text().splitlines():\n", - " if line.startswith(\"## \"):\n", - " heading = line[3:].strip()\n", - " blocks[heading] = []\n", - " blocks[heading].append(line)\n", - " excerpt = [\"\\n\".join(blocks[\"__preamble__\"]).strip()]\n", - " for prefix in wanted:\n", - " matched = [h for h in blocks if h.startswith(prefix)]\n", - " if len(matched) != 1:\n", - " raise RuntimeError(f\"AGENTS.md section {prefix!r} matched {matched}\")\n", - " excerpt.append(\"\\n\".join(blocks[matched[0]]).strip())\n", - " return \"\\n\\n\".join(excerpt)\n", - "\n", - "\n", - "bootstrap = (\n", - " \"Help me work on PyAutoFit in this experimental Colab notebook in teacher mode. \"\n", - " \"Use only notebook-relevant guidance from the reference material below and \"\n", - " \"the code I share. Skip CLI onboarding, filesystem checks, project-memory \"\n", - " \"creation and maintainer workflows. Ask one question at \"\n", - " \"a time; give hints before solutions. Do not claim to have read runtime files \"\n", - " \"or run code unless you actually have. Preserve the numerics of any \"\n", - " \"likelihood I supply. Before fitting real data, help me inspect it and discuss \"\n", - " \"artefacts, outliers and selection effects. Explain proposed \"\n", - " \"changes before I run them. If an API is uncertain, ask me to inspect it.\\n\"\n", - ")\n", - "context = bootstrap + \"\\nAssistant reference: \" + ASSISTANT_REF + \"\\n\"\n", - "context += \"\\n--- AGENTS.md (excerpt) ---\\n\" + agents_excerpt(agents_sections)\n", - "for relative in context_paths:\n", - " context += \"\\n\\n--- \" + relative + \" ---\\n\" + Path(relative).read_text()\n", - "print(context)\n", - "print(\"\\n[context: %d characters]\" % len(context))" - ], - "execution_count": null, - "outputs": [], - "id": "cell-3" - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3. Your sandbox\n", - "\n", - "This is now your assistant sandbox. Add your own cells and use Gemini in the\n", - "sidebar to do things in PyAutoFit — compose a model, wrap a likelihood, run a\n", - "search, read a result. Paste the cell or the error you are working on into your\n", - "message; the sidebar cannot reliably see the notebook.\n", - "\n", - "__Bring your own likelihood.__ The context above includes the assistant's BYOL\n", - "mode — overview, model, wrap and validate, choose a search, your go-ahead, then\n", - "run and inspect. Paste your own likelihood function into the sidebar and have\n", - "Gemini set PyAutoFit up around it. Two rules it is told to keep: your numerics are\n", - "never re-parametrised or \"fixed\", and nothing is fitted before you say go. Paste\n", - "the code itself, since the sidebar reads no files — and before fitting real data,\n", - "plot it and say what artefacts, outliers or selection effects you know of.\n", - "\n", - "The assistant's own worked example (data, model, likelihood, and the six steps\n", - "the guided tour walks) is in `scripts/start_here/` in the checkout. Run the cell\n", - "below to print any other assistant file when Gemini needs it, then paste the\n", - "output. For larger inference projects, continue in a local clone of\n", - "[autofit_assistant](https://github.com/PyAutoLabs/autofit_assistant)." - ], - "id": "cell-4" - }, - { - "cell_type": "code", - "metadata": {}, - "source": [ - "def show(relative):\n", - " \"\"\"Print any file from the assistant checkout, to copy into the Gemini sidebar.\"\"\"\n", - " print(Path(relative).read_text())\n", - "\n", - "\n", - "# e.g. show(\"skills/README.md\") — one line per skill, to pick the next one\n", - "# show(\"skills/af_simulate_dataset.md\") — any skill in full\n", - "# show(\"wiki/core/index.md\") — the curated PyAutoFit reference\n", - "# show(\"scripts/start_here/analysis.py\") — the bundled Analysis class\n", - "show(\"skills/README.md\")" - ], - "execution_count": null, - "outputs": [], - "id": "cell-5" - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/scripts/experimental_colab.py b/scripts/experimental_colab.py deleted file mode 100644 index 6357b82..0000000 --- a/scripts/experimental_colab.py +++ /dev/null @@ -1,170 +0,0 @@ -""" -# Experimental: PyAutoFit assistant in Colab - -Install the assistant's PyAutoFit stack in a **fresh CPU runtime** and give Colab's -Gemini sidebar its context, then experiment in your own cells. Run the first two -cells in order; installation can take a few minutes. - -This is a notebook experiment, not the full CLI assistant or an HPC service. -Cloning the repository does **not** make Gemini read its instructions. Step 2 -provides context to copy into the sidebar explicitly. Gemini availability depends -on your Google account and Colab settings. - -Save a copy of this notebook in Drive to keep your edits. Runtime files disappear -when Colab resets: download anything you want to keep before disconnecting. - -__Contents__ - -1. Setup -2. Gemini context -3. Your sandbox -""" - -import os -from pathlib import Path -import subprocess -import sys - -# The public release includes the model, likelihood and assistant context used here. -ASSISTANT_REF = "2026.9.15.1" -STACK_VERSION = "2026.9.15.1" -COLAB_HOME = Path("/content") -repo = COLAB_HOME / "autofit_assistant" -if not repo.exists(): - subprocess.run( - ["git", "clone", "--depth", "1", "--branch", ASSISTANT_REF, - "https://github.com/PyAutoLabs/autofit_assistant.git", str(repo)], - check=True, - ) -else: - actual = subprocess.check_output( - ["git", "-C", str(repo), "describe", "--tags", "--exact-match"], text=True - ).strip() - if actual != ASSISTANT_REF: - raise RuntimeError("This folder has another assistant version; use a fresh runtime.") - -subprocess.run( - [sys.executable, "-m", "pip", "install", f"autofit=={STACK_VERSION}", - f"autonerves=={STACK_VERSION}"], check=True, -) -os.environ.setdefault("NUMBA_CACHE_DIR", "/tmp/numba_cache") -os.environ.setdefault("MPLCONFIGDIR", "/tmp/matplotlib") -os.chdir(repo) -sys.path.insert(0, str(repo)) - -import autofit as af -import autonerves - -print("Assistant:", subprocess.check_output( - ["git", "rev-parse", "HEAD"], text=True).strip()) -print("PyAutoFit:", af.__version__, "PyAutoNerves:", autonerves.__version__) - -""" -## 2. Give Gemini the assistant context - -Run this cell, then **copy its printed text into the Gemini sidebar**. Ask Gemini -to acknowledge the supplied context before you start work. The context comes from -this pinned assistant checkout; no API key or Gemini SDK is needed. - -What it sends: the parts of `AGENTS.md` a sidebar session can actually act on, -teacher and BYOL modes, and the skills for composing a model, wrapping a -likelihood, configuring and running a search, plotting a fit and debugging one -that fails. The rest of the assistant is left out deliberately — much of it -directs an agent that can read files and run commands, which the sidebar cannot. -Section 3 prints any other file on demand. - -Only the text you supply is guaranteed to be part of that conversation. Sidebar -access to notebook content can vary: include the cell or error in your message -when needed. -""" - -# The sidebar has no filesystem, so only what is pasted is in context. These -# AGENTS.md sections carry the invariants and the map; the omitted ones describe -# session start-up, commit cadence and maintainer workflows that cannot run here. -agents_sections = [ - "Safety invariants", - "The three-layer model", - "Domain adaptation", -] -context_paths = [ - "modes/teacher.md", - "modes/byol.md", - "skills/af_compose_model.md", - "skills/af_wrap_likelihood.md", - "skills/af_configure_search.md", - "skills/af_run_search.md", - "skills/af_plot_fit.md", - "skills/af_debug_fit_failure.md", -] - - -def agents_excerpt(wanted): - """Return the named `## ` sections of AGENTS.md, plus its preamble, in file order.""" - blocks = {"__preamble__": []} - heading = "__preamble__" - for line in Path("AGENTS.md").read_text().splitlines(): - if line.startswith("## "): - heading = line[3:].strip() - blocks[heading] = [] - blocks[heading].append(line) - excerpt = ["\n".join(blocks["__preamble__"]).strip()] - for prefix in wanted: - matched = [h for h in blocks if h.startswith(prefix)] - if len(matched) != 1: - raise RuntimeError(f"AGENTS.md section {prefix!r} matched {matched}") - excerpt.append("\n".join(blocks[matched[0]]).strip()) - return "\n\n".join(excerpt) - - -bootstrap = ( - "Help me work on PyAutoFit in this experimental Colab notebook in teacher mode. " - "Use only notebook-relevant guidance from the reference material below and " - "the code I share. Skip CLI onboarding, filesystem checks, project-memory " - "creation and maintainer workflows. Ask one question at " - "a time; give hints before solutions. Do not claim to have read runtime files " - "or run code unless you actually have. Preserve the numerics of any " - "likelihood I supply. Before fitting real data, help me inspect it and discuss " - "artefacts, outliers and selection effects. Explain proposed " - "changes before I run them. If an API is uncertain, ask me to inspect it.\n" -) -context = bootstrap + "\nAssistant reference: " + ASSISTANT_REF + "\n" -context += "\n--- AGENTS.md (excerpt) ---\n" + agents_excerpt(agents_sections) -for relative in context_paths: - context += "\n\n--- " + relative + " ---\n" + Path(relative).read_text() -print(context) -print("\n[context: %d characters]" % len(context)) - -""" -## 3. Your sandbox - -This is now your assistant sandbox. Add your own cells and use Gemini in the -sidebar to do things in PyAutoFit — compose a model, wrap a likelihood, run a -search, read a result. Paste the cell or the error you are working on into your -message; the sidebar cannot reliably see the notebook. - -__Bring your own likelihood.__ The context above includes the assistant's BYOL -mode — overview, model, wrap and validate, choose a search, your go-ahead, then -run and inspect. Paste your own likelihood function into the sidebar and have -Gemini set PyAutoFit up around it. Two rules it is told to keep: your numerics are -never re-parametrised or "fixed", and nothing is fitted before you say go. Paste -the code itself, since the sidebar reads no files — and before fitting real data, -plot it and say what artefacts, outliers or selection effects you know of. - -The assistant's own worked example (data, model, likelihood, and the six steps -the guided tour walks) is in `scripts/start_here/` in the checkout. Run the cell -below to print any other assistant file when Gemini needs it, then paste the -output. For larger inference projects, continue in a local clone of -[autofit_assistant](https://github.com/PyAutoLabs/autofit_assistant). -""" - - -def show(relative): - """Print any file from the assistant checkout, to copy into the Gemini sidebar.""" - print(Path(relative).read_text()) - - -# e.g. show("skills/README.md") — one line per skill, to pick the next one -# show("skills/af_simulate_dataset.md") — any skill in full -# show("wiki/core/index.md") — the curated PyAutoFit reference -# show("scripts/start_here/analysis.py") — the bundled Analysis class -show("skills/README.md") diff --git a/skills/start-new-project.md b/skills/start-new-project.md index 8deb481..9e64058 100644 --- a/skills/start-new-project.md +++ b/skills/start-new-project.md @@ -107,7 +107,6 @@ else. README.md # front door: reproduce + continue-this-work (template below) AGENTS.md # thin: project context + refer-back + locate rule (below) CLAUDE.md # one-line `@AGENTS.md` stub - .gemini/settings.json # context.fileName -> AGENTS.md .claude/settings.json # PyAuto* API code-gate via refer-back (below) project.yaml # minimal manifest incl. assistant_ref (below) config/ activate.sh scripts/ # copied above @@ -163,7 +162,7 @@ This project ships the assistant's PyAuto* **API code-gate** (`.claude/settings. Bash runs generated PyAuto* code, a hook resolves the assistant (same order as above) and validates the symbols against the installed stack, denying code written from memory. It fails open if no assistant clone is found. Only Claude Code runs `.claude/` hooks — on any other -harness (Codex, OpenCode, Gemini CLI), self-enforce it: run +harness (Codex, GitHub Copilot CLI, OpenCode), self-enforce it: run `python /autoassistant/audit_skill_apis.py --code ""` (or `--file `) on generated PyAuto* code before executing it; never guess symbols.