| 1 | package Langertha::Holmgang::Runner; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: The model loop of one case over a Langertha engine: turns, turn limit, tokens per turn, lint mock runs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 35 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 35 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 35 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 35 | ▶ | use Carp qw( croak ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 35 | ▶ | use Future::AsyncAwait; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 35 | ▶ | use JSON::MaybeXS (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 35 | ▶ | use Langertha::Engine::Virtual; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 35 | ▶ | use Langertha::Holmgang::Error; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 35 | ▶ | use Langertha::Holmgang::Grader; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 35 | ▶ | use Langertha::Holmgang::Target; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 35 | ▶ | use Langertha::Virtual::Rules qw( answer tool ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 35 | ▶ | use Moose::Util (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 35 | ▶ | use Scalar::Util qw( blessed ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 35 | ▶ | use Time::HiRes (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 35 | our $VERSION = '0.001'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 35 | my $JSON = JSON::MaybeXS->new( utf8 => 0, canonical => 1, allow_nonref => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 35 | has target => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | isa => 'Langertha::Holmgang::Target', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | predicate => 'has_target', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 35 | has grader => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | builder => '_build_grader', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 224 | ▶ | sub _build_grader { Langertha::Holmgang::Grader->new } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_grader: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 1992 | ▶ | sub _ms { int( 1000 * $_[0] + 0.5 ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ms: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | # a deep copy as plain data (wire bodies may carry JSON booleans and shared refs) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 3646 | ▶ | sub _plain { $JSON->decode( $JSON->encode( $_[0] ) ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_plain: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 1156 | ▶ | async sub run_case_f { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run_case_f: called CC=35 SCAR=35.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 1156 | my ( $self, $case, %o ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 1156 | ▶ | croak __PACKAGE__.'->run_case needs a target' unless $self->has_target; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 1156 | my $target = $self->target; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 1156 | my $engine = $target->engine; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 1156 | ▶ | croak __PACKAGE__.': the engine '.ref($engine).' has no format_tool_results (Langertha::Role::Tools)' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | unless $engine->can('format_tool_results'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | # Langertha prepends an engine's own system_prompt as a second system message (k37) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 1156 | ▶ | croak __PACKAGE__.': the engine '.ref($engine).' has a system_prompt of its own; the case\'s system prompt is the only one' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$engine->can("system_prompt") and defined $engine->system_prompt
MC/DC50%1/2
$engine->can("system_prompt") and defined $engine->system_prompt
$engine->can("system_prompt")
defined $engine->system_prompt
Truth table66%2/3
A and B
A= $engine->can("system_prompt")B= defined $engine->system_prompt
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | if $engine->can('system_prompt') && defined $engine->system_prompt; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 1155 | ▶ | my $world = $self->grader->world_class->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$case->observe // []
MC/DC100%1/1
$case->observe // []
$case->observe
Truth table100%2/2
A
A= $case->observe
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | state => $case->initial_state, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | tools => $case->tools, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | observe => $case->observe // [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | simulators => $self->grader->simulators, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 1155 | my $offer = $world->offer; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 1155 | my $system = $case->effective('system'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | my @conversation = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | ( defined $system && length $system ? ( { role => 'system', content => $system } ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 1155 | ▶ | @{ _plain( $case->prompt_messages ) }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $system and length $system
MC/DC50%1/2
defined $system and length $system
defined $system
length $system
Truth table66%2/3
A and B
A= defined $systemB= length $system
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 1155 | my %controls = ( max_tokens => $case->effective('max_tokens') ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 1155 | ▶ | $controls{temperature} = $case->effective('temperature') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not $engine->can("supports") or $engine->supports("temperature")
MC/DC50%1/2
not $engine->can("supports") or $engine->supports("temperature")
not $engine->can("supports")
$engine->supports("temperature")
Truth table66%2/3
not(A) or B
A= not $engine->can("supports")B= $engine->supports("temperature")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | if !$engine->can('supports') || $engine->supports('temperature'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 1155 | ▶ | $controls{seed} = 0 + $o{seed} if defined $o{seed}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1155 | ▶ | $controls{tools} = $offer if @$offer; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1155 | my $max_turns = $case->effective('max_turns'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 1155 | my ( @turns, @calls, $error, $error_class, $turn_limit, $answer ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | # the vision pre-check found the target blind (k27): no request for a case with images | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1155 | ▶ | if ( $case->has_images && defined $o{no_vision} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$case->has_images and defined $o{"no_vision"}
MC/DC100%2/2
$case->has_images and defined $o{"no_vision"}
$case->has_images
defined $o{"no_vision"}
Truth table100%3/3
A and B
A= $case->has_imagesB= defined $o{"no_vision"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | ( $error, $error_class ) = ( $o{no_vision}, 'no_vision' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 1155 | ▶ | while ( !defined $error_class ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1997 | ▶ | if ( @turns >= $max_turns ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 4 | $turn_limit = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 4 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 1993 | my $t0 = Time::HiRes::time(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 1993 | my $turn = await $target->chat_turn_f( messages => $self->_wire_messages( $case, \@conversation ), %controls ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 1992 | my $ms = _ms( Time::HiRes::time() - $t0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 1992 | my $response = $turn->{response}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 1992 | ▶ | my $usage = $response && $response->has_usage ? $response->usage : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$response and $response->has_usage
MC/DC100%2/2
$response and $response->has_usage
$response
$response->has_usage
Truth table100%3/3
A and B
A= $responseB= $response->has_usage
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 1992 | ▶ | my @tc = $response && $response->has_tool_calls ? @{ $response->tool_calls } : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$response and $response->has_tool_calls
MC/DC100%2/2
$response and $response->has_tool_calls
$response
$response->has_tool_calls
Truth table100%3/3
A and B
A= $responseB= $response->has_tool_calls
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 1992 | ▶ | push @turns, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | input_tokens => $usage ? $usage->input_tokens : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | output_tokens => $usage ? $usage->output_tokens : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | reasoning_tokens => $usage ? $usage->reasoning_tokens : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | duration_ms => $ms, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | finish_reason => $response ? $response->finish_reason : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | calls => scalar @tc, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 1992 | ▶ | if ( defined $turn->{error_class} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 28 | ( $error, $error_class ) = @{$turn}{qw( error error_class )}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 28 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 1964 | ▶ | unless ( @tc ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | # without a tool call the case is over; the text is never graded | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 1116 | ▶ | $answer = $response->content // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$response->content // ""
MC/DC0%0/1
$response->content // ""
$response->content
Truth table50%1/2
A
A= $response->content
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 1116 | push @conversation, { role => 'assistant', content => $answer }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 1116 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 848 | my @results; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 848 | for my $tc ( @tc ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 849 | my ( $out, $args, $ok, $gap ) = $world->call( $tc->name, $self->_call_arguments($tc) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 849 | ▶ | push @calls, { tool => $tc->name, args => _plain($args), succeeded => $ok ? 1 : 0, sim_gap => $gap }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 849 | ▶ | push @results, { tool_call => $tc, result => { content => [ { type => 'text', text => $out // '' } ] } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$out // ""
MC/DC0%0/1
$out // ""
$out
Truth table50%1/2
A
A= $out
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 848 | push @conversation, @{ _plain( [ $engine->format_tool_results( $response->raw, \@results ) ] ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 1150 | ▶ | my $g = $self->grader->grade( $case, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | state => $world->state, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | calls => \@calls, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | ( defined $error ? ( error => $error, error_class => $error_class ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | ( $turn_limit ? ( turn_limit => 1 ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | case_id => $case->id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | repetition => $o{repetition} // 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | seed => defined $o{seed} ? 0 + $o{seed} : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 9200 | ( map { $_ => $g->{$_} } qw( status score error rules diff sim_gaps forbidden_calls injection_held ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | turns => \@turns, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | calls => \@calls, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 1150 | ▶ | transcript => [ grep { ( $_->{role} // '' ) ne 'system' } @conversation ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition75%3/4
$o{"repetition"} // 1
$$_{"role"} // ""
MC/DC100%1/1
$o{"repetition"} // 1
$o{"repetition"}
MC/DC0%0/1
$$_{"role"} // ""
$$_{"role"}
Truth table100%2/2
A
A= $o{"repetition"}
Truth table50%1/2
A
A= $$_{"role"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | answer => $answer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | state => $world->state, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 35 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | # the conversation as it goes out: each image placeholder { image, sha256, bytes } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | # of a message becomes the case's Langertha::Content::Image, which the engine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | # turns into its own image part; the conversation itself keeps the placeholder | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 1993 | ▶ | sub _wire_messages { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_wire_messages: called CC=6 SCAR=25.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | my ( $self, $case, $conversation ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_wire_messages: not called CC=6 SCAR=25.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | return [ map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | my $m = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | my $images = ref $m->{content} eq 'ARRAY' && grep { ref $_ eq 'HASH' && exists $_->{image} } @{ $m->{content} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%4/12
ref $$m{'content'} eq 'ARRAY' && grep({ref $_ eq 'HASH' and exists $$_{'image'};} @{$$m{'content'};})
ref $_ eq 'HASH' && exists $$_{'image'}
ref $$m{'content'} eq 'ARRAY' && grep({ref $_ eq 'HASH' and exists $$_{'image'};} @{$$m{'content'};})
ref $_ eq 'HASH' && exists $$_{'image'}
MC/DC50%1/2
ref $$m{'content'} eq 'ARRAY' && grep({ref $_ eq 'HASH' and exists $$_{'image'};} @{$$m{'content'};})
ref $$m{'content'} eq 'ARRAY'
grep({ref $_ eq 'HASH' and exists $$_{'image'};} @{$$m{'content'};})
MC/DC50%1/2
ref $_ eq 'HASH' && exists $$_{'image'}
ref $_ eq 'HASH'
exists $$_{'image'}
MC/DC0%0/2
ref $$m{'content'} eq 'ARRAY' && grep({ref $_ eq 'HASH' and exists $$_{'image'};} @{$$m{'content'};})
ref $$m{'content'} eq 'ARRAY'
grep({ref $_ eq 'HASH' and exists $$_{'image'};} @{$$m{'content'};})
MC/DC0%0/2
ref $_ eq 'HASH' && exists $$_{'image'}
ref $_ eq 'HASH'
exists $$_{'image'}
Truth table66%2/3
A && B
A= ref $$m{'content'} eq 'ARRAY'B= grep({ref $_ eq 'HASH' and exists $$_{'image'};} @{$$m{'content'};})
Truth table66%2/3
A && B
A= ref $_ eq 'HASH'B= exists $$_{'image'}
Truth table0%0/3
A && B
A= ref $$m{'content'} eq 'ARRAY'B= grep({ref $_ eq 'HASH' and exists $$_{'image'};} @{$$m{'content'};})
Truth table0%0/3
A && B
A= ref $_ eq 'HASH'B= exists $$_{'image'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | $images | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | ? +{ %$m, content => [ map { ref $_ eq 'HASH' && exists $_->{image} ? $case->image_content( $_->{image} ) : $_ } @{ $m->{content} } ] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition33%2/6
ref $_ eq "HASH" and exists $$_{"image"}
ref $_ eq "HASH" and exists $$_{"image"}
MC/DC50%1/2
ref $_ eq "HASH" and exists $$_{"image"}
ref $_ eq "HASH"
exists $$_{"image"}
MC/DC0%0/2
ref $_ eq "HASH" and exists $$_{"image"}
ref $_ eq "HASH"
exists $$_{"image"}
Truth table66%2/3
A and B
A= ref $_ eq "HASH"B= exists $$_{"image"}
Truth table0%0/3
A and B
A= ref $_ eq "HASH"B= exists $$_{"image"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | : $m; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } @$conversation ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 999 | ▶ | sub run_case { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run_case: called CC=1 SCAR=1.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | my ( $self, @args ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run_case: not called CC=1 SCAR=1.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | return $self->run_case_f(@args)->get; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | # what the world gets for a call: the decoded hash; for arguments that did not | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | # decode (Langertha keeps no raw text, only {} and the flag) a text that is no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | # JSON object, so the world answers with its own refusal, as cai-platform's did | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | # for the model's raw string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 849 | ▶ | sub _call_arguments { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_call_arguments: called CC=2 SCAR=10.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | my ( $self, $tc ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_call_arguments: not called CC=2 SCAR=10.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | return $tc->arguments_undecodable ? '{' : $tc->arguments; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | #### Lint's mock runs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 1094 | ▶ | sub mock_engine { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mock_engine: called CC=9 SCAR=30.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | my ( $class, $case, $mode ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mock_engine: not called CC=9 SCAR=30.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | $mode //= 'solution'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$mode //= "solution"
$mode //= "solution"
MC/DC100%1/1
$mode //= "solution"
$mode
MC/DC0%0/1
$mode //= "solution"
$mode
Truth table100%2/2
A
A= $mode
Truth table0%0/2
A
A= $mode
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | croak __PACKAGE__.'->mock_engine: mode is solution or text' unless $mode eq 'solution' || $mode eq 'text'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%3/6
$mode eq "solution" or $mode eq "text"
$mode eq "solution" or $mode eq "text"
MC/DC100%2/2
$mode eq "solution" or $mode eq "text"
$mode eq "solution"
$mode eq "text"
MC/DC0%0/2
$mode eq "solution" or $mode eq "text"
$mode eq "solution"
$mode eq "text"
Truth table100%3/3
A or B
A= $mode eq "solution"B= $mode eq "text"
Truth table0%0/3
A or B
A= $mode eq "solution"B= $mode eq "text"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | my @script = $mode eq 'solution' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | ▶ | ? ( ( map { tool( $_->{tool} => _plain( $_->{args} // {} ) ) } @{ $case->solution || [] } ), answer('Done.') ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition25%2/8
$$_{"args"} // {}
$case->solution || []
$$_{"args"} // {}
$case->solution || []
MC/DC0%0/1
$$_{"args"} // {}
$$_{"args"}
MC/DC0%0/1
$case->solution || []
$case->solution
MC/DC0%0/1
$$_{"args"} // {}
$$_{"args"}
MC/DC0%0/1
$case->solution || []
$case->solution
Truth table50%1/2
A
A= $$_{"args"}
Truth table50%1/2
A
A= $case->solution
Truth table0%0/2
A
A= $$_{"args"}
Truth table0%0/2
A
A= $case->solution
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | : ( answer('I would do it like this ... (text only)') ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | # the mock sees what it is sent: a case with images gets a mock that claims | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | # image_input, so the vision pre-check does not stop it at the wire, and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | # answers the sight test's requests once its script is done (k27) -- a case | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | # ends with the script's last answer, so a case never reaches the fallback | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | my $images = $case->has_images; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | my $engine = Langertha::Engine::Virtual->new( script => \@script, ( $images ? ( fallback => answer('OK') ) : () ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | Moose::Util::apply_all_roles( $engine, 'Langertha::Role::ImageInput' ) if $images; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | return $engine; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | # the parts of two results that must be identical (all but wall time) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 620 | ▶ | sub _comparable { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_comparable: called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | my ( $r ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_comparable: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | my %c = map { $_ => $r->{$_} } qw( status score error rules diff calls sim_gaps forbidden_calls injection_held transcript state ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | $c{turns} = [ map { my %t = %$_; delete $t{duration_ms}; \%t } @{ $r->{turns} } ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | return $JSON->encode( \%c ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 54 | ▶ | sub lint_mock_runs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
lint_mock_runs: called CC=1 SCAR=1.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | my ( $class ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
lint_mock_runs: not called CC=1 SCAR=1.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 311 | ▶ | return sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=26.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | my ( $lint, $case, $field ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=7 SCAR=26.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 931 | ▶ | my $run = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | ▶ | my ( $mode ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | my $runner = $class->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | grader => $lint->grader, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | target => Langertha::Holmgang::Target->new( engine => $class->mock_engine( $case, $mode ) ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | return $runner->run_case($case); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | my $refuse = sub { Langertha::Holmgang::Error->throw( $field.': '.$_[0], $_[1] ) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | my @replay = map { $run->('solution') } 1 .. 2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | $refuse->( 'solution', 'mock run replaying the reference solution is '.$replay[0]{status} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | .( defined $replay[0]{error} ? ': '.$replay[0]{error} : '' ) ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | unless $replay[0]{status} eq 'passed'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | $refuse->( 'solution', 'mock run replaying the reference solution gives a different result the second time' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | unless _comparable( $replay[0] ) eq _comparable( $replay[1] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | my $text = $run->('text'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | if ( $case->no_tool ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | $refuse->( 'solution', 'mock run answering text only is '.$text->{status}.' -- in the "no tool" family it must pass' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | ▶ | unless $text->{status} eq 'passed'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | $refuse->( 'rules', 'mock run answering text only passes -- the rules check no change' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | ▶ | if $text->{status} eq 'passed'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 35 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 35 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||