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: draftEditUnder review
What this benchmark means
README.md

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

Goal: derive BASEVAL, each subject's first observed result for a vital-sign parameter, carried forward to every later visit.

Input: vital-sign records keyed by subject, parameter code, and visit number, each carrying the collected numeric result. A visit with no collected result still has a record.

Variables:

  • AVISITN: the visit number of the measurement.
  • AVAL: the collected numeric result, blank when the visit has no collected result.
  • BASEVAL: the result from the subject's first visit with a collected result for the parameter, repeated on that and every later visit; blank on visits before any result was collected.

Note: the carried value never crosses subjects or parameters: each subject-parameter pair carries only its own first observed result.

Inputs

Under review
1 source file

input/vs.csv

Edit
12 rows
input/vs.csv
STUDYIDUSUBJIDPARAMCDAVISITNAVAL
YAMAA-01SYSBP1120
YAMAA-01SYSBP2125
YAMAA-01SYSBP3—
YAMAA-01SYSBP4130
YAMAA-01DIABP180
YAMAA-01DIABP282
YAMAA-01SYSBP1—
YAMAA-01SYSBP2140
YAMAA-01SYSBP3145
YAMAA-01DIABP178
YAMAA-01SYSBP1—
YAMAA-01SYSBP2—

Expected output

Under review
12 expected rows

expected/advs.csv

Edit
12 rows
expected/advs.csv
STUDYIDUSUBJIDPARAMCDAVISITNAVALBASEVAL
YAMAA-01SYSBP1120120
YAMAA-01SYSBP2125120
YAMAA-01SYSBP3—120
YAMAA-01SYSBP4130120
YAMAA-01DIABP18080
YAMAA-01DIABP28280
YAMAA-01SYSBP1——
YAMAA-01SYSBP2140140
YAMAA-01SYSBP3145140
YAMAA-01DIABP17878
YAMAA-01SYSBP1——
YAMAA-01SYSBP2——
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
ADVSSTUDYIDStudy IdentifiercharacterCopy value from VS.STUDYID.Predecessor
ADVSUSUBJIDUnique Subject IdentifiercharacterCopy value from VS.USUBJID.Predecessor
ADVSPARAMCDParameter CodecharacterCopy value from VS.PARAMCD.Predecessor
ADVSAVISITNAnalysis Visit NumbernumericCopy value from VS.AVISITN.Predecessor
ADVSAVALAnalysis ValuenumericCopy value from VS.AVAL.Predecessor
ADVSBASEVALFirst Observed Analysis Value Carried ForwardnumericFirst non-missing of _SEL_AVAL and _CARRIED.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-advs-first-observed-carry/full.md

Edit
18 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per subject per parameter per visit.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVISITN, AVAL, BASEVAL

Every record of the VS dataset appears once in the output, including a visit with no collected result, where AVAL has no value. BASEVAL is the result from the subject's first visit, by visit number, with a collected result for the parameter. BASEVAL repeats that result on that visit and on every later visit. BASEVAL has no value on visits before the first visit with a collected result, and has no value at any visit for a subject and parameter with no collected result. The carried value never crosses subjects or parameters: each subject and parameter carries only its own first observed result.

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

prompts/adam-advs-first-observed-carry/conventions.md

Edit
8 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per subject per parameter per visit.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVISITN, AVAL, BASEVAL

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

prompts/adam-advs-first-observed-carry/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per subject per parameter per visit.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVISITN, AVAL, BASEVAL

Read the source datasets from /app/input and save the completed dataset as /app/output/advs.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-advs-first-observed-carry/result.R

Edit
31 lines
# Reference solution for the yamaa benchmark adam-advs-first-observed-carry (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)vs <- read_csv(  "/app/input/vs.csv",  col_types = cols(AVISITN = col_integer(), AVAL = col_double(), .default = col_character()))# The first visit with a result for each subject and parameter.firsts <- vs |>  filter(!is.na(AVAL)) |>  arrange(STUDYID, USUBJID, PARAMCD, AVISITN) |>  distinct(STUDYID, USUBJID, PARAMCD, .keep_all = TRUE) |>  select(STUDYID, USUBJID, PARAMCD, FIRST_AVAL = AVAL, FIRST_VISIT = AVISITN)# The first result, repeated on that and every later visit; visits before# any result stay missing.advs <- vs |>  left_join(firsts, by = c("STUDYID", "USUBJID", "PARAMCD")) |>  mutate(BASEVAL = if_else(!is.na(FIRST_VISIT) & AVISITN >= FIRST_VISIT, FIRST_AVAL, NA_real_)) |>  arrange(USUBJID, PARAMCD, AVISITN) |>  select(STUDYID, USUBJID, PARAMCD, AVISITN, AVAL, BASEVAL)dir.create("/app/output", showWarnings = FALSE)write_csv(advs, "/app/output/advs.csv", na = "")

solutions/adam-advs-first-observed-carry/result.py

Edit
68 lines
# Reference solution for the yamaa benchmark adam-advs-first-observed-carry (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."""Build ADVS from VS: carry each subject/parameter's first observedresult forward as BASEVAL from the first visit with a collected resultonward."""import csvimport osINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def main():    with open(os.path.join(INPUT_DIR, "vs.csv"), newline="") as f:        rows = list(csv.DictReader(f))    # For each subject and parameter, find the first visit (by visit    # number) with a collected result, and that result.    first = {}    for row in rows:        key = (row["USUBJID"], row["PARAMCD"])        if row["AVAL"] == "":            continue        visit = int(row["AVISITN"])        if key not in first or visit < first[key][0]:            first[key] = (visit, row["AVAL"])    out_rows = []    for row in rows:        key = (row["USUBJID"], row["PARAMCD"])        baseval = ""        if key in first and int(row["AVISITN"]) >= first[key][0]:            baseval = first[key][1]        out_rows.append(            {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "PARAMCD": row["PARAMCD"],                "AVISITN": row["AVISITN"],                "AVAL": row["AVAL"],                "BASEVAL": baseval,            }        )    os.makedirs(OUTPUT_DIR, exist_ok=True)    with open(os.path.join(OUTPUT_DIR, "advs.csv"), "w", newline="") as f:        writer = csv.DictWriter(            f,            fieldnames=[                "STUDYID",                "USUBJID",                "PARAMCD",                "AVISITN",                "AVAL",                "BASEVAL",            ],        )        writer.writeheader()        writer.writerows(out_rows)if __name__ == "__main__":    main()

solutions/adam-advs-first-observed-carry/result.sas

Edit
20 lines
/* opensas reference solution for the yamaa benchmark adam-advs-first-observed-carry.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data vs;  length STUDYID USUBJID PARAMCD $1024;  infile "/app/input/vs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. PARAMCD : $char1024. AVISITN AVAL;run;proc sort data=vs out=ordered; by STUDYID USUBJID PARAMCD AVISITN; run;data result;  set ordered; by STUDYID USUBJID PARAMCD;  retain carried;  if first.PARAMCD then carried=.;  if not missing(AVAL) and missing(carried) then carried=AVAL;  BASEVAL=carried;run;proc export data=result(keep=STUDYID USUBJID PARAMCD AVISITN AVAL BASEVAL) outfile="/app/output/advs.csv" dbms=csv replace; run;