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,16 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Bike usage'
define view entity {{P}}I_BIKE_USE
as select from {{p}}bike as bike
inner join {{p}}ride as ride on ride.bike_id <> bike.bike_id
{
key bike.bike_id as bike_id,
bike.station as station,
count( * ) as ride_count,
sum( ride.distance_km ) as total_distance
}
group by
bike.bike_id,
bike.station
having
sum( ride.distance_km ) > 50.0

View File

@@ -0,0 +1,16 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Bike usage'
define view entity {{P}}I_BIKE_USE
as select from {{p}}bike as bike
inner join {{p}}ride as ride on ride.bike_id = bike.bike_id
{
key bike.bike_id as bike_id,
bike.station as station,
count( * ) as ride_count,
max( ride.distance_km ) as total_distance
}
group by
bike.bike_id,
bike.station
having
sum( ride.distance_km ) > 50.0

View File

@@ -0,0 +1,16 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Bike usage'
define view entity {{P}}I_BIKE_USE
as select from {{p}}bike as bike
inner join {{p}}ride as ride on ride.bike_id = bike.bike_id
{
key bike.bike_id as bike_id,
bike.station as station,
count( * ) as ride_count,
sum( ride.distance_km ) as total_distance
}
group by
bike.bike_id,
bike.station
having
max( ride.distance_km ) > 50.0

View File

@@ -0,0 +1,16 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Bike usage'
define view entity {{P}}I_BIKE_USE
as select from {{p}}bike as bike
inner join {{p}}ride as ride on ride.bike_id = bike.bike_id
{
key bike.bike_id as bike_id,
bike.station as station,
count( * ) as ride_count,
sum( ride.distance_km ) as total_distance
}
group by
bike.bike_id,
bike.station
having
sum( ride.distance_km ) <= 50.0

View File

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

View File

