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: carry the supplemental qualifier value onto each analysis
laboratory row (QVAL, QVAL_NAMED).
Input: laboratory records carry a numeric sequence number; supplemental records carry the same sequence as eight-character, space-padded text. Two subjects may share a sequence number.
Variables:
QVALis the qualifier value from the supplemental record whose study, subject, and padded sequence all match; empty when nothing matches.QVAL_NAMEDholds the same value from the same match, taken again once every laboratory row exists; empty when nothing matches.
Note: the padding must be exact: a zero-padded key does not match the space-padded form, and a supplemental record with no laboratory record changes nothing. Rows in both sequence ranges use the same match.
Inputs
Under review2 source filesinput/lb.csv
Edit6 rows| STUDYID | USUBJID | LBSEQ |
|---|---|---|
| YAMAA-01 | 7 | |
| YAMAA-01 | 200 | |
| YAMAA-01 | 259 | |
| YAMAA-01 | 259 | |
| YAMAA-01 | 42 | |
| YAMAA-01 | 311 |
input/supplb.csv
Edit7 rows| STUDYID | USUBJID | IDVARVAL | QVAL |
|---|---|---|---|
| YAMAA-01 | 7 | OTHER | |
| YAMAA-01 | 200 | BOUND | |
| YAMAA-01 | 259 | EP | |
| YAMAA-01 | 999 | ORPHAN | |
| YAMAA-01 | 259 | SHARED | |
| YAMAA-01 | 00000259 | ZEROPAD | |
| YAMAA-01 | 42 | SINGLE |
Expected output
Under review6 expected rowsexpected/adlb.csv
Edit6 rows| STUDYID | USUBJID | LBSEQ | QVAL | QVAL_NAMED |
|---|---|---|---|---|
| YAMAA-01 | 7 | OTHER | OTHER | |
| YAMAA-01 | 42 | SINGLE | SINGLE | |
| YAMAA-01 | 200 | BOUND | BOUND | |
| YAMAA-01 | 259 | EP | EP | |
| YAMAA-01 | 259 | SHARED | SHARED | |
| YAMAA-01 | 311 | — | — |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADLB | STUDYID | Study Identifier | character | Copy value from LB.STUDYID. | Predecessor | ||
| ADLB | USUBJID | Subject Identifier | character | Copy value from LB.USUBJID. | Predecessor | ||
| ADLB | LBSEQ | Sequence Number | numeric | Copy value from LB.LBSEQ. | Predecessor | ||
| ADLB | QVAL | Supplemental Value | character | Set per constructed row; see the Row construction sheet. | Derived | ||
| ADLB | QVAL_NAMED | Supplemental Value by Named Intermediate | character | Take QVAL from the SUPPLB record whose STUDYID equals LB.STUDYID, USUBJID equals LB.USUBJID and IDVARVAL equals LBSEQ padded on the left with spaces to at least 8 characters, and no match yields blank. | Derived |
| Template | Include when | QVAL |
|---|---|---|
| low_sequence | LB.LBSEQ < 200 | Copy QVAL from the SUPPLB record whose STUDYID equals LB.STUDYID, USUBJID equals LB.USUBJID and IDVARVAL equals LBSEQ padded on the left with spaces to at least 8 characters, and no match yields blank |
| high_sequence | LB.LBSEQ >= 200 | Copy QVAL from the SUPPLB record whose STUDYID equals LB.STUDYID, USUBJID equals LB.USUBJID and IDVARVAL equals LBSEQ padded on the left with spaces to at least 8 characters, and no match yields blank |
| 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-adlb-supplb-padded-key/full.md
Edit17 linesFollowing CDISC ADaM standards, use the provided LB and SUPPLB datasets to create an ADLB dataset with one record per laboratory record.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, QVAL, QVAL_NAMED
QVAL is the qualifier value of the SUPPLB record whose STUDYID and USUBJID match the laboratory record and whose IDVARVAL is the record's LBSEQ padded with spaces to eight characters. QVAL has no value when no SUPPLB record matches. QVAL_NAMED holds the same value from the same match and has no value when no SUPPLB record matches. The padding is exact: an IDVARVAL padded with zeros does not match. A SUPPLB record that matches no laboratory record changes nothing. Rows with an LBSEQ below 200 and rows with an LBSEQ of 200 or more use the same match.
Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.
prompts/adam-adlb-supplb-padded-key/conventions.md
Edit10 linesFollowing CDISC ADaM standards, use the provided LB and SUPPLB datasets to create an ADLB dataset with one record per laboratory record.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, QVAL, QVAL_NAMED
IDVARVAL is the record's LBSEQ padded with spaces to eight characters.
Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.
prompts/adam-adlb-supplb-padded-key/brief.md
Edit8 linesFollowing CDISC ADaM standards, use the provided LB and SUPPLB datasets to create an ADLB dataset with one record per laboratory record.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, LBSEQ, QVAL, QVAL_NAMED
Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adlb-supplb-padded-key/result.R
Edit35 lines# Reference solution for the yamaa benchmark adam-adlb-supplb-padded-key (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(stringr)lb <- read_csv( "/app/input/lb.csv", col_types = cols(LBSEQ = col_integer(), .default = col_character()))supp <- read_csv( "/app/input/supplb.csv", col_types = cols(.default = col_character()), trim_ws = FALSE)# The qualifier value whose IDVARVAL is the laboratory sequence number as# eight characters, right-aligned and space-padded. Zero-padded keys do# not match; a supplemental record with no laboratory record adds no row.adlb <- lb |> mutate(PADDED_KEY = str_pad(as.character(LBSEQ), width = 8, side = "left", pad = " ")) |> left_join( supp |> select(STUDYID, USUBJID, IDVARVAL, QVAL), by = c("STUDYID", "USUBJID", "PADDED_KEY" = "IDVARVAL") ) |> mutate(QVAL_NAMED = QVAL) |> arrange(LBSEQ, USUBJID) |> select(STUDYID, USUBJID, LBSEQ, QVAL, QVAL_NAMED)dir.create("/app/output", showWarnings = FALSE)write_csv(adlb, "/app/output/adlb.csv", na = "")solutions/adam-adlb-supplb-padded-key/result.py
Edit50 lines# Reference solution for the yamaa benchmark adam-adlb-supplb-padded-key (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_DIR = "/app/input"OUTPUT_DIR = "/app/output"def main(): with open(f"{INPUT_DIR}/lb.csv", newline="") as f: lb_rows = list(csv.DictReader(f)) with open(f"{INPUT_DIR}/supplb.csv", newline="") as f: supp_rows = list(csv.DictReader(f)) # Index SUPPLB by (STUDYID, USUBJID, IDVARVAL) exactly as collected: # IDVARVAL must equal the LBSEQ padded with spaces to eight characters. supp = {} for row in supp_rows: key = (row["STUDYID"], row["USUBJID"], row["IDVARVAL"]) supp[key] = row["QVAL"] out_rows = [] for row in lb_rows: padded = row["LBSEQ"].rjust(8) key = (row["STUDYID"], row["USUBJID"], padded) qval = supp.get(key, "") out_rows.append( { "STUDYID": row["STUDYID"], "USUBJID": row["USUBJID"], "LBSEQ": row["LBSEQ"], "QVAL": qval, "QVAL_NAMED": qval, } ) with open(f"{OUTPUT_DIR}/adlb.csv", "w", newline="") as f: writer = csv.DictWriter( f, fieldnames=["STUDYID", "USUBJID", "LBSEQ", "QVAL", "QVAL_NAMED"] ) writer.writeheader() writer.writerows(out_rows)if __name__ == "__main__": main()solutions/adam-adlb-supplb-padded-key/result.sas
Edit23 lines/* opensas reference solution for the yamaa benchmark adam-adlb-supplb-padded-key. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data lb; length STUDYID USUBJID $1024; infile "/app/input/lb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. LBSEQ;run;data supplb; length STUDYID USUBJID IDVARVAL QVAL $1024; infile "/app/input/supplb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. IDVARVAL : $char1024. QVAL : $char1024.;run;data lb_key; set lb; length PARENTKEY $8; PARENTKEY=put(LBSEQ,8.); run;proc sql; create table result as select a.*,b.QVAL,b.QVAL as QVAL_NAMED from lb_key as a left join supplb as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID and a.PARENTKEY=b.IDVARVAL;quit;proc export data=result(keep=STUDYID USUBJID LBSEQ QVAL QVAL_NAMED) outfile="/app/output/adlb.csv" dbms=csv replace; run;
yamaa