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: 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 review1 source fileinput/vs.csv
Edit12 rows| STUDYID | USUBJID | PARAMCD | AVISITN | AVAL |
|---|---|---|---|---|
| YAMAA-01 | SYSBP | 1 | 120 | |
| YAMAA-01 | SYSBP | 2 | 125 | |
| YAMAA-01 | SYSBP | 3 | — | |
| YAMAA-01 | SYSBP | 4 | 130 | |
| YAMAA-01 | DIABP | 1 | 80 | |
| YAMAA-01 | DIABP | 2 | 82 | |
| YAMAA-01 | SYSBP | 1 | — | |
| YAMAA-01 | SYSBP | 2 | 140 | |
| YAMAA-01 | SYSBP | 3 | 145 | |
| YAMAA-01 | DIABP | 1 | 78 | |
| YAMAA-01 | SYSBP | 1 | — | |
| YAMAA-01 | SYSBP | 2 | — |
Expected output
Under review12 expected rowsexpected/advs.csv
Edit12 rows| STUDYID | USUBJID | PARAMCD | AVISITN | AVAL | BASEVAL |
|---|---|---|---|---|---|
| YAMAA-01 | SYSBP | 1 | 120 | 120 | |
| YAMAA-01 | SYSBP | 2 | 125 | 120 | |
| YAMAA-01 | SYSBP | 3 | — | 120 | |
| YAMAA-01 | SYSBP | 4 | 130 | 120 | |
| YAMAA-01 | DIABP | 1 | 80 | 80 | |
| YAMAA-01 | DIABP | 2 | 82 | 80 | |
| YAMAA-01 | SYSBP | 1 | — | — | |
| YAMAA-01 | SYSBP | 2 | 140 | 140 | |
| YAMAA-01 | SYSBP | 3 | 145 | 140 | |
| YAMAA-01 | DIABP | 1 | 78 | 78 | |
| YAMAA-01 | SYSBP | 1 | — | — | |
| YAMAA-01 | SYSBP | 2 | — | — |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADVS | STUDYID | Study Identifier | character | Copy value from VS.STUDYID. | Predecessor | ||
| ADVS | USUBJID | Unique Subject Identifier | character | Copy value from VS.USUBJID. | Predecessor | ||
| ADVS | PARAMCD | Parameter Code | character | Copy value from VS.PARAMCD. | Predecessor | ||
| ADVS | AVISITN | Analysis Visit Number | numeric | Copy value from VS.AVISITN. | Predecessor | ||
| ADVS | AVAL | Analysis Value | numeric | Copy value from VS.AVAL. | Predecessor | ||
| ADVS | BASEVAL | First Observed Analysis Value Carried Forward | numeric | First non-missing of _SEL_AVAL and _CARRIED. | Derived |
| 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-advs-first-observed-carry/full.md
Edit18 linesFollowing 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
Edit8 linesFollowing 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
Edit8 linesFollowing 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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-advs-first-observed-carry/result.R
Edit31 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
Edit68 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
Edit20 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;
yamaa