Review ask

As a clinical trial statistician or programmer, challenge anything in this benchmark: describe a problem in Comments, or propose a fix with the Edit button on any source file.

  1. Task: Would a real study need this derivation, specified this way? Does it follow CDISC ADaM: variable names, controlled terms, record structure? Flag any rule that is ambiguous or that a sponsor would handle differently.
  2. Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
  3. Expected output: Would independent QC programming reproduce every value from these inputs and rules?

The other tabs beside Comments are background for assessment, not under review.

Summary

Lifecycle: reviewedEditUnder review
What this benchmark means
README.md

Goal: write one best overall response record for each subject, carrying the randomization date (RANDDT) through and adding the response (AVALC), its rank (AVAL), and its supporting date (ADT).

Input: subject-level records with randomization date (RANDDT), plus a prepared response selection in which the record with BORSEQ equal to 1 holds the subject's winning category (BORCAT) and date (ADT).

Variables:

  • AVALC is the best overall response: complete response (CR), partial response (PR), stable disease (SD), neither complete response nor progressive disease (NON-CR/NON-PD), progressive disease (PD), or not evaluable (NE); empty when the subject has no record with BORSEQ equal to 1.
  • AVAL ranks that response as 1 (complete response), 2 (partial response), 3 (stable disease), 4 (neither complete response nor progressive disease), 5 (progressive disease), or 6 (not evaluable); empty when AVALC is empty.
  • ADT is the analysis date supporting the response, taken from that record's date; empty whenever AVALC is.

Note: every subject in the subject-level records gets one record, so a subject with no record with BORSEQ equal to 1 keeps its randomization date with response, rank, and date all empty. The supporting date is never before the randomization date; it may fall exactly on it.

Inputs

Under review
2 source files

input/adrs_selection.csv

Edit
12 rows
input/adrs_selection.csv
STUDYIDUSUBJIDASEQADTRANDDYAVALCBORCATBORPRIBORSEQ
YAMAA-0112025-02-1742PRPR22
YAMAA-0122025-04-0791CRCR11
YAMAA-0112025-02-1028SDNE63
YAMAA-0122025-04-1491SDSD31
YAMAA-0132025-05-12119SDSD32
YAMAA-0112025-02-1021SDNE62
YAMAA-0122025-03-0342PDPD51
YAMAA-0112025-02-2428SDNE61
YAMAA-0122025-04-0770NENE62
YAMAA-0112025-03-3149NON-CR/NON-PDNON-CR/NON-PD41
YAMAA-0112025-03-2435PRPR21
YAMAA-0112025-02-241CRCR11

input/adsl.csv

Edit
8 rows
input/adsl.csv
STUDYIDUSUBJIDRANDDT
YAMAA-012025-01-06
YAMAA-012025-01-13
YAMAA-012025-01-20
YAMAA-012025-01-27
YAMAA-012025-02-03
YAMAA-012025-02-10
YAMAA-012025-02-17
YAMAA-012025-02-24

Expected output

Under review
8 expected rows

expected/adrs.csv

Edit
8 rows
expected/adrs.csv
STUDYIDUSUBJIDPARAMCDPARAMRANDDTAVALCAVALADT
YAMAA-01BORBest Overall Response by Investigator2025-01-06CR12025-04-07
YAMAA-01BORBest Overall Response by Investigator2025-01-13SD32025-04-14
YAMAA-01BORBest Overall Response by Investigator2025-01-20PD52025-03-03
YAMAA-01BORBest Overall Response by Investigator2025-01-27NE62025-02-24
YAMAA-01BORBest Overall Response by Investigator2025-02-03———
YAMAA-01BORBest Overall Response by Investigator2025-02-10NON-CR/NON-PD42025-03-31
YAMAA-01BORBest Overall Response by Investigator2025-02-17PR22025-03-24
YAMAA-01BORBest Overall Response by Investigator2025-02-24CR12025-02-24
Shaded columns are derived— = missing value

Comments and assessment materials

Comments

