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

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

Goal: build one ADVS row per collected character-result row, carrying SERIES, AVISITN, and AVALC through unchanged and adding PREVAVALC for the closest earlier non-blank result.

Input: collected character results for three subjects, with series, visit number, and character result.

Variables:

  • SERIES identifies the analysis series; rows with no series value share one series.
  • AVISITN is the visit number that orders rows within a series.
  • AVALC is the current character result, kept as collected; blank when no result was collected.
  • PREVAVALC is the closest earlier non-blank result for the same subject and series, never the row's own; blank when no earlier row in the series has a result.

Note: within a series, rows are ordered by visit number with missing numbers last, and rows sharing a visit number (or both missing one) keep their collected order. The look-back skips blank results, so it can cross consecutive blank rows, but it never crosses into another series. A subject with a single collected row, and a series whose earlier rows are all blank, both leave PREVAVALC blank.

Inputs

Under review
1 source file

input/vs.csv

Edit
14 rows
input/vs.csv
STUDYIDUSUBJIDVSSEQSERIESAVISITNAVALC
YAMAA-011A—NULL-ORDER
YAMAA-012A1FIRST
YAMAA-013A1—
YAMAA-014A2—
YAMAA-015B1B-FIRST
YAMAA-016B2—
YAMAA-017—1UNGROUPED
YAMAA-018—2—
YAMAA-019A1SOLO
YAMAA-0110C1—
YAMAA-0111C2—
YAMAA-0112C3LATE
YAMAA-0113C——
YAMAA-0114C——

Expected output

Under review
14 expected rows

expected/advs.csv

Edit
14 rows
expected/advs.csv
STUDYIDUSUBJIDVSSEQSERIESAVISITNAVALCPREVAVALC
YAMAA-011A—NULL-ORDERFIRST
YAMAA-012A1FIRST—
YAMAA-013A1—FIRST
YAMAA-014A2—FIRST
YAMAA-015B1B-FIRST—
YAMAA-016B2—B-FIRST
YAMAA-017—1UNGROUPED—
YAMAA-018—2—UNGROUPED
YAMAA-019A1SOLO—
YAMAA-0110C1——
YAMAA-0111C2——
YAMAA-0112C3LATE—
YAMAA-0113C——LATE
YAMAA-0114C——LATE
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
ADVSVSSEQSequence NumbernumericCopy value from VS.VSSEQ.Predecessor
ADVSSERIESAnalysis SeriescharacterCopy value from VS.SERIES.Predecessor
ADVSAVISITNAnalysis Visit NumbernumericCopy value from VS.AVISITN.Predecessor
ADVSAVALCAnalysis Value (C)characterCopy value from VS.AVALC.Predecessor
ADVSPREVAVALCPrevious Non-Missing Analysis Value (C)characterMost recent non-missing AVALC from an earlier row within each group of STUDYID, USUBJID, SERIES, ordered by AVISITN, nulls last then VSSEQ.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-prior-result/full.md

Edit
17 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per collected character-result row.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, VSSEQ, SERIES, AVISITN, AVALC, PREVAVALC

PREVAVALC is the closest earlier non-blank AVALC for the same subject and series, never the row's own AVALC. Rows with no SERIES value share one series. Within a series, rows are ordered by AVISITN, with a missing AVISITN last, and rows sharing an AVISITN, or both missing one, keep their collected order. Blank results are skipped, so the closest earlier non-blank AVALC may lie beyond consecutive blank rows, but it never comes from another series. PREVAVALC has no value when no earlier row in the series has a non-blank AVALC.

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

prompts/adam-advs-prior-result/conventions.md

Edit
8 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per collected character-result row.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, VSSEQ, SERIES, AVISITN, AVALC, PREVAVALC

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

prompts/adam-advs-prior-result/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADVS dataset with one record per collected character-result row.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, VSSEQ, SERIES, AVISITN, AVALC, PREVAVALC

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-prior-result/result.R

