agents-last-exam/agents-last-exam huggingface dataset:
Title: Mask Mandate Moment-In-Time Ratio
Domain: health_medicine — Public Health & Epidemiology

Summary: Estimate the causal moment-in-time effect of a county-level mask mandate from a staged matched-pair county panel and produce the required six-value results JSON.

Task prompt:
You are working on a Linux VM to estimate the moment-in-time effect of a county-level mask mandate.

Visible task files:
- `base/input/task_prompt.md`
- `base/input/output_schema.json`
- `base/input/county_panel.csv`
- `base/input/matched_pairs.csv`
- `base/software/README.txt`

What you must do:
1. Read the staged task prompt and output schema.
2. Build the stacked matched-pair county-day analysis frame and engineer the required lagged features.
3. Fit the specified quasi-Poisson mixed model with the spline-by-treatment interaction.
4. Compute the policy-effect ratios at relative days 14, 28, and 42, plus the arithmetic mean over days 1..42.
5. Write exactly one file to `base/output`:
   - `base/output/results.json`

Output rules:
- Write valid JSON only.
- Use exactly the six keys listed in `output_schema.json`.
- Output numeric values, not strings.
- Do not modify the staged input files and do not write outside `base/output`.


The agent must:
Read the staged task prompt and output schema before doing any analysis.
Build the stacked matched-pair county-day analysis frame and the required lagged predictors.
Fit the specified quasi-Poisson mixed model with the spline-by-treatment interaction.
Write exactly one `output/results.json` file containing the six required numeric keys.

Software: R
nlme
MASS
splines
dplyr
jsonlite

Input files:
name: task_prompt.md
format: Markdown
path: input/task_prompt.md
description: Agent-visible epidemiology task brief with the full modeling contract.
name: output_schema.json
format: JSON
path: input/output_schema.json
description: Exact six-key output schema for `results.json`.
name: county_panel.csv
format: CSV
path: input/county_panel.csv
description: Daily county-level panel with incidence, weather, visitation, R, and demographic covariates.
name: matched_pairs.csv
format: CSV
path: input/matched_pairs.csv
description: Matched-pair intervention table with `group_id`, `mask_grp`, and `mask_time`.
name: README.txt
format: text
path: software/README.txt
description: Agent-visible runtime note describing the planned Stage 4 `software/Rscript` entry point.
Title: Continuous Treatment Shift Simulation Replication
Domain: health_medicine — Public Health & Epidemiology

Summary: Reproduce a causal-inference Monte Carlo simulation study comparing IPTW, A-IPTW, and TMLE under a continuous-treatment shift intervention.

Task prompt:
You are working on a Linux R biostatistics simulation benchmark.

Task root:
- `base`

Read the staged task specification and schema:
- `base/input/simulation_spec.pdf`
- `base/input/simulation_spec.txt`
- `base/input/task_instructions.md`
- `base/input/output_schema.json`

Your job is to reproduce the continuous-treatment shift-intervention simulation study from the specification.

Required work:
1. Estimate the large-sample Monte Carlo truth for `psi0 = E[Q(A + 2, W)]` using at least 1,000,000 draws.
2. Implement IPTW, A-IPTW, and TMLE estimators for the shift intervention.
3. Run at least 1000 repetitions for each sample size: 50, 100, 200, and 500.
4. Summarize mean estimate, bias, variance, Monte Carlo SE, 95% interval, and coverage for every estimator/sample-size pair.
5. Write all deliverables only under `base/output`.

Required outputs:
- `base/output/summary_results.csv`
- `base/output/coverage_results.csv`
- `base/output/comparison_plots/` with at least one non-empty `.png` or `.pdf`
- `base/output/summary_findings.txt`
- `base/output/run_metadata.json`

Software guidance:
- Use the provisioned R entry point `base/software/Rscript`.
- You may write temporary simulation files inside `base/output`.

The agent must:
Read the staged simulation specification and output schema.
Estimate the Monte Carlo target truth with at least 1,000,000 draws.
Implement IPTW, A-IPTW, and TMLE for the A+2 shift intervention.
Run at least 1000 repetitions for each required sample size.
Write summary CSVs, comparison plots, metadata, and findings under output/.

Software: R
Rscript