@@ -0,0 +1,84 @@
CLASS {{p}}t_bike_hid 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 heavy_bikes_only FOR TESTING.
METHODS boundary_excluded FOR TESTING.
METHODS light_bike_excluded FOR TESTING.
METHODS bike_without_rides FOR TESTING.
METHODS ride_count_shown FOR TESTING.
METHODS total_distance_shown FOR TESTING.
METHODS station_shown FOR TESTING.
ENDCLASS.
CLASS {{p}}t_bike_hid IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BIKE_USE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_bike TYPE STANDARD TABLE OF {{p}}bike WITH EMPTY KEY.
DATA lt_ride TYPE STANDARD TABLE OF {{p}}ride WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_bike = VALUE #( ( bike_id = 'B1' station = 'NORD' bike_type = 'E' )
( bike_id = 'B2' station = 'SUED' bike_type = 'C' )
( bike_id = 'B3' station = 'WEST' bike_type = 'C' )
( bike_id = 'B4' station = 'OST' bike_type = 'E' )
( bike_id = 'B5' station = 'NORD' bike_type = 'C' ) ).
lt_ride = VALUE #( ( ride_id = 'R01' bike_id = 'B1' ride_date = '20240101' distance_km = '20.0' )
( ride_id = 'R02' bike_id = 'B1' ride_date = '20240102' distance_km = '30.0' )
( ride_id = 'R03' bike_id = 'B2' ride_date = '20240103' distance_km = '25.5' )
( ride_id = 'R04' bike_id = 'B2' ride_date = '20240104' distance_km = '30.0' )
( ride_id = 'R05' bike_id = 'B3' ride_date = '20240105' distance_km = '10.0' )
( ride_id = 'R06' bike_id = 'B4' ride_date = '20240106' distance_km = '40.0' )
( ride_id = 'R07' bike_id = 'B4' ride_date = '20240107' distance_km = '40.0' )
( ride_id = 'R08' bike_id = 'B4' ride_date = '20240108' distance_km = '25.0' ) ).
go_env->insert_test_data( lt_bike ).
go_env->insert_test_data( lt_ride ).
ENDMETHOD.
METHOD heavy_bikes_only.
SELECT COUNT(*) FROM {{p}}i_bike_use INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rows ).
ENDMETHOD.
METHOD boundary_excluded.
SELECT COUNT(*) FROM {{p}}i_bike_use WHERE bike_id = 'B1' INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
METHOD light_bike_excluded.
SELECT COUNT(*) FROM {{p}}i_bike_use WHERE bike_id = 'B3' INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
METHOD bike_without_rides.
SELECT COUNT(*) FROM {{p}}i_bike_use WHERE bike_id = 'B5' INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
METHOD ride_count_shown.
SELECT SINGLE ride_count FROM {{p}}i_bike_use WHERE bike_id = 'B2' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
ENDMETHOD.
METHOD total_distance_shown.
SELECT SINGLE total_distance FROM {{p}}i_bike_use WHERE bike_id = 'B4' INTO @DATA(lv_total).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '105.0' )
act = CONV decfloat34( lv_total ) ).
ENDMETHOD.
METHOD station_shown.
SELECT SINGLE station FROM {{p}}i_bike_use WHERE bike_id = 'B2' INTO @DATA(lv_station).
cl_abap_unit_assert=>assert_equals( exp = 'SUED' act = lv_station ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,64 @@
{
"task": "G1052",
"mutants": [
{
"object": "{{P}}I_BIKE_USE",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "survived",
"hidden": "7/7",
"failed_tests": []
},
{
"object": "{{P}}I_BIKE_USE",
"mutant": "line 5: = -> <> (eq)",
"status": "killed",
"hidden": "1/7",
"failed_tests": [
"BIKE_WITHOUT_RIDES",
"BOUNDARY_EXCLUDED",
"HEAVY_BIKES_ONLY",
"LIGHT_BIKE_EXCLUDED",
"RIDE_COUNT_SHOWN",
"TOTAL_DISTANCE_SHOWN"
]
},
{
"object": "{{P}}I_BIKE_USE",
"mutant": "line 10: sum( -> max( (agg)",
"status": "killed",
"hidden": "6/7",
"failed_tests": [
"TOTAL_DISTANCE_SHOWN"
]
},
{
"object": "{{P}}I_BIKE_USE",
"mutant": "line 16: sum( -> max( (agg)",
"status": "killed",
"hidden": "3/7",
"failed_tests": [
"HEAVY_BIKES_ONLY",
"RIDE_COUNT_SHOWN",
"STATION_SHOWN",
"TOTAL_DISTANCE_SHOWN"
]
},
{
"object": "{{P}}I_BIKE_USE",
"mutant": "line 16: > -> <= (rel)",
"status": "killed",
"hidden": "2/7",
"failed_tests": [
"BOUNDARY_EXCLUDED",
"LIGHT_BIKE_EXCLUDED",
"RIDE_COUNT_SHOWN",
"STATION_SHOWN",
"TOTAL_DISTANCE_SHOWN"
]
}
],
"valid": 5,
"killed": 4,
"kill_rate": 0.8,
"ok": true
}

View File

@@ -0,0 +1,16 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Bike usage'
define view entity {{P}}I_BIKE_USE
as select from {{p}}bike as bike
inner join {{p}}ride as ride on ride.bike_id = bike.bike_id
{
key bike.bike_id as bike_id,
bike.station as station,
count( * ) as ride_count,
sum( ride.distance_km ) as total_distance
}
group by
bike.bike_id,
bike.station
having
sum( ride.distance_km ) > 50.0

View File

@@ -0,0 +1,47 @@
CLASS {{p}}t_bike_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 heavy_bike_only FOR TESTING.
METHODS light_bike_hidden FOR TESTING.
ENDCLASS.
CLASS {{p}}t_bike_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BIKE_USE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_bike TYPE STANDARD TABLE OF {{p}}bike WITH EMPTY KEY.
DATA lt_ride TYPE STANDARD TABLE OF {{p}}ride WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_bike = VALUE #( ( bike_id = 'B1' station = 'NORD' bike_type = 'E' )
( bike_id = 'B2' station = 'SUED' bike_type = 'C' ) ).
lt_ride = VALUE #( ( ride_id = 'R1' bike_id = 'B1' ride_date = '20240101' distance_km = '60.0' )
( ride_id = 'R2' bike_id = 'B2' ride_date = '20240102' distance_km = '20.0' ) ).
go_env->insert_test_data( lt_bike ).
go_env->insert_test_data( lt_ride ).
ENDMETHOD.
METHOD heavy_bike_only.
SELECT COUNT(*) FROM {{p}}i_bike_use INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rows ).
ENDMETHOD.
METHOD light_bike_hidden.
SELECT SINGLE ride_count, total_distance FROM {{p}}i_bike_use WHERE bike_id = 'B1'
INTO @DATA(ls_use).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_use-ride_count ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '60.0' )
act = CONV decfloat34( ls_use-total_distance ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Bike'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}bike {
key client : abap.clnt not null;
key bike_id : abap.char(10) not null;
station : abap.char(10);
bike_type : abap.char(4);
}

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Bike ride'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}ride {
key client : abap.clnt not null;
key ride_id : abap.char(10) not null;
bike_id : abap.char(10);
ride_date : abap.dats;
distance_km : abap.dec(5,1);
}

View File