Edit
40 lines
# Reference solution for the yamaa benchmark adam-advs-prior-result (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)library(tidyr)vs <- read_csv(  "/app/input/vs.csv",  col_types = cols(    VSSEQ = col_integer(), AVISITN = col_integer(),    .default = col_character()  ))# Within a series, rows are ordered by visit number with missing numbers# last, keeping the collected order for ties. The look-back skips blank# results but never crosses into another series.ordered <- vs |>  arrange(STUDYID, USUBJID, SERIES, is.na(AVISITN), AVISITN)# Forward-fill the ordered results, then lag by one so the row's own# value never counts.prev <- ordered |>  group_by(STUDYID, USUBJID, SERIES) |>  fill(AVALC, .direction = "down") |>  mutate(PREVAVALC = lag(AVALC)) |>  ungroup() |>  select(STUDYID, USUBJID, VSSEQ, PREVAVALC)advs <- vs |>  left_join(prev, by = c("STUDYID", "USUBJID", "VSSEQ")) |>  arrange(USUBJID, VSSEQ) |>  select(STUDYID, USUBJID, VSSEQ, SERIES, AVISITN, AVALC, PREVAVALC)dir.create("/app/output", showWarnings = FALSE)write_csv(advs, "/app/output/advs.csv", na = "")

solutions/adam-advs-prior-result/result.py

Edit
67 lines
# Reference solution for the yamaa benchmark adam-advs-prior-result (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 the VS dataset: one record per collected row, withPREVAVALC set to the closest earlier non-blank AVALC for the samesubject and series.Rows with no SERIES value share one series. Within a subject andseries, rows are ordered by AVISITN with a missing AVISITN last, androws that tie keep their collected order. Blank results never serve asa previous value, and a previous value never crosses a series or asubject."""import csvINPUT_VS = "/app/input/vs.csv"OUTPUT_ADVS = "/app/output/advs.csv"COLUMNS = ["STUDYID", "USUBJID", "VSSEQ", "SERIES", "AVISITN", "AVALC",           "PREVAVALC"]def visit_key(row):    """Sort key: AVISITN ascending, a missing AVISITN last.    The sort is stable, so rows sharing an AVISITN, or both missing    one, keep their collected order.    """    text = row["AVISITN"].strip()    if text == "":        return (1, 0.0)    return (0, float(text))def main():    with open(INPUT_VS, newline="") as handle:        rows = list(csv.DictReader(handle))    groups = {}    for index, row in enumerate(rows):        key = (row["USUBJID"], row["SERIES"])        groups.setdefault(key, []).append(index)    previous = {}    for indexes in groups.values():        last_nonblank = ""        for index in sorted(indexes, key=lambda i: visit_key(rows[i])):            previous[index] = last_nonblank            avalc = rows[index]["AVALC"]            if avalc.strip() != "":                last_nonblank = avalc    with open(OUTPUT_ADVS, "w", newline="") as handle:        writer = csv.DictWriter(handle, fieldnames=COLUMNS)        writer.writeheader()        for index, row in enumerate(rows):            out = {name: row[name] for name in COLUMNS if name != "PREVAVALC"}            out["PREVAVALC"] = previous[index]            writer.writerow(out)if __name__ == "__main__":    main()

solutions/adam-advs-prior-result/result.sas

Edit
25 lines
/* opensas reference solution for the yamaa benchmark adam-advs-prior-result.   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 SERIES AVALC $1024;  infile "/app/input/vs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. VSSEQ SERIES : $char1024. AVISITN AVALC : $char1024.;run;data ordered; set vs; ordinal=_n_; novisit=missing(AVISITN); run;proc sort data=ordered; by STUDYID USUBJID SERIES novisit AVISITN ordinal; run;data result;  length PREVAVALC carried $1024;  retain carried;  set ordered; by STUDYID USUBJID SERIES;  if first.SERIES then carried='';  PREVAVALC=carried;  if not missing(AVALC) then carried=AVALC;run;proc sql;  create table final as select STUDYID, USUBJID, VSSEQ, SERIES, AVISITN, AVALC, PREVAVALC from result;quit;proc export data=final outfile="/app/output/advs.csv" dbms=csv replace; run;