Input files:
name: simulation_spec.pdf
format: pdf
path: input/simulation_spec.pdf
description: Original submitted simulation specification.
name: simulation_spec.txt
format: txt
path: input/simulation_spec.txt
description: Text extraction of the simulation specification.
name: task_instructions.md
format: md
path: input/task_instructions.md
description: Agent-facing task instructions and required output filenames.
name: output_schema.json
format: json
path: input/output_schema.json
description: Required output columns, sample sizes, and estimator labels.
Title: Sepsis-Associated AKI Phenotyping
Domain: health_medicine — Clinical Informatics & Care Operations

Summary: Read staged synthetic MIMIC-IV style tables and identify the ICU patients who satisfy Sepsis-3 plus KDIGO SA-AKI timing criteria.

Task prompt:
You are working on a Windows clinical phenotyping task over staged synthetic MIMIC-IV style tables.

Use the staged data under `base\input` and the stable Python entry point `base\software\python.bat`.

Your job is to identify patients who developed sepsis-associated acute kidney injury (SA-AKI) during an ICU stay by operationalizing:
- Sepsis-3 onset
- KDIGO AKI staging
- the requirement that AKI begins within 7 days after sepsis onset during the same ICU stay

Visible raw data locations:
- Hospital tables: `base\input\mimic_synthetic\hosp`
- ICU tables: `base\input\mimic_synthetic\icu`
- Note tables: `base\input\mimic_synthetic\note`

Important raw files you will likely need:
- `base\input\mimic_synthetic\hosp\admissions.csv.gz`
- `base\input\mimic_synthetic\hosp\labevents.csv.gz`
- `base\input\mimic_synthetic\hosp\microbiologyevents.csv.gz`
- `base\input\mimic_synthetic\hosp\patients.csv.gz`
- `base\input\mimic_synthetic\icu\icustays.csv.gz`
- `base\input\mimic_synthetic\icu\chartevents.csv.gz`
- `base\input\mimic_synthetic\icu\outputevents.csv.gz`
- `base\input\mimic_synthetic\icu\datetimeevents.csv.gz`

What you must do:
1. Read the staged raw CSV tables directly from `base\input\mimic_synthetic`.
2. Determine which ICU patients satisfy the SA-AKI definition from the staged cohort.
3. Write exactly one CSV file to `base\output\sa_aki_patients.csv`.

Output rules:
- The file must be named exactly `sa_aki_patients.csv`.
- The header row must be exactly `subject_id`.
- Each subsequent row must contain one integer `subject_id`.
- Do not add any other columns, commentary, or sidecar outputs.
- Do not write outside `base\output`.


The agent must:
Read the staged synthetic MIMIC-IV tables under `input/mimic_synthetic/`.
Operationalize Sepsis-3 onset plus KDIGO AKI staging during ICU stays.
Restrict positives to patients whose AKI begins within 7 days after sepsis onset during the same ICU stay.
Write exactly one CSV to `output/sa_aki_patients.csv` with a single `subject_id` column.

Software: Python
pandas
NumPy

Input files:
name: mimic_synthetic/hosp
format: directory of `.csv.gz` files
path: input/mimic_synthetic/hosp
description: Hospital tables including admissions, labs, medications, microbiology, and patient demographics.
name: mimic_synthetic/icu
format: directory of `.csv.gz` files
path: input/mimic_synthetic/icu
description: ICU tables including stays, charted events, urine output, and datetime events.
name: mimic_synthetic/note
format: directory of `.csv.gz` files
path: input/mimic_synthetic/note
description: Clinical note tables from the staged synthetic cohort.
name: python.bat
format: Windows batch script
path: software/python.bat
description: Stable task-local entry point to the baseline Windows Python runtime.
Title: Scene3 Skullstrip QC
Domain: health_medicine — Experimental Psychology & Neuroimaging

Summary: Review skull-stripping results for the staged brain MRI case and record the required QC decision.

Task prompt:
You are a neuroimaging analyst completing a GUI workflow in 3D Slicer 5.0.3.

## Your Task
Workflow 3: skull-stripping QC

Goal:
1. Open the staged T1w image and candidate masks in 3D Slicer.
2. Visually compare the three candidate masks for over- and under-stripping.
3. Choose the best candidate.
4. Save qc_result.json with the following fields:
   - "chosen_mask": the filename of the best candidate (e.g. "cand2_mid_mask.nii.gz")
   - "verdict": exactly "OK" if the chosen mask is acceptable, or "NOT_OK" if none are acceptable
   - "rationale": a short explanation of why you chose that candidate

Required output:
- output/qc_result.json

## Input Files
All task inputs are staged in:
- `base/input`