Signed in with GitHub; saved in repository Discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Dataset NameVariable NameVariable LabelTypeCodelist/Controlled TermsCoreComputational MethodOrigin
ADRSSTUDYIDStudy IdentifiercharacterCopy value from ADSL.STUDYID.Predecessor
ADRSUSUBJIDUnique Subject IdentifiercharacterCopy value from ADSL.USUBJID.Predecessor
ADRSPARAMCDParameter CodecharacterSet constant value "BOR".Assigned
ADRSPARAMParametercharacterSet constant value "Best Overall Response by Investigator".Assigned
ADRSRANDDTRandomization DatenumericISO 8601Copy value from ADSL.RANDDT.Predecessor
ADRSAVALCAnalysis Value (C)characterCR, PR, SD, NON-CR/NON-PD, PD, NETake BORCAT from the ADRSSEL record matching on the shared output keys, where ADRSSEL.BORSEQ = 1, and no match yields blank.Derived
ADRSAVALAnalysis ValuenumericRecode AVALC: "CR" → "1", "PR" → "2", "SD" → "3", "NON-CR/NON-PD" → "4", "PD" → "5", "NE" → "6"; missing values stay missing; unlisted values are errors.Derived
ADRSADTAnalysis DatenumericISO 8601Take ADT from the ADRSSEL record matching on the shared output keys, where ADRSSEL.BORSEQ = 1, and no match yields blank.Derived
VariablePermitted values
AVALCCR, PR, SD, NON-CR/NON-PD, PD, NE
VersionDateAuthorDescriptionReviewerSign-off
1.32026-09-29yamaa docs buildShow study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata
1.22026-09-29yamaa docs buildClassify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived
1.12026-09-29yamaa docs buildResolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML
1.0yamaa docs buildInitial generation from spec.yaml

Agent prompt

The request an agent receives with the input files; each tier states no more than the one above

prompts/adam-adrs-best-response/full.md

Edit
29 lines

Following CDISC ADaM standards, use the provided ADSL and ADRSSEL datasets to create an ADRS dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, RANDDT, AVALC, AVAL, ADT

Use PARAMCD "BOR" and PARAM "Best Overall Response by Investigator". RANDDT is the subject's randomization date.

AVALC is the best overall response: the response category (BORCAT) of the subject's selection record with BORSEQ 1, one of complete response (CR), partial response (PR), stable disease (SD), neither complete response nor progressive disease (NON-CR/NON-PD), progressive disease (PD), or not evaluable (NE). It has no value when the subject has no record with BORSEQ 1.

AVAL ranks that response as 1 (complete response), 2 (partial response), 3 (stable disease), 4 (neither complete response nor progressive disease), 5 (progressive disease), or 6 (not evaluable); it has no value when AVALC has none.

ADT is the analysis date supporting the response, taken from that record's date; it has no value whenever AVALC has none. The supporting date is never before the randomization date; it may fall exactly on it. Every subject keeps its record with the randomization date even when response, rank, and date are all empty.

Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.

prompts/adam-adrs-best-response/conventions.md

Edit
18 lines

Following CDISC ADaM standards, use the provided ADSL and ADRSSEL datasets to create an ADRS dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, RANDDT, AVALC, AVAL, ADT

Use PARAMCD "BOR" and PARAM "Best Overall Response by Investigator".

AVALC is one of complete response (CR), partial response (PR), stable disease (SD), neither complete response nor progressive disease (NON-CR/NON-PD), progressive disease (PD), or not evaluable (NE), or has no value.

AVAL ranks the response as 1 (complete response), 2 (partial response), 3 (stable disease), 4 (neither complete response nor progressive disease), 5 (progressive disease), or 6 (not evaluable).

Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.

prompts/adam-adrs-best-response/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided ADSL and ADRSSEL datasets to create an ADRS dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, RANDDT, AVALC, AVAL, ADT

Read the source datasets from /app/input and save the completed dataset as /app/output/adrs.csv.

yamaa code

Runs the yamaa specification; its result must match the expected output

run.R

Edit
4 lines
library(yamaa)adrs <- yamaa_domain("spec.yaml")$outputadrs

run.py

Edit
4 lines
import yamaaadrs = yamaa.yamaa_domain("spec.yaml").outputadrs

Solution without yamaa

Written from the full prompt and the inputs alone; CI checks it reproduces the expected output

solutions/adam-adrs-best-response/result.R

