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:
Kral
2026-10-05 13:35:54 +02:00
parent 1c4667a0fc
commit 13360292dd
781 changed files with 50211 additions and 22 deletions

View File

@@ -0,0 +1,16 @@
{
"id": "G1306",
"pool": "train",
"category": "K",
"base_task": "G1003",
"style": "free_text",
"tool_schema": null,
"attempts": [
{
"stage": "validate",
"oracle": 100.0,
"null": 0
}
],
"accepted": true
}

View File

@@ -0,0 +1,172 @@
CLASS {{p}}t21_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA mo_cut TYPE REF TO {{p}}if_drone_check.
DATA mo_drone TYPE REF TO {{p}}drone_checker.
METHODS setup.
METHODS ok_flight FOR TESTING.
METHODS payload_zero FOR TESTING.
METHODS payload_too_heavy FOR TESTING.
METHODS distance_zero FOR TESTING.
METHODS distance_too_far FOR TESTING.
METHODS wind_too_strong FOR TESTING.
METHODS battery_too_low FOR TESTING.
METHODS battery_exact_ok FOR TESTING.
METHODS outside_zone FOR TESTING.
METHODS no_daylight FOR TESTING.
METHODS required_battery_rounds_up FOR TESTING.
METHODS order_payload_first FOR TESTING.
ENDCLASS.
CLASS {{p}}t21_hidden IMPLEMENTATION.
METHOD setup.
mo_drone = NEW {{p}}drone_checker( ).
mo_cut = mo_drone.
ENDMETHOD.
METHOD ok_flight.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-ok
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-ok
act = mo_cut->check( iv_payload = '5.00'
iv_distance = '20.00'
iv_wind_speed = '12.00'
iv_battery = 50
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD payload_zero.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-payload
act = mo_cut->check( iv_payload = '0.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD payload_too_heavy.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-payload
act = mo_cut->check( iv_payload = '5.01'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD distance_zero.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-distance
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '0.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD distance_too_far.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-distance
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '20.01'
iv_wind_speed = '5.00'
iv_battery = 60
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD wind_too_strong.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-wind
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '12.01'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD battery_too_low.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-battery
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 29
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-battery
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '7.50'
iv_wind_speed = '5.00'
iv_battery = 25
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD battery_exact_ok.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-ok
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD outside_zone.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-zone
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_false
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD no_daylight.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-light
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_false ) ).
ENDMETHOD.
METHOD required_battery_rounds_up.
cl_abap_unit_assert=>assert_equals( exp = 26 act = mo_drone->required_battery( '7.50' ) ).
cl_abap_unit_assert=>assert_equals( exp = 50 act = mo_drone->required_battery( '20.00' ) ).
cl_abap_unit_assert=>assert_equals( exp = 0 act = mo_drone->required_battery( '0.00' ) ).
ENDMETHOD.
METHOD order_payload_first.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-payload
act = mo_cut->check( iv_payload = '6.00'
iv_distance = '25.00'
iv_wind_speed = '20.00'
iv_battery = 0
iv_in_zone = abap_false
iv_daylight = abap_false ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,49 @@
CLASS {{p}}drone_checker DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES {{p}}if_drone_check.
METHODS required_battery
IMPORTING iv_distance TYPE {{p}}if_drone_check=>ty_distance
RETURNING VALUE(rv_percent) TYPE {{p}}if_drone_check=>ty_percent.
PRIVATE SECTION.
CONSTANTS:
c_max_payload TYPE {{p}}if_drone_check=>ty_weight VALUE '5.00',
c_max_distance TYPE {{p}}if_drone_check=>ty_distance VALUE '20.00',
c_max_wind TYPE {{p}}if_drone_check=>ty_speed VALUE '12.00',
c_reserve TYPE {{p}}if_drone_check=>ty_percent VALUE 10,
c_percent_per_km TYPE {{p}}if_drone_check=>ty_percent VALUE 2.
ENDCLASS.
CLASS {{p}}drone_checker IMPLEMENTATION.
METHOD {{p}}if_drone_check~check.
IF iv_payload <= 0 OR iv_payload > c_max_payload.
rv_reason = {{p}}if_drone_check=>c_reason-payload.
ELSEIF iv_distance <= 0 OR iv_distance > c_max_distance.
rv_reason = {{p}}if_drone_check=>c_reason-distance.
ELSEIF iv_wind_speed > c_max_wind.
rv_reason = {{p}}if_drone_check=>c_reason-wind.
ELSEIF iv_battery < required_battery( iv_distance ).
rv_reason = {{p}}if_drone_check=>c_reason-battery.
ELSEIF iv_in_zone = abap_false.
rv_reason = {{p}}if_drone_check=>c_reason-zone.
ELSEIF iv_daylight = abap_false.
rv_reason = {{p}}if_drone_check=>c_reason-light.
ELSE.
rv_reason = {{p}}if_drone_check=>c_reason-ok.
ENDIF.
ENDMETHOD.
METHOD required_battery.
IF iv_distance <= 0.
RETURN.
ENDIF.
DATA lv_km TYPE i.
lv_km = iv_distance.
IF lv_km < iv_distance.
lv_km = lv_km + 1.
ENDIF.
rv_percent = lv_km * c_percent_per_km + c_reserve.
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,110 @@
CLASS ltc_drone_checker DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA mo_cut TYPE REF TO {{p}}if_drone_check.
DATA mo_drone TYPE REF TO {{p}}drone_checker.
METHODS setup.
METHODS valid_request_is_ok FOR TESTING.
METHODS heavy_payload_is_rejected FOR TESTING.
METHODS strong_wind_is_rejected FOR TESTING.
METHODS low_battery_is_rejected FOR TESTING.
METHODS required_battery_is_rounded_up FOR TESTING.
METHODS zone_and_light_are_checked FOR TESTING.
METHODS reason_order_is_kept FOR TESTING.
ENDCLASS.
CLASS ltc_drone_checker IMPLEMENTATION.
METHOD setup.
mo_drone = NEW {{p}}drone_checker( ).
mo_cut = mo_drone.
ENDMETHOD.
METHOD valid_request_is_ok.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-ok
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD heavy_payload_is_rejected.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-payload
act = mo_cut->check( iv_payload = '5.01'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD strong_wind_is_rejected.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-wind
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '12.01'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD low_battery_is_rejected.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-battery
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 29
iv_in_zone = abap_true
iv_daylight = abap_true ) ).
ENDMETHOD.
METHOD required_battery_is_rounded_up.
cl_abap_unit_assert=>assert_equals( exp = 26 act = mo_drone->required_battery( '7.50' ) ).
cl_abap_unit_assert=>assert_equals( exp = 30 act = mo_drone->required_battery( '10.00' ) ).
cl_abap_unit_assert=>assert_equals( exp = 0 act = mo_drone->required_battery( '0.00' ) ).
ENDMETHOD.
METHOD zone_and_light_are_checked.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-zone
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_false
iv_daylight = abap_true ) ).
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-light
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '10.00'
iv_wind_speed = '5.00'
iv_battery = 30
iv_in_zone = abap_true
iv_daylight = abap_false ) ).
ENDMETHOD.
METHOD reason_order_is_kept.
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-payload
act = mo_cut->check( iv_payload = '6.00'
iv_distance = '25.00'
iv_wind_speed = '20.00'
iv_battery = 0
iv_in_zone = abap_false
iv_daylight = abap_false ) ).
cl_abap_unit_assert=>assert_equals(
exp = {{p}}if_drone_check=>c_reason-distance
act = mo_cut->check( iv_payload = '2.00'
iv_distance = '25.00'
iv_wind_speed = '20.00'
iv_battery = 0
iv_in_zone = abap_false
iv_daylight = abap_false ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,25 @@
INTERFACE {{p}}if_drone_check PUBLIC.
TYPES ty_reason TYPE c LENGTH 10.
TYPES ty_weight TYPE p LENGTH 8 DECIMALS 2.
TYPES ty_distance TYPE p LENGTH 8 DECIMALS 2.
TYPES ty_speed TYPE p LENGTH 8 DECIMALS 2.
TYPES ty_percent TYPE i.
CONSTANTS:
BEGIN OF c_reason,
ok TYPE ty_reason VALUE 'OK',
payload TYPE ty_reason VALUE 'PAYLOAD',
distance TYPE ty_reason VALUE 'DISTANCE',
wind TYPE ty_reason VALUE 'WIND',
battery TYPE ty_reason VALUE 'BATTERY',
zone TYPE ty_reason VALUE 'ZONE',
light TYPE ty_reason VALUE 'LIGHT',
END OF c_reason.
METHODS check
IMPORTING iv_payload TYPE ty_weight
iv_distance TYPE ty_distance
iv_wind_speed TYPE ty_speed
iv_battery TYPE ty_percent
iv_in_zone TYPE abap_bool
iv_daylight TYPE abap_bool
RETURNING VALUE(rv_reason) TYPE ty_reason.
ENDINTERFACE.

View File

@@ -0,0 +1 @@
Hello, please create the class {{P}}DRONE_CHECKER in package $TMP. The class must be public, final, and have a public constructor without parameters. It must implement the interface {{P}}IF_DRONE_CHECK. The interface {{P}}IF_DRONE_CHECK exists in package $TMP and is active. It has the types TY_REASON (character, length 10), TY_WEIGHT (packed number, length 8, 2 decimals), TY_DISTANCE (packed number, length 8, 2 decimals), TY_SPEED (packed number, length 8, 2 decimals), and TY_PERCENT (integer). It has the constant structure C_REASON with the components OK, PAYLOAD, DISTANCE, WIND, BATTERY, ZONE, and LIGHT. It has one method CHECK with IMPORTING parameters iv_payload TYPE ty_weight, iv_distance TYPE ty_distance, iv_wind_speed TYPE ty_speed, iv_battery TYPE ty_percent, iv_in_zone TYPE abap_bool, iv_daylight TYPE abap_bool, and RETURNING VALUE(rv_reason) TYPE ty_reason. The class must have the public method REQUIRED_BATTERY with IMPORTING iv_distance TYPE {{P}}IF_DRONE_CHECK=>TY_DISTANCE and RETURNING VALUE(rv_percent) TYPE {{P}}IF_DRONE_CHECK=>TY_PERCENT. Do not add other public methods. The payload is in kilograms, the distance in kilometres, the wind speed in metres per second, and the battery charge in percent. The check applies the rules in this sequence and returns the reason of the first rule that fails. If the payload is less than or equal to zero, or greater than 5.00, return PAYLOAD. If the distance is less than or equal to zero, or greater than 20.00, return DISTANCE. If the wind speed is greater than 12.00, return WIND. If the battery charge is less than the charge that the flight needs, return BATTERY. If iv_in_zone is abap_false, return ZONE. If iv_daylight is abap_false, return LIGHT. Else return OK. The charge that a flight needs is the result of REQUIRED_BATTERY. If the distance is less than or equal to zero, the result is 0. Else the result is 2 percent for each started kilometre plus a reserve of 10 percent. A started kilometre counts as a full kilometre. The release target is SAP_BASIS 816 (ABAP Platform 2025). Follow Clean ABAP. Keep the method length below 40 statements. Do not use global variables. Do not write comments that restate the code. Do not change {{P}}IF_DRONE_CHECK. The class must be active and have no syntax error. The hidden tests must pass. Write your own ABAP Unit tests for the class.

View File

@@ -0,0 +1,53 @@
{
"id": "G1306",
"category": "K",
"object_type": "CLAS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 80,
"max_activations": 20
},
"seed": [
{
"type": "INTF",
"name": "{{P}}IF_DRONE_CHECK",
"file": "seed/if_drone_check.intf.abap",
"description": "Drone flight check contract"
}
],
"contract": [
{
"type": "CLAS",
"name": "{{P}}DRONE_CHECKER",
"implements": "{{P}}IF_DRONE_CHECK"
}
],
"out_of_scope": [
"{{P}}IF_DRONE_CHECK"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T21_HIDDEN",
"file": "hidden/t21_hidden.clas.abap",
"description": "T21 hidden tests"
}
],
"reference": [
{
"type": "CLAS",
"name": "{{P}}DRONE_CHECKER",
"file": "reference/drone_checker.clas.abap",
"description": "Drone flight checker",
"testclasses_file": "reference/drone_checker.testclasses.abap"
}
],
"craft_checks": [
"method_length",
"db_operation_in_loop"
],
"base_task": "G1003",
"input_style": "free_text"
}