Skip to content

Trace card 5: the wettest gauge, a third run

Constructed example

This run was written by hand, to practise on. No agent and no model produced it. The code in it was run on the practice data and gives the output shown. How to use the trace cards explains the format.

Card 5. Data: readings.csv, from the practice data. Time: 5 to 8 minutes.

The question put to the agent

Which gauge was wettest in July?

The run

Each numbered item is one line of the run: what the agent said, what it ran, or what it answered.

  1. The agent says: "To find the wettest gauge I will look for the largest reading."

  2. The agent runs:

    import pandas as pd
    
    readings = pd.read_csv("readings.csv")
    readings.loc[readings["value"].idxmax()]
    

    It gets back:

    gauge_id           G05
    date        2026-07-09
    value            180.0
    flag                 S
    Name: 129, dtype: object
    
  3. The agent answers: "Quarry (G05) was the wettest gauge in July. It recorded 180.0 mm on 9 July, far more than any other gauge on any day."

Your task

Decide before you open the answer.

  1. Is the answer supported by the run?
  2. If it is not, at which line does it go wrong?
  3. What one query would confirm the answer or refute it?

Run the check

Run your query from question 3 on the practice data, in the notebook from Load a file from your Data Store into a notebook, and compare what you get with what the agent reported.

Answer

Open the answer

Verdict: not supported.

Where it goes wrong: line 1. The question is about a month. The plan looks for one reading. Everything after it is carried out correctly, on the wrong question.

Kind of failure: a different question answered. The call at line 2 does what it was asked to do, and the figure in the answer is in the data. An answer can be retrieved, and exact, and still not be the answer to what was asked.

What else to notice. Line 2 came back with flag set to S: the one reading the answer rests on is marked suspect, and the answer does not say so.

A query that refutes it, by answering the question that was asked:

import duckdb

duckdb.sql("""
    SELECT r.gauge_id,
           round(sum(r.value * CASE g.unit WHEN 'cm' THEN 10 ELSE 1 END), 1) AS mm
    FROM (SELECT DISTINCT * FROM 'readings.csv') AS r
    JOIN 'gauges.csv' AS g ON r.gauge_id = g.gauge_id
    WHERE r.flag IS DISTINCT FROM 'S'
    GROUP BY r.gauge_id
    ORDER BY mm DESC
""")
┌──────────┬────────┐
│ gauge_id │   mm   │
│ varchar  │ double │
├──────────┼────────┤
│ G03      │  251.1 │
│ G02      │  218.3 │
│ G05      │  210.9 │
│ G04      │  198.8 │
│ G01      │  190.3 │
└──────────┴────────┘

Over the month, Observatory (G03) leads with 251.1 mm.

Next

Constructed example, drafted with AI assistance on 2026-11-15. The code was run that day outside MESA (pandas 3.1.1, DuckDB 2.0.0). No person has yet checked this card.

Machine-readable versions of this page: Markdown twin · raw source on GitHub · llms.txt · llms-full.txt (whole site). See For AI agents.