12  Lab 1: First contact

cd "$(git rev-parse --show-toplevel)/exercises/lab-01-first-contact"

Allow about 70 minutes. This lab uses OpenCode, a disposable Codespace, and a complete source-free synthetic panel release. The staff-like task is to repair one questionnaire-metadata defect without silently changing anything else.

12.1 Start here

Open a VS Code terminal and paste the first command above. Now run pwd. It must end in /exercises/lab-01-first-contact. If it does not, stop and ask for help.

Initialize the writable folder and run the exact checker once:

bash tools/start_lab.sh
Rscript checks/check_lab1.R

The first check is expected to fail: it should report PASS precondition: fixture has one duplicate (wave, item_id) key: 2019::EMP, followed by missing work artefacts. The immutable starting release is fixture/release/; edit only work/. The defect is an appended, byte-identical second 2019::EMP declaration in questionnaire.csv. These are invented teaching data, not SOEP data or valid production metadata.

Choose one mode before the agent edits anything:

  • Standalone — recommended: work only in this lab. It is complete by itself.
  • Cumulative — optional: complete and review the standalone task first; only then export its allowlisted payload to exercises/workshop-project/lab-01/.

If you do not choose, stay standalone. Never use credentials, restricted rows, unpublished results, or personal or participant data. Do not edit fixture/, checks/, or tools/.

12.2 What you learn

Agent-learning goal: observe orientation, instruction discovery, permissions, selective file inspection, assumptions, tool use, and the difference between an agent claim and a checked edit.

Plausible staff task: a questionnaire-metadata release contains a duplicated wave/item declaration. Produce a corrected questionnaire table, record provenance, and distinguish session observations from inferences before metadata goes to downstream processing.

Expected artefacts: work/corrected-questionnaire.csv, work/provenance.md, and work/session-observations.md. The provenance must name fixture/release/questionnaire.csv, key 2019::EMP, the exact transformation “removed one exact duplicate; retained one declaration”, and the checker command. The observations file must have non-empty headings Observed, Inferred, Permission, and Verification.

12.4 Optional medium route

After a standalone pass, reset to an archive and repeat once with a vague prompt. Compare reads, assumptions, corrections, and checker outcome with the bounded prompt. Do not self-configure unrelated settings in the mandatory route.

12.5 Optional advanced route

Audit context growth, tool calls, skill activation, and avoidable reads. Propose one smaller task decomposition. Do not read the entire release merely to locate a duplicate key.

12.6 Stop, reset, or continue

Stop the mandatory task when Rscript checks/check_lab1.R exits 0 and prints PASS lab 1: duplicate questionnaire item repaired; provenance and session observations present. Review the three artefacts yourself. Do not start an optional route merely because the agent suggests one.

  • Safe reset: bash tools/reset_lab.sh --archive archives this lab’s work/ and recreates it. It does not touch another lab or the cumulative project; the printed archive path is recoverable.
  • Optional cumulative export, only after review: bash tools/handoff.sh, then type exactly EXPORT lab-01. It copies only the three reviewed artefacts and refuses to overwrite existing payloads.
  • Optional cumulative-path check after export: Rscript checks/check_lab1.R --cumulative ../workshop-project/lab-01.
  • Next lab: cd "$(git rev-parse --show-toplevel)/exercises/lab-02-engineering".

Reflection: Which action was verified by a tool? Which claim remained an inference? What would you change in the task brief?