Session 13 · Tuesday 27 October 2026

Make the agent show its work

16.S893AI Agents for Engineering Research

Today

  • Effectively supervising agent work
  • When and what to outsource to an agent
  • Pod discussions
  • Making agent work easier to review

Agents often give you something like this

Commit 24d25af (AA-15, "xfoil_polar v1.2: Cp files in both modes") adds an optional
`cp: true` request field to `xfoil_polar`. In either `viscous` or `inviscid` mode, it
writes an XFOIL `CPWR bl/aNNN.cp` file per angle and sets `points[].cp_file` for
converged points (null otherwise, with a new `cp_file_missing` warning for
missing/truncated files). `boundary_layer` now implies `cp`. Backlog task AA-15 is
marked Done, with updated contract/schemas/SKILL, Python/Node test suites passing
(184/27, no stray processes), and a real-binary test matching inviscid Cp at α=4°
against a direct XFOIL `CPWR` run within 2e-5. It appears to work as implemented.

Two extremes of working with agents

Accept everything
  • You go fast at first
  • You build up cognitive debt
  • You cannot build on the work, because you do not know whether it works or whether you can trust it
Read everything
  • You read every diff and every log
  • You become the bottleneck
  • Reading code that someone else wrote is slow, so you lose the time the agent saved you

Identify the core intellectual contribution of your project, and do that part yourself.

On the rest of the project, you supervise, and you judge the work that the agent did on your behalf.

What's the balance?

A plotting scriptA solver boundary condition
1 How likely is the agent to be wrong?Not veryQuite likely
2 How bad would a missed error be?Cheap, you redo the plotEvery result after it is wrong
3 How easily would you notice it?Easily, the plot looks wrongHardly, the numbers look plausible
So how closely should you check it?A quick glance is probably good enoughCheck it thoroughly. Make it programmatic and systematic, with no magic numbers

Beyond all this, you need to check your core contribution yourself, thoroughly.

When code is cheap to write

  • You can afford far more elaborate tests than you would write by hand, e.g., compare two languages before you choose one
  • You can start over with what you learned, because the agent can rebuild the routine parts quickly
  • The core still needs your time, because you have to build on top of it, and that needs strong foundations

Four kinds of code in a project

Kind of codeWhat it isEvidence it needs
ThrowawayCode you will delete, such as exploration scripts or a quick benchmarkIt runs and the output looks right
ScaffoldingCode that runs your work, such as job scripts. If it breaks, you see it failIt runs end to end, and you saw it
InfrastructureCode your results pass through, such as parsers or a wrapped solver. An error here changes your numbers silentlyA test against an independent reference, such as a direct solver run or a known case, that fails without the change
CoreThe formulation and the analysis behind your claimA re-run case, a known limit or independent data

A test needs the same evidence as the code it tests. No test is throwaway.

Group work, 30 minutes, in last week's pods, starting from last week's project presentations. Step 1, on your own for a few minutes, sort the parts of your project into four kinds, and note any part that does not fit neatly. Throwaway, quick tests, explorations and benchmarks you will delete: will you delete it? Scaffolding, code that runs your work, such as job scripts: if it broke, would you see it fail? Infrastructure, code your results pass through, such as a parser: would an error change your numbers without warning? Core, your intellectual contribution: is it what your paper or thesis claims? Step 2, in your pod, take turns. Explain your sort, and the pod challenges it with the questions. Aim to get through everyone, but it is fine if you do not.

Making agent work easier to review

Questions to ask about an agent's work

QuestionWhat it catches
What exactly is claimed, and how sure is the agent?A vague claim
Was each claim measured, or only stated?“It is faster”, with nothing timed
Where is the command and its output?“It works” with no proof
Does the new test fail without the change?Tests that don’t test anything
Was any test or check changed or deleted?Passing by weakening the check
What would show this is wrong, and did anyone look?Looking only for confirmation
Which one or two things does the result depend on?Missing the part that matters most
The walkthrough extension, one pi package with a command, a skill and two tools. The /walkthrough command sends the skill to the agent and turns off its other tools. The agent calls the record tool, walkthrough_record, which runs one command, here or at another commit. It saves the command, its output and exit status to the evidence log, .walkthrough/evidence.jsonl, plus git status before and after. Limits: 20 commands and 5 minutes in total, 60 s per command and 120 s at most. It refuses git changes, rm -r and rm -f. The write tool, walkthrough_write, reads the log, checks each record id, quote and figure, and writes the page, .walkthrough/<title>.html, with sections, checks, limits and the exact command log. The agent runs commands only through the record tool, so the log lists everything it ran.

Demo

# Ask for a walkthrough of the last several commits
pi
> /walkthrough explain to me all the changes that we made in the previous
  several commits and how that improved and sped up the code
# Your turn. Install the extension from npm
pi install npm:show-not-tell

# Then start a fresh session in your own repository and ask
pi
> /walkthrough my last commit that changed code

Techniques so far

TechniqueSessionIn one line
Context2, 3All the model knows about your problem is in the window
Skill3A file the model reads when the task matches
Sandbox4Limit what a wrong tool call can do
Approved tests6The agent proposes tests; you approve them
Task file7One task, one fresh session, one approved test
Tool, script, agent7Where does the output go? A schema, a file, a fresh context
Walkthrough13The agent records what it ran; you check what matters
By Thursday 5 November

Do

  • In a fresh session, run /walkthrough on the last feature you built for your project, and commit the page to your repo
  • Write a dev-log paragraph that identifies your core contribution, one part you do not yet know how to check, and how you plan to check it

Read

Back to course home