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,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Play statistics'
define view entity {{P}}I_PLAY_STATS
as select from {{p}}play as play
left outer join {{p}}perf as perf on perf.play_id = play.play_id
{
key play.play_id as play_id,
play.title as title,
count( * ) as performance_count,
sum( perf.tickets_sold ) as total_tickets,
sum( perf.revenue ) as total_revenue
}
group by
play.play_id,
play.title

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Play statistics'
define view entity {{P}}I_PLAY_STATS
as select from {{p}}play as play
inner join {{p}}perf as perf on perf.play_id <> play.play_id
{
key play.play_id as play_id,
play.title as title,
count( * ) as performance_count,
sum( perf.tickets_sold ) as total_tickets,
sum( perf.revenue ) as total_revenue
}
group by
play.play_id,
play.title

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Play statistics'
define view entity {{P}}I_PLAY_STATS
as select from {{p}}play as play
inner join {{p}}perf as perf on perf.play_id = play.play_id
{
key play.play_id as play_id,
play.title as title,
count( * ) as performance_count,
max( perf.tickets_sold ) as total_tickets,
sum( perf.revenue ) as total_revenue
}
group by
play.play_id,
play.title

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Play statistics'
define view entity {{P}}I_PLAY_STATS
as select from {{p}}play as play
inner join {{p}}perf as perf on perf.play_id = play.play_id
{
key play.play_id as play_id,
play.title as title,
count( * ) as performance_count,
sum( perf.tickets_sold ) as total_tickets,
max( perf.revenue ) as total_revenue
}
group by
play.play_id,
play.title

View File