Edit
51 lines
# Reference solution for the yamaa benchmark adam-adrs-best-response (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)adsl <- read_csv(  "/app/input/adsl.csv",  col_types = cols(RANDDT = col_date(), .default = col_character()))selection <- read_csv(  "/app/input/adrs_selection.csv",  col_types = cols(    ASEQ = col_integer(),    ADT = col_date(),    RANDDY = col_integer(),    BORPRI = col_integer(),    BORSEQ = col_integer(),    .default = col_character()  ))# The best overall response is the selection record numbered 1.best <- selection |>  filter(BORSEQ == 1L) |>  select(USUBJID, BORCAT, BESTDT = ADT)adrs <- adsl |>  left_join(best, by = "USUBJID") |>  mutate(    PARAMCD = "BOR",    PARAM = "Best Overall Response by Investigator",    AVALC = BORCAT,    AVAL = case_when(      AVALC == "CR" ~ 1L,      AVALC == "PR" ~ 2L,      AVALC == "SD" ~ 3L,      AVALC == "NON-CR/NON-PD" ~ 4L,      AVALC == "PD" ~ 5L,      AVALC == "NE" ~ 6L    ),    ADT = BESTDT  ) |>  select(STUDYID, USUBJID, PARAMCD, PARAM, RANDDT, AVALC, AVAL, ADT) |>  arrange(USUBJID)dir.create("/app/output", showWarnings = FALSE)write_csv(adrs, "/app/output/adrs.csv", na = "")

solutions/adam-adrs-best-response/result.py

Edit
47 lines
# Reference solution for the yamaa benchmark adam-adrs-best-response (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.from pathlib import Pathimport polars as pladsl = pl.read_csv("/app/input/adsl.csv", infer_schema=False).with_columns(    pl.col("RANDDT").str.to_date())selection = pl.read_csv(    "/app/input/adrs_selection.csv", infer_schema=False).with_columns(    pl.col("ASEQ").cast(pl.Int64),    pl.col("ADT").str.to_date(),    pl.col("RANDDY").cast(pl.Int64),    pl.col("BORPRI").cast(pl.Int64),    pl.col("BORSEQ").cast(pl.Int64),)# The best overall response is the selection record numbered 1.best = selection.filter(pl.col("BORSEQ") == 1).select(    "USUBJID", BORCAT="BORCAT", BESTDT="ADT")adrs = (    adsl.join(best, on="USUBJID", how="left")    .with_columns(        PARAMCD=pl.lit("BOR"),        PARAM=pl.lit("Best Overall Response by Investigator"),        AVALC=pl.col("BORCAT"),        AVAL=pl.col("BORCAT").replace_strict(            {"CR": 1, "PR": 2, "SD": 3, "NON-CR/NON-PD": 4, "PD": 5, "NE": 6},            default=None,            return_dtype=pl.Int64,        ),        ADT=pl.col("BESTDT"),    )    .select("STUDYID", "USUBJID", "PARAMCD", "PARAM", "RANDDT", "AVALC", "AVAL", "ADT")    .sort("USUBJID"))Path("/app/output").mkdir(exist_ok=True)adrs.write_csv("/app/output/adrs.csv")

solutions/adam-adrs-best-response/result.sas

Edit
28 lines
/* opensas reference solution for the yamaa benchmark adam-adrs-best-response.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data adrs_selection;  length STUDYID USUBJID ADT RANDDY AVALC BORCAT BORPRI $1024;  infile "/app/input/adrs_selection.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. ASEQ ADT : $char1024. RANDDY : $char1024. AVALC : $char1024. BORCAT : $char1024. BORPRI : $char1024. BORSEQ;run;data adsl;  length STUDYID USUBJID RANDDT $1024;  infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. RANDDT : $char1024.;run;proc sql; create table joined as select a.*,b.BORCAT as AVALC,b.ADT from adsl as a left join adrs_selection as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID and b.BORSEQ=1; quit;data result;  length PARAMCD $8 PARAM $40;  set joined; PARAMCD='BOR'; PARAM='Best Overall Response by Investigator';  select(AVALC); when('CR') AVAL=1; when('PR') AVAL=2; when('SD') AVAL=3; when('NON-CR/NON-PD') AVAL=4; when('PD') AVAL=5; when('NE') AVAL=6; otherwise AVAL=.; end;  if missing(AVALC) then ADT='';run;proc sql;  create table final as select STUDYID, USUBJID, PARAMCD, PARAM, RANDDT, AVALC, AVAL, ADT from result;quit;proc export data=final outfile="/app/output/adrs.csv" dbms=csv replace; run;