@@ -0,0 +1,37 @@
CLASS {{p}}seed_data DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
ENDCLASS.
CLASS {{p}}seed_data IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DATA lt_bike TYPE STANDARD TABLE OF {{p}}bike WITH EMPTY KEY.
DATA lt_ride TYPE STANDARD TABLE OF {{p}}ride WITH EMPTY KEY.
DELETE FROM {{p}}ride.
DELETE FROM {{p}}bike.
lt_bike = VALUE #(
( bike_id = 'B1' station = 'NORD' bike_type = 'E' )
( bike_id = 'B2' station = 'SUED' bike_type = 'C' )
( bike_id = 'B3' station = 'WEST' bike_type = 'C' )
( bike_id = 'B4' station = 'OST' bike_type = 'E' )
( bike_id = 'B5' station = 'NORD' bike_type = 'C' ) ).
INSERT {{p}}bike FROM TABLE @lt_bike.
lt_ride = VALUE #(
( ride_id = 'R01' bike_id = 'B1' ride_date = '20240101' distance_km = '20.0' )
( ride_id = 'R02' bike_id = 'B1' ride_date = '20240102' distance_km = '30.0' )
( ride_id = 'R03' bike_id = 'B2' ride_date = '20240103' distance_km = '25.5' )
( ride_id = 'R04' bike_id = 'B2' ride_date = '20240104' distance_km = '30.0' )
( ride_id = 'R05' bike_id = 'B3' ride_date = '20240105' distance_km = '10.0' )
( ride_id = 'R06' bike_id = 'B4' ride_date = '20240106' distance_km = '40.0' )
( ride_id = 'R07' bike_id = 'B4' ride_date = '20240107' distance_km = '40.0' )
( ride_id = 'R08' bike_id = 'B4' ride_date = '20240108' distance_km = '25.0' ) ).
INSERT {{p}}ride FROM TABLE @lt_ride.
out->write( |Bikes: { lines( lt_bike ) }| ).
out->write( |Rides: { lines( lt_ride ) }| ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,40 @@
# 1. Goal
Show how much each bike of a bike-sharing fleet is used. The operations team
needs the heavily used bikes, so that it can plan maintenance. A report and an
OData service will read the usage figures. Therefore the calculation must run in
the database, in a CDS view.
# 2. Open questions
None.
# 3. Context
- Table {{P}}BIKE holds the bikes, package $TMP. Key: BIKE_ID (CHAR 10).
Fields: STATION (CHAR 10), BIKE_TYPE (CHAR 4).
- Table {{P}}RIDE holds the rides, package $TMP. Key: RIDE_ID (CHAR 10).
Fields: BIKE_ID (CHAR 10), RIDE_DATE (DATS), DISTANCE_KM (DEC 5,1, the
distance of the ride in kilometres).
# 4. Contract
- Create the CDS view entity {{P}}I_BIKE_USE in package $TMP.
- The view has these elements, with these names:
BIKE_ID (key), STATION, RIDE_COUNT, TOTAL_DISTANCE.
- Use no authorization check (#NOT_REQUIRED).
# 5. Business rules
1. The view shows one row for each bike that has at least one ride. A bike
without rides is not shown.
2. RIDE_COUNT is the number of rides of the bike.
3. TOTAL_DISTANCE is the sum of DISTANCE_KM of all rides of the bike.
4. The view shows only the bikes whose total distance is more than 50.0
kilometres. A bike with a total distance of exactly 50.0 kilometres is not
shown.
# 6. Constraints
- Release target: 7.58.
- Coding standards: Clean ABAP.
- Out of scope: do not change {{P}}BIKE and {{P}}RIDE.
# 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,72 @@
{
"id": "G1052",
"category": "B",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v758",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 60,
"max_activations": 15
},
"seed": [
{
"type": "TABL",
"name": "{{P}}BIKE",
"file": "seed/bike.tabl.asabap",
"description": "Bike master data"
},
{
"type": "TABL",
"name": "{{P}}RIDE",
"file": "seed/ride.tabl.asabap",
"description": "Bike ride"
},
{
"type": "CLAS",
"name": "{{P}}SEED_DATA",
"file": "seed/seed_data.clas.abap",
"description": "Seed data for bikes and rides",
"run": true
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_BIKE_USE",
"fields": [
"BIKE_ID",
"STATION",
"RIDE_COUNT",
"TOTAL_DISTANCE"
]
}
],
"out_of_scope": [
"{{P}}BIKE",
"{{P}}RIDE"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T_BIKE_HID",
"file": "hidden/t_bike_hid.clas.abap",
"description": "Hidden tests for {{P}}I_BIKE_USE"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_BIKE_USE",
"file": "reference/i_bike_use.ddls.asddls",
"description": "Bike usage with HAVING"
},
{
"type": "CLAS",
"name": "{{P}}T_BIKE_TEST",
"file": "reference/t_bike_test.clas.abap",
"description": "Own tests for {{P}}I_BIKE_USE"
}
],
"craft_checks": []
}