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,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Fabric roll grade'
define view entity {{P}}I_ROLL_GRADE
as select from {{p}}roll as roll
inner join {{p}}fabric as fabric on fabric.fabric <> roll.fabric
{
key roll.roll_id as roll_id,
fabric.fabric_name as fabric_name,
case when fabric.fibre = 'C' or fabric.fibre = 'W'
or fabric.fibre = 'S'
then 'N'
else 'S' end as fibre_class,
substring( roll.roll_id, 1, 3 ) as loom,
round( cast( roll.length_cm as abap.dec(15,2) )
* cast( roll.width_cm as abap.dec(15,2) )
/ 10000, 2 ) as area_sqm,
case when roll.defects = 0 then 'A'
when roll.defects <= 3 then 'B'
else 'C' end as grade
}

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Fabric roll grade'
define view entity {{P}}I_ROLL_GRADE
as select from {{p}}roll as roll
inner join {{p}}fabric as fabric on fabric.fabric = roll.fabric
{
key roll.roll_id as roll_id,
fabric.fabric_name as fabric_name,
case when fabric.fibre = 'C' or fabric.fibre = 'W'
or fabric.fibre = 'S'
then 'N'
else 'Z' end as fibre_class,
substring( roll.roll_id, 1, 3 ) as loom,
round( cast( roll.length_cm as abap.dec(15,2) )
* cast( roll.width_cm as abap.dec(15,2) )
/ 10000, 2 ) as area_sqm,
case when roll.defects = 0 then 'A'
when roll.defects <= 3 then 'B'
else 'C' end as grade
}

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Fabric roll grade'
define view entity {{P}}I_ROLL_GRADE
as select from {{p}}roll as roll
inner join {{p}}fabric as fabric on fabric.fabric = roll.fabric
{
key roll.roll_id as roll_id,
fabric.fabric_name as fabric_name,
case when fabric.fibre = 'C' or fabric.fibre = 'W'
or fabric.fibre = 'S'
then 'N'
else 'S' end as fibre_class,
substring( roll.roll_id, 2, 3 ) as loom,
round( cast( roll.length_cm as abap.dec(15,2) )
* cast( roll.width_cm as abap.dec(15,2) )
/ 10000, 2 ) as area_sqm,
case when roll.defects = 0 then 'A'
when roll.defects <= 3 then 'B'
else 'C' end as grade
}

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Fabric roll grade'
define view entity {{P}}I_ROLL_GRADE
as select from {{p}}roll as roll
inner join {{p}}fabric as fabric on fabric.fabric = roll.fabric
{
key roll.roll_id as roll_id,
fabric.fabric_name as fabric_name,
case when fabric.fibre = 'C' or fabric.fibre = 'W'
or fabric.fibre = 'S'
then 'N'
else 'S' end as fibre_class,
substring( roll.roll_id, 1, 3 ) as loom,
round( cast( roll.length_cm as abap.dec(15,2) )
* cast( roll.width_cm as abap.dec(15,2) )
/ 10000, 3 ) as area_sqm,
case when roll.defects = 0 then 'A'
when roll.defects <= 3 then 'B'
else 'C' end as grade
}

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Fabric roll grade'
define view entity {{P}}I_ROLL_GRADE
as select from {{p}}roll as roll
inner join {{p}}fabric as fabric on fabric.fabric = roll.fabric
{
key roll.roll_id as roll_id,
fabric.fabric_name as fabric_name,
case when fabric.fibre = 'C' or fabric.fibre = 'W'
or fabric.fibre = 'S'
then 'N'
else 'S' end as fibre_class,
substring( roll.roll_id, 1, 3 ) as loom,
round( cast( roll.length_cm as abap.dec(15,2) )
* cast( roll.width_cm as abap.dec(15,2) )
/ 10000, 2 ) as area_sqm,
case when roll.defects = 0 then 'A'
when roll.defects > 3 then 'B'
else 'C' end as grade
}

View File

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