@@ -0,0 +1,19 @@
{
"id": "G0166",
"pool": "eval",
"object_type": "DDLS",
"category": "I",
"attempts": [
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 4,
"killed": 4,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,103 @@
CLASS {{p}}t20_hidden 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 one_row_per_play FOR TESTING.
METHODS performance_count FOR TESTING.
METHODS total_tickets FOR TESTING.
METHODS total_revenue FOR TESTING.
METHODS play_without_perf FOR TESTING.
METHODS title_shown FOR TESTING.
METHODS single_performance FOR TESTING.
METHODS decimals FOR TESTING.
ENDCLASS.
CLASS {{p}}t20_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_PLAY_STATS' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_play TYPE STANDARD TABLE OF {{p}}play WITH EMPTY KEY.
DATA lt_perf TYPE STANDARD TABLE OF {{p}}perf WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_play = VALUE #( ( play_id = 'P1' title = 'HAMLET' genre = 'DRAMA' director = 'A' )
( play_id = 'P2' title = 'CARMEN' genre = 'OPERA' director = 'B' )
( play_id = 'P3' title = 'ROMEO' genre = 'DRAMA' director = 'C' )
( play_id = 'P4' title = 'TOSCA' genre = 'OPERA' director = 'D' ) ).
lt_perf = VALUE #( ( play_id = 'P1' perf_no = 1 tickets_sold = 100 revenue = '1000.00' )
( play_id = 'P1' perf_no = 2 tickets_sold = 150 revenue = '1500.00' )
( play_id = 'P1' perf_no = 3 tickets_sold = 50 revenue = '500.00' )
( play_id = 'P2' perf_no = 1 tickets_sold = 200 revenue = '4000.00' )
( play_id = 'P4' perf_no = 1 tickets_sold = 10 revenue = '10.10' )
( play_id = 'P4' perf_no = 2 tickets_sold = 1 revenue = '0.05' ) ).
go_env->insert_test_data( lt_play ).
go_env->insert_test_data( lt_perf ).
ENDMETHOD.
METHOD one_row_per_play.
SELECT COUNT(*) FROM {{p}}i_play_stats INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_rows ).
ENDMETHOD.
METHOD performance_count.
SELECT SINGLE performance_count FROM {{p}}i_play_stats
WHERE play_id = 'P1' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_count ).
ENDMETHOD.
METHOD total_tickets.
SELECT SINGLE total_tickets FROM {{p}}i_play_stats
WHERE play_id = 'P1' INTO @DATA(lv_tickets).
cl_abap_unit_assert=>assert_equals( exp = 300 act = lv_tickets ).
ENDMETHOD.
METHOD total_revenue.
SELECT SINGLE total_revenue FROM {{p}}i_play_stats
WHERE play_id = 'P1' INTO @DATA(lv_revenue).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '3000.00' )
act = CONV decfloat34( lv_revenue ) ).
ENDMETHOD.
METHOD play_without_perf.
SELECT COUNT(*) FROM {{p}}i_play_stats
WHERE play_id = 'P3' INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
METHOD title_shown.
SELECT SINGLE title FROM {{p}}i_play_stats
WHERE play_id = 'P1' INTO @DATA(lv_title).
cl_abap_unit_assert=>assert_equals( exp = 'HAMLET' act = lv_title ).
ENDMETHOD.
METHOD single_performance.
SELECT SINGLE performance_count, total_tickets, total_revenue
FROM {{p}}i_play_stats
WHERE play_id = 'P2' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_row-performance_count ).
cl_abap_unit_assert=>assert_equals( exp = 200 act = ls_row-total_tickets ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '4000.00' )
act = CONV decfloat34( ls_row-total_revenue ) ).
ENDMETHOD.
METHOD decimals.
SELECT SINGLE total_tickets, total_revenue
FROM {{p}}i_play_stats
WHERE play_id = 'P4' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 11 act = ls_row-total_tickets ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '10.15' )
act = CONV decfloat34( ls_row-total_revenue ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,53 @@
{
"task": "G0166",
"mutants": [
{
"object": "{{P}}I_PLAY_STATS",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "killed",
"hidden": "6/8",
"failed_tests": [
"ONE_ROW_PER_PLAY",
"PLAY_WITHOUT_PERF"
]
},
{
"object": "{{P}}I_PLAY_STATS",
"mutant": "line 5: = -> <> (eq)",
"status": "killed",
"hidden": "2/8",
"failed_tests": [
"DECIMALS",
"ONE_ROW_PER_PLAY",
"PLAY_WITHOUT_PERF",
"SINGLE_PERFORMANCE",
"TOTAL_REVENUE",
"TOTAL_TICKETS"
]
},
{
"object": "{{P}}I_PLAY_STATS",
"mutant": "line 10: sum( -> max( (agg)",
"status": "killed",
"hidden": "6/8",
"failed_tests": [
"DECIMALS",
"TOTAL_TICKETS"
]
},
{
"object": "{{P}}I_PLAY_STATS",
"mutant": "line 11: sum( -> max( (agg)",
"status": "killed",
"hidden": "6/8",
"failed_tests": [
"DECIMALS",
"TOTAL_REVENUE"
]
}
],
"valid": 4,
"killed": 4,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Play statistics'
define view entity {{P}}I_PLAY_STATS
as select from {{p}}play as play
inner join {{p}}perf as perf on perf.play_id = play.play_id
{
key play.play_id as play_id,
play.title as title,
count( * ) as performance_count,
sum( perf.tickets_sold ) as total_tickets,
sum( perf.revenue ) as total_revenue
}
group by
play.play_id,
play.title

View File

@@ -0,0 +1,42 @@
CLASS {{p}}t20_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 totals_of_one_play FOR TESTING.
ENDCLASS.
CLASS {{p}}t20_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_PLAY_STATS' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
go_env->clear_doubles( ).
ENDMETHOD.
METHOD totals_of_one_play.
DATA lt_play TYPE STANDARD TABLE OF {{p}}play WITH EMPTY KEY.
DATA lt_perf TYPE STANDARD TABLE OF {{p}}perf WITH EMPTY KEY.
lt_play = VALUE #( ( play_id = 'A' title = 'TEST' genre = 'DRAMA' director = 'X' ) ).
lt_perf = VALUE #( ( play_id = 'A' perf_no = 1 tickets_sold = 10 revenue = '1.00' )
( play_id = 'A' perf_no = 2 tickets_sold = 20 revenue = '2.00' ) ).
go_env->insert_test_data( lt_play ).
go_env->insert_test_data( lt_perf ).
SELECT SINGLE performance_count, total_tickets, total_revenue
FROM {{p}}i_play_stats
WHERE play_id = 'A' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_row-performance_count ).
cl_abap_unit_assert=>assert_equals( exp = 30 act = ls_row-total_tickets ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( 3 )
act = CONV decfloat34( ls_row-total_revenue ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,16 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Play statistics'
define view entity {{P}}I_PLAY_STATS
as select from {{p}}play as play
inner join {{p}}perf as perf on perf.play_id = play.play_id
{
key play.play_id as play_id,
play.title as title,
count( * ) as performance_count,
sum( perf.tickets_sold ) as total_tickets,
sum( perf.revenue ) as total_revenue
}
group by
play.play_id,
play.title,
perf.perf_no

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Performance'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}perf {
key client : abap.clnt not null;
key play_id : abap.char(10) not null;
key perf_no : abap.int4 not null;
perf_date : abap.dats;
tickets_sold : abap.int4;
revenue : abap.dec(15,2);
}

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Play'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}play {
key client : abap.clnt not null;
key play_id : abap.char(10) not null;
title : abap.char(40);
genre : abap.char(20);
director : abap.char(40);
}

