Workflow

How a physicist runs a research project inside secdev and stays in charge of it: set the project up, write the plan, hand the agent one task at a time, and read what comes back.

The overview promised a loop the agent runs on its own while a person stays in charge of the question. This page shows what the person does, step by step, under the guided contract, in which the agent works on one task at a time and then reports back. The Example page shows what came out of one real project run this way: the agent’s records, its results and the finished paper.

Setting up a project

A project starts with a few steps the person does once; the agent joins at the fourth. From then on the work alternates between the two: the agent runs a task and writes what it found into the wiki, the person reads the wiki and steers, and at the end the person writes the paper from what the wiki holds.

  1. Start a scientific container

    Two secdev images carry the research tooling. newton is the local workbench: numerics, symbolic algebra, LaTeX. einstein is newton plus reach: it can submit jobs to the institute’s compute cluster and run commands on the GPU host. A project that needs the cluster runs in einstein:

    cd ~/projects/example
    secdev einstein
    

    Start the container inside a terminal multiplexer such as tmux, a program that keeps a terminal session alive after its window closes, so the session survives a closed laptop. On start-up the container writes a manifest file, SECDEV.md, that tells the agent what this container can reach and what it must not attempt.

  2. Lay down the scaffold and the contract

    One command, run once in the empty project directory, creates the fixed project structure together with the contract the agent will work under. secdev ships the structure as profiles, one per way of working, and guided-wiki is the default:

    # inside the container, in the project root
    scaffold init guided-wiki
    

    Guided means one task at a time: the agent returns when the task is done. The unattended profiles are described further down, and the secdev Technical Details list all profiles. A project that several agents share adds --with collaboration. The command creates the following files and directories, each with one job:

    project/
      AGENTS.md      # entry point: points the agent at the files
      CONTRACT.md    # the rules the agent works under
      PLAN.md        # the physicist's goal and tasks; read-only
      TASKS.md       # the agent's proposals for new tasks
      PROBLEMS.md    # open and closed conceptual problems
      LOG.md         # the lab book: one terse entry per step
      code/          # the simulation and analysis code
      data/          # what the runs produced
      wiki/          # findings, written for the physicist;
                     # the papers in wiki/literature/
      memory/        # the agent's working notes
      paper/         # main.tex: the manuscript; the agent
                     # edits it only on request
      .secdev/       # scaffold.toml: profile and version
    

    The project directory is also an Obsidian vault, so the physicist reads the wiki in Obsidian, a Markdown editor, as linked pages with their plots in place.

    The contract, installed as CONTRACT.md, is the file of numbered rules the agent reads at the start of every session, and it determines everything that follows: how the plan works, what the agent must record, what it may not do, and where it may write. It is short enough to read in full, and reading it is the quickest way to see what guidance the agent works under. The guided contract, as the agent receives it:

    # §C. Guided Research Contract
    
    This contract applies to a project set up with the `guided-wiki` scaffold
    profile. It defines project-specific research behavior.
    Container capabilities, installed tools, security constraints, and optional
    remote resources are documented separately in [`SECDEV.md`](SECDEV.md).
    
    ## §C1. Project Scaffold
    
    - MUST read [`SECDEV.md`](SECDEV.md), `CONTRACT.md`, [`PLAN.md`](PLAN.md),
      [`TASKS.md`](TASKS.md), [`PROBLEMS.md`](PROBLEMS.md), [`LOG.md`](LOG.md),
      [`wiki/index.md`](wiki/index.md), [`wiki/overview.md`](wiki/overview.md), and
      [`memory/index.md`](memory/index.md) at session start.
    - MUST NOT create the research layout manually if required scaffold files are
      missing; run `scaffold check` and ask before running `scaffold update`.
    - `scaffold` is opt-in and refuses to overwrite existing files.
    
    ### §C1.1 [`PLAN.md`](PLAN.md)
    
    - Human-owned project contract.
    - MUST read at session start.
    - MUST NOT modify.
    - If edits are requested, tell the human to run `chmod +w PLAN.md`.
    - Front matter:
      - `title`: title for the wiki, reports, and summaries.
      - `label`: ASCII slug; use only letters, numbers, dots, underscores,
        hyphens.
      - `mattermost_channel_url`: optional metadata; this guided contract does
        not use Mattermost for reporting.
    - The `Tasks` section lists the human-approved research tasks: initial
      directions plus accepted [`TASKS.md`](TASKS.md) proposals, under
      human-assigned IDs.
    
    ### §C1.2 [`TASKS.md`](TASKS.md)
    
    - Shared proposal board for new high-level scientific tasks; not a work list.
    - MAY propose a task when evidence, literature, or results suggest a direction
      not covered by [`PLAN.md`](PLAN.md). Proposals MUST cite that evidence and
      MUST contain only high-level scientific objectives, not technical
      micro-steps.
    - Proposals use stable IDs `T001`, `T002`, ..., never reused and independent of
      [`PLAN.md`](PLAN.md) task IDs, with `State` (`OPEN` or `CLOSED`), `Purpose`,
      and `Outcome` (`pending` while open).
    - MUST reply to human comments in the proposal's `Discussion` list, with dated
      entries signed `AI:` or `Human:`.
    - MUST NOT work on a proposal, beyond small checks that inform the
      discussion, until the human has copied it into [`PLAN.md`](PLAN.md).
    - At session start, MUST close each open proposal the human has copied into
      [`PLAN.md`](PLAN.md): set `State` to `CLOSED` and `Outcome` to
      `accepted into PLAN.md as <PLAN.md task ID>`. If the correspondence is
      unclear, ask in the `Discussion` list instead.
    - Rejected, withdrawn, or superseded proposals are closed with the reason.
    - MUST NOT delete proposals; closed proposals keep their full text and
      discussion.
    
    ### §C1.3 [`PROBLEMS.md`](PROBLEMS.md)
    
    - Shared, human- and agent-readable record of conceptual or structural
      research problems.
    - MUST keep unresolved problems under `OPEN` and resolved problems under
      `CLOSED`, with stable IDs and a resolution or closure reason.
    - MUST NOT delete closed problems.
    - Technical failures, package limitations, and implementation details belong
      in [`LOG.md`](LOG.md), not [`PROBLEMS.md`](PROBLEMS.md).
    
    ### §C1.4 [`LOG.md`](LOG.md)
    
    - Terse ledger of the project's history.
    - MUST read at session start.
    - MUST record every experiment, simulation, investigation, failure, and
      dead end, newest first.
    - Each entry gives goal, one-line method, outcome, and next step, names the
      [`PLAN.md`](PLAN.md) task ID of work on an approved task (`--task`), and
      points to `data/`, `code/`, [`memory/`](memory/index.md), and
      [`wiki/`](wiki/index.md) paths (`--ref`).
    - Detail belongs in [`memory/`](memory/index.md) and findings in
      [`wiki/`](wiki/index.md); MUST NOT repeat them here.
    - SHOULD use `research-log` or `research-run` instead of hand-formatting
      entries.
    
    ### §C1.5 Literature
    
    - Papers live in `wiki/literature/`, one file per paper in each subfolder:
      `notes/<citekey>.md`, `pdf/<citekey>.pdf`, and `bib/<citekey>.bib`.
    - A paper exists for the project only once `research-lit add DOI --pdf FILE`
      has stored its downloaded PDF and its BibTeX fetched via the DOI. Until then
      MUST NOT cite, link, or rely on it.
    - MUST NOT write or edit `.bib` files by hand; regenerate
      `paper/bibliography.bib` with `research-lit bib`.
    - A paper counts as read only once its note has a Summary and Relevance in
      the agent's own words; Relevance MUST link the concept and study pages the
      paper informs.
    - MUST locate the original source; MUST NOT cite from memory or guess a DOI.
    - A paper without DOI needs explicit human approval, recorded in its note as
      `no_doi: approved by human YYYY-MM-DD`.
    
    ### §C1.6 [`wiki/`](wiki/index.md)
    
    - Research wiki and the agent-human interface. The agent maintains it; the
      human reads it in Obsidian and MAY edit any page. MUST NOT revert human
      edits.
    - Layout: [`overview.md`](wiki/overview.md) (current picture, the human's entry
      point), [`glossary.md`](wiki/glossary.md) (abbreviations and notation),
      `concepts/` (concepts, models, variants, methods), `studies/` (one page per
      line of investigation), `literature/`, and `assets/` (hand-made images only).
    - MUST create pages with `research-wiki new` and regenerate
      [`index.md`](wiki/index.md) with `research-wiki index`; MUST NOT edit
      [`index.md`](wiki/index.md) by hand.
    - MUST use relative Markdown links and embed figures from `data/<run>/` in
      place instead of copying them.
    - MUST write each paragraph, list item, and callout line of a wiki page on
      one line, never hard-wrapped, because Obsidian shows every line break; and
      MUST double-quote front-matter values that contain `: ` or start with a
      YAML indicator such as `#` or `[`. `research-wiki fix` repairs both.
    - Every claim MUST link its evidence and carry its status; only tested results
      are presented as results. No raw dumps, code listings, or chatter.
    - MUST keep [`overview.md`](wiki/overview.md) current and link every study that
      is not superseded.
    - MUST answer each human `> [!question]` callout below it and change it to
      `> [!answer]`.
    - MUST keep pages well structured: sections and subsections by topic, short
      paragraphs, lists for enumerations instead of chained sentences, and no
      walls of text dense with inline maths.
    - MUST set any equation longer than a short symbol or relation as a display
      equation (`$$…$$`), and number or name it when the text refers to it.
    - SHOULD follow the `secdev-explanatory-writing` skill for wiki prose.
    - `research-wiki check` MUST pass before returning to the human.
    
    ### §C1.7 [`memory/`](memory/index.md)
    
    - The agent's only persistent memory, shared by every agent on the project.
      MUST NOT use built-in agent memory features.
    - Written for agents, not humans: working state, labelled hunches, detailed
      failure reasons, and know-how.
    - `tasks/<ID>.md` holds the working state of one approved task,
      `topics/<slug>.md` cross-cutting know-how, `archive/` condensed files of
      closed tasks. Create files with `research-wiki new task|topic`.
    - MUST read [`memory/index.md`](memory/index.md) and the current task file at
      session start; read topics only as the job needs them.
    - MUST update the task file before ending a session or switching tasks.
    - When a task closes, MUST condense its file: lasting know-how to `topics/`,
      verified insights to [`wiki/`](wiki/index.md) (linked, not copied), the rest
      to `archive/`.
    - MUST NOT hold findings ([`wiki/`](wiki/index.md)) or chronology
      ([`LOG.md`](LOG.md)).
    
    ### §C1.8 Folders
    
    - `data/`: store simulation or experimental output; use `research-run` for
      local command runs when practical so outputs and [`LOG.md`](LOG.md) stay
      linked.
    - `code/`: store independent codebases or `uv` projects; prefer one
      subfolder per experiment and reference it from [`LOG.md`](LOG.md).
    - `paper/`: final-paper workspace; edit only on explicit human request.
      Prose in final papers MUST be human-written, so agents MUST NOT write
      fully formulated paper paragraphs.
    
    ## §C2. Session Warmup
    
    - At session start, MUST run `research-warmup`.
    - MUST read the files listed in §C1; the helper checks presence, lists open
      human questions in [`wiki/`](wiki/index.md), and summarizes
      `research-wiki check`, but does not replace reading them.
    - SHOULD run `research-audit` when starting substantial work or before
      returning final results.
    
    ## §C3. Guided Work Loop
    
    For the user-requested job:
    
    1. Read current project state, approved tasks in [`PLAN.md`](PLAN.md), open
       proposals in [`TASKS.md`](TASKS.md), and known problems.
    2. Plan the next concrete step.
    3. Execute.
    4. Evaluate evidence.
    5. Record the step in [`LOG.md`](LOG.md), update the task file in
       [`memory/`](memory/index.md), maintain [`PROBLEMS.md`](PROBLEMS.md), propose
       new high-level tasks in [`TASKS.md`](TASKS.md) when the evidence suggests
       them, and, when noteworthy, update [`wiki/`](wiki/index.md).
    6. Continue until the requested job is fully achieved or genuinely blocked.
    7. Return to the user with the outcome, evidence, and remaining risks.
    
    Loop rules:
    
    - MUST continue after intermediate steps when useful work remains within the
      requested job.
    - MUST return to the user after the requested job is complete.
    - MUST return to the user when progress requires a decision that cannot be
      derived from [`PLAN.md`](PLAN.md), [`TASKS.md`](TASKS.md),
      [`PROBLEMS.md`](PROBLEMS.md), evidence, or a safe default.
    - MUST NOT use Mattermost for progress reporting under this contract.
    
    ## §C4. Planning Before Execution
    
    - For any non-trivial task:
      - MUST plan before editing, running simulations, or modifying the wiki.
      - MUST base plan on the approved tasks in [`PLAN.md`](PLAN.md), plus
        [`PROBLEMS.md`](PROBLEMS.md) and [`LOG.md`](LOG.md). Open proposals in
        [`TASKS.md`](TASKS.md) are not work orders.
    - Trivial tasks are limited to mechanical inspection or status checks that do
      not change project state.
    
    ### §C4.1 Git Discipline
    
    - Unless the user explicitly requests another workflow, SHOULD develop on the
      repository's default branch, normally `master` or `main`, and SHOULD NOT
      create additional branches.
    - SHOULD commit autonomously at reasonable, coherent checkpoints with
      explanatory commit messages.
    - If undoing committed changes is necessary, SHOULD use `git revert` rather
      than rewriting history.
    
    ## §C5. Token Budget
    
    - MUST use `research-warmup` during warmup.
    - SHOULD check `usage` before token-heavy steps, after experiments finish,
      and when nearing limits.
    - If token budget prevents safe completion, record the state in the
      [`memory/`](memory/index.md) task file and in [`LOG.md`](LOG.md)
      with `research-log` and return to the user with the next concrete action.
    
    ## §C6. Completion And Blocking
    
    - A job is complete only when the requested deliverable is produced, checked,
      and documented.
    - If blocked, MUST document:
      - what was attempted,
      - the evidence for the block,
      - the smallest user decision or external change needed to continue.
    - SHOULD use `research-log --blocked` for blocked work. A blocked approved task
      is recorded in [`LOG.md`](LOG.md) with its task ID; it has no state in
      [`TASKS.md`](TASKS.md).
    - MUST NOT treat a failed experiment as a scientific conclusion until the
      implementation has been checked.
    
    ## §C7. Integrity
    
    ### §C7.1 Never break a promise.
    
    - If you say "I will do X", do it.
    - Under-promise and over-deliver.
    - If work is deferred, MUST record reason in [`LOG.md`](LOG.md), preferably
      with `research-log`.
    
    ### §C7.2 Never manipulate evaluation.
    
    - MUST NOT change metrics, test sets, problem definitions, or fixed
      hyperparameters to make results look better.
    - MUST NOT hard-code results.
    - MUST NOT cherry-pick seeds.
    
    ### §C7.3 Never fabricate citations.
    
    - MUST verify every bibliography entry against the actual source; papers enter
      only through `research-lit add` (§C1.5).
    - MUST confirm exact title, full author list, year, venue, and DOI/arXiv or
      other identifier.
    - If the paper cannot be found, do not guess.
    
    ## §C8. Efficiency
    
    ### §C8.1 Make it work before moving on.
    
    - Treat experiment crashes as bugs, not as evidence against the method.
    - MUST NOT discard methods because of implementation failures.
    - If an experiment crashes, investigate, fix, and rerun when still relevant
      to the requested job.
    
    ### §C8.2 Use compute intelligently.
    
    - At session start, SHOULD check local CPU/memory capability.
    - IF [`SECDEV.md`](SECDEV.md) documents specialized compute or remote resources
      suitable for the task, SHOULD use them according to that documentation.
    - IF starting a local simulation:
      - MUST estimate expected runtime before launch.
      - SHOULD use `research-run` to capture outputs, timeout metadata, and the
        matching [`LOG.md`](LOG.md) entry.
      - MUST use a reasonable timeout when the runtime has not been tested
        before.
      - MUST run without a timeout only after prior tests give a good runtime
        estimate.
      - MUST schedule and perform a status check at that expected runtime.
      - MUST investigate simulations that run much longer than expected.
    - Remote jobs that can be actively monitored, such as Slurm jobs, are exempt
      from the local timeout requirement.
    - For embarrassingly parallel work, SHOULD use multiple worker processes when
      it materially reduces wall time and MUST leave CPU headroom.
    
    ## §C9. Scientific Rigor
    
    ### §C9.1 One variable per experiment.
    
    - Change exactly one thing per experiment.
    - If two things change and the metric improves, you cannot know which helped.
    
    ### §C9.2 Evaluate in tiers.
    
    - Tier 1: seconds, does it run?
    - Tier 2: minutes, signal on small subset?
    - Tier 3: full evaluation for reportable claims.
    - MUST NOT draw conclusions from small-scale bug-catching runs.
    
    ### §C9.3 Bound your expectations.
    
    - Before implementing a heuristic, identify theoretical best case and
      estimate maximum possible improvement or correction.
    
    ### §C9.4 Never overstate simplified results.
    
    - MUST state caveats for toy models, approximations, restricted parameter
      regimes, finite-size systems, relaxed assumptions, and surrogate metrics.
    - Restricted contradiction is evidence, not full disproof.
    - Keep caveats visible in [`LOG.md`](LOG.md), plots, user reports, and
      [`wiki/`](wiki/index.md). If the caveat affects a human-selected paper
      result, include it in `paper/` as a terse note or figure/caption constraint.
    
    ## §C10. Documentation And Reproducibility
    
    ### §C10.1 Record everything.
    
    - MUST log every experiment with goal, method, outcome, and next step,
      preferably with `research-log` or `research-run`.
    - MUST include failures.
    - MUST document tested, noteworthy results in [`wiki/`](wiki/index.md).
    - SHOULD use plots when available.
    - MUST use tables only when clearly better than plots for the message.
    - MUST keep [`wiki/glossary.md`](wiki/glossary.md) current.
    - Dead ends and later-invalidated results are logged in [`LOG.md`](LOG.md),
      with their detail in [`memory/`](memory/index.md).
    - If it is not in [`LOG.md`](LOG.md), it did not happen.
    
    ### §C10.2 Verify before claiming.
    
    - Assume you are wrong until verified.
    - MUST write verification scripts, not just explanations.
    - MUST actively try to falsify claims.
    - MUST grade claims as verified, partially verified, or unverified.
    
    ### §C10.3 Wiki And Paper Roles.
    
    - [`wiki/`](wiki/index.md) is the agent-human interface. Agents MAY write clear
      prose, explanations, caveats, plots, and result summaries there.
    - `paper/` is the final-paper workspace. Agents MUST edit it only when the
      human explicitly asks.
    - Agents MUST NOT convert [`wiki/`](wiki/index.md) wholesale into `paper/`.
    - Normal flow is [`LOG.md`](LOG.md), `data/`, and `code/` to
      [`wiki/`](wiki/index.md), then human-selected content to `paper/`.
    - In `paper/`, agents MAY add paper-grade figures, equations, labels,
      bibliography wiring, provenance notes, and keyword-style placeholders.
    - In `paper/`, agents MUST NOT write fully formulated prose paragraphs; prose
      may only be inserted when supplied by the human.
    
    ### §C10.4 Plot And Figure Quality.
    
    - Figure rules apply to both [`wiki/`](wiki/index.md) and `paper/`. Wiki
      figures are SVG; the paper uses PDF exports of the selected figures.
    - Every figure MUST support one clear claim and be referenced from nearby text
      or notes.
    - Multi-panel labels such as `(a)`, `(b)`, `(c)` MUST use the same font, size,
      style, and relative position; corresponding labels SHOULD align across
      panels.
    - Text inside figures MUST be legible at final rendered size, with consistent
      font sizes for labels, ticks, legends, annotations, and panel labels.
    - Labels, legends, annotations, arrows, and panel marks MUST NOT overlap data,
      axes, colorbars, or other informative content.
    - Axes and colorbars MUST name quantities and units where applicable.
    - Related figures MUST use consistent variable names, colors, markers, line
      styles, limits, and normalization when comparing the same quantities.
    - Prefer vector formats for plots when practical; avoid decorative styling.
    - Before marking a figure ready, compile or render it and inspect final-size
      output for alignment, readability, overlap, missing labels, and consistency
      with captions or notes.
    
    The guided research contract in full, as scaffold installs it into a project. Scroll inside the box to read it. Open the file in a new tab
  3. Write the plan

    PLAN.md is the physicist’s document, and the only place the scientific direction is set. The scaffold installs it read-only, so the physicist unlocks it, writes the goal and the first tasks, and locks it again:

    chmod +w PLAN.md
    $EDITOR PLAN.md
    chmod 0444 PLAN.md
    

    The plan is a scientific brief, not a prompt. It states the goal and the model, and then numbered tasks, each saying what to compute, what counts as a result, where the files go, and how much freedom the agent has to deviate. A first task typically asks for an implementation and a validation against known limits; a later one for a parameter scan with a plot. The opening of a real plan, shortened (its physics is explained on the Example page), shows the shape:

    # Research Plan
    > Owned by the human researcher. The agent must read this
    > file at the start of every session and must not modify it.
    
    ## Goal
    We study the phase diagram of the blockade Hamiltonian
    [...] as function of Ω/Δ [...]. The method is based on
    large scale numerical MPS simulations using TenPy on the
    computer cluster available.
    
    ## Tasks
    Task 1: Read the relevant files and get familiar with the
    problem and the objectives. Then, write a summary of the
    Hamiltonian and the main objective in the draft.tex.
    Task 2: Prepare the steps to perform numerical simulations
    using TenPy. [...]
    Task 3: Perform a fast scan of the phase diagram. [...]
    

    The note at the top of the plan is backed by the contract from the previous step, whose clause on the plan makes it the physicist’s document:

    Commit the scaffold and the plan before the agent starts, so that everything it does afterwards is visible as a change against a clean starting point.

  4. Warm the agent up

    Start the agent from the project root and give it one instruction before any research task:

    Prompt to the agent:

    Warm up by reading AGENTS.md and every file it links. Report back when you understand the project and await my first research task.

    The agent runs research-warmup, which checks that the scaffold is complete, prints how much of its usage allowance is left and what resources the machine has, and shows the Git state; then it reads the manifest, the contract, the plan, the task proposals, the problem list, the lab book, the wiki’s overview and its own memory. A session that skips the warm-up rediscovers things the lab book already knows. The contract prescribes the warm-up:

  5. Hand over one task and let the agent run

    Give the agent one task from the plan, by number, and leave it alone:

    Prompt to the agent:

    Work on Task 3 as described in PLAN.md.

    The agent plans, calculates, codes, submits jobs, waits, evaluates and documents, for as long as the task takes, without stopping to ask. A task can take an afternoon or run for days on the cluster. The agent keeps three records. The lab book holds a terse entry for every step, failed ones included. Its working notes go to memory/, so that the next session starts where this one stopped. The wiki in wiki/ is the interface to the physicist: for each finding a page with a short explanation, the plot, the caveats, and links to the code and data behind it.

  6. Read the wiki, give feedback, repeat

    When the agent returns, the person reads the wiki, not the code and not the lab book. The wiki is where the agent explains itself to a person, and the plot is usually what decides the next step. The following screenshot shows the entry page of a project’s wiki in Obsidian:

    Obsidian with a fictional project open as a vault: on the left the file tree with paper, the wiki folder expanded to concepts, literature, studies, glossary, index and overview, and the files LOG, PLAN, PROBLEMS and TASKS; on the right the wiki's overview page with the question, the current picture with links to two studies, an embedded plot of Binder cumulant curves for three system sizes crossing at one point, a question about the crossing with the agent's answer below it, and the key results with their status. (enlarge)
    The entry page of a project’s wiki in Obsidian. Every claim links its study and carries its status. A question can also be left on a page, as in the box, and the agent answers it there.

    The feedback is a scientific conversation in the terminal: which result settles the question, which does not, which idea to drop, what to compute next. When the evidence suggests a new direction, the agent proposes a task in TASKS.md; it works on the proposal only once the physicist has copied it into the plan. Larger corrections go into the plan, which the person unlocks, edits and locks again; then the next task goes to the agent. A project goes round this loop for weeks. The Example page describes the decisions of one project at several of its turns, including a dead end the physicist closed.

  7. Collect the results and write the paper

    At the end the wiki holds more than a paper needs: every finding, every dead end, every plot. The person decides which results carry the argument, asks the agent to move those figures, equations and verified references into paper/, and writes the text. The agent may not write a paragraph there. The contract’s clause on the two directories draws the line:

    So the physicist writes the manuscript text, and the agent supplies figures, equations, verified references and, on request, an annotated proof-reading pass with its findings in a separate file. How that division of labour reads in a finished paper is on the Example page.

