Pipeline controller: plan 2 (hard +, error +50 %), backlog throttle, 2 trajectory workers, stop rules, summaries every 50; budget reserve
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
16
tasks_gen/train/G1304/generation.json
Normal file
16
tasks_gen/train/G1304/generation.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"id": "G1304",
|
||||
"pool": "train",
|
||||
"category": "K",
|
||||
"base_task": "G1011",
|
||||
"style": "free_text",
|
||||
"tool_schema": null,
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
97
tasks_gen/train/G1304/hidden/repair_charge_hidden.clas.abap
Normal file
97
tasks_gen/train/G1304/hidden/repair_charge_hidden.clas.abap
Normal file
@@ -0,0 +1,97 @@
|
||||
CLASS {{p}}repair_charge_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
|
||||
CLASS-METHODS class_setup.
|
||||
CLASS-METHODS class_teardown.
|
||||
METHODS setup.
|
||||
METHODS charge_c1 FOR TESTING.
|
||||
METHODS charge_c2 FOR TESTING.
|
||||
METHODS count_c1 FOR TESTING.
|
||||
METHODS count_c2 FOR TESTING.
|
||||
METHODS pairs_c1 FOR TESTING.
|
||||
METHODS pairs_c2 FOR TESTING.
|
||||
METHODS single_rate_ok FOR TESTING.
|
||||
METHODS open_job_hidden FOR TESTING.
|
||||
METHODS row_count FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}repair_charge_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_REPAIR_CHARGE' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_job TYPE STANDARD TABLE OF {{p}}job WITH EMPTY KEY.
|
||||
DATA lt_rate TYPE STANDARD TABLE OF {{p}}rate WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_job = VALUE #(
|
||||
( job_id = 'J1' customer = 'C1' shoe_type = 'BOOT' repair_type = 'SOLE' pairs = 2 job_state = 'D' )
|
||||
( job_id = 'J2' customer = 'C1' shoe_type = 'SHOE' repair_type = 'HEEL' pairs = 1 job_state = 'D' )
|
||||
( job_id = 'J3' customer = 'C2' shoe_type = 'BOOT' repair_type = 'SOLE' pairs = 3 job_state = 'D' )
|
||||
( job_id = 'J4' customer = 'C3' shoe_type = 'BOOT' repair_type = 'SOLE' pairs = 1 job_state = 'O' )
|
||||
( job_id = 'J5' customer = 'C2' shoe_type = 'BOOT' repair_type = 'HEEL' pairs = 1 job_state = 'D' )
|
||||
( job_id = 'J6' customer = 'C4' shoe_type = 'SANDAL' repair_type = 'STRAP' pairs = 2 job_state = 'D' ) ).
|
||||
lt_rate = VALUE #(
|
||||
( shoe_type = 'BOOT' repair_type = 'SOLE' price = '12.50' )
|
||||
( shoe_type = 'BOOT' repair_type = 'HEEL' price = '6.25' )
|
||||
( shoe_type = 'SHOE' repair_type = 'HEEL' price = '4.00' )
|
||||
( shoe_type = 'SHOE' repair_type = 'SOLE' price = '3.75' )
|
||||
( shoe_type = 'SANDAL' repair_type = 'STRAP' price = '5.00' ) ).
|
||||
go_env->insert_test_data( lt_job ).
|
||||
go_env->insert_test_data( lt_rate ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD charge_c1.
|
||||
SELECT SINGLE total_charge FROM {{p}}i_repair_charge WHERE customer = 'C1' INTO @DATA(lv_charge).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '29.00' )
|
||||
act = CONV decfloat34( lv_charge ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD charge_c2.
|
||||
SELECT SINGLE total_charge FROM {{p}}i_repair_charge WHERE customer = 'C2' INTO @DATA(lv_charge).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '43.75' )
|
||||
act = CONV decfloat34( lv_charge ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD count_c1.
|
||||
SELECT SINGLE job_count FROM {{p}}i_repair_charge WHERE customer = 'C1' INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD count_c2.
|
||||
SELECT SINGLE job_count FROM {{p}}i_repair_charge WHERE customer = 'C2' INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD pairs_c1.
|
||||
SELECT SINGLE total_pairs FROM {{p}}i_repair_charge WHERE customer = 'C1' INTO @DATA(lv_pairs).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_pairs ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD pairs_c2.
|
||||
SELECT SINGLE total_pairs FROM {{p}}i_repair_charge WHERE customer = 'C2' INTO @DATA(lv_pairs).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_pairs ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD single_rate_ok.
|
||||
SELECT SINGLE total_charge FROM {{p}}i_repair_charge WHERE customer = 'C4' INTO @DATA(lv_charge).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' )
|
||||
act = CONV decfloat34( lv_charge ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD open_job_hidden.
|
||||
SELECT COUNT(*) FROM {{p}}i_repair_charge WHERE customer = 'C3' INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD row_count.
|
||||
SELECT COUNT(*) FROM {{p}}i_repair_charge INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
15
tasks_gen/train/G1304/reference/i_repair_charge.ddls.asddls
Normal file
15
tasks_gen/train/G1304/reference/i_repair_charge.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Repair charge per customer'
|
||||
define view entity {{P}}I_REPAIR_CHARGE
|
||||
as select from {{p}}job as job
|
||||
inner join {{p}}rate as rate on rate.shoe_type = job.shoe_type
|
||||
and rate.repair_type = job.repair_type
|
||||
{
|
||||
key job.customer as customer,
|
||||
count( * ) as job_count,
|
||||
sum( job.pairs ) as total_pairs,
|
||||
sum( cast( job.pairs as abap.dec( 10, 0 ) ) * rate.price ) as total_charge
|
||||
}
|
||||
where job.job_state = 'D'
|
||||
group by
|
||||
job.customer
|
||||
59
tasks_gen/train/G1304/reference/repair_charge_test.clas.abap
Normal file
59
tasks_gen/train/G1304/reference/repair_charge_test.clas.abap
Normal file
@@ -0,0 +1,59 @@
|
||||
CLASS {{p}}repair_charge_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
|
||||
CLASS-METHODS class_setup.
|
||||
CLASS-METHODS class_teardown.
|
||||
METHODS setup.
|
||||
METHODS charge_of_two_jobs FOR TESTING.
|
||||
METHODS charge_of_single_rate FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}repair_charge_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_REPAIR_CHARGE' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
go_env->clear_doubles( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD charge_of_two_jobs.
|
||||
DATA lt_job TYPE STANDARD TABLE OF {{p}}job WITH EMPTY KEY.
|
||||
DATA lt_rate TYPE STANDARD TABLE OF {{p}}rate WITH EMPTY KEY.
|
||||
lt_job = VALUE #(
|
||||
( job_id = 'A' customer = 'C1' shoe_type = 'BOOT' repair_type = 'SOLE' pairs = 2 job_state = 'D' )
|
||||
( job_id = 'B' customer = 'C1' shoe_type = 'BOOT' repair_type = 'HEEL' pairs = 1 job_state = 'D' ) ).
|
||||
lt_rate = VALUE #(
|
||||
( shoe_type = 'BOOT' repair_type = 'SOLE' price = '10.00' )
|
||||
( shoe_type = 'BOOT' repair_type = 'HEEL' price = '5.00' ) ).
|
||||
go_env->insert_test_data( lt_job ).
|
||||
go_env->insert_test_data( lt_rate ).
|
||||
SELECT SINGLE job_count, total_pairs, total_charge FROM {{p}}i_repair_charge
|
||||
WHERE customer = 'C1' INTO @DATA(ls_charge).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_charge-job_count ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = ls_charge-total_pairs ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '25.00' )
|
||||
act = CONV decfloat34( ls_charge-total_charge ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD charge_of_single_rate.
|
||||
DATA lt_job TYPE STANDARD TABLE OF {{p}}job WITH EMPTY KEY.
|
||||
DATA lt_rate TYPE STANDARD TABLE OF {{p}}rate WITH EMPTY KEY.
|
||||
lt_job = VALUE #(
|
||||
( job_id = 'C' customer = 'C2' shoe_type = 'SANDAL' repair_type = 'STRAP' pairs = 4 job_state = 'D' ) ).
|
||||
lt_rate = VALUE #(
|
||||
( shoe_type = 'SANDAL' repair_type = 'STRAP' price = '5.50' ) ).
|
||||
go_env->insert_test_data( lt_job ).
|
||||
go_env->insert_test_data( lt_rate ).
|
||||
SELECT SINGLE total_charge FROM {{p}}i_repair_charge
|
||||
WHERE customer = 'C2' INTO @DATA(lv_charge).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '22.00' )
|
||||
act = CONV decfloat34( lv_charge ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
14
tasks_gen/train/G1304/seed/i_repair_charge.ddls.asddls
Normal file
14
tasks_gen/train/G1304/seed/i_repair_charge.ddls.asddls
Normal file
@@ -0,0 +1,14 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Repair charge per customer'
|
||||
define view entity {{P}}I_REPAIR_CHARGE
|
||||
as select from {{p}}job as job
|
||||
inner join {{p}}rate as rate on rate.shoe_type = job.shoe_type
|
||||
{
|
||||
key job.customer as customer,
|
||||
count( * ) as job_count,
|
||||
sum( job.pairs ) as total_pairs,
|
||||
sum( cast( job.pairs as abap.dec( 10, 0 ) ) * rate.price ) as total_charge
|
||||
}
|
||||
where job.job_state = 'D'
|
||||
group by
|
||||
job.customer
|
||||
14
tasks_gen/train/G1304/seed/job.tabl.asabap
Normal file
14
tasks_gen/train/G1304/seed/job.tabl.asabap
Normal file
@@ -0,0 +1,14 @@
|
||||
@EndUserText.label : 'Repair job'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}job {
|
||||
key client : abap.clnt not null;
|
||||
key job_id : abap.char(10) not null;
|
||||
customer : abap.char(10);
|
||||
shoe_type : abap.char(4);
|
||||
repair_type : abap.char(4);
|
||||
pairs : abap.int4;
|
||||
job_state : abap.char(1);
|
||||
}
|
||||
11
tasks_gen/train/G1304/seed/rate.tabl.asabap
Normal file
11
tasks_gen/train/G1304/seed/rate.tabl.asabap
Normal file
@@ -0,0 +1,11 @@
|
||||
@EndUserText.label : 'Repair rate'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}rate {
|
||||
key client : abap.clnt not null;
|
||||
key shoe_type : abap.char(4) not null;
|
||||
key repair_type : abap.char(4) not null;
|
||||
price : abap.dec(15,2);
|
||||
}
|
||||
34
tasks_gen/train/G1304/seed/seed_repair.clas.abap
Normal file
34
tasks_gen/train/G1304/seed/seed_repair.clas.abap
Normal file
@@ -0,0 +1,34 @@
|
||||
CLASS {{p}}seed_repair DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}seed_repair IMPLEMENTATION.
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
DATA lt_job TYPE STANDARD TABLE OF {{p}}job WITH EMPTY KEY.
|
||||
DATA lt_rate TYPE STANDARD TABLE OF {{p}}rate WITH EMPTY KEY.
|
||||
|
||||
lt_job = VALUE #(
|
||||
( job_id = 'J1' customer = 'C1' shoe_type = 'BOOT' repair_type = 'SOLE' pairs = 2 job_state = 'D' )
|
||||
( job_id = 'J2' customer = 'C1' shoe_type = 'SHOE' repair_type = 'HEEL' pairs = 1 job_state = 'D' )
|
||||
( job_id = 'J3' customer = 'C2' shoe_type = 'BOOT' repair_type = 'SOLE' pairs = 3 job_state = 'D' )
|
||||
( job_id = 'J4' customer = 'C3' shoe_type = 'BOOT' repair_type = 'SOLE' pairs = 1 job_state = 'O' )
|
||||
( job_id = 'J5' customer = 'C2' shoe_type = 'BOOT' repair_type = 'HEEL' pairs = 1 job_state = 'D' )
|
||||
( job_id = 'J6' customer = 'C4' shoe_type = 'SANDAL' repair_type = 'STRAP' pairs = 2 job_state = 'D' ) ).
|
||||
|
||||
lt_rate = VALUE #(
|
||||
( shoe_type = 'BOOT' repair_type = 'SOLE' price = '12.50' )
|
||||
( shoe_type = 'BOOT' repair_type = 'HEEL' price = '6.25' )
|
||||
( shoe_type = 'SHOE' repair_type = 'HEEL' price = '4.00' )
|
||||
( shoe_type = 'SHOE' repair_type = 'SOLE' price = '3.75' )
|
||||
( shoe_type = 'SANDAL' repair_type = 'STRAP' price = '5.00' ) ).
|
||||
|
||||
DELETE FROM {{p}}job.
|
||||
DELETE FROM {{p}}rate.
|
||||
INSERT {{p}}job FROM TABLE @lt_job.
|
||||
INSERT {{p}}rate FROM TABLE @lt_rate.
|
||||
|
||||
out->write( |Jobs: { lines( lt_job ) }, rates: { lines( lt_rate ) }| ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
1
tasks_gen/train/G1304/spec.md
Normal file
1
tasks_gen/train/G1304/spec.md
Normal file
@@ -0,0 +1 @@
|
||||
Hi, please fix the CDS view entity {{P}}I_REPAIR_CHARGE in package $TMP. The view gives the total repair charge of each customer of a cobbler's workshop. A report and an OData service read the charges. The calculation must be in the database, in a CDS view. The view entity already exists and has a defect. The elements are CUSTOMER as key, JOB_COUNT, TOTAL_PAIRS, and TOTAL_CHARGE. The authorization check is #NOT_REQUIRED. The view shows one row for each customer that has at least one repair job in the view. JOB_COUNT is the number of repair jobs of the customer in the view. TOTAL_PAIRS is the sum of PAIRS of these jobs. The charge of a repair job is its PAIRS multiplied by the price that the rate table holds for the shoe type and the repair type of the job. TOTAL_CHARGE is the sum of the charges of these jobs, with 2 decimals. Users report that JOB_COUNT, TOTAL_PAIRS, and TOTAL_CHARGE of a customer are too high. The three values are correct when the customer has no job whose shoe type has more than one repair type in the rate table. The three values must be correct for every customer. All other behavior of the view stays the same. Use table {{P}}JOB for repair jobs. Its key is JOB_ID (CHAR 10). Its fields are CUSTOMER (CHAR 10), SHOE_TYPE (CHAR 4), REPAIR_TYPE (CHAR 4), PAIRS (INT4), and JOB_STATE (CHAR 1). Use table {{P}}RATE for repair rates. Its key is SHOE_TYPE (CHAR 4) and REPAIR_TYPE (CHAR 4). Its field is PRICE (DEC 15,2, price for one pair). Both tables are in package $TMP. Do not change {{P}}JOB and {{P}}RATE. The release target is 8.16. Follow Clean ABAP. There must be no ATC priority 1 or 2 findings. No dynpro, no SmartForms, no BAdI, and no RAP behavior definition. The view must be active and have no syntax error. The hidden tests must pass. Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class. There are no open questions.
|
||||
80
tasks_gen/train/G1304/task.json
Normal file
80
tasks_gen/train/G1304/task.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"id": "G1304",
|
||||
"category": "K",
|
||||
"object_type": "DDLS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}JOB",
|
||||
"file": "seed/job.tabl.asabap",
|
||||
"description": "Repair job"
|
||||
},
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}RATE",
|
||||
"file": "seed/rate.tabl.asabap",
|
||||
"description": "Repair rate"
|
||||
},
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_REPAIR_CHARGE",
|
||||
"file": "seed/i_repair_charge.ddls.asddls",
|
||||
"description": "Faulty repair charge view"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SEED_REPAIR",
|
||||
"file": "seed/seed_repair.clas.abap",
|
||||
"description": "Seed data for the repair tables",
|
||||
"run": true
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_REPAIR_CHARGE",
|
||||
"fields": [
|
||||
"CUSTOMER",
|
||||
"JOB_COUNT",
|
||||
"TOTAL_PAIRS",
|
||||
"TOTAL_CHARGE"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}JOB",
|
||||
"{{P}}RATE"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}REPAIR_CHARGE_HIDDEN",
|
||||
"file": "hidden/repair_charge_hidden.clas.abap",
|
||||
"description": "Hidden tests for the repair charge view"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_REPAIR_CHARGE",
|
||||
"file": "reference/i_repair_charge.ddls.asddls",
|
||||
"description": "Fixed repair charge view"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}REPAIR_CHARGE_TEST",
|
||||
"file": "reference/repair_charge_test.clas.abap",
|
||||
"description": "Own tests for the repair charge view"
|
||||
}
|
||||
],
|
||||
"craft_checks": [],
|
||||
"base_task": "G1011",
|
||||
"input_style": "free_text"
|
||||
}
|
||||
Reference in New Issue
Block a user