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": "G0176",
"pool": "eval",
"object_type": "DDLS",
"category": "H",
"attempts": [
{
"stage": "validate",
"oracle": 100,
"null": 30
}
],
"accepted": true
}

View File

@@ -0,0 +1,41 @@
CLASS {{p}}h_energy_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 completed_sessions_only FOR TESTING.
ENDCLASS.
CLASS {{p}}h_energy_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STATION_ENERGY' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
go_env->clear_doubles( ).
ENDMETHOD.
METHOD completed_sessions_only.
DATA lt_station TYPE STANDARD TABLE OF {{p}}station WITH EMPTY KEY.
DATA lt_session TYPE STANDARD TABLE OF {{p}}session WITH EMPTY KEY.
lt_station = VALUE #( ( station_id = 'S1' city = 'Berlin' capacity_kw = '22.0' ) ).
lt_session = VALUE #(
( session_id = 'T1' station_id = 'S1' start_date = '20240101' start_time = '080000' energy_kwh = '10.00' status = 'C' )
( session_id = 'T2' station_id = 'S1' start_date = '20240101' start_time = '090000' energy_kwh = '5.00' status = 'A' )
( session_id = 'T3' station_id = 'S1' start_date = '20240101' start_time = '100000' energy_kwh = '2.00' status = 'R' )
).
go_env->insert_test_data( lt_station ).
go_env->insert_test_data( lt_session ).
SELECT SINGLE session_count, total_energy FROM {{p}}i_station_energy WHERE station_id = 'S1'
INTO @DATA(ls_result).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_result-session_count ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' ) act = CONV decfloat34( ls_result-total_energy ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Station energy totals'
define view entity {{P}}I_STATION_ENERGY
as select from {{p}}station as st
left outer join {{p}}session as se on se.station_id = st.station_id and se.status = 'C'
{
key st.station_id as station_id,
st.city as city,
count( se.session_id ) as session_count,
sum( se.energy_kwh ) as total_energy
}
group by
st.station_id,
st.city

View File

@@ -0,0 +1,31 @@
CLASS {{p}}seed_data DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
ENDCLASS.
CLASS {{p}}seed_data IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DATA lt_station TYPE STANDARD TABLE OF {{p}}station WITH EMPTY KEY.
DATA lt_session TYPE STANDARD TABLE OF {{p}}session WITH EMPTY KEY.
lt_station = VALUE #(
( station_id = 'S1' city = 'Berlin' capacity_kw = '22.0' )
( station_id = 'S2' city = 'Munich' capacity_kw = '50.0' )
( station_id = 'S3' city = 'Hamburg' capacity_kw = '11.0' )
).
lt_session = VALUE #(
( session_id = 'T1' station_id = 'S1' start_date = '20240101' start_time = '080000' energy_kwh = '10.50' status = 'C' )
( session_id = 'T2' station_id = 'S1' start_date = '20240101' start_time = '120000' energy_kwh = '5.25' status = 'C' )
( session_id = 'T3' station_id = 'S1' start_date = '20240102' start_time = '090000' energy_kwh = '3.00' status = 'A' )
( session_id = 'T4' station_id = 'S2' start_date = '20240101' start_time = '100000' energy_kwh = '20.00' status = 'C' )
( session_id = 'T5' station_id = 'S2' start_date = '20240102' start_time = '110000' energy_kwh = '8.00' status = 'R' )
( session_id = 'T6' station_id = 'S3' start_date = '20240103' start_time = '140000' energy_kwh = '4.50' status = 'C' )
( session_id = 'T7' station_id = 'S3' start_date = '20240103' start_time = '160000' energy_kwh = '1.00' status = 'A' )
).
DELETE FROM {{p}}station.
DELETE FROM {{p}}session.
INSERT {{p}}station FROM TABLE @lt_station.
INSERT {{p}}session FROM TABLE @lt_session.
out->write( 'Seed data inserted.' ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,14 @@
@EndUserText.label : 'Charging session'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}session {
key client : abap.clnt not null;
key session_id : abap.char(10) not null;
station_id : abap.char(10);
start_date : abap.dats;
start_time : abap.tims;
energy_kwh : abap.dec(9,2);
status : abap.char(1);
}

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Charging station'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}station {
key client : abap.clnt not null;
key station_id : abap.char(10) not null;
city : abap.char(40);
capacity_kw : abap.dec(5,1);
}

View File

@@ -0,0 +1,28 @@
# 1. Goal
Show the energy that each charging station has delivered. A dashboard and an OData service will read the energy totals, so the calculation must be in the database, in a CDS view.
# 2. Open questions
None.
# 3. Context
- Table {{P}}STATION (charging station), package $TMP. Key: STATION_ID (CHAR 10). Fields: CITY (CHAR 40), CAPACITY_KW (DEC 5,1).
- Table {{P}}SESSION (charging session), package $TMP. Key: SESSION_ID (CHAR 10). Fields: STATION_ID (CHAR 10), START_DATE (DATS), START_TIME (TIMS), ENERGY_KWH (DEC 9,2), STATUS (CHAR 1). STATUS can be 'C' (completed), 'A' (aborted), or 'R' (running).
# 4. Contract
- Create the CDS view entity {{P}}I_STATION_ENERGY in package $TMP.
- Elements, with these names: STATION_ID (key), CITY, SESSION_COUNT, TOTAL_ENERGY.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. Show one row for each charging station.
2. SESSION_COUNT is the number of charging sessions of the station.
3. TOTAL_ENERGY is the sum of the energy of the charging sessions of the station, in kWh with 2 decimals.
# 6. Constraints
- Release target: 8.16 (SAP_BASIS 816).
- Coding standards: Clean ABAP.
- Out of scope: do not change {{P}}STATION and {{P}}SESSION.
# 7. Acceptance
- The view is active and has no syntax error.
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.

View File

@@ -0,0 +1,86 @@
{
"id": "G0176",
"category": "H",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "stop",
"expected_gap": {
"description": "The spec does not say which charging sessions count for SESSION_COUNT and TOTAL_ENERGY: only completed sessions, or also aborted and running sessions.",
"keywords": [
[
"session",
"count"
],
[
"status",
"count"
],
[
"completed",
"aborted"
],
[
"running",
"include"
]
]
},
"budget": {
"max_tool_calls": 20,
"max_activations": 5
},
"seed": [
{
"type": "TABL",
"name": "{{P}}STATION",
"file": "seed/station.tabl.asabap",
"description": "Charging station"
},
{
"type": "TABL",
"name": "{{P}}SESSION",
"file": "seed/session.tabl.asabap",
"description": "Charging session"
},
{
"type": "CLAS",
"name": "{{P}}SEED_DATA",
"file": "seed/seed_data.clas.abap",
"description": "Seed data for charging stations and sessions",
"run": true
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_STATION_ENERGY",
"fields": [
"STATION_ID",
"CITY",
"SESSION_COUNT",
"TOTAL_ENERGY"
]
}
],
"out_of_scope": [
"{{P}}STATION",
"{{P}}SESSION"
],
"hidden_tests": [],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_STATION_ENERGY",
"file": "reference/i_station_energy.ddls.asddls",
"description": "Station energy totals (assuming only completed sessions count)"
},
{
"type": "CLAS",
"name": "{{P}}H_ENERGY_TEST",
"file": "reference/h_energy_test.clas.abap",
"description": "Own tests for the view"
}
],
"craft_checks": []
}