Key staged files:
- `base/input/T1w.nii.gz`
- `base/input/cand1_loose_mask.nii.gz`
- `base/input/cand2_mid_mask.nii.gz`
- `base/input/cand3_strict_mask.nii.gz`
- `base/input/cand1_loose_brain.nii.gz`
- `base/input/cand2_mid_brain.nii.gz`
- `base/input/cand3_strict_brain.nii.gz`
- `base/input/candidates.json`

## Software
Launch the correct GUI workflow with:
- `base/software/launch_gui.sh`

The Desktop task folder is a symlink into `/media/user/data/agenthle/...`, so write all outputs under the staged task directory only.

## Required Output Files
Save these outputs exactly under `base/output`:
- `base/output/qc_result.json`

## Evaluation
Ensure all required output files exist, are readable, and satisfy the documented output contract.
Focus on this correctness target:
- The JSON must identify the best candidate mask, include a QC verdict, and include a short rationale.


The agent must:
Launch 3D Slicer from `software/launch_gui.sh`.
Open the staged T1w image and inspect the three candidate masks and extracted brain images.
Decide which candidate best balances over- and under-stripping.
Save `output/qc_result.json` containing the chosen mask filename, a verdict, and a short rationale.

Software: Python

Input files:
name: T1w.nii.gz
format: NIfTI volume
path: input/T1w.nii.gz
description: Anatomical image used for skull-strip QC.
name: cand1_loose_mask.nii.gz
format: NIfTI mask
path: input/cand1_loose_mask.nii.gz
description: Deliberately loose candidate.
name: cand2_mid_mask.nii.gz
format: NIfTI mask
path: input/cand2_mid_mask.nii.gz
description: Mid-volume candidate; this is the hidden correct choice.
name: cand3_strict_mask.nii.gz
format: NIfTI mask
path: input/cand3_strict_mask.nii.gz
description: Deliberately strict candidate.
name: cand1_loose_brain.nii.gz / cand2_mid_brain.nii.gz / cand3_strict_brain.nii.gz
format: NIfTI volume
path: input/*.nii.gz
description: Auxiliary extracted-brain views for faster qualitative comparison.
name: candidates.json
format: JSON
path: input/candidates.json
description: Candidate manifest copied from the raw bundle.
Title: SimGlucose Safe Basal Control
Domain: health_medicine — Therapeutic & Oncology Services

Summary: Implement a meal-unannounced, basal-only glucose controller for SimGlucose that satisfies safety gates across hidden patient episodes.

Task prompt:
You are working on a Linux VM to implement a meal-unannounced basal-only glucose controller in SimGlucose.

Visible task files:
- Task brief: `base/input/public/task.md`
- Controller API: `base/input/public/task_api.py`
- Submission format: `base/input/public/submission_format.md`
- Public evaluator: `base/input/public/evaluate_public.py`
- Agent runtime manifest: `base/input/runtime_env/pyproject.toml`
- Agent runtime lockfile: `base/input/runtime_env/uv.lock`

Write your submission under `base/output/submission`.
Required files:
- `base/output/submission/controller.py`
- `base/output/submission/metadata.json`

Optional supporting files:
- `base/output/submission/report.md`
- `base/output/submission/assets/...`
- `base/output/submission/training_code/...`

Rules:
- Follow the public observation/action contract exactly.
- The controller must expose either `build_controller()` or `SubmissionController`.
- Use only the staged task files as your source of truth.
- If you need Python dependencies for solving, install them yourself from `base/input/runtime_env`.


The agent must:
Read the staged public task package under input/public/ including the observation/action contract and submission format
Implement submission/controller.py exposing build_controller() or SubmissionController
Write submission/metadata.json with all required fields
Design a meal-unannounced, basal-only controller using only current CGM, time of day, sample interval, and action bounds

Software: Python 3.11
uv
SimGlucose 0.2.11

Input files:
name: task.md
format: Markdown
path: input/public/task.md
description: High-level task contract
name: task_api.py
format: Python
path: input/public/task_api.py
description: Stable observation wrapper API
name: submission_format.md
format: Markdown
path: input/public/submission_format.md
description: Exact required deliverable shape
name: runtime_env/pyproject.toml
format: TOML
path: input/runtime_env/pyproject.toml
description: Canonical agent-facing runtime manifest
Title: Whole-Slide Tumor Localization
Domain: health_medicine — Clinical Diagnostics & Imaging

Summary: Navigate a CAMELYON16 whole-slide pathology image with provided OpenSlide helper tools and output a structured tumor localization result.

Task prompt:
You are working on a Linux VM with a CAMELYON16 whole-slide pathology image.

Visible files:
- Whole-slide image: `center_point/input/tumor_001.tif`
- Python helper module: `center_point/input/wsi_tools.py`
- Optional runtime dependency manifest: `center_point/input/runtime_env/pyproject.toml`

The helper module provides a `WSINavigationEnvironment` class with methods for slide metadata, thumbnails, region reads, and tissue masks. Use those tools, plus visual inspection of H&E tissue patches, to navigate the slide and localize tumor metastasis.

Your task for this variant:
Find a representative level-0 coordinate near the center of the tumor metastasis. Write `{"x": <float>, "y": <float>}`.

Output requirements:
- Save exactly one JSON file at `center_point/output/prediction.json`.
- Use level-0 slide coordinates.
- Do not modify files under `input/`.
- Do not write outside your assigned output directory.


The agent must:
Use the staged `tumor_001.tif` and `wsi_tools.py` helper module.
Navigate the whole-slide image systematically with metadata, thumbnails, tissue masks, and patch reads.
Visually identify tumor metastasis in H&E tissue patches.
Write exactly one variant-specific `output/prediction.json` file.
Do not modify staged input files or write outside the assigned output directory.

Software: Python
OpenSlide
NumPy
Pillow
Shapely

Input files:
name: tumor_001.tif
format: BigTIFF whole-slide image
path: input/tumor_001.tif
description: CAMELYON16 sentinel lymph node whole-slide image.
name: wsi_tools.py
format: Python module
path: input/wsi_tools.py
description: OpenSlide-based helper class for slide metadata, thumbnails, region reads, and tissue masks.
name: pyproject.toml
format: Python project manifest
path: input/runtime_env/pyproject.toml
description: Optional agent-runtime dependency manifest.
Title: AGORA AI Governance Document Classification
Domain: legal — Compliance & Regulatory

Summary: Classify three cached AI governance documents across legislative status, technical scope, and AI lifecycle stages with verbatim evidence and a gap analysis.

Task prompt:
You are working on a Linux VM as a policy analyst.

Visible task files:
- `base/input/task_spec.md`
- `base/input/taxonomy_and_instructions.md`
- `base/input/document_index.json`
- `base/input/documents/`
- `base/software/README.txt`
- `base/software/python` (optional Python helper entry point)

Your task:
1. Read `task_spec.md`, the sanitized taxonomy instructions, and all three cached document text files.
2. Classify AGORA IDs 768, 1293, and 2047 across legislative status, technical scope, and AI lifecycle stage.
3. For every TRUE label, provide a verbatim evidence quote from the corresponding cached document text.
4. Produce a cross-document matrix and a 150-300 word gap analysis.
5. Write valid JSON to:
   - `base/output/agent_output.json`

Rules:
- Do not modify files under `input/`.
- Use the cached documents under `input/documents/` as the canonical evidence source.
- Keep the final deliverable at exactly `base/output/agent_output.json`.


The agent must:
Read input/task_spec.md, input/taxonomy_and_instructions.md, input/document_index.json, and the three cached document text files.
Classify each document across the provided legislative-status, technical-scope, and lifecycle-stage taxonomies.
Provide verbatim evidence quotes from the cached text for every TRUE label.
Write output/agent_output.json with the requested structured JSON, cross-document matrix, and gap analysis.

Software: Python 3.14.3

Input files:
name: task_spec.md
format: Markdown
path: input/task_spec.md
description: Agent-visible task instructions and required output schema.
name: taxonomy_and_instructions.md
format: Markdown
path: input/taxonomy_and_instructions.md
description: Sanitized taxonomy definitions and public task instructions.
name: document_index.json
format: JSON
path: input/document_index.json
description: Cached document titles, source URLs, and local text filenames.
name: documents
format: Text directory
path: input/documents
description: Cached public document text for AGORA IDs 768, 1293, and 2047.
Title: BAC Arbitration Fee Calculation
Domain: legal — Doctrinal Legal Research

Summary: Calculate Beijing Arbitration Commission institution fees, arbitrator remuneration, and total fees for five arbitration cases using staged Chinese PDF fee schedules.

Task prompt:
You are calculating arbitration fees under the staged Beijing Arbitration Commission (BAC) materials.

## Closed-Book Rule

- Use only the staged materials under `base/input`.
- Do not use outside web search or external regulatory knowledge.

## Inputs

- Task brief: `base/input/task_brief.md`
- Case facts: `base/input/cases.json`
- Output contract: `base/input/output_contract.json`
- Document manifest: `base/input/document_manifest.json`
- BAC PDF documents: `base/input/documents`
- Optional Python runtime manifest: `base/input/runtime_env/pyproject.toml`
- Python 3.12 entry point: `base/software/python3.12`

## Your Task

Calculate, for each of the five listed cases:

- institution fee in RMB;
- arbitrator remuneration in RMB;
- total fee in RMB.

All values must be accurate to two decimal places. Case 4 has a special condition: the parties reached a settlement agreement regarding the dispute before applying for arbitration.

If you want Python PDF tooling, install/use the package manifest under `input/runtime_env/`; do not modify files under `input/`.

## Deliverable

Write exactly one JSON file here:

`base/output/arbitration_fee_results.json`

Follow the schema in `base/input/output_contract.json`. The evaluated numeric fields for each case are:

- `institution_fee_rmb`
- `arbitrator_remuneration_rmb`
- `total_fee_rmb`


The agent must:
Use only the staged BAC source PDFs, case facts, and schema under `input/`.
Calculate the institution fee, arbitrator remuneration, and total fee for all five cases.
Report all evaluated amounts in RMB to two decimal places.
Write exactly one JSON file to `output/arbitration_fee_results.json`.
Do not modify files under `input/`; write final work only under `output/`.

Software: Python

Input files:
name: task_brief.md
format: Markdown
path: input/task_brief.md
description: Agent-facing task brief and deliverable path.
name: cases.json
format: JSON
path: input/cases.json
description: Five dispute amounts and the Case 4 settlement condition.
name: output_contract.json
format: JSON
path: input/output_contract.json
description: Required output filename and case field schema.
name: document_manifest.json
format: JSON
path: input/document_manifest.json
description: Manifest for the seven staged BAC PDFs.
name: documents
format: PDF directory
path: input/documents/
description: Seven BAC Chinese-language PDF source documents.
name: pyproject.toml
format: TOML
path: input/runtime_env/pyproject.toml
description: Optional Python PDF-library runtime manifest.
name: python3.12
format: Shell wrapper
path: software/python3.12
description: Python 3.12 entry point verified during Stage 4.
Title: WGS Variant Calling
Domain: life_sciences — Genomics & Sequence Analysis

Summary: Run a germline variant-calling workflow on real HG002 reads from a 1 Mb GRCh38 chromosome 17 region and produce a filtered VCF for evaluator-side benchmarking.

Task prompt:
You are given paired-end HG002 sequencing reads covering a 1 Mb region of GRCh38 chromosome 17, plus the GRCh38 chromosome 17 reference.

Run an Ubuntu-native germline variant-calling workflow using `bwa`, `samtools`, and `bcftools`, then produce a filtered VCF containing SNP and INDEL calls.

Task directory:
- `base`

Input directory:
- `base/input`

Available environment:
- `bwa`, `samtools`, `bcftools`, FastQC, MultiQC, and RTG Tools are preinstalled on `PATH`

Required outputs under `base/output`:
- `region_R1_fastqc.html`
- `region_R2_fastqc.html`
- `multiqc_report.html`
- `flagstat.txt`
- `duplication_metrics.txt`
- `variants.filtered.vcf.gz`
- `variants.filtered.vcf.gz.tbi`
- `rtg_summary.csv` with the header `Type,Precision,Sensitivity,F_measure` and rows for SNP and INDEL; metric values may be `NA`

Do not ask for confirmation. Execute directly.

The agent must:
Run an Ubuntu-native germline variant-calling workflow on real HG002 paired-end reads from the staged 1 Mb chr17 region.
Write outputs only under `output/` while keeping the staged input files untouched.
Work directly on Ubuntu; Windows + WSL is no longer the canonical runtime.


Input files:
name: region_R1.fastq.gz
format: gz
path: input/region_R1.fastq.gz
name: region_R2.fastq.gz
format: gz
path: input/region_R2.fastq.gz
name: chr17.fa
format: fa
path: input/chr17.fa
description: GRCh38 chromosome 17 reference FASTA.
name: chr17.fa.fai
format: fai
path: input/chr17.fa.fai
description: FASTA index for the chromosome 17 reference.
name: chr17.dict
format: dict
path: input/chr17.dict
description: Sequence dictionary for the chromosome 17 reference.