View File

@@ -0,0 +1,43 @@
# 1. Goal
The CDS view entity {{P}}I_PLAY_STATS in package $TMP shows statistics for the plays
of a theatre. Users report two defects:
- A play with more than one performance appears more than once in the result.
- For such a play, PERFORMANCE_COUNT is 1, and TOTAL_TICKETS and TOTAL_REVENUE show
the values of one performance only.
Fix the view so that it shows one row for each play that has at least one performance,
with the correct totals. All other behavior stays the same.
# 2. Open questions
None.
# 3. Context
- Table {{P}}PLAY (play), package $TMP. Key: PLAY_ID (CHAR 10).
Further fields: TITLE (CHAR 40), GENRE (CHAR 20), DIRECTOR (CHAR 40).
- Table {{P}}PERF (performance), package $TMP. Key: PLAY_ID (CHAR 10), PERF_NO (INT4).
Further fields: PERF_DATE (DATS), TICKETS_SOLD (INT4), REVENUE (DEC 15,2).
- The CDS view entity {{P}}I_PLAY_STATS in package $TMP reads both tables.
# 4. Contract
- Fix the CDS view entity {{P}}I_PLAY_STATS in package $TMP. Keep the name and the
elements of the view.
- Elements, with these names: PLAY_ID (key), TITLE, PERFORMANCE_COUNT, TOTAL_TICKETS,
TOTAL_REVENUE.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. PERFORMANCE_COUNT is the number of performances of the play.
2. TOTAL_TICKETS is the sum of TICKETS_SOLD of all performances of the play.
3. TOTAL_REVENUE is the sum of REVENUE of all performances of the play, with 2 decimals.
4. TITLE is the title of the play.
# 6. Constraints
- Release target: 8.16.
- Package: $TMP.
- Out of scope: do not change {{P}}PLAY and {{P}}PERF.
# 7. Acceptance
- The view is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.

View File

@@ -0,0 +1,72 @@
{
"id": "G0166",
"category": "I",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 30,
"max_activations": 8
},
"seed": [
{
"type": "TABL",
"name": "{{P}}PLAY",
"file": "seed/play.tabl.asabap",
"description": "Play"
},
{
"type": "TABL",
"name": "{{P}}PERF",
"file": "seed/perf.tabl.asabap",
"description": "Performance"
},
{
"type": "DDLS",
"name": "{{P}}I_PLAY_STATS",
"file": "seed/i_play_stats.ddls.asddls",
"description": "Faulty play statistics view"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_PLAY_STATS",
"fields": [
"PLAY_ID",
"TITLE",
"PERFORMANCE_COUNT",
"TOTAL_TICKETS",
"TOTAL_REVENUE"
]
}
],
"out_of_scope": [
"{{P}}PLAY",
"{{P}}PERF"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T20_HIDDEN",
"file": "hidden/t20_hidden.clas.abap",
"description": "T20 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_PLAY_STATS",
"file": "reference/i_play_stats.ddls.asddls",
"description": "Fixed play statistics view"
},
{
"type": "CLAS",
"name": "{{P}}T20_TEST",
"file": "reference/t20_test.clas.abap",
"description": "T20 own tests"
}
],
"craft_checks": []
}