Review ask

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

Lifecycle: finalizedEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: carry each subject's collected age (AGE) and age units (AGEU), and derive AGEGR1 and AGEGR1N to pool subjects into age groups.

Input: demographics (DM) records carrying age (AGE) and age units (AGEU).

Variables:

  • AGEGR1 is the pooled group: <18 when age is below 18, 18-64 when age is 18 through 64 inclusive, and >64 when age is above 64; Missing when AGE is missing.
  • AGEGR1N is the numeric rank of AGEGR1: 1 for <18, 2 for 18-64, and 3 for >64; empty when AGE is missing.

Note: both variables share the same bands, so the number always matches the text for each subject. A subject aged exactly 18 or 64 falls in 18-64: boundary ages belong to the middle band.

Inputs

Under review
1 source file

input/dm.csv

Edit
10 rows
input/dm.csv
STUDYIDUSUBJIDAGEAGEU
YAMAA-016YEARS
YAMAA-0117YEARS
YAMAA-0118YEARS
YAMAA-0123YEARS
YAMAA-0142YEARS
YAMAA-0164YEARS
YAMAA-0165YEARS
YAMAA-0172YEARS
YAMAA-0191YEARS
YAMAA-01——

Expected output

Under review
10 expected rows

expected/adsl.csv

Edit
10 rows
expected/adsl.csv
STUDYIDUSUBJIDAGEAGEUAGEGR1AGEGR1N
YAMAA-016YEARS<181
YAMAA-0117YEARS<181
YAMAA-0118YEARS18-642
YAMAA-0123YEARS18-642
YAMAA-0142YEARS18-642
YAMAA-0164YEARS18-642
YAMAA-0165YEARS>643
YAMAA-0172YEARS>643
YAMAA-0191YEARS>643
YAMAA-01——Missing—
Shaded columns are derived— = missing value

Human review and assessment

Your review

3 questions and your comments · View benchmark discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Dataset NameVariable NameVariable LabelTypeCodelist/Controlled TermsCoreComputational MethodOrigin
ADSLSTUDYIDStudy IdentifiercharacterCopy value from DM.STUDYID.Predecessor
ADSLUSUBJIDUnique Subject IdentifiercharacterCopy value from DM.USUBJID.Predecessor
ADSLAGEAgenumericCopy value from DM.AGE.Predecessor
ADSLAGEUAge UnitscharacterCopy value from DM.AGEU.Predecessor
ADSLAGEGR1Pooled Age Group 1characterIf AGE < 18 then "<18"; If AGE >= 18 AND AGE <= 64 then "18-64"; If AGE > 64 then ">64"; otherwise "Missing".Derived
ADSLAGEGR1NPooled Age Group 1 (N)numericIf AGEGR1 = '<18' then "1"; If AGEGR1 = '18-64' then "2"; If AGEGR1 = '>64' then "3"; otherwise "None".Derived
VersionDateAuthorDescriptionReviewerSign-off
1.72026-10-20yamaa docs buildRead 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.62026-10-17yamaa docs buildDescribe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight
1.52026-10-17yamaa docs buildName 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.42026-10-15yamaa docs buildState datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks
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-adsl-age-group/full.md

Edit
14 lines

Following CDISC ADaM standards, use the provided DM dataset to create an ADSL dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AGE, AGEU, AGEGR1, AGEGR1N

AGEGR1 is "<18" when AGE is below 18, "18-64" when AGE is 18 through 64, and ">64" when AGE is above 64. AGEGR1 is "Missing" when AGE has no value. AGEGR1N is 1 for "<18", 2 for "18-64", and 3 for ">64". AGEGR1N has no value when AGE has no value.

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

prompts/adam-adsl-age-group/conventions.md

Edit
14 lines

Following CDISC ADaM standards, use the provided DM dataset to create an ADSL dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AGE, AGEU, AGEGR1, AGEGR1N

AGEGR1 is "<18" when AGE is below 18, "18-64" when AGE is 18 through 64, and ">64" when AGE is above 64. AGEGR1 is "Missing" when AGE has no value. AGEGR1N is 1 for "<18", 2 for "18-64", and 3 for ">64". AGEGR1N has no value when AGE has no value.

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

prompts/adam-adsl-age-group/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided DM dataset to create an ADSL dataset with one record per subject.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, AGE, AGEU, AGEGR1, AGEGR1N

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

yamaa code

Public calls generated from benchmark.yaml; results must match the expected output

R

Edit
3 lines
library(yamaa)yamaa_spec("spec.yaml")$run()$output

Python

Edit
3 lines
import yamaayamaa.spec("spec.yaml").run().output

Solution without yamaa

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

solutions/adam-adsl-age-group/result.R

Edit
32 lines
# Reference solution for the yamaa benchmark adam-adsl-age-group (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)dm <- read_csv(  "/app/input/dm.csv",  col_types = cols(AGE = col_double(), .default = col_character()))adsl <- dm |>  mutate(    AGEGR1 = case_when(      is.na(AGE) ~ "Missing",      AGE < 18 ~ "<18",      AGE <= 64 ~ "18-64",      .default = ">64"    ),    AGEGR1N = case_when(      AGEGR1 == "<18" ~ 1L,      AGEGR1 == "18-64" ~ 2L,      AGEGR1 == ">64" ~ 3L    )  ) |>  select(STUDYID, USUBJID, AGE, AGEU, AGEGR1, AGEGR1N)dir.create("/app/output", showWarnings = FALSE)write_csv(adsl, "/app/output/adsl.csv", na = "")

solutions/adam-adsl-age-group/result.py

Edit
52 lines
# Reference solution for the yamaa benchmark adam-adsl-age-group (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 csvINPUT_CSV = "/app/input/dm.csv"OUTPUT_CSV = "/app/output/adsl.csv"def age_group(age_text):    """Return (AGEGR1, AGEGR1N) for a raw AGE cell."""    if age_text is None or age_text.strip() == "":        return "Missing", ""    age = float(age_text)    if age < 18:        return "<18", "1"    if age <= 64:        return "18-64", "2"    return ">64", "3"def main():    with open(INPUT_CSV, newline="") as f:        rows = list(csv.DictReader(f))    out_rows = []    for row in rows:        age = row["AGE"]        agegr1, agegr1n = age_group(age)        out_rows.append(            {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "AGE": age,                "AGEU": row["AGEU"],                "AGEGR1": agegr1,                "AGEGR1N": agegr1n,            }        )    fieldnames = ["STUDYID", "USUBJID", "AGE", "AGEU", "AGEGR1", "AGEGR1N"]    with open(OUTPUT_CSV, "w", newline="") as f:        writer = csv.DictWriter(f, fieldnames=fieldnames)        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-adsl-age-group/result.sas

Edit
23 lines
/* opensas reference solution for the yamaa benchmark adam-adsl-age-group.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data dm;  length STUDYID USUBJID AGEU $1024;  infile "/app/input/dm.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. AGE AGEU : $char1024.;run;data result;  length AGEGR1 $7;  set dm;  if missing(AGE) then do; AGEGR1='Missing'; AGEGR1N=.; end;  else if AGE < 18 then do; AGEGR1='<18'; AGEGR1N=1; end;  else if AGE <= 64 then do; AGEGR1='18-64'; AGEGR1N=2; end;  else do; AGEGR1='>64'; AGEGR1N=3; end;run;proc sql;  create table final as select STUDYID, USUBJID, AGE, AGEU, AGEGR1, AGEGR1N from result;quit;proc export data=final outfile="/app/output/adsl.csv" dbms=csv replace; run;