View File

@@ -0,0 +1,97 @@
CLASS {{p}}t16_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 grade_a FOR TESTING.
METHODS grade_b FOR TESTING.
METHODS grade_c FOR TESTING.
METHODS fibre_natural FOR TESTING.
METHODS fibre_synthetic FOR TESTING.
METHODS loom_prefix FOR TESTING.
METHODS area_rounded FOR TESTING.
METHODS area_whole FOR TESTING.
METHODS fabric_name FOR TESTING.
METHODS roll_without_fabric FOR TESTING.
ENDCLASS.
CLASS {{p}}t16_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_ROLL_GRADE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_fabric TYPE STANDARD TABLE OF {{p}}fabric WITH EMPTY KEY.
DATA lt_roll TYPE STANDARD TABLE OF {{p}}roll WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_fabric = VALUE #( ( fabric = 'F1' fabric_name = 'COTTON POPLIN' fibre = 'C' )
( fabric = 'F2' fabric_name = 'WOOL TWILL' fibre = 'W' )
( fabric = 'F3' fabric_name = 'SILK SATIN' fibre = 'S' )
( fabric = 'F4' fabric_name = 'POLYESTER' fibre = 'P' ) ).
lt_roll = VALUE #( ( roll_id = 'L01-R-0001' fabric = 'F1' length_cm = 123 width_cm = 45 defects = 0 )
( roll_id = 'L02-R-0002' fabric = 'F2' length_cm = 200 width_cm = 150 defects = 3 )
( roll_id = 'L03-R-0003' fabric = 'F4' length_cm = 100 width_cm = 100 defects = 4 )
( roll_id = 'L04-R-0004' fabric = 'F9' length_cm = 100 width_cm = 100 defects = 1 ) ).
go_env->insert_test_data( lt_fabric ).
go_env->insert_test_data( lt_roll ).
ENDMETHOD.
METHOD grade_a.
SELECT SINGLE grade FROM {{p}}i_roll_grade WHERE roll_id = 'L01-R-0001' INTO @DATA(lv_grade).
cl_abap_unit_assert=>assert_equals( exp = 'A' act = lv_grade ).
ENDMETHOD.
METHOD grade_b.
SELECT SINGLE grade FROM {{p}}i_roll_grade WHERE roll_id = 'L02-R-0002' INTO @DATA(lv_grade).
cl_abap_unit_assert=>assert_equals( exp = 'B' act = lv_grade ).
ENDMETHOD.
METHOD grade_c.
SELECT SINGLE grade FROM {{p}}i_roll_grade WHERE roll_id = 'L03-R-0003' INTO @DATA(lv_grade).
cl_abap_unit_assert=>assert_equals( exp = 'C' act = lv_grade ).
ENDMETHOD.
METHOD fibre_natural.
SELECT SINGLE fibre_class FROM {{p}}i_roll_grade WHERE roll_id = 'L02-R-0002' INTO @DATA(lv_class).
cl_abap_unit_assert=>assert_equals( exp = 'N' act = lv_class ).
ENDMETHOD.
METHOD fibre_synthetic.
SELECT SINGLE fibre_class FROM {{p}}i_roll_grade WHERE roll_id = 'L03-R-0003' INTO @DATA(lv_class).
cl_abap_unit_assert=>assert_equals( exp = 'S' act = lv_class ).
ENDMETHOD.
METHOD loom_prefix.
SELECT SINGLE loom FROM {{p}}i_roll_grade WHERE roll_id = 'L02-R-0002' INTO @DATA(lv_loom).
cl_abap_unit_assert=>assert_equals( exp = 'L02' act = lv_loom ).
ENDMETHOD.
METHOD area_rounded.
SELECT SINGLE area_sqm FROM {{p}}i_roll_grade WHERE roll_id = 'L01-R-0001' INTO @DATA(lv_area).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '0.55' )
act = CONV decfloat34( lv_area ) ).
ENDMETHOD.
METHOD area_whole.
SELECT SINGLE area_sqm FROM {{p}}i_roll_grade WHERE roll_id = 'L02-R-0002' INTO @DATA(lv_area).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '3.00' )
act = CONV decfloat34( lv_area ) ).
ENDMETHOD.
METHOD fabric_name.
SELECT SINGLE fabric_name FROM {{p}}i_roll_grade WHERE roll_id = 'L02-R-0002' INTO @DATA(lv_name).
cl_abap_unit_assert=>assert_equals( exp = 'WOOL TWILL' act = lv_name ).
ENDMETHOD.
METHOD roll_without_fabric.
SELECT COUNT(*) FROM {{p}}i_roll_grade INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_rows ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,57 @@
{
"task": "G1040",
"mutants": [
{
"object": "{{P}}I_ROLL_GRADE",
"mutant": "line 5: = -> <> (eq)",
"status": "killed",
"hidden": "7/10",
"failed_tests": [
"FABRIC_NAME",
"FIBRE_SYNTHETIC",
"ROLL_WITHOUT_FABRIC"
]
},
{
"object": "{{P}}I_ROLL_GRADE",
"mutant": "line 12: 'S' -> 'Z' (lit)",
"status": "killed",
"hidden": "9/10",
"failed_tests": [
"FIBRE_SYNTHETIC"
]
},
{
"object": "{{P}}I_ROLL_GRADE",
"mutant": "line 13: 1 -> 2 (const)",
"status": "killed",
"hidden": "9/10",
"failed_tests": [
"LOOM_PREFIX"
]
},
{
"object": "{{P}}I_ROLL_GRADE",
"mutant": "line 16: 2 -> 3 (const)",
"status": "killed",
"hidden": "9/10",
"failed_tests": [
"AREA_ROUNDED"
]
},
{
"object": "{{P}}I_ROLL_GRADE",
"mutant": "line 18: <= -> > (rel)",
"status": "killed",
"hidden": "8/10",
"failed_tests": [
"GRADE_B",
"GRADE_C"
]
}
],
"valid": 5,
"killed": 5,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Fabric roll grade'
define view entity {{P}}I_ROLL_GRADE
as select from {{p}}roll as roll
inner join {{p}}fabric as fabric on fabric.fabric = roll.fabric
{
key roll.roll_id as roll_id,
fabric.fabric_name as fabric_name,
case when fabric.fibre = 'C' or fabric.fibre = 'W'
or fabric.fibre = 'S'
then 'N'
else 'S' end as fibre_class,
substring( roll.roll_id, 1, 3 ) as loom,
round( cast( roll.length_cm as abap.dec(15,2) )
* cast( roll.width_cm as abap.dec(15,2) )
/ 10000, 2 ) as area_sqm,
case when roll.defects = 0 then 'A'
when roll.defects <= 3 then 'B'
else 'C' end as grade
}

View File

@@ -0,0 +1,46 @@
CLASS {{p}}t16_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 grade_and_area FOR TESTING.
METHODS natural_fibre FOR TESTING.
ENDCLASS.
CLASS {{p}}t16_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_ROLL_GRADE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_fabric TYPE STANDARD TABLE OF {{p}}fabric WITH EMPTY KEY.
DATA lt_roll TYPE STANDARD TABLE OF {{p}}roll WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_fabric = VALUE #( ( fabric = 'F1' fabric_name = 'COTTON POPLIN' fibre = 'C' ) ).
lt_roll = VALUE #( ( roll_id = 'L01-R-0001' fabric = 'F1' length_cm = 123 width_cm = 45 defects = 0 ) ).
go_env->insert_test_data( lt_fabric ).
go_env->insert_test_data( lt_roll ).
ENDMETHOD.
METHOD grade_and_area.
SELECT SINGLE grade, area_sqm, loom FROM {{p}}i_roll_grade
WHERE roll_id = 'L01-R-0001' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'A' act = ls_row-grade ).
cl_abap_unit_assert=>assert_equals( exp = 'L01' act = ls_row-loom ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '0.55' )
act = CONV decfloat34( ls_row-area_sqm ) ).
ENDMETHOD.
METHOD natural_fibre.
SELECT SINGLE fibre_class FROM {{p}}i_roll_grade
WHERE roll_id = 'L01-R-0001' INTO @DATA(lv_class).
cl_abap_unit_assert=>assert_equals( exp = 'N' act = lv_class ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Fabric master'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}fabric {
key client : abap.clnt not null;
key fabric : abap.char(10) not null;
fabric_name : abap.char(20);
fibre : abap.char(1);
}

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Fabric roll'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}roll {
key client : abap.clnt not null;
key roll_id : abap.char(10) not null;
fabric : abap.char(10);
length_cm : abap.int4;
width_cm : abap.int4;
defects : abap.int4;
}

