Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
14
tasks_gen/eval/G0173/generation.json
Normal file
14
tasks_gen/eval/G0173/generation.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "G0173",
|
||||
"pool": "eval",
|
||||
"object_type": "FUNC",
|
||||
"category": "H",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100,
|
||||
"null": 30
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
31
tasks_gen/eval/G0173/reference/kart_fee.func.abap
Normal file
31
tasks_gen/eval/G0173/reference/kart_fee.func.abap
Normal file
@@ -0,0 +1,31 @@
|
||||
FUNCTION {{p}}kart_fee
|
||||
IMPORTING
|
||||
iv_laps TYPE i
|
||||
iv_driver_age TYPE i
|
||||
iv_member TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_discount TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_laps.
|
||||
|
||||
ev_discount = abap_false.
|
||||
IF iv_laps < 1.
|
||||
RAISE invalid_laps.
|
||||
ENDIF.
|
||||
IF iv_driver_age < 18.
|
||||
cv_fee = 15.
|
||||
ELSE.
|
||||
cv_fee = CONV decfloat34( iv_laps ) * 1.5.
|
||||
IF iv_member = abap_true.
|
||||
cv_fee = cv_fee * 9 / 10.
|
||||
ev_discount = abap_true.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
IF cv_fee < 20.
|
||||
cv_fee = 20.
|
||||
ENDIF.
|
||||
cv_fee = round( val = cv_fee dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
ENDFUNCTION.
|
||||
70
tasks_gen/eval/G0173/reference/kart_test.clas.abap
Normal file
70
tasks_gen/eval/G0173/reference/kart_test.clas.abap
Normal file
@@ -0,0 +1,70 @@
|
||||
CLASS {{p}}kart_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS fee_for IMPORTING iv_laps TYPE i iv_age TYPE i iv_member TYPE abap_bool
|
||||
RETURNING VALUE(rv_fee) TYPE decfloat34.
|
||||
METHODS invalid_laps FOR TESTING.
|
||||
METHODS adult_base_fee FOR TESTING.
|
||||
METHODS member_discount FOR TESTING.
|
||||
METHODS minimum_fee FOR TESTING.
|
||||
METHODS junior_fee FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}kart_test IMPLEMENTATION.
|
||||
METHOD fee_for.
|
||||
DATA lv_discount TYPE abap_bool.
|
||||
CALL FUNCTION '{{P}}KART_FEE'
|
||||
EXPORTING
|
||||
iv_laps = iv_laps
|
||||
iv_driver_age = iv_age
|
||||
iv_member = iv_member
|
||||
IMPORTING
|
||||
ev_discount = lv_discount
|
||||
CHANGING
|
||||
cv_fee = rv_fee
|
||||
EXCEPTIONS
|
||||
invalid_laps = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_laps.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
CALL FUNCTION '{{P}}KART_FEE'
|
||||
EXPORTING
|
||||
iv_laps = 0
|
||||
iv_driver_age = 30
|
||||
iv_member = abap_false
|
||||
CHANGING
|
||||
cv_fee = lv_fee
|
||||
EXCEPTIONS
|
||||
invalid_laps = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD adult_base_fee.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( 30 )
|
||||
act = fee_for( iv_laps = 20 iv_age = 30 iv_member = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD member_discount.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( 27 )
|
||||
act = fee_for( iv_laps = 20 iv_age = 30 iv_member = abap_true ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_fee.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( 20 )
|
||||
act = fee_for( iv_laps = 5 iv_age = 30 iv_member = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD junior_fee.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( 20 )
|
||||
act = fee_for( iv_laps = 10 iv_age = 15 iv_member = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
16
tasks_gen/eval/G0173/seed/kart_sample.func.abap
Normal file
16
tasks_gen/eval/G0173/seed/kart_sample.func.abap
Normal file
@@ -0,0 +1,16 @@
|
||||
FUNCTION {{p}}kart_sample
|
||||
IMPORTING
|
||||
iv_laps TYPE i
|
||||
iv_driver_age TYPE i
|
||||
iv_member TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_discount TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_laps.
|
||||
|
||||
ev_discount = abap_false.
|
||||
cv_fee = 0.
|
||||
|
||||
ENDFUNCTION.
|
||||
42
tasks_gen/eval/G0173/spec.md
Normal file
42
tasks_gen/eval/G0173/spec.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# 1. Goal
|
||||
A go-kart track charges a fee for each race. A booking program calls one
|
||||
function module for each completed race. The function module calculates the
|
||||
fee from the number of laps, the driver age, and the membership status.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Function group {{P}}FG_KART exists in package $TMP.
|
||||
- Function module {{P}}KART_SAMPLE exists in this group. It shows the
|
||||
interface style that the booking program uses. Do not change it.
|
||||
|
||||
# 4. Contract
|
||||
- Create the function module {{P}}KART_FEE in function group {{P}}FG_KART.
|
||||
- Use exactly this interface:
|
||||
- Importing parameters: iv_laps TYPE i, iv_driver_age TYPE i,
|
||||
iv_member TYPE abap_bool
|
||||
- Exporting parameter: ev_discount TYPE abap_bool
|
||||
- Changing parameter: cv_fee TYPE decfloat34
|
||||
- Exception: invalid_laps
|
||||
|
||||
# 5. Business rules
|
||||
1. If iv_laps is less than 1, raise the exception INVALID_LAPS.
|
||||
2. The base fee is 1.50 per lap.
|
||||
3. For a driver under 18 years, the fee is exactly 15.00.
|
||||
4. For a driver of 18 years or more who is a member, reduce the fee by 10 %
|
||||
and set ev_discount to true.
|
||||
5. The minimum fee is 20.00.
|
||||
6. Round the fee half up to 2 decimals.
|
||||
7. Set ev_discount to false, except in rule 4.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Package: $TMP.
|
||||
- Out of scope: do not change {{P}}KART_SAMPLE.
|
||||
- Write ABAP Unit tests for the function module in a global test class.
|
||||
|
||||
# 7. Acceptance
|
||||
- The function module is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- The global test class for the function module passes.
|
||||
94
tasks_gen/eval/G0173/task.json
Normal file
94
tasks_gen/eval/G0173/task.json
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"id": "G0173",
|
||||
"category": "H",
|
||||
"object_type": "FUNC",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "stop",
|
||||
"expected_gap": {
|
||||
"description": "Rule 3 (a driver under 18 pays exactly 15.00) and rule 5 (the minimum fee is 20.00) contradict each other, and the spec does not say which rule has priority.",
|
||||
"keywords": [
|
||||
[
|
||||
"18",
|
||||
"15"
|
||||
],
|
||||
[
|
||||
"minimum",
|
||||
"20"
|
||||
],
|
||||
[
|
||||
"contradict",
|
||||
"rule"
|
||||
]
|
||||
]
|
||||
},
|
||||
"budget": {
|
||||
"max_tool_calls": 30,
|
||||
"max_activations": 6
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "FUGR",
|
||||
"name": "{{P}}FG_KART",
|
||||
"description": "Go-kart fee function group"
|
||||
},
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}KART_SAMPLE",
|
||||
"functionGroup": "{{P}}FG_KART",
|
||||
"file": "seed/kart_sample.func.abap",
|
||||
"description": "Sample interface for the booking program"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}KART_FEE",
|
||||
"functionGroup": "{{P}}FG_KART",
|
||||
"params": [
|
||||
{
|
||||
"name": "iv_laps",
|
||||
"type": "i"
|
||||
},
|
||||
{
|
||||
"name": "iv_driver_age",
|
||||
"type": "i"
|
||||
},
|
||||
{
|
||||
"name": "iv_member",
|
||||
"type": "abap_bool"
|
||||
},
|
||||
{
|
||||
"name": "ev_discount",
|
||||
"type": "abap_bool"
|
||||
},
|
||||
{
|
||||
"name": "cv_fee",
|
||||
"type": "decfloat34"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}KART_SAMPLE"
|
||||
],
|
||||
"hidden_tests": [],
|
||||
"reference": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}KART_FEE",
|
||||
"functionGroup": "{{P}}FG_KART",
|
||||
"file": "reference/kart_fee.func.abap",
|
||||
"description": "Fee calculation for a race"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}KART_TEST",
|
||||
"file": "reference/kart_test.clas.abap",
|
||||
"description": "Tests for the fee calculation"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"method_length"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user