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:
Kral
2026-10-05 13:35:54 +02:00
parent 1c4667a0fc
commit 13360292dd
781 changed files with 50211 additions and 22 deletions

View 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
or 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

View 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

View 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,
max( cast( job.pairs as abap.dec( 10, 0 ) ) * rate.price ) as total_charge
}
where job.job_state = 'D'
group by
job.customer

View 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

View File

@@ -0,0 +1,19 @@
{
"id": "G1011",
"pool": "train",
"object_type": "DDLS",
"category": "I",
"attempts": [
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 5,
"killed": 4,
"ok": true
}
}
],
"accepted": true
}

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

View File

@@ -0,0 +1,69 @@
{
"task": "G1011",
"mutants": [
{
"object": "{{P}}I_REPAIR_CHARGE",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "survived",
"hidden": "9/9",
"failed_tests": []
},
{
"object": "{{P}}I_REPAIR_CHARGE",
"mutant": "line 6: and -> or (logic)",
"status": "killed",
"hidden": "3/9",
"failed_tests": [
"CHARGE_C1",
"CHARGE_C2",
"COUNT_C1",
"COUNT_C2",
"PAIRS_C1",
"PAIRS_C2"
]
},
{
"object": "{{P}}I_REPAIR_CHARGE",
"mutant": "line 6: = -> <> (eq)",
"status": "killed",
"hidden": "5/9",
"failed_tests": [
"CHARGE_C1",
"CHARGE_C2",
"ROW_COUNT",
"SINGLE_RATE_OK"
]
},
{
"object": "{{P}}I_REPAIR_CHARGE",
"mutant": "line 11: sum( -> max( (agg)",
"status": "killed",
"hidden": "7/9",
"failed_tests": [
"CHARGE_C1",
"CHARGE_C2"
]
},
{
"object": "{{P}}I_REPAIR_CHARGE",
"mutant": "line 13: = -> <> (eq)",
"status": "killed",
"hidden": "0/9",
"failed_tests": [
"CHARGE_C1",
"CHARGE_C2",
"COUNT_C1",
"COUNT_C2",
"OPEN_JOB_HIDDEN",
"PAIRS_C1",
"PAIRS_C2",
"ROW_COUNT",
"SINGLE_RATE_OK"
]
}
],
"valid": 5,
"killed": 4,
"kill_rate": 0.8,
"ok": true
}

View 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

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

View 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

View 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);
}

View 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);
}

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

View File

@@ -0,0 +1,47 @@
# 1. Goal
Give the total repair charge of each customer of a cobbler's workshop. A report
and an OData service read the charges, so the calculation must be in the
database, in a CDS view.
# 2. Open questions
None.
# 3. Context
- Table {{P}}JOB (repair job), package $TMP. Key: JOB_ID (CHAR 10).
Fields: CUSTOMER (CHAR 10), SHOE_TYPE (CHAR 4), REPAIR_TYPE (CHAR 4),
PAIRS (INT4), JOB_STATE (CHAR 1).
- Table {{P}}RATE (repair rate), package $TMP. Key: SHOE_TYPE (CHAR 4),
REPAIR_TYPE (CHAR 4). Field: PRICE (DEC 15,2, price for one pair).
- The CDS view entity {{P}}I_REPAIR_CHARGE in package $TMP already exists and
has a defect.
# 4. Contract
- Fix the CDS view entity {{P}}I_REPAIR_CHARGE in package $TMP.
- Elements, with these names: CUSTOMER (key), JOB_COUNT, TOTAL_PAIRS,
TOTAL_CHARGE.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. The view shows one row for each customer that has at least one repair job
in the view.
2. JOB_COUNT is the number of repair jobs of the customer in the view.
3. TOTAL_PAIRS is the sum of PAIRS of these jobs.
4. 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.
5. 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.
6. All other behavior of the view stays the same.
# 6. Constraints
- Release target: 8.16.
- Coding standards: Clean ABAP. No ATC priority 1 or 2 findings.
- Out of scope: do not change {{P}}JOB and {{P}}RATE. No dynpro, no
SmartForms, no BAdI, no RAP behavior definition.
# 7. Acceptance
- The view is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.

View File

@@ -0,0 +1,78 @@
{
"id": "G1011",
"category": "I",
"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": []
}