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: 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 review
1 source file

input/lb.csv

Edit
9 rows
input/lb.csv
STUDYIDUSUBJIDPARAMCDAVAL
YAMAA-01GLUC3.14159
YAMAA-01GLUC7
YAMAA-01GLUC0.5
YAMAA-01GLUC-1.234
YAMAA-01GLUC1234.5678
YAMAA-01GLUC—
YAMAA-01GLUC2.675
YAMAA-01GLUC-0.001
YAMAA-01GLUC12345678.9

Expected output

Under review
9 expected rows

expected/adlb.csv

Edit
9 rows
expected/adlb.csv
STUDYIDUSUBJIDPARAMCDAVALAVALCAVALCS
YAMAA-01GLUC3.14159 3.143.1
YAMAA-01GLUC7 7.007.0
YAMAA-01GLUC0.5 0.500.5
YAMAA-01GLUC-1.234 -1.23-1.2
YAMAA-01GLUC1234.5678 1234.571234.6
YAMAA-01GLUC—NOT DONE—
YAMAA-01GLUC2.675 2.682.7
YAMAA-01GLUC-0.001 0.000.0
YAMAA-01GLUC12345678.912345678.9012345678.9
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
ADLBSTUDYIDStudy IdentifiercharacterCopy value from LB.STUDYID.Predecessor
ADLBUSUBJIDUnique Subject IdentifiercharacterCopy value from LB.USUBJID.Predecessor
ADLBPARAMCDParameter CodecharacterCopy value from LB.PARAMCD.Predecessor
ADLBAVALAnalysis ValuenumericCopy value from LB.AVAL.Predecessor
ADLBAVALCAnalysis Value (C)characterWrite 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
ADLBAVALCSAnalysis Value (C) to One DecimalcharacterWrite AVAL as text with exactly 1 decimal, rounded half away from zero.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-adlb-character-result-text/full.md

Edit
26 lines

Following 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

Edit
17 lines

Following 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

Edit
8 lines

Following 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.

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-adlb-character-result-text/result.R

Edit
38 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

Edit
50 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

Edit
30 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;