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

View File

@@ -0,0 +1,133 @@
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS call
IMPORTING iv_lot_type TYPE string
iv_hammer TYPE decfloat34
iv_channel TYPE string
iv_fee TYPE decfloat34 DEFAULT 7
EXPORTING ev_skip TYPE abap_bool
ev_fee TYPE decfloat34
ev_subrc TYPE sysubrc.
METHODS band_first FOR TESTING.
METHODS band_second FOR TESTING.
METHODS band_third FOR TESTING.
METHODS online_reduction FOR TESTING.
METHODS premium_rounding FOR TESTING.
METHODS minimum_premium FOR TESTING.
METHODS maximum_premium FOR TESTING.
METHODS charity_skips FOR TESTING.
METHODS negative_hammer FOR TESTING.
METHODS skip_false_for_sale FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_hidden IMPLEMENTATION.
METHOD call.
ev_fee = iv_fee.
CALL FUNCTION '{{P}}AUC_PREMIUM'
EXPORTING
iv_lot_type = iv_lot_type
iv_hammer = iv_hammer
iv_channel = iv_channel
IMPORTING
ev_skip = ev_skip
CHANGING
cv_fee = ev_fee
EXCEPTIONS
invalid_hammer = 1
OTHERS = 2.
ev_subrc = sy-subrc.
ENDMETHOD.
METHOD band_first.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 100.
call( EXPORTING iv_lot_type = `S` iv_hammer = 500 iv_channel = `B`
IMPORTING ev_fee = lv_act ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD band_second.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 320.
call( EXPORTING iv_lot_type = `S` iv_hammer = 2000 iv_channel = `B`
IMPORTING ev_fee = lv_act ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD band_third.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 1880.
call( EXPORTING iv_lot_type = `S` iv_hammer = 20000 iv_channel = `B`
IMPORTING ev_fee = lv_act ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD online_reduction.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 90.
call( EXPORTING iv_lot_type = `S` iv_hammer = 500 iv_channel = `O`
IMPORTING ev_fee = lv_act ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD premium_rounding.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
DATA lv_hammer TYPE decfloat34.
lv_exp = '228.15'.
lv_hammer = '1234.56'.
call( EXPORTING iv_lot_type = `S` iv_hammer = lv_hammer iv_channel = `B`
IMPORTING ev_fee = lv_act ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD minimum_premium.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 5.
call( EXPORTING iv_lot_type = `S` iv_hammer = 10 iv_channel = `B`
IMPORTING ev_fee = lv_act ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD maximum_premium.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 5000.
call( EXPORTING iv_lot_type = `S` iv_hammer = 100000 iv_channel = `B`
IMPORTING ev_fee = lv_act ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD charity_skips.
DATA lv_skip TYPE abap_bool.
DATA lv_fee TYPE decfloat34.
DATA lv_exp TYPE decfloat34.
lv_fee = 7.
lv_exp = 7.
call( EXPORTING iv_lot_type = `C` iv_hammer = 5000 iv_channel = `B` iv_fee = 7
IMPORTING ev_skip = lv_skip ev_fee = lv_fee ).
cl_abap_unit_assert=>assert_equals( exp = abap_true act = lv_skip ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
ENDMETHOD.
METHOD negative_hammer.
DATA lv_rc TYPE sysubrc.
call( EXPORTING iv_lot_type = `S` iv_hammer = -1 iv_channel = `B`
IMPORTING ev_subrc = lv_rc ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
ENDMETHOD.
METHOD skip_false_for_sale.
DATA lv_skip TYPE abap_bool.
call( EXPORTING iv_lot_type = `S` iv_hammer = 500 iv_channel = `B`
IMPORTING ev_skip = lv_skip ).
cl_abap_unit_assert=>assert_equals( exp = abap_false act = lv_skip ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,41 @@
FUNCTION {{p}}auc_premium
IMPORTING
iv_lot_type TYPE string
iv_hammer TYPE decfloat34
iv_channel TYPE string
EXPORTING
ev_skip TYPE abap_bool
CHANGING
cv_fee TYPE decfloat34
EXCEPTIONS
invalid_hammer.
DATA lv_premium TYPE decfloat34.
ev_skip = abap_false.
IF iv_hammer < 0.
RAISE invalid_hammer.
ENDIF.
IF iv_lot_type = 'C'.
ev_skip = abap_true.
RETURN.
ENDIF.
IF iv_hammer <= 1000.
lv_premium = iv_hammer * 20 / 100.
ELSEIF iv_hammer <= 10000.
lv_premium = 1000 * 20 / 100 + ( iv_hammer - 1000 ) * 12 / 100.
ELSE.
lv_premium = 1000 * 20 / 100 + 9000 * 12 / 100 + ( iv_hammer - 10000 ) * 6 / 100.
ENDIF.
IF iv_channel = 'O'.
lv_premium = lv_premium * 90 / 100.
ENDIF.
lv_premium = round( val = lv_premium dec = 2 mode = cl_abap_math=>round_half_up ).
IF lv_premium < 5.
lv_premium = 5.
ELSEIF lv_premium > 5000.
lv_premium = 5000.
ENDIF.
cv_fee = lv_premium.
ENDFUNCTION.

View File

@@ -0,0 +1,99 @@
CLASS {{p}}t14_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS premium_for
IMPORTING iv_lot_type TYPE string
iv_hammer TYPE decfloat34
iv_channel TYPE string
RETURNING VALUE(rv_fee) TYPE decfloat34.
METHODS band_premium FOR TESTING.
METHODS online_reduction FOR TESTING.
METHODS premium_limits FOR TESTING.
METHODS charity_lot FOR TESTING.
METHODS negative_hammer FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_test IMPLEMENTATION.
METHOD premium_for.
DATA lv_skip TYPE abap_bool.
CALL FUNCTION '{{P}}AUC_PREMIUM'
EXPORTING
iv_lot_type = iv_lot_type
iv_hammer = iv_hammer
iv_channel = iv_channel
IMPORTING
ev_skip = lv_skip
CHANGING
cv_fee = rv_fee
EXCEPTIONS
invalid_hammer = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD band_premium.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 320.
lv_act = premium_for( iv_lot_type = `S` iv_hammer = 2000 iv_channel = `B` ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD online_reduction.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 90.
lv_act = premium_for( iv_lot_type = `S` iv_hammer = 500 iv_channel = `O` ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD premium_limits.
DATA lv_exp TYPE decfloat34.
DATA lv_act TYPE decfloat34.
lv_exp = 5.
lv_act = premium_for( iv_lot_type = `S` iv_hammer = 10 iv_channel = `B` ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
lv_exp = 5000.
lv_act = premium_for( iv_lot_type = `S` iv_hammer = 100000 iv_channel = `B` ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD charity_lot.
DATA lv_skip TYPE abap_bool.
DATA lv_fee TYPE decfloat34.
DATA lv_exp TYPE decfloat34.
lv_fee = 7.
lv_exp = 7.
CALL FUNCTION '{{P}}AUC_PREMIUM'
EXPORTING
iv_lot_type = `C`
iv_hammer = 5000
iv_channel = `B`
IMPORTING
ev_skip = lv_skip
CHANGING
cv_fee = lv_fee
EXCEPTIONS
invalid_hammer = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
cl_abap_unit_assert=>assert_true( lv_skip ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
ENDMETHOD.
METHOD negative_hammer.
DATA lv_fee TYPE decfloat34.
CALL FUNCTION '{{P}}AUC_PREMIUM'
EXPORTING
iv_lot_type = `S`
iv_hammer = -5
iv_channel = `B`
CHANGING
cv_fee = lv_fee
EXCEPTIONS
invalid_hammer = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,15 @@
FUNCTION {{p}}auc_sample
IMPORTING
iv_lot_type TYPE string
iv_hammer TYPE decfloat34
iv_channel TYPE string
EXPORTING
ev_skip TYPE abap_bool
CHANGING
cv_fee TYPE decfloat34
EXCEPTIONS
invalid_hammer.
ev_skip = abap_false.
ENDFUNCTION.

View File

@@ -0,0 +1,5 @@
Please create the function module {{P}}AUC_PREMIUM in function group {{P}}FG_AUCT. The function group is in package $TMP. The function module must use exactly the same interface as the sample module {{P}}AUC_SAMPLE: the same parameter names, kinds, types, and exceptions. The parameters are iv_lot_type, iv_hammer, iv_channel, ev_skip, and cv_fee. The exception is INVALID_HAMMER. Do not change {{P}}AUC_SAMPLE.
The module calculates a buyer's premium for each sold lot. The auction program calls one premium module for each sold lot. If iv_hammer is less than 0, raise the exception INVALID_HAMMER and stop. Set ev_skip to false, except for lot type C. For lot type C (charity), set ev_skip to true. Leave cv_fee unchanged and stop. For every other lot type, calculate the band premium from iv_hammer. The part of iv_hammer up to 1,000.00 has a 20% rate. The part above 1,000.00 up to 10,000.00 has a 12% rate. The part above 10,000.00 has a 6% rate. For channel O (online), the premium is 90% of the band premium. For every other channel, the premium is the band premium. Round the premium half up to 2 decimals. The minimum premium is 5.00. The maximum premium is 5,000.00. Set cv_fee to the premium after rounding and applying the minimum and maximum.
The code must run on a 7.02 system. Do not use syntax that was introduced after release 7.02. Use Clean ABAP. The function module must be active and have no syntax error. The hidden tests must pass. Write ABAP Unit tests for the function module in a global test class.

View File

@@ -0,0 +1,86 @@
{
"id": "G1302",
"category": "K",
"object_type": "FUNC",
"difficulty": 2,
"release_target": "v702",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 60,
"max_activations": 15
},
"seed": [
{
"type": "FUGR",
"name": "{{P}}FG_AUCT",
"description": "Buyer's premium modules"
},
{
"type": "FUNC",
"name": "{{P}}AUC_SAMPLE",
"functionGroup": "{{P}}FG_AUCT",
"file": "seed/auc_sample.func.abap",
"description": "Sample premium module"
}
],
"contract": [
{
"type": "FUNC",
"name": "{{P}}AUC_PREMIUM",
"functionGroup": "{{P}}FG_AUCT",
"params": [
{
"name": "iv_lot_type",
"type": "string"
},
{
"name": "iv_hammer",
"type": "decfloat34"
},
{
"name": "iv_channel",
"type": "string"
},
{
"name": "ev_skip",
"type": "abap_bool"
},
{
"name": "cv_fee",
"type": "decfloat34"
}
]
}
],
"out_of_scope": [
"{{P}}AUC_SAMPLE"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T14_HIDDEN",
"file": "hidden/t14_hidden.clas.abap",
"description": "T14 hidden tests"
}
],
"reference": [
{
"type": "FUNC",
"name": "{{P}}AUC_PREMIUM",
"functionGroup": "{{P}}FG_AUCT",
"file": "reference/auc_premium.func.abap",
"description": "Buyer's premium module"
},
{
"type": "CLAS",
"name": "{{P}}T14_TEST",
"file": "reference/t14_test.clas.abap",
"description": "T14 own tests"
}
],
"craft_checks": [
"no_new_syntax"
],
"base_task": "G1006",
"input_style": "free_text"
}