{
 "kind": "test",
 "record_id": "test:thklu3q",
 "url": "https://headlesson.com/tests/thklu3q",
 "app": {
  "id": "app:duckdb",
  "name": "DuckDB",
  "made_by_headlesson_operator": false,
  "url": "https://headlesson.com/apps/duckdb"
 },
 "mcp_get": "headlesson_get id=\"app:duckdb\" sections [\"lesson\",\"gotchas\"]",
 "dates": {
  "tested": "2026-10-11",
  "record_confirmed": "2026-10-11",
  "note": "Elapsed days are not shown; judge age from these dates."
 },
 "question": "Create a small CSV, aggregate it with SQL and get the result as JSON and CSV.",
 "conclusion": "On 2026-10-11, the headlesson operator ran all 6 steps of this lesson with DuckDB 1.5.6 (macOS26.5.2 arm64; Homebrew duckdb 1.5.6 bottle installed during this test; self-made CSV input only), and all passed. The final Next step is advice and was not run. An independent check (revision 3fadc9d) covered: The installation step was not performed during the independent check, so 0 of 6 steps were verified consecutively from the start of the lesson. The outputs of the later five steps were checked separately, and values matched across JSON, CSV and Parquet. Its limits: Not an independent pass of the whole lesson. The JSON sum is a string and the Parquet type is DOUBLE. This is the operator's own run, not a vendor claim.",
 "tested": {
  "date": "2026-10-11",
  "version": "1.5.6",
  "environment": "macOS26.5.2 arm64; Homebrew duckdb 1.5.6 bottle installed during this test; self-made CSV input only",
  "status": "passed",
  "steps_passed": 6,
  "steps_total": 6
 },
 "steps": [
  {
   "step": "brew install duckdb",
   "result": "passed"
  },
  {
   "step": "duckdb --version",
   "result": "passed"
  },
  {
   "step": "printf 'region,product,amount\\nnorth,apple,3\\nnorth,pear,5\\nsouth,apple,7\\nsouth,apple,1\\neast,pear,4\\n' > sales.csv",
   "result": "passed"
  },
  {
   "step": "duckdb -init /dev/null -json -c \"SELECT region, count(*) AS n, sum(amount) AS total FROM 'sales.csv' GROUP BY region ORDER BY total DESC\"",
   "result": "passed"
  },
  {
   "step": "duckdb -init /dev/null -csv -c \"SELECT product, avg(amount) AS avg_amount FROM read_csv('sales.csv') GROUP BY product ORDER BY product\"",
   "result": "passed"
  },
  {
   "step": "duckdb -init /dev/null -c \"COPY (SELECT region, sum(amount) AS total FROM 'sales.csv' GROUP BY region) TO 'totals.parquet' (FORMAT parquet)\"",
   "result": "passed"
  }
 ],
 "next_advice": "Next: Agree with the user on the real data files and whether any output file may be written; run DESCRIBE SELECT * FROM '<file>' first to check the inferred column types, then run the aggregate with -json and compare row counts with the source.",
 "cautions": {
  "note": "These notes come from the lesson. Some describe failures seen in tests; others are general cautions. Each one is not a separately tested result.",
  "items": [
   "sum() over an integer column returns HUGEINT, which -json prints as a quoted string (for example \"total\":\"8\"); CAST to BIGINT or DOUBLE when a JSON number is needed.",
   "The CLI runs ~/.duckdbrc on startup; pass -init /dev/null for a reproducible run.",
   "Column types are inferred from the CSV contents; check them with DESCRIBE before relying on numeric or date columns.",
   "Without a database file the CLI uses a temporary in-memory database; tables created there are lost when the command exits.",
   "Rows with equal ORDER BY values come back in no guaranteed order; add a tie-breaker column for stable output.",
   "Confirm: Check which files a query reads and writes (COPY ... TO overwrites paths) and confirm row counts and types before passing results to a downstream step."
  ]
 },
 "not_shown": [
  "Not measured in this run: remote files (httpfs/S3).",
  "Not measured in this run: extension installation over the network.",
  "Not measured in this run: large files.",
  "Not measured in this run: the web UI.",
  "Not measured in this run: safe mode.",
  "Not measured in this run: real user data.",
  "Whether an agent new to this tool can use it from this record alone (the operator wrote and ran the lesson).",
  "Comparisons between models or clients.",
  "Production use, accounts, or real customer data.",
  "Behaviour of the latest version (the test is tied to the version and date below).",
  "The final \"Next\" step is advice and was not part of the test."
 ],
 "primary_record": "Operator record: a past lesson trial (legacy). It is not claimed to meet level L1 of run-task-contract/0.1.0.",
 "independent_check": {
  "state": "recorded",
  "revision": "3fadc9d6215b5a823c490dfc86f16d93dac683b2",
  "scope": "The installation step was not performed during the independent check, so 0 of 6 steps were verified consecutively from the start of the lesson. The outputs of the later five steps were checked separately, and values matched across JSON, CSV and Parquet.",
  "limits": "Not an independent pass of the whole lesson. The JSON sum is a string and the Parquet type is DOUBLE."
 },
 "evidence": "A non-public test report exists and is not published, so third parties cannot check it directly.",
 "source_version": {
  "record": "the catalog record app:duckdb at revision 9bafd789f564",
  "rule": "the revision after which the recorded test stayed unchanged"
 },
 "sources": [
  {
   "fields": [
    "/question",
    "/next_advice",
    "/cautions/items/2",
    "/cautions/items/4",
    "/cautions/items/5"
   ],
   "source": "headlesson editorial judgement",
   "checked": "2026-10-11",
   "certainty": "inferred",
   "by": "editorial"
  },
  {
   "fields": [
    "/steps/0/step"
   ],
   "source": "https://duckdb.org/install/",
   "checked": "2026-10-11",
   "certainty": "primary",
   "by": "official"
  },
  {
   "fields": [
    "/steps/1/step",
    "/steps/2/step",
    "/steps/3/step",
    "/steps/4/step",
    "/steps/5/step",
    "/cautions/items/0"
   ],
   "source": "headlesson editorial judgement",
   "checked": "2026-10-11",
   "certainty": "primary",
   "by": "editorial"
  },
  {
   "fields": [
    "/cautions/items/1",
    "/cautions/items/3"
   ],
   "source": "https://duckdb.org/docs/current/clients/cli/overview.html",
   "checked": "2026-10-11",
   "certainty": "primary",
   "by": "official"
  }
 ],
 "corrections": [],
 "withdrawn": null,
 "cite": "headlesson test:thklu3q — DuckDB 1.5.6, 2026-10-11: 6/6 lesson steps passed (operator record). On 2026-10-11, the headlesson operator ran all 6 steps of this lesson with DuckDB 1.5.6 (macOS26.5.2 arm64; Homebrew duckdb 1.5.6 bottle installed during this test; self-made CSV input only), and all passed. The final Next step is advice and was not run. An independent check (revision 3fadc9d) covered: The installation step was not performed during the independent check, so 0 of 6 steps were verified consecutively from the start of the lesson. The outputs of the later five steps were checked separately, and values matched across JSON, CSV and Parquet. Its limits: Not an independent pass of the whole lesson. The JSON sum is a string and the Parquet type is DOUBLE. This is the operator's own run, not a vendor claim. https://headlesson.com/tests/thklu3q",
 "page_updated": "2026-10-13"
}