The guided loop: one task at a time

Under the guided contract the physicist gives one task, the agent works it to completion or to a real blocker, and returns with the outcome, the evidence and the remaining risks. Inside the task the agent does not stop to ask. The loop in full:

The guided loop. The task enters at the top left and the loop ends by returning to the human at the bottom right — the difference between this contract and the autonomous one.

Every pass through the loop leaves an entry in LOG.md, the lab book. An entry has a fixed shape, goal, task, a one-line method, outcome, next step and references to the data, code, notes and wiki pages behind it, and the agent writes it with the research-log helper. The lab book is a ledger, not a notebook: the detail sits in the files it points to, and a physicist opens it to trace a claim back to its run:

A light editor view of the top of a LOG.md lab book: two complete entries, newest first, each with goal, task, a one-line method, outcome, next step and references to the run directory, the code, the task notes and a wiki page. (enlarge)
Every step leaves one terse entry, and each entry points at the run and the pages behind it.

The rule behind the lab book is short, and its last line is the one the agents quote back when asked why they log a failed attempt:

Two further rules matter most when nobody is watching. The agent may not make a result look better by changing what is measured, nor by keeping only the random runs that happened to come out well (choosing the seeds, the numbers that start them), and it may not cite a paper it has not verified:

Rules about record-keeping would be a burden if the agent had to honour them by hand, so the scaffold ships a set of helper commands that make the correct record the convenient one. The agent has already used two of them, research-warmup and research-log. research-run executes a command, captures its output under data/ and writes the matching lab-book entry in one go. research-lit adds a paper by its DOI: it fetches the bibliography entry from the publisher’s record and files the PDF beside a note, and the paper counts as read only once the agent has written that note. research-wiki creates wiki pages from templates, rebuilds the index and checks links and layout. research-audit checks the bookkeeping before a report. The Technical Details page lists them all.