View File

@@ -0,0 +1,43 @@
# 1. Goal
A textile mill inspects the fabric rolls of its looms. The quality team needs
one row for each roll with the fabric name, the fibre class, the loom, the
area and the grade. A report and an OData service will read the rows, so the
calculation must be in the database, in a CDS view.
# 2. Open questions
None.
# 3. Context
- Table {{P}}FABRIC (fabric master), package $TMP. Key: FABRIC (CHAR 10).
Fields: FABRIC_NAME (CHAR 20), FIBRE (CHAR 1).
FIBRE is 'C' for cotton, 'W' for wool, 'S' for silk and 'P' for polyester.
- Table {{P}}ROLL (fabric roll), package $TMP. Key: ROLL_ID (CHAR 10).
Fields: FABRIC (CHAR 10), LENGTH_CM (INT4), WIDTH_CM (INT4), DEFECTS (INT4).
The first three characters of ROLL_ID identify the loom that wove the roll.
# 4. Contract
- Create the CDS view entity {{P}}I_ROLL_GRADE in package $TMP.
- Elements, with these names: ROLL_ID (key), FABRIC_NAME, FIBRE_CLASS, LOOM,
AREA_SQM, GRADE.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. Show one row for each roll that has a fabric in {{P}}FABRIC. Do not show a
roll when its fabric is not in {{P}}FABRIC.
2. FABRIC_NAME is the name of the fabric of the roll.
3. FIBRE_CLASS is 'N' when the fibre is cotton, wool or silk. FIBRE_CLASS is
'S' for every other fibre.
4. LOOM is the first three characters of the roll ID.
5. AREA_SQM is LENGTH_CM multiplied by WIDTH_CM and divided by 10000. Round
the result to 2 decimals.
6. GRADE is 'A' when the roll has no defect. GRADE is 'B' when the roll has 1
to 3 defects. GRADE is 'C' when the roll has more than 3 defects.
# 6. Constraints
- Release target: 7.58.
- Out of scope: do not change {{P}}FABRIC and {{P}}ROLL.
# 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,67 @@
{
"id": "G1040",
"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}}FABRIC",
"file": "seed/fabric.tabl.asabap",
"description": "Fabric master"
},
{
"type": "TABL",
"name": "{{P}}ROLL",
"file": "seed/roll.tabl.asabap",
"description": "Fabric roll"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_ROLL_GRADE",
"fields": [
"ROLL_ID",
"FABRIC_NAME",
"FIBRE_CLASS",
"LOOM",
"AREA_SQM",
"GRADE"
]
}
],
"out_of_scope": [
"{{P}}FABRIC",
"{{P}}ROLL"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T16_HIDDEN",
"file": "hidden/t16_hidden.clas.abap",
"description": "T16 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_ROLL_GRADE",
"file": "reference/i_roll_grade.ddls.asddls",
"description": "Fabric roll grade"
},
{
"type": "CLAS",
"name": "{{P}}T16_TEST",
"file": "reference/t16_test.clas.abap",
"description": "T16 own tests"
}
],
"craft_checks": []
}