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 @@
{
"id": "G1300",
"pool": "train",
"category": "K",
"base_task": "G1000",
"style": "free_text",
"tool_schema": null,
"attempts": [
{
"stage": "validate",
"oracle": 100.0,
"null": 0
}
],
"accepted": true
}

View File

@@ -0,0 +1,108 @@
CLASS {{p}}t20_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 deviation_below FOR TESTING.
METHODS deviation_zero FOR TESTING.
METHODS deviation_above FOR TESTING.
METHODS percent_rounded FOR TESTING.
METHODS status_hold FOR TESTING.
METHODS status_warn FOR TESTING.
METHODS status_load FOR TESTING.
METHODS status_at_five_pct FOR TESTING.
METHODS unweighed_hidden FOR TESTING.
METHODS customer_shown FOR TESTING.
ENDCLASS.
CLASS {{p}}t20_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_CONT_WEIGHT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_cont TYPE STANDARD TABLE OF {{p}}cont WITH EMPTY KEY.
DATA lt_weigh TYPE STANDARD TABLE OF {{p}}weigh WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_cont = VALUE #(
( cont_id = 'C1' customer = 'ALPHA' decl_kg = '1000.00' max_kg = '1200.00' )
( cont_id = 'C2' customer = 'BETA' decl_kg = '1000.00' max_kg = '1200.00' )
( cont_id = 'C3' customer = 'GAMMA' decl_kg = '1000.00' max_kg = '1200.00' )
( cont_id = 'C4' customer = 'DELTA' decl_kg = '500.00' max_kg = '600.00' )
( cont_id = 'C5' customer = 'EPSILON' decl_kg = '1000.00' max_kg = '1200.00' )
( cont_id = 'C6' customer = 'ZETA' decl_kg = '1000.00' max_kg = '1200.00' )
( cont_id = 'C7' customer = 'ETA' decl_kg = '800.00' max_kg = '900.00' )
( cont_id = 'C8' customer = 'THETA' decl_kg = '300.00' max_kg = '400.00' ) ).
lt_weigh = VALUE #(
( cont_id = 'C1' meas_kg = '1020.00' )
( cont_id = 'C2' meas_kg = '1100.00' )
( cont_id = 'C3' meas_kg = '1300.00' )
( cont_id = 'C4' meas_kg = '450.00' )
( cont_id = 'C5' meas_kg = '950.00' )
( cont_id = 'C7' meas_kg = '800.00' )
( cont_id = 'C8' meas_kg = '310.00' ) ).
go_env->insert_test_data( lt_cont ).
go_env->insert_test_data( lt_weigh ).
ENDMETHOD.
METHOD deviation_below.
SELECT SINGLE deviation_kg FROM {{p}}i_cont_weight WHERE cont_id = 'C4' INTO @DATA(lv_dev).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '50.00' )
act = CONV decfloat34( lv_dev ) ).
ENDMETHOD.
METHOD deviation_zero.
SELECT SINGLE deviation_kg FROM {{p}}i_cont_weight WHERE cont_id = 'C7' INTO @DATA(lv_dev).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '0.00' )
act = CONV decfloat34( lv_dev ) ).
ENDMETHOD.
METHOD deviation_above.
SELECT SINGLE deviation_kg FROM {{p}}i_cont_weight WHERE cont_id = 'C1' INTO @DATA(lv_dev).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '20.00' )
act = CONV decfloat34( lv_dev ) ).
ENDMETHOD.
METHOD percent_rounded.
SELECT SINGLE deviation_pct FROM {{p}}i_cont_weight WHERE cont_id = 'C8' INTO @DATA(lv_pct).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '3.33' )
act = CONV decfloat34( lv_pct ) ).
ENDMETHOD.
METHOD status_hold.
SELECT SINGLE status FROM {{p}}i_cont_weight WHERE cont_id = 'C3' INTO @DATA(lv_status).
cl_abap_unit_assert=>assert_equals( exp = 'HOLD' act = lv_status ).
ENDMETHOD.
METHOD status_warn.
SELECT SINGLE status FROM {{p}}i_cont_weight WHERE cont_id = 'C2' INTO @DATA(lv_status).
cl_abap_unit_assert=>assert_equals( exp = 'WARN' act = lv_status ).
ENDMETHOD.
METHOD status_load.
SELECT SINGLE status FROM {{p}}i_cont_weight WHERE cont_id = 'C1' INTO @DATA(lv_status).
cl_abap_unit_assert=>assert_equals( exp = 'LOAD' act = lv_status ).
ENDMETHOD.
METHOD status_at_five_pct.
SELECT SINGLE status FROM {{p}}i_cont_weight WHERE cont_id = 'C5' INTO @DATA(lv_status).
cl_abap_unit_assert=>assert_equals( exp = 'LOAD' act = lv_status ).
ENDMETHOD.
METHOD unweighed_hidden.
SELECT COUNT(*) FROM {{p}}i_cont_weight INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 7 act = lv_rows ).
ENDMETHOD.
METHOD customer_shown.
SELECT SINGLE customer FROM {{p}}i_cont_weight WHERE cont_id = 'C4' INTO @DATA(lv_cust).
cl_abap_unit_assert=>assert_equals( exp = 'DELTA' act = lv_cust ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Container weight check'
define view entity {{P}}I_CONT_WEIGHT
as select from {{p}}cont as cont
inner join {{p}}weigh as weigh on weigh.cont_id = cont.cont_id
{
key cont.cont_id as cont_id,
cont.customer as customer,
cont.decl_kg as decl_kg,
weigh.meas_kg as meas_kg,
cast( abs( weigh.meas_kg - cont.decl_kg ) as abap.dec(15,2) ) as deviation_kg,
division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) as deviation_pct,
case
when weigh.meas_kg > cont.max_kg then 'HOLD'
when division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) > 5 then 'WARN'
else 'LOAD'
end as status
}

