As a clinical trial statistician or programmer, answer three short questions in Your review: the task, the inputs and outputs, and the AI-assisted review. Agreeing with all three approves this benchmark; disagreeing with any needs a comment. Propose a fix with the Edit button on any source file, or add it to your comments.
We suggest spending no more than 5 minutes on a review. The other tabs beside Your review are background for assessment, not under review.
Summary
README.mdPublic entries: Python and R. Passing coverage requires an installed inventory.
Goal: build a reviewer-ordered adverse event listing carrying
ASEQ, AETERM, ASTDT, and ASEV for every event, worst severity
first.
Input: adverse event records carrying sequence number (AESEQ),
reported term (AETERM), onset date (AESTDTC), and severity
(AESEV).
Variables:
AETERM: the adverse event term exactly as reported.ASTDT: the collected onset date (AESTDTC); blank when the event has no recorded onset date.ASEV: the reported severity (AESEV); blank when no severity was reported.
Note: the reviewer reads the worst-severity events first, and
within one severity the earliest onset first. An event with no onset
date comes before the dated events of its severity, so a record still
missing its date is read rather than overlooked. An event with no
reported severity comes after every reported severity, because an
absent severity is not a mild one. Events the reviewer cannot tell
apart -- the same severity on the same date -- stay in collection
(AESEQ) order.
Inputs
Under review1 source fileinput/ae.csv
Edit11 rows| STUDYID | USUBJID | AESEQ | AETERM | AESTDTC | AESEV |
|---|---|---|---|---|---|
| PILOT7 | 1 | Nausea | 2025-03-10 | MILD | |
| PILOT7 | 2 | Pneumonitis | 2025-02-01 | SEVERE | |
| PILOT7 | 3 | Rash | — | MODERATE | |
| PILOT7 | 4 | Colitis | 2025-01-15 | MODERATE | |
| PILOT7 | 5 | Sepsis | 2025-02-01 | SEVERE | |
| PILOT7 | 6 | Cough | 2025-01-20 | — | |
| PILOT7 | 1 | Headache | 2025-04-02 | MILD | |
| PILOT7 | 7 | Myocarditis | — | SEVERE | |
| PILOT7 | 8 | Diarrhea | 2025-01-15 | MODERATE | |
| PILOT7 | 9 | Hypotension | 2025-02-01 | SEVERE | |
| PILOT7 | 2 | Fatigue | 2025-04-10 | — |
Expected output
Under review11 expected rowsexpected/adae.csv
Edit11 rows| STUDYID | USUBJID | ASEQ | AETERM | ASTDT | ASEV |
|---|---|---|---|---|---|
| PILOT7 | 7 | Myocarditis | — | SEVERE | |
| PILOT7 | 2 | Pneumonitis | 2025-02-01 | SEVERE | |
| PILOT7 | 5 | Sepsis | 2025-02-01 | SEVERE | |
| PILOT7 | 9 | Hypotension | 2025-02-01 | SEVERE | |
| PILOT7 | 3 | Rash | — | MODERATE | |
| PILOT7 | 4 | Colitis | 2025-01-15 | MODERATE | |
| PILOT7 | 8 | Diarrhea | 2025-01-15 | MODERATE | |
| PILOT7 | 1 | Nausea | 2025-03-10 | MILD | |
| PILOT7 | 6 | Cough | 2025-01-20 | — | |
| PILOT7 | 1 | Headache | 2025-04-02 | MILD | |
| PILOT7 | 2 | Fatigue | 2025-04-10 | — |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADAE | STUDYID | Study Identifier | character | Copy value from AE.STUDYID. | Predecessor | ||
| ADAE | USUBJID | Unique Subject Identifier | character | Copy value from AE.USUBJID. | Predecessor | ||
| ADAE | ASEQ | Analysis Sequence Number | numeric | Copy value from AE.AESEQ. | Predecessor | ||
| ADAE | AETERM | Reported Term for the Adverse Event | character | Copy value from AE.AETERM. | Predecessor | ||
| ADAE | ASTDT | Analysis Start Date | numeric | ISO 8601 | Copy value from AE.AESTDTC. | Predecessor | |
| ADAE | ASEV | Analysis Severity/Intensity | character | MILD, MODERATE, SEVERE | Copy value from AE.AESEV. | Predecessor |
| Variable | Permitted values |
|---|---|
| ASEV | MILD, MODERATE, SEVERE |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 1.7 | 2026-10-20 | yamaa docs build | Read a specification in the 1.0 surface as its 0.5 counterpart; state that missing values stay missing where a mapping declares no missing handler, and leave out a declared missing answer that restates a handler's default | ||
| 1.6 | 2026-10-17 | yamaa docs build | Describe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight | ||
| 1.5 | 2026-10-17 | yamaa docs build | Name collected precision in words instead of letter codes; state imputation fallbacks, minimum source precision, bounds ignored outside the collected period, and invalid text with no handler as an error; describe date and datetime shifts, imputation flag codes, and partial text giving no date part | ||
| 1.4 | 2026-10-15 | yamaa docs build | State datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks | ||
| 1.3 | 2026-09-29 | yamaa docs build | Show study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata | ||
| 1.2 | 2026-09-29 | yamaa docs build | Classify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived | ||
| 1.1 | 2026-09-29 | yamaa docs build | Resolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML | ||
| 1.0 | yamaa docs build | Initial generation from spec.yaml |
prompts/adam-adae-review-order/full.md
Edit21 linesFollowing CDISC ADaM standards, use the provided AE dataset to create an ADAE dataset with one record per adverse event.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, ASEQ, AETERM, ASTDT, ASEV
AETERM is the adverse event term exactly as reported. ASTDT is AESTDTC, the collected onset date, and ASTDT has no value when the event has no recorded onset date. ASEV is AESEV, the reported severity, and ASEV has no value when no severity was reported. ASEQ is AESEQ, the event's collected sequence number.
For each subject, the listing is in review order. "SEVERE" events come before "MODERATE" events, and "MODERATE" events come before "MILD" events. An event with no reported severity comes after every event with a reported severity. Within one severity, an event with no onset date comes first, and the dated events follow with the earliest onset first. Events alike in severity and onset date are presented in ASEQ order.
Read the source datasets from /app/input and save the completed dataset as /app/output/adae.csv.
prompts/adam-adae-review-order/conventions.md
Edit15 linesFollowing CDISC ADaM standards, use the provided AE dataset to create an ADAE dataset with one record per adverse event.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, ASEQ, AETERM, ASTDT, ASEV
For each subject, the listing is in review order. "SEVERE" events come before "MODERATE" events, and "MODERATE" events come before "MILD" events. An event with no reported severity comes after every event with a reported severity. Within one severity, an event with no onset date comes first, and the dated events follow with the earliest onset first. Events alike in severity and onset date are presented in ASEQ order.
Read the source datasets from /app/input and save the completed dataset as /app/output/adae.csv.
prompts/adam-adae-review-order/brief.md
Edit8 linesFollowing CDISC ADaM standards, use the provided AE dataset to create an ADAE dataset with one record per adverse event.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, ASEQ, AETERM, ASTDT, ASEV
Read the source datasets from /app/input and save the completed dataset as /app/output/adae.csv.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adae-review-order/result.R
Edit24 lines# Reference solution for the yamaa benchmark adam-adae-review-order (R track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1.library(dplyr, warn.conflicts = FALSE)library(readr)ae <- read_csv( "/app/input/ae.csv", col_types = cols(AESEQ = col_integer(), .default = col_character()))adae <- ae |> mutate( ASEQ = AESEQ, ASTDT = if_else(is.na(AESTDTC) | AESTDTC == "", NA_character_, AESTDTC), ASEV = if_else(is.na(AESEV) | AESEV == "", NA_character_, AESEV) ) |> select(STUDYID, USUBJID, ASEQ, AETERM, ASTDT, ASEV)dir.create("/app/output", showWarnings = FALSE)write_csv(adae, "/app/output/adae.csv", na = "")solutions/adam-adae-review-order/result.py
Edit53 lines# Reference solution for the yamaa benchmark adam-adae-review-order (Python track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1.import csvSEVERITY_RANK = {"SEVERE": 0, "MODERATE": 1, "MILD": 2}def main(): with open("/app/input/ae.csv", newline="", encoding="utf-8") as f: rows = list(csv.DictReader(f)) subject_order = {} for row in rows: if row["USUBJID"] not in subject_order: subject_order[row["USUBJID"]] = len(subject_order) def review_key(row): severity = (row["AESEV"] or "").strip() rank = SEVERITY_RANK.get(severity, 3) onset = (row["AESTDTC"] or "").strip() # Within one severity, an event with no onset date comes first. return ( subject_order[row["USUBJID"]], rank, 0 if onset == "" else 1, onset, int(row["AESEQ"]), ) rows.sort(key=review_key) with open("/app/output/adae.csv", "w", newline="", encoding="utf-8") as f: writer = csv.writer(f, lineterminator="\n") writer.writerow(["STUDYID", "USUBJID", "ASEQ", "AETERM", "ASTDT", "ASEV"]) for row in rows: writer.writerow( [ row["STUDYID"], row["USUBJID"], row["AESEQ"], row["AETERM"], row["AESTDTC"], row["AESEV"], ] )if __name__ == "__main__": main()solutions/adam-adae-review-order/result.sas
Edit16 lines/* opensas reference solution for the yamaa benchmark adam-adae-review-order. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data ae; length STUDYID USUBJID AETERM AESTDTC AESEV $1024; infile "/app/input/ae.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. AESEQ AETERM : $char1024. AESTDTC : $char1024. AESEV : $char1024.;run;proc sql; create table result as select STUDYID,USUBJID,AESEQ as ASEQ,AETERM,AESTDTC as ASTDT,AESEV as ASEV from ae;quit;proc export data=result(keep=STUDYID USUBJID ASEQ AETERM ASTDT ASEV) outfile="/app/output/adae.csv" dbms=csv replace; run;
yamaa