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: build the Trial Arms dataset, one record per planned element of
each arm, carrying ARM, ETCD, ELEMENT and EPOCH, and submit it as a
Dataset-JSON file with its data-definition document.
Input: the protocol's planned design, one row per element of each arm in its planned order.
Variables:
ARMCDandARMare the planned arm's code and description.TAETORDis the element's position within its arm, starting at 1.ETCDandELEMENTare the element's code and description.EPOCHis the trial period the element belongs to:SCREENINGandTREATMENTfrom the published epoch terminology, andEXTENSION, the open-label extension period, which the sponsor added to that list.
Note: the data-definition document is prepared for a regulatory
submission, so every published epoch term carries its NCI code. The
sponsor's EXTENSION term has no NCI code: the document marks it as a sponsor
addition to the published list instead.
Inputs
Under review1 source fileinput/design.csv
Edit6 rows| STUDYID | ARMCD | ARM | TAETORD | ETCD | ELEMENT | EPOCH |
|---|---|---|---|---|---|---|
| STUDY02 | PBO | Placebo | 1 | SCRN | Screening | SCREENING |
| STUDY02 | PBO | Placebo | 2 | PBO | Placebo | TREATMENT |
| STUDY02 | PBO | Placebo | 3 | OLE | Open-label active drug | EXTENSION |
| STUDY02 | ACT | Active drug | 1 | SCRN | Screening | SCREENING |
| STUDY02 | ACT | Active drug | 2 | ACT | Active drug | TREATMENT |
| STUDY02 | ACT | Active drug | 3 | OLE | Open-label active drug | EXTENSION |
Expected output
Under review6 expected rowsexpected/define.xml
EditDefine-XMLDefine-XML 2.1.11: STUDY02
Example study submitting a sponsor-extended epoch; STUDY-02; SDTMIG 3.4; CDISC/NCI 2023-12-15
| Dataset | Description | Class | Structure | Purpose | Keys | Documentation | Location |
|---|---|---|---|---|---|---|---|
| TA | Trial Arms | TRIAL DESIGN | One record per planned element per arm | Tabulation | STUDYID, ARMCD, TAETORD | ta.json |
TA
| Variable | Label / Description | Type | Role | Length or Display Format | Controlled Terms or ISO Format | Origin / Source / Method / Comment |
|---|---|---|---|---|---|---|
| DOMAIN | Domain Abbreviation | text | Identifier | 2 | Assigned; Sponsor | |
| STUDYID | Study Identifier | text | Identifier | 7 | Protocol; Sponsor | |
| ARMCD | Planned Arm Code | text | Topic | 3 | Protocol; Sponsor | |
| ARM | Description of Planned Arm | text | Synonym Qualifier | 11 | Protocol; Sponsor | |
| TAETORD | Planned Order of Element within Arm | integer | Timing | 8 | Protocol; Sponsor | |
| ETCD | Element Code | text | Record Qualifier | 4 | Protocol; Sponsor | |
| ELEMENT | Description of Element | text | Synonym Qualifier | 22 | Protocol; Sponsor | |
| EPOCH | Epoch | text | Timing | 9 | Epoch (CL.EPOCH) SCREENING TREATMENT EXTENSION | Protocol; Sponsor |
Original source
<?xml version="1.0" encoding="UTF-8"?>
<ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:def="http://www.cdisc.org/ns/def/v2.1" xmlns:xlink="http://www.w3.org/1999/xlink" ODMVersion="1.3.2" FileType="Snapshot" FileOID="STUDY02.sdtm.Define-XML_2.1" CreationDateTime="2026-09-11T00:00:00" SourceSystem="yamaa" SourceSystemVersion="1.0" def:Context="Submission">
<Study OID="STDY.STUDY02">
<GlobalVariables>
<StudyName>STUDY02</StudyName>
<StudyDescription>Example study submitting a sponsor-extended epoch</StudyDescription>
<ProtocolName>STUDY-02</ProtocolName>
</GlobalVariables>
<MetaDataVersion OID="MDV.STUDY02.sdtm" Name="STUDY02 sdtm metadata" def:DefineVersion="2.1.11">
<def:Standards>
<def:Standard OID="STD.SDTMIG" Name="SDTMIG" Type="IG" Version="3.4" Status="Final"/>
<def:Standard OID="STD.CT_SDTM" Name="CDISC/NCI" Type="CT" PublishingSet="SDTM" Version="2023-12-15" Status="Final"/>
</def:Standards>
<ItemGroupDef OID="IG.TA" Name="TA" Domain="TA" Purpose="Tabulation" SASDatasetName="TA" Repeating="No" IsReferenceData="Yes" def:Structure="One record per planned element per arm" def:ArchiveLocationID="LF.TA" def:StandardOID="STD.SDTMIG">
<Description>
<TranslatedText xml:lang="en">Trial Arms</TranslatedText>
</Description>
<ItemRef ItemOID="IT.TA.DOMAIN" OrderNumber="1" Mandatory="Yes" Role="Identifier"/>
<ItemRef ItemOID="IT.TA.STUDYID" OrderNumber="2" Mandatory="Yes" KeySequence="1" Role="Identifier"/>
<ItemRef ItemOID="IT.TA.ARMCD" OrderNumber="3" Mandatory="Yes" KeySequence="2" Role="Topic"/>
<ItemRef ItemOID="IT.TA.ARM" OrderNumber="4" Mandatory="Yes" Role="Synonym Qualifier"/>
<ItemRef ItemOID="IT.TA.TAETORD" OrderNumber="5" Mandatory="Yes" KeySequence="3" Role="Timing"/>
<ItemRef ItemOID="IT.TA.ETCD" OrderNumber="6" Mandatory="Yes" Role="Record Qualifier"/>
<ItemRef ItemOID="IT.TA.ELEMENT" OrderNumber="7" Mandatory="No" Role="Synonym Qualifier"/>
<ItemRef ItemOID="IT.TA.EPOCH" OrderNumber="8" Mandatory="Yes" Role="Timing"/>
<def:Class Name="TRIAL DESIGN"/>
<def:leaf ID="LF.TA" xlink:href="ta.json">
<def:title>ta.json</def:title>
</def:leaf>
</ItemGroupDef>
<ItemDef OID="IT.TA.DOMAIN" Name="DOMAIN" DataType="text" Length="2" SASFieldName="DOMAIN">
<Description>
<TranslatedText xml:lang="en">Domain Abbreviation</TranslatedText>
</Description>
<def:Origin Type="Assigned" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.TA.STUDYID" Name="STUDYID" DataType="text" Length="7" SASFieldName="STUDYID">
<Description>
<TranslatedText xml:lang="en">Study Identifier</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.TA.ARMCD" Name="ARMCD" DataType="text" Length="3" SASFieldName="ARMCD">
<Description>
<TranslatedText xml:lang="en">Planned Arm Code</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.TA.ARM" Name="ARM" DataType="text" Length="11" SASFieldName="ARM">
<Description>
<TranslatedText xml:lang="en">Description of Planned Arm</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.TA.TAETORD" Name="TAETORD" DataType="integer" Length="8" SASFieldName="TAETORD">
<Description>
<TranslatedText xml:lang="en">Planned Order of Element within Arm</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.TA.ETCD" Name="ETCD" DataType="text" Length="4" SASFieldName="ETCD">
<Description>
<TranslatedText xml:lang="en">Element Code</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.TA.ELEMENT" Name="ELEMENT" DataType="text" Length="22" SASFieldName="ELEMENT">
<Description>
<TranslatedText xml:lang="en">Description of Element</TranslatedText>
</Description>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<ItemDef OID="IT.TA.EPOCH" Name="EPOCH" DataType="text" Length="9" SASFieldName="EPOCH">
<Description>
<TranslatedText xml:lang="en">Epoch</TranslatedText>
</Description>
<CodeListRef CodeListOID="CL.EPOCH"/>
<def:Origin Type="Protocol" Source="Sponsor"/>
</ItemDef>
<CodeList OID="CL.EPOCH" Name="Epoch" DataType="text" def:StandardOID="STD.CT_SDTM">
<EnumeratedItem CodedValue="SCREENING">
<Alias Context="nci:ExtCodeID" Name="C48262"/>
</EnumeratedItem>
<EnumeratedItem CodedValue="TREATMENT">
<Alias Context="nci:ExtCodeID" Name="C101526"/>
</EnumeratedItem>
<EnumeratedItem CodedValue="EXTENSION" def:ExtendedValue="Yes"/>
<Alias Context="nci:ExtCodeID" Name="C99079"/>
</CodeList>
</MetaDataVersion>
</Study>
</ODM>
expected/ta.csv
Edit6 rows| DOMAIN | STUDYID | ARMCD | ARM | TAETORD | ETCD | ELEMENT | EPOCH |
|---|---|---|---|---|---|---|---|
| TA | STUDY02 | PBO | Placebo | 1 | SCRN | Screening | SCREENING |
| TA | STUDY02 | PBO | Placebo | 2 | PBO | Placebo | TREATMENT |
| TA | STUDY02 | PBO | Placebo | 3 | OLE | Open-label active drug | EXTENSION |
| TA | STUDY02 | ACT | Active drug | 1 | SCRN | Screening | SCREENING |
| TA | STUDY02 | ACT | Active drug | 2 | ACT | Active drug | TREATMENT |
| TA | STUDY02 | ACT | Active drug | 3 | OLE | Open-label active drug | EXTENSION |
expected/ta.json
Edit{
"datasetJSONCreationDateTime": "2026-09-11T00:00:00",
"datasetJSONVersion": "1.1.0",
"fileOID": "STUDY02.sdtm.Define-XML_2.1.TA",
"sourceSystem": {"name": "yamaa", "version": "1.0"},
"studyOID": "STDY.STUDY02",
"metaDataVersionOID": "MDV.STUDY02.sdtm",
"metaDataRef": "define.xml",
"itemGroupOID": "IG.TA",
"records": 6,
"name": "TA",
"label": "Trial Arms",
"columns": [
{"itemOID": "IT.TA.DOMAIN", "name": "DOMAIN", "label": "Domain Abbreviation", "dataType": "string", "length": 2},
{"itemOID": "IT.TA.STUDYID", "name": "STUDYID", "label": "Study Identifier", "dataType": "string", "length": 7, "keySequence": 1},
{"itemOID": "IT.TA.ARMCD", "name": "ARMCD", "label": "Planned Arm Code", "dataType": "string", "length": 3, "keySequence": 2},
{"itemOID": "IT.TA.ARM", "name": "ARM", "label": "Description of Planned Arm", "dataType": "string", "length": 11},
{"itemOID": "IT.TA.TAETORD", "name": "TAETORD", "label": "Planned Order of Element within Arm", "dataType": "integer", "length": 8, "keySequence": 3},
{"itemOID": "IT.TA.ETCD", "name": "ETCD", "label": "Element Code", "dataType": "string", "length": 4},
{"itemOID": "IT.TA.ELEMENT", "name": "ELEMENT", "label": "Description of Element", "dataType": "string", "length": 22},
{"itemOID": "IT.TA.EPOCH", "name": "EPOCH", "label": "Epoch", "dataType": "string", "length": 9}
],
"rows": [
["TA", "STUDY02", "PBO", "Placebo", 1, "SCRN", "Screening", "SCREENING"],
["TA", "STUDY02", "PBO", "Placebo", 2, "PBO", "Placebo", "TREATMENT"],
["TA", "STUDY02", "PBO", "Placebo", 3, "OLE", "Open-label active drug", "EXTENSION"],
["TA", "STUDY02", "ACT", "Active drug", 1, "SCRN", "Screening", "SCREENING"],
["TA", "STUDY02", "ACT", "Active drug", 2, "ACT", "Active drug", "TREATMENT"],
["TA", "STUDY02", "ACT", "Active drug", 3, "OLE", "Open-label active drug", "EXTENSION"]
]
}
Human review and assessment
| Variable Name | Variable Label | Type | Length | Controlled Terms or Format | Origin | Core | Conversion Definition | Variable Type | Variable Order | Comments for Define |
|---|---|---|---|---|---|---|---|---|---|---|
| DOMAIN | Domain Abbreviation | Char | 2 | Assigned | Req | Set constant value "TA". | SDTM | 1 | ||
| STUDYID | Study Identifier | Char | 12 | Protocol | Req | Copy value from DESIGN.STUDYID. | SDTM | 2 | ||
| ARMCD | Planned Arm Code | Char | 8 | Protocol | Req | Copy value from DESIGN.ARMCD. | SDTM | 3 | ||
| ARM | Description of Planned Arm | Char | 40 | Protocol | Req | Copy value from DESIGN.ARM. | SDTM | 4 | ||
| TAETORD | Planned Order of Element within Arm | Num | 8 | Protocol | Req | Copy value from DESIGN.TAETORD. | SDTM | 5 | ||
| ETCD | Element Code | Char | 8 | Protocol | Req | Copy value from DESIGN.ETCD. | SDTM | 6 | ||
| ELEMENT | Description of Element | Char | 40 | Protocol | Perm | Copy value from DESIGN.ELEMENT. | SDTM | 7 | ||
| EPOCH | Epoch | Char | 20 | Epoch | Protocol | Req | Copy value from DESIGN.EPOCH. | SDTM | 8 |
| Codelist ID | Name | Value | Decode | Codelist NCI alias | Value NCI alias | Extensible | Extended value | SAS format | Dictionary | Version |
|---|---|---|---|---|---|---|---|---|---|---|
| EPOCH | Epoch | SCREENING | C99079 | C48262 | Yes | |||||
| EPOCH | Epoch | TREATMENT | C99079 | C101526 | Yes | |||||
| EPOCH | Epoch | EXTENSION | C99079 | Yes | Yes |
| 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/sdtm-ta-sponsor-epoch/full.md
Edit13 linesFollowing CDISC SDTM standards, use the provided DESIGN dataset to create a TA dataset with one record per planned element per arm.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, ARMCD, ARM, TAETORD, ETCD, ELEMENT, EPOCH
ARMCD, ARM, ETCD, ELEMENT and EPOCH are as the protocol design states them, and TAETORD is the element's planned order within its arm, starting at 1. "EXTENSION", the open-label extension period, is a sponsor addition to the published epoch terms and is kept as written.
Read the source datasets from /app/input and save the completed dataset as /app/output/ta.csv.
prompts/sdtm-ta-sponsor-epoch/conventions.md
Edit10 linesFollowing CDISC SDTM standards, use the provided DESIGN dataset to create a TA dataset with one record per planned element per arm.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, ARMCD, ARM, TAETORD, ETCD, ELEMENT, EPOCH
"EXTENSION" is a sponsor epoch and is kept as written.
Read the source datasets from /app/input and save the completed dataset as /app/output/ta.csv.
prompts/sdtm-ta-sponsor-epoch/brief.md
Edit8 linesFollowing CDISC SDTM standards, use the provided DESIGN dataset to create a TA dataset with one record per planned element per arm.
The output dataset should contain the following columns in this order: DOMAIN, STUDYID, ARMCD, ARM, TAETORD, ETCD, ELEMENT, EPOCH
Read the source datasets from /app/input and save the completed dataset as /app/output/ta.csv.
R
Edit3 lineslibrary(yamaa)yamaa_project("project.yaml")$spec("TA")$run()$outputPython
Edit3 linesimport yamaayamaa.project("project.yaml").spec("TA").run().outputsolutions/sdtm-ta-sponsor-epoch/result.R
Edit23 lines# Reference solution for the yamaa benchmark sdtm-ta-sponsor-epoch (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)design <- read_csv( "/app/input/design.csv", col_types = cols(.default = col_character()))ta <- design |> mutate( DOMAIN = "TA", TAETORD = as.integer(TAETORD) ) |> select(DOMAIN, STUDYID, ARMCD, ARM, TAETORD, ETCD, ELEMENT, EPOCH)dir.create("/app/output", showWarnings = FALSE)write_csv(ta, "/app/output/ta.csv", na = "")solutions/sdtm-ta-sponsor-epoch/result.py
Edit28 lines# Reference solution for the yamaa benchmark sdtm-ta-sponsor-epoch (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.from pathlib import Pathimport polars as pldesign = pl.read_csv("/app/input/design.csv", infer_schema=False)ta = design.with_columns( DOMAIN=pl.lit("TA"), TAETORD=pl.col("TAETORD").cast(pl.Int64),).select( "DOMAIN", "STUDYID", "ARMCD", "ARM", "TAETORD", "ETCD", "ELEMENT", "EPOCH",)Path("/app/output").mkdir(exist_ok=True)ta.write_csv("/app/output/ta.csv")solutions/sdtm-ta-sponsor-epoch/result.sas
Edit17 lines/* opensas reference solution for the yamaa benchmark sdtm-ta-sponsor-epoch. Reads the benchmark inputs and derives the requested output. Execute with the existing opensas runtime: opensas /app/output/result.sas. */data design; length STUDYID ARMCD ARM ETCD ELEMENT EPOCH $1024; infile "/app/input/design.csv" dsd dlm="," firstobs=2 truncover lrecl=32767; input STUDYID : $char1024. ARMCD : $char1024. ARM : $char1024. TAETORD ETCD : $char1024. ELEMENT : $char1024. EPOCH : $char1024.;run;data result; set design; length DOMAIN $2; DOMAIN='TA'; run;proc sql; create table final as select DOMAIN, STUDYID, ARMCD, ARM, TAETORD, ETCD, ELEMENT, EPOCH from result;quit;proc export data=final outfile="/app/output/ta.csv" dbms=csv replace; run;
yamaa