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:
Kral
2026-10-03 12:10:52 +02:00
parent d3250acfb8
commit 39769afce8
741 changed files with 40573 additions and 317 deletions

View File

@@ -0,0 +1,14 @@
{
"id": "G0169",
"pool": "eval",
"object_type": "CLAS",
"category": "H",
"attempts": [
{
"stage": "validate",
"oracle": 100,
"null": 30
}
],
"accepted": true
}

View File

@@ -0,0 +1,76 @@
CLASS {{p}}cowork_fee DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
TYPES ty_desk TYPE c LENGTH 3.
TYPES ty_amount TYPE i.
METHODS constructor.
METHODS calculate_fee
IMPORTING
iv_desk TYPE ty_desk
iv_months TYPE i
iv_student TYPE abap_bool
iv_under_25 TYPE abap_bool
RETURNING
VALUE(rv_fee) TYPE ty_amount.
PRIVATE SECTION.
METHODS monthly_fee
IMPORTING
iv_desk TYPE ty_desk
iv_student TYPE abap_bool
iv_under_25 TYPE abap_bool
RETURNING
VALUE(rv_fee) TYPE ty_amount.
ENDCLASS.
CLASS {{p}}cowork_fee IMPLEMENTATION.
METHOD constructor.
ENDMETHOD.
METHOD calculate_fee.
IF iv_months < 1.
rv_fee = 0.
RETURN.
ENDIF.
DATA(lv_monthly) = monthly_fee( iv_desk = iv_desk
iv_student = iv_student
iv_under_25 = iv_under_25 ).
rv_fee = lv_monthly * iv_months.
ENDMETHOD.
METHOD monthly_fee.
" Resolve the contradiction: the student rule wins over the under-25 rule.
IF iv_student = abap_true.
CASE iv_desk.
WHEN 'HOT'.
rv_fee = 160.
WHEN 'DED'.
rv_fee = 280.
WHEN 'PRI'.
rv_fee = 480.
WHEN OTHERS.
rv_fee = 0.
ENDCASE.
ELSEIF iv_under_25 = abap_true.
CASE iv_desk.
WHEN 'HOT'.
rv_fee = 150.
WHEN 'DED'.
rv_fee = 260.
WHEN 'PRI'.
rv_fee = 450.
WHEN OTHERS.
rv_fee = 0.
ENDCASE.
ELSE.
CASE iv_desk.
WHEN 'HOT'.
rv_fee = 200.
WHEN 'DED'.
rv_fee = 350.
WHEN 'PRI'.
rv_fee = 600.
WHEN OTHERS.
rv_fee = 0.
ENDCASE.
ENDIF.
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,60 @@
CLASS ltc_cowork_fee DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA mo_cut TYPE REF TO {{p}}cowork_fee.
METHODS setup.
METHODS hot_desk_no_discount FOR TESTING.
METHODS student_discount FOR TESTING.
METHODS under_25_discount FOR TESTING.
METHODS student_and_under_25 FOR TESTING.
METHODS invalid_desk FOR TESTING.
METHODS invalid_months FOR TESTING.
ENDCLASS.
CLASS ltc_cowork_fee IMPLEMENTATION.
METHOD setup.
mo_cut = NEW {{p}}cowork_fee( ).
ENDMETHOD.
METHOD hot_desk_no_discount.
cl_abap_unit_assert=>assert_equals( exp = 200
act = mo_cut->calculate_fee( iv_desk = 'HOT' iv_months = 1
iv_student = abap_false
iv_under_25 = abap_false ) ).
ENDMETHOD.
METHOD student_discount.
cl_abap_unit_assert=>assert_equals( exp = 160
act = mo_cut->calculate_fee( iv_desk = 'HOT' iv_months = 1
iv_student = abap_true
iv_under_25 = abap_false ) ).
ENDMETHOD.
METHOD under_25_discount.
cl_abap_unit_assert=>assert_equals( exp = 150
act = mo_cut->calculate_fee( iv_desk = 'HOT' iv_months = 1
iv_student = abap_false
iv_under_25 = abap_true ) ).
ENDMETHOD.
METHOD student_and_under_25.
" The reference resolves the contradiction in favour of the student rule.
cl_abap_unit_assert=>assert_equals( exp = 160
act = mo_cut->calculate_fee( iv_desk = 'HOT' iv_months = 1
iv_student = abap_true
iv_under_25 = abap_true ) ).
ENDMETHOD.
METHOD invalid_desk.
cl_abap_unit_assert=>assert_equals( exp = 0
act = mo_cut->calculate_fee( iv_desk = 'XXX' iv_months = 1
iv_student = abap_false
iv_under_25 = abap_false ) ).
ENDMETHOD.
METHOD invalid_months.
cl_abap_unit_assert=>assert_equals( exp = 0
act = mo_cut->calculate_fee( iv_desk = 'HOT' iv_months = 0
iv_student = abap_false
iv_under_25 = abap_false ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,43 @@
# 1. Goal
Calculate the monthly fee for a member of a coworking space. A billing program calls the calculation before it creates an invoice. The program needs one fee for each member.
# 2. Open questions
None.
# 3. Context
- Package $TMP is available.
- The class {{P}}COWORK_FEE does not exist yet.
- The billing program uses the public method of the class.
# 4. Contract
- Create the class {{P}}COWORK_FEE in package $TMP.
- The class is public and final.
- The class has a public constructor without parameters.
- The class has one public method:
CALCULATE_FEE
IMPORTING
iv_desk TYPE ty_desk
iv_months TYPE i
iv_student TYPE abap_bool
iv_under_25 TYPE abap_bool
RETURNING
VALUE(rv_fee) TYPE ty_amount.
- Define the types ty_desk (C LENGTH 3) and ty_amount (TYPE i) in the public section.
- Do not add other public methods.
# 5. Business rules
1. The desk type is HOT, DED, or PRI. The base monthly fee is 200 for HOT, 350 for DED, and 600 for PRI. If the desk type is not in this list, return 0.
2. The number of months must be at least 1. If iv_months is less than 1, return 0.
3. The fee is the monthly fee multiplied by the number of months.
4. If the member is a student, the monthly fee is 160 for HOT, 280 for DED, and 480 for PRI.
5. If the member is under 25, the monthly fee is 150 for HOT, 260 for DED, and 450 for PRI.
# 6. Constraints
- Release target: SAP_BASIS 816.
- Coding standards: Clean ABAP. Method length below 40 statements. No global variables. No comment that restates the code.
- Out of scope: no other objects.
# 7. Acceptance
- The class is active and has no syntax error.
- The class passes the ATC checks with no priority 1 or 2 findings.
- Write your own ABAP Unit tests for the class.

View File

@@ -0,0 +1,54 @@
{
"id": "G0169",
"category": "H",
"object_type": "CLAS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "stop",
"expected_gap": {
"description": "The business rules do not say which monthly fee applies when a member is both a student and under 25.",
"keywords": [
[
"student",
"under",
"25"
],
[
"both",
"apply"
],
[
"contradict"
],
[
"which",
"applies"
]
]
},
"budget": {
"max_tool_calls": 40,
"max_activations": 10
},
"seed": [],
"contract": [
{
"type": "CLAS",
"name": "{{P}}COWORK_FEE"
}
],
"out_of_scope": [],
"hidden_tests": [],
"reference": [
{
"type": "CLAS",
"name": "{{P}}COWORK_FEE",
"file": "reference/cowork_fee.clas.abap",
"description": "Coworking fee calculator",
"testclasses_file": "reference/cowork_fee.testclasses.abap"
}
],
"craft_checks": [
"method_length"
]
}