View File

@@ -0,0 +1,53 @@
CLASS {{p}}t20_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 hold_for_heavy FOR TESTING.
METHODS load_for_light FOR TESTING.
ENDCLASS.
CLASS {{p}}t20_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_CONT_WEIGHT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_cont TYPE STANDARD TABLE OF {{p}}cont WITH EMPTY KEY.
DATA lt_weigh TYPE STANDARD TABLE OF {{p}}weigh WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_cont = VALUE #( ( cont_id = 'A' customer = 'CUST_A' decl_kg = '1000.00' max_kg = '1100.00' )
( cont_id = 'B' customer = 'CUST_B' decl_kg = '1000.00' max_kg = '1100.00' ) ).
lt_weigh = VALUE #( ( cont_id = 'A' meas_kg = '1150.00' )
( cont_id = 'B' meas_kg = '1010.00' ) ).
go_env->insert_test_data( lt_cont ).
go_env->insert_test_data( lt_weigh ).
ENDMETHOD.
METHOD hold_for_heavy.
SELECT SINGLE deviation_kg, deviation_pct, status FROM {{p}}i_cont_weight
WHERE cont_id = 'A' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '150.00' )
act = CONV decfloat34( ls_row-deviation_kg ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '15.00' )
act = CONV decfloat34( ls_row-deviation_pct ) ).
cl_abap_unit_assert=>assert_equals( exp = 'HOLD' act = ls_row-status ).
ENDMETHOD.
METHOD load_for_light.
SELECT SINGLE deviation_kg, deviation_pct, status FROM {{p}}i_cont_weight
WHERE cont_id = 'B' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' )
act = CONV decfloat34( ls_row-deviation_kg ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1.00' )
act = CONV decfloat34( ls_row-deviation_pct ) ).
cl_abap_unit_assert=>assert_equals( exp = 'LOAD' act = ls_row-status ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Container'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}cont {
key client : abap.clnt not null;
key cont_id : abap.char(10) not null;
customer : abap.char(10);
decl_kg : abap.dec(15,2);
max_kg : abap.dec(15,2);
}

View File

@@ -0,0 +1,10 @@
@EndUserText.label : 'Weighbridge record'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}weigh {
key client : abap.clnt not null;
key cont_id : abap.char(10) not null;
meas_kg : abap.dec(15,2);
}

View File

@@ -0,0 +1 @@
Please create the CDS view entity {{P}}I_CONT_WEIGHT in package $TMP. The view shows the weight check for each container at a container terminal. A report and an OData service will read this check. Therefore the calculation must be in the database, in a CDS view. The view uses table {{P}}CONT (container master) in package $TMP. Its key is CONT_ID (CHAR 10). Its fields are CUSTOMER (CHAR 10), DECL_KG (DEC 15,2, declared weight in kilograms), and MAX_KG (DEC 15,2, maximum permitted weight in kilograms). The view also uses table {{P}}WEIGH (weighbridge record) in package $TMP. Its key is CONT_ID (CHAR 10). Its field is MEAS_KG (DEC 15,2, measured weight in kilograms). The view elements have these names: CONT_ID (key), CUSTOMER, DECL_KG, MEAS_KG, DEVIATION_KG, DEVIATION_PCT, and STATUS. The view has no authorization check (#NOT_REQUIRED). Show one row for each container that has a weighbridge record. Do not show a container without a weighbridge record. DEVIATION_KG is the difference between MEAS_KG and DECL_KG, without a sign. It is always positive or zero and has 2 decimals. DEVIATION_PCT is DEVIATION_KG as a percentage of DECL_KG. It has 2 decimals. STATUS is 'HOLD' if MEAS_KG is greater than MAX_KG. STATUS is 'WARN' if MEAS_KG is not greater than MAX_KG and DEVIATION_PCT is greater than 5. STATUS is 'LOAD' in all other cases. DECL_KG is always greater than zero. The release target is 8.16. Use Clean ABAP. Keep every method below 40 statements. Do not change {{P}}CONT and {{P}}WEIGH. 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.

View File

@@ -0,0 +1,70 @@
{
"id": "G1300",
"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}}CONT",
"file": "seed/cont.tabl.asabap",
"description": "Container master"
},
{
"type": "TABL",
"name": "{{P}}WEIGH",
"file": "seed/weigh.tabl.asabap",
"description": "Weighbridge record"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_CONT_WEIGHT",
"fields": [
"CONT_ID",
"CUSTOMER",
"DECL_KG",
"MEAS_KG",
"DEVIATION_KG",
"DEVIATION_PCT",
"STATUS"
]
}
],
"out_of_scope": [
"{{P}}CONT",
"{{P}}WEIGH"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T20_HIDDEN",
"file": "hidden/t20_hidden.clas.abap",
"description": "T20 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_CONT_WEIGHT",
"file": "reference/i_cont_weight.ddls.asddls",
"description": "Container weight check"
},
{
"type": "CLAS",
"name": "{{P}}T20_TEST",
"file": "reference/t20_test.clas.abap",
"description": "T20 own tests"
}
],
"craft_checks": [],
"base_task": "G1000",
"input_style": "free_text"
}