Running jobs on the cluster

In the einstein container the agent submits jobs the same way a person does. The cluster’s job scheduler, the program that queues every user’s computations and starts each one when a machine is free, puts the agent’s jobs into the same queue as everyone else’s, under the same fair-share rules, which give priority to users who have used the cluster least. The contract requires a runtime estimate before a launch and a status check when that time is up. Waiting costs nothing: after submitting, the agent starts a small helper, slurm_wait, as a background process that polls the queue and exits when the job leaves it, and the agent software, Claude Code for example, notices that the helper has exited and resumes the agent. Until then the agent sleeps and spends no tokens. On waking it evaluates the results, fixes what went wrong, resubmits, and makes the plots, so the person coming back in the morning often finds the results already in the wiki. The queue itself is nothing special, which is the point:

A dark terminal showing a cluster queue listing with a handful of agent-submitted jobs (running and pending), next to the agent's own monitoring output. (enlarge)
The agent submits to the same queue as everyone else and watches it with the same tools.

The two unattended contracts (experimental)

The fully autonomous contract and the automatic optimizer are experimental: only the guided contract has been through a full project. The fully autonomous contract changes one thing in the guided loop: it no longer returns to the human. The contract’s first clause defines it:

Supervision moves from the terminal to a chat channel named in the plan. At each checkpoint the agent posts a short report there, with the problem, the approach, the result, the next step and a plot, and reads the replies before its next decision. A question to the supervisor must come with a default action and a deadline, so a supervisor who is asleep does not stall the run. The automatic optimizer contract is narrower still: the agent improves one function (for example, a solver whose accuracy the program scores) against a fixed scoring program it may not touch, committing every version before it is scored. Both take their loop and their “never stop” rule from Andrej Karpathy’s autoresearch, an agent that improves a training script overnight against a fixed evaluation [1].

References

  1. autoresearch: AI agents running research on single-GPU nanochat training automaticallyA. Karpathy (2026) · github.com/karpathy/autoresearch

Feedback

Every heading, paragraph, list item, figure and table on this page now has a short label in the margin, such as sw14. The label lets you point at the exact passage you mean.

A later version may number the page differently, so clicking a label copies it together with the version, as in sw14@70e35cc92aed.

For a correction, a suggestion or a question, paste the copied labels into an email to the address above and add what you would change or want to know.

The labels stay on as you move between pages. Press Labels off in the footer to hide them.