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: write each analysis value (AVAL) as display text, adding
AVALC and AVALCS.
Input: laboratory (LB) records carrying one numeric analysis value per subject and test.
Variables:
AVALC: the analysis value rounded to two decimals and written with exactly two, trailing zeros kept, right-aligned in eight characters with leading spaces; a value too wide for eight characters is written whole, and a value that was not collected is written NOT DONE.AVALCS: the same value rounded to one decimal and written with exactly one, without leading spaces; blank when the value was not collected.
Note: the rounding is the one the file-level display precision uses: a half goes away from zero, and so does a value stored a hair below a half, so 2.675 shows as 2.68. A value that rounds to zero shows no minus sign. Unlike a number reported to fixed places as the file is written, this text is part of the dataset, for display only: nothing downstream reads it back as a number, and the analysis value keeps every digit it was collected with.
Inputs
Under review1 source fileinput/lb.csv
Edit9 rows| STUDYID | USUBJID | PARAMCD | AVAL |
|---|---|---|---|
| YAMAA-01 | GLUC | 3.14159 | |
| YAMAA-01 | GLUC | 7 | |
| YAMAA-01 | GLUC | 0.5 | |
| YAMAA-01 | GLUC | -1.234 | |
| YAMAA-01 | GLUC | 1234.5678 | |
| YAMAA-01 | GLUC | — | |
| YAMAA-01 | GLUC | 2.675 | |
| YAMAA-01 | GLUC | -0.001 | |
| YAMAA-01 | GLUC | 12345678.9 |
Expected output
Under review9 expected rowsexpected/adlb.csv
Edit9 rows| STUDYID | USUBJID | PARAMCD | AVAL | AVALC | AVALCS |
|---|---|---|---|---|---|
| YAMAA-01 | GLUC | 3.14159 | 3.14 | 3.1 | |
| YAMAA-01 | GLUC | 7 | 7.00 | 7.0 | |
| YAMAA-01 | GLUC | 0.5 | 0.50 | 0.5 | |
| YAMAA-01 | GLUC | -1.234 | -1.23 | -1.2 | |
| YAMAA-01 | GLUC | 1234.5678 | 1234.57 | 1234.6 | |
| YAMAA-01 | GLUC | — | NOT DONE | — | |
| YAMAA-01 | GLUC | 2.675 | 2.68 | 2.7 | |
| YAMAA-01 | GLUC | -0.001 | 0.00 | 0.0 | |
| YAMAA-01 | GLUC | 12345678.9 | 12345678.90 | 12345678.9 |
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 | Unique Subject Identifier | character | Copy value from LB.USUBJID. | Predecessor | ||
| ADLB | PARAMCD | Parameter Code | character | Copy value from LB.PARAMCD. | Predecessor | ||
| ADLB | AVAL | Analysis Value | numeric | Copy value from LB.AVAL. | Predecessor | ||
| ADLB | AVALC | Analysis Value (C) | character | Write AVAL as text with exactly 2 decimals, rounded half away from zero, padded on the left with spaces to at least 8 characters; a missing source → "NOT DONE". | Derived | ||
| ADLB | AVALCS | Analysis Value (C) to One Decimal | character | Write AVAL as text with exactly 1 decimal, rounded half away from zero. | 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-adlb-character-result-text/full.md
Edit26 linesFollowing CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVAL, AVALC, AVALCS
AVAL keeps every digit it was collected with and is not rounded. AVALC and AVALCS are display text of AVAL, held in the dataset:
- AVALC is AVAL rounded to two decimals and written with exactly two, trailing zeros kept, right-aligned in eight characters with leading spaces; a minus sign counts as one of the eight. A value too wide for eight characters is written whole, with both decimals and no leading spaces, never shortened. When AVAL has no value (the value was not collected), AVALC is "NOT DONE".
- AVALCS is AVAL rounded to one decimal and written with exactly one, without leading spaces. AVALCS has no value when AVAL has no value.
- Both are plain positional numbers: no digit grouping, no exponent, and one 0 before the point for a value below one in magnitude.
A half rounds away from zero, and so does a value stored a hair below a half (within 2^-26 of one unit in the last kept place), so 2.675 shows as 2.68. A value that rounds to zero shows no minus sign.
Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.
prompts/adam-adlb-character-result-text/conventions.md
Edit17 linesFollowing CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVAL, AVALC, AVALCS
AVALC is AVAL as display text with exactly two digits after the decimal point, trailing zeros kept, right-aligned in eight characters with leading spaces, or "NOT DONE"; a text wider than eight characters is written in full. AVALCS is AVAL with exactly one digit after the decimal point, without leading spaces. Both round a value that is exactly halfway away from zero, as its decimal digits show it, even where binary storage holds it a hair below the half. A value that rounds to zero is written without a minus sign. AVAL itself is not rounded.
Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.
prompts/adam-adlb-character-result-text/brief.md
Edit8 linesFollowing CDISC ADaM standards, use the provided LB dataset to create an ADLB dataset with one record per subject per parameter.
The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, AVAL, AVALC, AVALCS
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-character-result-text/result.R
Edit38 lines# Reference solution for the yamaa benchmark adam-adlb-character-result-text (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(readr)lb <- read_csv( "/app/input/lb.csv", col_types = cols(AVAL = col_double(), .default = col_character()))# The value rounded to `places` decimals with an exact half going away from# zero; a value stored a hair below a half counts as the half it stands for.# A result of zero is written without a minus sign.display <- function(value, places) { scaled <- abs(value) * 10^places whole <- floor(scaled) whole <- ifelse(scaled - whole >= 0.5 - 1e-9, whole + 1, whole) rounded <- sign(value) * whole / 10^places rounded[!is.na(rounded) & rounded == 0] <- 0 ifelse(is.na(value), NA_character_, formatC(rounded, format = "f", digits = places))}two <- display(lb$AVAL, 2)adlb <- data.frame( STUDYID = lb$STUDYID, USUBJID = lb$USUBJID, PARAMCD = lb$PARAMCD, AVAL = lb$AVAL, # Right-aligned in eight characters; a wider text is written in full. AVALC = ifelse(is.na(two), "NOT DONE", sprintf("%8s", two)), AVALCS = display(lb$AVAL, 1))dir.create("/app/output", showWarnings = FALSE)write_csv(adlb, "/app/output/adlb.csv", na = "")solutions/adam-adlb-character-result-text/result.py
Edit50 lines# Reference solution for the yamaa benchmark adam-adlb-character-result-text (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 csvfrom decimal import ROUND_HALF_UP, Decimaldef display(value, places, width=0): """The value rounded to `places` decimals with an exact half going away from zero, written with exactly that many digits after the point, without a minus sign on zero, and right-aligned in `width` characters; a wider text is written in full.""" rounded = value.quantize(Decimal(1).scaleb(-places), rounding=ROUND_HALF_UP) if rounded == 0: rounded = abs(rounded) return f"{rounded:.{places}f}".rjust(width)def main(): with open("/app/input/lb.csv", newline="") as f: rows = list(csv.DictReader(f)) out_rows = [] for row in rows: # The value as the source writes it, read as an exact decimal. text = (row["AVAL"] or "").strip() aval = Decimal(text) if text else None out_rows.append( { "STUDYID": row["STUDYID"], "USUBJID": row["USUBJID"], "PARAMCD": row["PARAMCD"], "AVAL": text, "AVALC": "NOT DONE" if aval is None else display(aval, 2, 8), "AVALCS": "" if aval is None else display(aval, 1), } ) fieldnames = ["STUDYID", "USUBJID", "PARAMCD", "AVAL", "AVALC", "AVALCS"] with open("/app/output/adlb.csv", "w", newline="") as f: writer = csv.DictWriter(f, fieldnames=fieldnames) writer.writeheader() writer.writerows(out_rows)if __name__ == "__main__": main()solutions/adam-adlb-character-result-text/result.sas
Edit30 lines/* opensas reference solution for the yamaa benchmark adam-adlb-character-result-text. 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 PARAMCD $1024; infile "/app/input/lb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. USUBJID : $char1024. PARAMCD : $char1024. AVAL;run;/* Two decimals right-aligned in eight characters, or written in full when wider; one decimal without leading spaces. ROUND sends a half away from zero, and a result of zero is written without a minus sign. */data result; set lb; length AVALC AVALCS $32; if missing(AVAL) then AVALC = "NOT DONE"; else do; AVALC = strip(put(round(AVAL, 0.01), 32.2)); if AVALC = "-0.00" then AVALC = "0.00"; if length(AVALC) < 8 then AVALC = right(put(AVALC, $8.)); AVALCS = strip(put(round(AVAL, 0.1), 32.1)); if AVALCS = "-0.0" then AVALCS = "0.0"; end;run;proc sql; create table final as select STUDYID, USUBJID, PARAMCD, AVAL, AVALC, AVALCS from result;quit;proc export data=final outfile="/app/output/adlb.csv" dbms=csv replace; run;
yamaa