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:
16
tasks_gen/train/G1314/generation.json
Normal file
16
tasks_gen/train/G1314/generation.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"id": "G1314",
|
||||
"pool": "train",
|
||||
"category": "K",
|
||||
"base_task": "G1026",
|
||||
"style": "free_text",
|
||||
"tool_schema": null,
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
129
tasks_gen/train/G1314/hidden/t88_hidden.clas.abap
Normal file
129
tasks_gen/train/G1314/hidden/t88_hidden.clas.abap
Normal file
@@ -0,0 +1,129 @@
|
||||
CLASS {{p}}t88_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING iv_type TYPE string
|
||||
iv_hours TYPE decfloat34
|
||||
iv_fee TYPE decfloat34 DEFAULT 7
|
||||
EXPORTING ev_skip TYPE abap_bool
|
||||
ev_fee TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS day_shift_fee FOR TESTING.
|
||||
METHODS day_rounding FOR TESTING.
|
||||
METHODS day_minimum_fee FOR TESTING.
|
||||
METHODS night_shift_fee FOR TESTING.
|
||||
METHODS night_rounding FOR TESTING.
|
||||
METHODS holiday_shift_fee FOR TESTING.
|
||||
METHODS holiday_above_min FOR TESTING.
|
||||
METHODS other_shift_zero FOR TESTING.
|
||||
METHODS zero_hours_rejected FOR TESTING.
|
||||
METHODS negative_hours_rejected FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t88_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
ev_fee = iv_fee.
|
||||
CALL FUNCTION '{{P}}GUARD_FEE'
|
||||
EXPORTING
|
||||
iv_shift_type = iv_type
|
||||
iv_hours = iv_hours
|
||||
IMPORTING
|
||||
ev_surcharge = ev_skip
|
||||
CHANGING
|
||||
cv_fee = ev_fee
|
||||
EXCEPTIONS
|
||||
invalid_hours = 1
|
||||
OTHERS = 2.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_shift_fee.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '102.00'.
|
||||
call( EXPORTING iv_type = 'DAY' iv_hours = 4
|
||||
IMPORTING ev_fee = lv_fee ev_skip = lv_skip ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_false act = lv_skip ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_rounding.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '57.38'.
|
||||
call( EXPORTING iv_type = 'DAY' iv_hours = '2.25'
|
||||
IMPORTING ev_fee = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_minimum_fee.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '50.00'.
|
||||
call( EXPORTING iv_type = 'DAY' iv_hours = 1
|
||||
IMPORTING ev_fee = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD night_shift_fee.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '127.50'.
|
||||
call( EXPORTING iv_type = 'NIGHT' iv_hours = 4
|
||||
IMPORTING ev_fee = lv_fee ev_skip = lv_skip ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_true act = lv_skip ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD night_rounding.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '71.72'.
|
||||
call( EXPORTING iv_type = 'NIGHT' iv_hours = '2.25'
|
||||
IMPORTING ev_fee = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD holiday_shift_fee.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '204.00'.
|
||||
call( EXPORTING iv_type = 'HOLIDAY' iv_hours = 4
|
||||
IMPORTING ev_fee = lv_fee ev_skip = lv_skip ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_true act = lv_skip ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD holiday_above_min.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '51.00'.
|
||||
call( EXPORTING iv_type = 'HOLIDAY' iv_hours = 1
|
||||
IMPORTING ev_fee = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD other_shift_zero.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '0.00'.
|
||||
call( EXPORTING iv_type = 'STANDBY' iv_hours = 4
|
||||
IMPORTING ev_fee = lv_fee ev_skip = lv_skip ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_false act = lv_skip ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zero_hours_rejected.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_rc TYPE sysubrc.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '7.00'.
|
||||
call( EXPORTING iv_type = 'DAY' iv_hours = 0 iv_fee = 7
|
||||
IMPORTING ev_fee = lv_fee ev_subrc = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_hours_rejected.
|
||||
DATA lv_rc TYPE sysubrc.
|
||||
call( EXPORTING iv_type = 'NIGHT' iv_hours = '-2.5'
|
||||
IMPORTING ev_subrc = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
45
tasks_gen/train/G1314/reference/guard_fee.func.abap
Normal file
45
tasks_gen/train/G1314/reference/guard_fee.func.abap
Normal file
@@ -0,0 +1,45 @@
|
||||
FUNCTION {{p}}guard_fee
|
||||
IMPORTING
|
||||
iv_shift_type TYPE string
|
||||
iv_hours TYPE decfloat34
|
||||
EXPORTING
|
||||
ev_surcharge TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_hours.
|
||||
|
||||
CONSTANTS c_base_rate TYPE decfloat34 VALUE '25.50'.
|
||||
CONSTANTS c_night_factor TYPE decfloat34 VALUE '1.25'.
|
||||
CONSTANTS c_holiday_factor TYPE decfloat34 VALUE '2.00'.
|
||||
CONSTANTS c_min_fee TYPE decfloat34 VALUE '50.00'.
|
||||
|
||||
DATA lv_known TYPE abap_bool.
|
||||
|
||||
ev_surcharge = abap_false.
|
||||
|
||||
IF iv_hours <= 0.
|
||||
RAISE invalid_hours.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_shift_type.
|
||||
WHEN 'DAY'.
|
||||
lv_known = abap_true.
|
||||
cv_fee = round( val = iv_hours * c_base_rate dec = 2 ).
|
||||
WHEN 'NIGHT'.
|
||||
lv_known = abap_true.
|
||||
ev_surcharge = abap_true.
|
||||
cv_fee = round( val = iv_hours * c_base_rate * c_night_factor dec = 2 ).
|
||||
WHEN 'HOLIDAY'.
|
||||
lv_known = abap_true.
|
||||
ev_surcharge = abap_true.
|
||||
cv_fee = round( val = iv_hours * c_base_rate * c_holiday_factor dec = 2 ).
|
||||
WHEN OTHERS.
|
||||
cv_fee = 0.
|
||||
ENDCASE.
|
||||
|
||||
IF lv_known = abap_true AND cv_fee < c_min_fee.
|
||||
cv_fee = c_min_fee.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
68
tasks_gen/train/G1314/reference/t88_test.clas.abap
Normal file
68
tasks_gen/train/G1314/reference/t88_test.clas.abap
Normal file
@@ -0,0 +1,68 @@
|
||||
CLASS {{p}}t88_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS fee_for
|
||||
IMPORTING iv_type TYPE string
|
||||
iv_hours TYPE decfloat34
|
||||
RETURNING VALUE(rv_fee) TYPE decfloat34.
|
||||
METHODS day_fee FOR TESTING.
|
||||
METHODS night_fee FOR TESTING.
|
||||
METHODS holiday_fee FOR TESTING.
|
||||
METHODS minimum_fee FOR TESTING.
|
||||
METHODS invalid_hours FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t88_test IMPLEMENTATION.
|
||||
METHOD fee_for.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
CALL FUNCTION '{{P}}GUARD_FEE'
|
||||
EXPORTING
|
||||
iv_shift_type = iv_type
|
||||
iv_hours = iv_hours
|
||||
IMPORTING
|
||||
ev_surcharge = lv_skip
|
||||
CHANGING
|
||||
cv_fee = rv_fee
|
||||
EXCEPTIONS
|
||||
invalid_hours = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = sy-subrc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_fee.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '102.00'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = fee_for( iv_type = 'DAY' iv_hours = 4 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD night_fee.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '127.50'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = fee_for( iv_type = 'NIGHT' iv_hours = 4 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD holiday_fee.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '204.00'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = fee_for( iv_type = 'HOLIDAY' iv_hours = 4 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_fee.
|
||||
DATA lv_exp TYPE decfloat34 VALUE '50.00'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = fee_for( iv_type = 'DAY' iv_hours = 1 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_hours.
|
||||
DATA lv_fee TYPE decfloat34 VALUE '7.00'.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '7.00'.
|
||||
CALL FUNCTION '{{P}}GUARD_FEE'
|
||||
EXPORTING
|
||||
iv_shift_type = 'DAY'
|
||||
iv_hours = 0
|
||||
CHANGING
|
||||
cv_fee = lv_fee
|
||||
EXCEPTIONS
|
||||
invalid_hours = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_expected act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
14
tasks_gen/train/G1314/seed/guard_sample.func.abap
Normal file
14
tasks_gen/train/G1314/seed/guard_sample.func.abap
Normal file
@@ -0,0 +1,14 @@
|
||||
FUNCTION {{p}}guard_sample
|
||||
IMPORTING
|
||||
iv_shift_type TYPE string
|
||||
iv_hours TYPE decfloat34
|
||||
EXPORTING
|
||||
ev_surcharge TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_hours.
|
||||
|
||||
ev_surcharge = abap_false.
|
||||
|
||||
ENDFUNCTION.
|
||||
5
tasks_gen/train/G1314/spec.md
Normal file
5
tasks_gen/train/G1314/spec.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Please create the function module {{P}}GUARD_FEE in the function group {{P}}FG_GUARD in package $TMP. The function group {{P}}FG_GUARD already exists. The function module {{P}}GUARD_SAMPLE exists in this function group. It is the sample module. The billing program calls all shift modules with the same interface. Use exactly the interface of {{P}}GUARD_SAMPLE: the same parameter names, parameter kinds, types, and exceptions. Do not change {{P}}GUARD_SAMPLE. Do not use application tables. Do not use transports. The release target is 7.02. Use only syntax that release 7.02 supports. There are no open questions.
|
||||
|
||||
The function module calculates the fee for a guard shift. The parameters are iv_shift_type, iv_hours, ev_surcharge, and cv_fee. If iv_hours is less than or equal to 0, raise the exception INVALID_HOURS. Do not change cv_fee. Set ev_surcharge to false. If iv_shift_type is DAY, set cv_fee to iv_hours multiplied by 25.50. If iv_shift_type is NIGHT, set cv_fee to iv_hours multiplied by 25.50 multiplied by 1.25. Set ev_surcharge to true. If iv_shift_type is HOLIDAY, set cv_fee to iv_hours multiplied by 25.50 multiplied by 2.00. Set ev_surcharge to true. For any other shift type, set cv_fee to 0. Do not apply the rounding and minimum rules for any other shift type. For iv_shift_type DAY, NIGHT, and HOLIDAY, round cv_fee half up to 2 decimal places. For these three shift types, if cv_fee is less than 50.00, set cv_fee to 50.00.
|
||||
|
||||
The function module {{P}}GUARD_FEE 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.
|
||||
83
tasks_gen/train/G1314/task.json
Normal file
83
tasks_gen/train/G1314/task.json
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"id": "G1314",
|
||||
"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_GUARD",
|
||||
"description": "Guard shift function group"
|
||||
},
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}GUARD_SAMPLE",
|
||||
"functionGroup": "{{P}}FG_GUARD",
|
||||
"file": "seed/guard_sample.func.abap",
|
||||
"description": "Sample shift module that fixes the interface"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}GUARD_FEE",
|
||||
"functionGroup": "{{P}}FG_GUARD",
|
||||
"params": [
|
||||
{
|
||||
"name": "iv_shift_type",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "iv_hours",
|
||||
"type": "decfloat34"
|
||||
},
|
||||
{
|
||||
"name": "ev_surcharge",
|
||||
"type": "abap_bool"
|
||||
},
|
||||
{
|
||||
"name": "cv_fee",
|
||||
"type": "decfloat34"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}GUARD_SAMPLE"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T88_HIDDEN",
|
||||
"file": "hidden/t88_hidden.clas.abap",
|
||||
"description": "T88 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}GUARD_FEE",
|
||||
"functionGroup": "{{P}}FG_GUARD",
|
||||
"file": "reference/guard_fee.func.abap",
|
||||
"description": "Guard shift fee module"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T88_TEST",
|
||||
"file": "reference/t88_test.clas.abap",
|
||||
"description": "T88 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"method_length",
|
||||
"release_syntax"
|
||||
],
|
||||
"base_task": "G1026",
|
||||
"input_style": "free_text"
|
||||
}
|
||||
Reference in New Issue
Block a user