completion-kit 0.28.45 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/completion_kit/application.js +52 -23
- data/app/assets/stylesheets/completion_kit/application.css +56 -15
- data/app/controllers/completion_kit/api/v1/metric_versions_controller.rb +2 -0
- data/app/controllers/completion_kit/api/v1/metrics_controller.rb +1 -1
- data/app/controllers/completion_kit/api/v1/runs_controller.rb +4 -1
- data/app/controllers/completion_kit/metrics_controller.rb +48 -46
- data/app/controllers/completion_kit/onboarding_controller.rb +1 -1
- data/app/controllers/completion_kit/runs_controller.rb +18 -6
- data/app/helpers/completion_kit/application_helper.rb +110 -52
- data/app/jobs/completion_kit/check_review_job.rb +27 -6
- data/app/models/completion_kit/metric.rb +103 -28
- data/app/models/completion_kit/metric_version.rb +16 -1
- data/app/models/completion_kit/prompt.rb +1 -1
- data/app/models/completion_kit/review.rb +2 -0
- data/app/models/completion_kit/run.rb +36 -18
- data/app/services/completion_kit/checks/contains.rb +2 -8
- data/app/services/completion_kit/checks/equals.rb +2 -7
- data/app/services/completion_kit/checks/expected_resolver.rb +17 -3
- data/app/services/completion_kit/checks/flag.rb +13 -0
- data/app/services/completion_kit/checks/json_path_equals.rb +2 -15
- data/app/services/completion_kit/checks/labels.rb +104 -0
- data/app/services/completion_kit/checks/length_bounds.rb +4 -4
- data/app/services/completion_kit/checks/list_overlap.rb +96 -0
- data/app/services/completion_kit/checks/not_contains.rb +2 -8
- data/app/services/completion_kit/checks/numeric_bounds.rb +22 -0
- data/app/services/completion_kit/checks/numeric_equals.rb +37 -0
- data/app/services/completion_kit/checks/numeric_value.rb +45 -0
- data/app/services/completion_kit/checks/regex.rb +2 -2
- data/app/services/completion_kit/checks/registry.rb +107 -4
- data/app/services/completion_kit/checks/result.rb +5 -1
- data/app/services/completion_kit/checks/target_resolver.rb +43 -8
- data/app/services/completion_kit/checks/textual.rb +19 -0
- data/app/services/completion_kit/mcp_tools/metric_versions.rb +1 -1
- data/app/services/completion_kit/mcp_tools/metrics.rb +21 -7
- data/app/services/completion_kit/mcp_tools/prompts.rb +1 -1
- data/app/services/completion_kit/prompt_improvement_service.rb +1 -1
- data/app/services/completion_kit/promptfoo_importer.rb +4 -4
- data/app/services/completion_kit/run_comparison.rb +6 -0
- data/app/views/completion_kit/agreements/_buttons.html.erb +1 -1
- data/app/views/completion_kit/api_reference/_body.html.erb +9 -5
- data/app/views/completion_kit/metric_groups/_form.html.erb +13 -2
- data/app/views/completion_kit/metric_groups/edit.html.erb +1 -1
- data/app/views/completion_kit/metrics/_check_spec.html.erb +5 -11
- data/app/views/completion_kit/metrics/_form.html.erb +62 -47
- data/app/views/completion_kit/onboarding/show.html.erb +2 -2
- data/app/views/completion_kit/prompts/_form.html.erb +2 -1
- data/app/views/completion_kit/provider_credentials/_models_card.html.erb +2 -2
- data/app/views/completion_kit/responses/show.html.erb +1 -1
- data/app/views/completion_kit/runs/_compare_score.html.erb +1 -1
- data/app/views/completion_kit/runs/_form.html.erb +21 -11
- data/app/views/completion_kit/runs/_response_row.html.erb +5 -3
- data/app/views/completion_kit/runs/_row.html.erb +10 -8
- data/app/views/completion_kit/runs/_run_config.html.erb +1 -1
- data/app/views/completion_kit/runs/_status_panel.html.erb +2 -2
- data/app/views/completion_kit/runs/compare.html.erb +10 -6
- data/app/views/completion_kit/runs/edit.html.erb +1 -1
- data/app/views/completion_kit/runs/new.html.erb +1 -1
- data/app/views/completion_kit/shared/_branded_select.html.erb +1 -1
- data/app/views/layouts/completion_kit/application.html.erb +1 -1
- data/config/locales/en.yml +2 -0
- data/db/migrate/20260903000001_add_check_score_to_completion_kit_reviews.rb +5 -0
- data/db/migrate/20261013000001_drop_completion_kit_mcp_sessions.rb +16 -0
- data/lib/completion_kit/errors.rb +2 -2
- data/lib/completion_kit/version.rb +1 -1
- metadata +10 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module CompletionKit
|
|
2
|
+
module Checks
|
|
3
|
+
module Textual
|
|
4
|
+
def self.operands(target, config)
|
|
5
|
+
value = config["value"].to_s
|
|
6
|
+
haystack = target.to_s
|
|
7
|
+
return [value.strip, haystack.strip] if Flag.on?(config, "trim")
|
|
8
|
+
|
|
9
|
+
[value, haystack]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.include?(haystack, value, config)
|
|
13
|
+
return haystack.include?(value) if Flag.on?(config, "case_sensitive")
|
|
14
|
+
|
|
15
|
+
haystack.downcase.include?(value.downcase)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -27,7 +27,7 @@ module CompletionKit
|
|
|
27
27
|
handler: :publish
|
|
28
28
|
},
|
|
29
29
|
"metric_versions_dismiss" => {
|
|
30
|
-
description: "Destroy a draft MetricVersion (use for either source: 'edit' or source: 'suggestion'). Published versions are refused
|
|
30
|
+
description: "Destroy a draft MetricVersion (use for either source: 'edit' or source: 'suggestion'). Published versions are refused. To demote a published version, publish a different one as current instead.",
|
|
31
31
|
inputSchema: {
|
|
32
32
|
type: "object",
|
|
33
33
|
properties: {
|
|
@@ -3,30 +3,44 @@ module CompletionKit
|
|
|
3
3
|
module Metrics
|
|
4
4
|
extend Base
|
|
5
5
|
|
|
6
|
+
CASE_SENSITIVE_NOTE = "A check with no case_sensitive matches case-insensitively, regex and list_overlap included; " \
|
|
7
|
+
"send case_sensitive: true to match case exactly. Before 0.29.0 a regex check read a missing case_sensitive as case-sensitive."
|
|
8
|
+
|
|
6
9
|
CHECK_CONFIG_SCHEMA = {
|
|
7
10
|
type: "object",
|
|
8
11
|
properties: {
|
|
9
12
|
check_kind: {type: "string", enum: CompletionKit::Checks::Registry.kinds},
|
|
10
13
|
target: {type: "string", enum: CompletionKit::Checks::TargetResolver::TARGETS},
|
|
11
14
|
target_path: {type: "string"},
|
|
12
|
-
value: {type:
|
|
15
|
+
value: {type: %w[string number array], items: {type: %w[string number]}, description: "Only list_overlap takes a list, as a JSON array or as comma-separated text; every other rule refuses one"},
|
|
13
16
|
pattern: {type: "string"},
|
|
14
17
|
json_path: {type: "string"},
|
|
15
18
|
expected: {},
|
|
16
19
|
compare_to: {type: "string", enum: %w[constant expected]},
|
|
17
20
|
expected_path: {type: "string"},
|
|
18
|
-
min: {type: "
|
|
19
|
-
max: {type: "
|
|
20
|
-
|
|
21
|
+
min: {type: "number"},
|
|
22
|
+
max: {type: "number"},
|
|
23
|
+
score_by: {type: "string", enum: CompletionKit::Checks::ListOverlap::MEASURES},
|
|
24
|
+
tolerance: {type: %w[number string], description: "A plain number for a fixed amount, or a percentage string such as \"2%\" for a share of the expected value"},
|
|
25
|
+
case_sensitive: {type: "boolean", description: CASE_SENSITIVE_NOTE},
|
|
21
26
|
multiline: {type: "boolean"},
|
|
22
27
|
trim: {type: "boolean"}
|
|
23
28
|
}
|
|
24
29
|
}.freeze
|
|
25
30
|
|
|
26
31
|
CHECK_CONFIG_HINT = "For a deterministic check set metric_type:\"check\" and check_config. Per-kind required keys: " \
|
|
27
|
-
"value (contains/not_contains/equals), pattern (regex), json_path+expected (json_path_equals), " \
|
|
28
|
-
"min and/or max (length_bounds); valid_json takes no extra keys. target_path is required when target is json_path
|
|
29
|
-
"
|
|
32
|
+
"value (contains/not_contains/equals/list_overlap/numeric_equals), pattern (regex), json_path+expected (json_path_equals), " \
|
|
33
|
+
"min and/or max (length_bounds/numeric_bounds); valid_json takes no extra keys. target_path is required when target is json_path; " \
|
|
34
|
+
"a target_path sent with no target sets target to json_path, and one sent with any other target is refused. " \
|
|
35
|
+
"target_path walks array indices, as in items.0.name; any path may start at the root with $., as in $.items.0.name. " \
|
|
36
|
+
"list_overlap grades a list-valued field and stores a fraction rather than a verdict: score_by is recall, precision, f1 or jaccard (recall by default), " \
|
|
37
|
+
"and min is the fraction that counts as a pass (1, a perfect score, by default). " \
|
|
38
|
+
"numeric_bounds and numeric_equals read a number, ignoring the thousands commas and currency symbol a figure is written with; " \
|
|
39
|
+
"a comma counts only as a thousands separator, with three digits after it and no decimal point before it, so 1,5 is not a number; " \
|
|
40
|
+
"numeric_equals takes a tolerance, either a plain number for a fixed amount or a percentage string such as 2% for a share of the expected value. " \
|
|
41
|
+
"#{CASE_SENSITIVE_NOTE} " \
|
|
42
|
+
"Set compare_to:\"expected\" on #{CompletionKit::Checks::Registry.comparable_kinds.join(", ")} to grade against each row's own expected_output (ground truth) " \
|
|
43
|
+
"instead of a constant; drop value (or expected, for json_path_equals) and add expected_path to dig into the answer key when it is JSON."
|
|
30
44
|
|
|
31
45
|
TOOLS = {
|
|
32
46
|
"metrics_list" => {
|
|
@@ -28,7 +28,7 @@ module CompletionKit
|
|
|
28
28
|
handler: :create
|
|
29
29
|
},
|
|
30
30
|
"prompts_update" => {
|
|
31
|
-
description: "Update a prompt. If the prompt already has runs, this creates a new DRAFT version (current=false) rather than editing in place or publishing
|
|
31
|
+
description: "Update a prompt. If the prompt already has runs, this creates a new DRAFT version (current=false) rather than editing in place or publishing. Promote it with prompts_publish, so an agent's edits don't go live without a gate. If it has no runs, it is updated in place.",
|
|
32
32
|
inputSchema: {
|
|
33
33
|
type: "object",
|
|
34
34
|
properties: {
|
|
@@ -40,7 +40,7 @@ module CompletionKit
|
|
|
40
40
|
if review.check?
|
|
41
41
|
sections << " #{review.metric_name}: #{review.passed ? "PASS" : "FAIL"}"
|
|
42
42
|
else
|
|
43
|
-
sections << " #{review.metric_name}: #{review.ai_score}/5
|
|
43
|
+
sections << " #{review.metric_name}: #{review.ai_score}/5. #{review.ai_feedback}"
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
sections << ""
|
|
@@ -149,17 +149,17 @@ module CompletionKit
|
|
|
149
149
|
def check_mapping(type, text)
|
|
150
150
|
case type
|
|
151
151
|
when "contains"
|
|
152
|
-
[{ "check_kind" => "contains", "target" => "response_text", "value" => text }, "Contains #{text.truncate(30).inspect}"]
|
|
152
|
+
[{ "check_kind" => "contains", "target" => "response_text", "value" => text, "case_sensitive" => true }, "Contains #{text.truncate(30).inspect}"]
|
|
153
153
|
when "icontains"
|
|
154
154
|
[{ "check_kind" => "contains", "target" => "response_text", "value" => text, "case_sensitive" => false }, "Contains #{text.truncate(30).inspect}"]
|
|
155
155
|
when "not-contains"
|
|
156
|
-
[{ "check_kind" => "not_contains", "target" => "response_text", "value" => text }, "Does not contain #{text.truncate(30).inspect}"]
|
|
156
|
+
[{ "check_kind" => "not_contains", "target" => "response_text", "value" => text, "case_sensitive" => true }, "Does not contain #{text.truncate(30).inspect}"]
|
|
157
157
|
when "not-icontains"
|
|
158
158
|
[{ "check_kind" => "not_contains", "target" => "response_text", "value" => text, "case_sensitive" => false }, "Does not contain #{text.truncate(30).inspect}"]
|
|
159
159
|
when "equals"
|
|
160
|
-
[{ "check_kind" => "equals", "target" => "response_text", "value" => text }, "Equals #{text.truncate(30).inspect}"]
|
|
160
|
+
[{ "check_kind" => "equals", "target" => "response_text", "value" => text, "case_sensitive" => true }, "Equals #{text.truncate(30).inspect}"]
|
|
161
161
|
when "regex"
|
|
162
|
-
[{ "check_kind" => "regex", "target" => "response_text", "pattern" => text }, "Matches /#{text.truncate(30)}/"]
|
|
162
|
+
[{ "check_kind" => "regex", "target" => "response_text", "pattern" => text, "case_sensitive" => true }, "Matches /#{text.truncate(30)}/"]
|
|
163
163
|
when "is-json"
|
|
164
164
|
[{ "check_kind" => "valid_json", "target" => "response_text" }, "Valid JSON"]
|
|
165
165
|
end
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<% verdict_icons = { "agree" => "hand-thumb-up", "disagree" => "hand-thumb-down", "borderline" => "scale" } %>
|
|
22
22
|
<% verdict_hints = {
|
|
23
23
|
"agree" => "The score looks right.",
|
|
24
|
-
"disagree" => "The score is wrong
|
|
24
|
+
"disagree" => "The score is wrong. You'll pick the right one.",
|
|
25
25
|
"borderline" => "The rubric is unclear here; either score could be defensible."
|
|
26
26
|
} %>
|
|
27
27
|
<% CompletionKit::Agreement::VERDICTS.each do |verdict| %>
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
<div class="ck-api-endpoint">
|
|
136
136
|
<p class="ck-api-method"><span class="ck-chip ck-chip--soft">GET</span> /api/v1/runs/:id</p>
|
|
137
137
|
<p class="ck-meta-copy">Get a run with status, progress, response count, and average score.</p>
|
|
138
|
-
<p class="ck-api-params"><strong>Also returns:</strong> <code>metric_averages</code>, a per-metric breakdown with each metric's average score (<code>pass_rate</code> for checks), the number of rows it graded, and <code>low_count</code>, how many scored below the medium quality threshold</p>
|
|
138
|
+
<p class="ck-api-params"><strong>Also returns:</strong> <code>metric_averages</code>, a per-metric breakdown with each metric's average score (<code>pass_rate</code> for checks, plus <code>avg_check_score</code> for a <code>list_overlap</code> check, the average fraction from 0 to 1), the number of rows it graded, and <code>low_count</code>, how many scored below the medium quality threshold</p>
|
|
139
139
|
<%= render "completion_kit/api_reference/example", base_url: base_url, token: token, real_token: real_token, cmd: "curl #{base_url}/api/v1/runs/1 \\\n -H \"Authorization: Bearer #{token}\"" %>
|
|
140
140
|
</div>
|
|
141
141
|
<%= render "completion_kit/api_reference/resource_list", title: "Your recent runs",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
</div>
|
|
167
167
|
<div class="ck-api-endpoint">
|
|
168
168
|
<p class="ck-api-method"><span class="ck-chip ck-chip--soft">GET</span> /api/v1/runs/:id/compare?with=:other_id</p>
|
|
169
|
-
<p class="ck-meta-copy">Side-by-side comparison against another run. Returns <code>{left_run_id, right_run_id, metric_ids: [...], rows: [...]}</code> with one row per input case, per-metric scores on both sides, and the delta. Rows are keyed by the left run's input cases: a case present only in the left run is returned with the right side nulled out, and a case present only in the right run is omitted.</p>
|
|
169
|
+
<p class="ck-meta-copy">Side-by-side comparison against another run. Returns <code>{left_run_id, right_run_id, metric_ids: [...], rows: [...]}</code> with one row per input case, per-metric scores on both sides, and the delta. A check reports <code>left_passed</code>, <code>right_passed</code> and <code>result_change</code>, and a <code>list_overlap</code> check also reports <code>left_check_score</code>, <code>right_check_score</code> and <code>check_score_delta</code>, so a fraction that moved shows even when the verdict did not. Rows are keyed by the left run's input cases: a case present only in the left run is returned with the right side nulled out, and a case present only in the right run is omitted.</p>
|
|
170
170
|
<%= render "completion_kit/api_reference/example", base_url: base_url, token: token, real_token: real_token, cmd: "curl \"#{base_url}/api/v1/runs/1/compare?with=2\" \\\n -H \"Authorization: Bearer #{token}\"" %>
|
|
171
171
|
</div>
|
|
172
172
|
<div class="ck-api-endpoint">
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
</div>
|
|
197
197
|
<%= render "completion_kit/api_reference/resource_list", title: "Your responses",
|
|
198
198
|
items: recent_runs.first(1).map { |r|
|
|
199
|
-
{ name: "#{r.name}
|
|
199
|
+
{ name: "#{r.name} · responses",
|
|
200
200
|
url: "#{base_url}/api/v1/runs/#{r.id}/responses", dom_id: "responses_ep_#{r.id}" }
|
|
201
201
|
} %>
|
|
202
202
|
</div>
|
|
@@ -237,8 +237,12 @@
|
|
|
237
237
|
</div>
|
|
238
238
|
<div class="ck-api-endpoint">
|
|
239
239
|
<p class="ck-api-method"><span class="ck-chip ck-chip--soft">POST</span> /api/v1/metrics</p>
|
|
240
|
-
<p class="ck-meta-copy">Create a metric. Defaults to an LLM judge; pass <code>metric_type</code> <code>check</code> with a <code>check_config</code> for a deterministic
|
|
240
|
+
<p class="ck-meta-copy">Create a metric. Defaults to an LLM judge; pass <code>metric_type</code> <code>check</code> with a <code>check_config</code> for a deterministic check that runs with no model and no cost.</p>
|
|
241
241
|
<p class="ck-api-params"><strong>Required:</strong> <code>name</code> <strong>Optional:</strong> <code>metric_type</code> (llm_judge default, or check), <code>instruction</code> and <code>rubric_bands</code> (array of {stars, description}) for judges, <code>check_config</code> (<code>check_kind</code>, <code>target</code>, plus per-kind keys) for checks</p>
|
|
242
|
+
<p class="ck-api-params"><strong>Check kinds:</strong> <code>contains</code>, <code>not_contains</code>, <code>equals</code> (<code>value</code>); <code>regex</code> (<code>pattern</code>); <code>valid_json</code>; <code>json_path_equals</code> (<code>json_path</code>, <code>expected</code>); <code>length_bounds</code> and <code>numeric_bounds</code> (<code>min</code> and/or <code>max</code>); <code>list_overlap</code> (<code>value</code>, <code>score_by</code>, <code>min</code>); <code>numeric_equals</code> (<code>value</code>, <code>tolerance</code>)</p>
|
|
243
|
+
<p class="ck-api-params"><strong>Case:</strong> A check with no <code>case_sensitive</code> matches case-insensitively, <code>regex</code> and <code>list_overlap</code> included. Send <code>"case_sensitive": true</code> to match case exactly. Before 0.29.0 a <code>regex</code> check read a missing <code>case_sensitive</code> as case-sensitive.</p>
|
|
244
|
+
<p class="ck-api-params"><strong>Grading against the answer key:</strong> set <code>compare_to</code> to <code>expected</code> on <code>contains</code>, <code>not_contains</code>, <code>equals</code>, <code>json_path_equals</code>, <code>list_overlap</code> or <code>numeric_equals</code> to grade each row against its own <code>expected_output</code> rather than a constant. Drop <code>value</code> (or <code>expected</code>, on <code>json_path_equals</code>) and add <code>expected_path</code> to name the field to read out of a JSON answer key. A <code>target_path</code>, an <code>expected_path</code> and a <code>json_path</code> all walk array indices, as in <code>items.0.name</code>, and may start at the root with <code>$.</code>, as in <code>$.items.0.name</code>. A <code>target_path</code> sent with no <code>target</code> sets <code>target</code> to <code>json_path</code>, and one sent with any other <code>target</code> is refused.</p>
|
|
245
|
+
<p class="ck-api-params"><strong>Scores, not just verdicts:</strong> <code>list_overlap</code> grades a list-valued field and stores a fraction on the review as <code>check_score</code>, with <code>score_by</code> one of recall, precision, f1 or jaccard. Its <code>min</code> is the fraction that counts as a pass. <code>numeric_equals</code> takes a <code>tolerance</code> that is a plain number for a fixed amount, or a percentage string such as <code>"2%"</code> for a share of the expected value. Each run averages it per metric as <code>avg_check_score</code> inside <code>metric_averages</code>, so a partial answer has run history and can gate a regression.</p>
|
|
242
246
|
<%= render "completion_kit/api_reference/example", base_url: base_url, token: token, real_token: real_token, cmd: "curl -X POST #{base_url}/api/v1/metrics \\\n -H \"Authorization: Bearer #{token}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"name\": \"relevance\", \"instruction\": \"Is the response relevant?\"}'" %>
|
|
243
247
|
</div>
|
|
244
248
|
<div class="ck-api-endpoint">
|
|
@@ -329,7 +333,7 @@
|
|
|
329
333
|
</div>
|
|
330
334
|
<div class="ck-api-endpoint">
|
|
331
335
|
<p class="ck-api-method"><span class="ck-chip ck-chip--soft">GET</span> /api/v1/runs/:run_id/responses/:response_id/metrics/:metric_id/agreements</p>
|
|
332
|
-
<p class="ck-meta-copy">List agreements scoped to a specific run, response, and metric
|
|
336
|
+
<p class="ck-meta-copy">List agreements scoped to a specific run, response, and metric. It is the nested equivalent of the top-level index filtered by those three ids.</p>
|
|
333
337
|
</div>
|
|
334
338
|
<div class="ck-api-endpoint">
|
|
335
339
|
<p class="ck-api-method"><span class="ck-chip" style="color: var(--ck-danger);">DELETE</span> /api/v1/agreements/:id</p>
|
|
@@ -2,10 +2,21 @@
|
|
|
2
2
|
<% metric_group_delete_id = "ck_delete_metric_group_#{metric_group.id}" %>
|
|
3
3
|
<% members_n = metric_group.metrics.count %>
|
|
4
4
|
<% metric_group_delete_confirm = members_n.zero? ?
|
|
5
|
-
"Delete \"#{metric_group.
|
|
6
|
-
"Delete \"#{metric_group.
|
|
5
|
+
"Delete \"#{metric_group.name_was}\"? It has no members." :
|
|
6
|
+
"Delete \"#{metric_group.name_was}\"? Removes this grouping. #{pluralize(members_n, 'member metric')} #{members_n == 1 ? 'is' : 'are'} kept." %>
|
|
7
7
|
<% end %>
|
|
8
8
|
<%= form_with(model: metric_group, url: metric_group.persisted? ? metric_group_path(metric_group) : metric_groups_path, local: true) do |form| %>
|
|
9
|
+
<% if metric_group.errors.any? %>
|
|
10
|
+
<div class="ck-flash ck-flash--alert" role="alert">
|
|
11
|
+
<p class="ck-flash__title"><%= pluralize(metric_group.errors.count, "problem") %> prevented this metric group from being saved.</p>
|
|
12
|
+
<ul class="ck-error-list">
|
|
13
|
+
<% metric_group.errors.full_messages.each do |message| %>
|
|
14
|
+
<li><%= message %></li>
|
|
15
|
+
<% end %>
|
|
16
|
+
</ul>
|
|
17
|
+
</div>
|
|
18
|
+
<% end %>
|
|
19
|
+
|
|
9
20
|
<div class="ck-card ck-form-card">
|
|
10
21
|
<div class="ck-field">
|
|
11
22
|
<%= form.label :name, "Metric group name", class: "ck-label" %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<% content_for :ck_title, "Edit metric group" %>
|
|
2
2
|
<ol class="ck-breadcrumb">
|
|
3
3
|
<li><%= link_to "Metrics", metrics_path %></li>
|
|
4
|
-
<li><%= link_to @metric_group.
|
|
4
|
+
<li><%= link_to @metric_group.name_was, metric_group_path(@metric_group) %></li>
|
|
5
5
|
<li>Edit</li>
|
|
6
6
|
</ol>
|
|
7
7
|
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
<% config = local_assigns.fetch(:config) %>
|
|
2
2
|
<dl class="ck-check-spec">
|
|
3
3
|
<div class="ck-check-spec__row">
|
|
4
|
-
<dt class="ck-check-spec__term"
|
|
4
|
+
<dt class="ck-check-spec__term"><%= ck_check_field_label("check_kind") %></dt>
|
|
5
5
|
<dd class="ck-check-spec__val"><%= ck_check_kind_label(config["check_kind"]) %></dd>
|
|
6
6
|
</div>
|
|
7
7
|
<div class="ck-check-spec__row">
|
|
8
|
-
<dt class="ck-check-spec__term"
|
|
8
|
+
<dt class="ck-check-spec__term"><%= ck_check_field_label("target") %></dt>
|
|
9
9
|
<dd class="ck-check-spec__val"><%= ck_check_target_label(config["target"]) %></dd>
|
|
10
10
|
</div>
|
|
11
|
-
<% config
|
|
11
|
+
<% ck_check_spec_fields(config).each do |key, value| %>
|
|
12
12
|
<div class="ck-check-spec__row">
|
|
13
|
-
<dt class="ck-check-spec__term"><%= ck_check_field_label(key) %></dt>
|
|
14
|
-
<dd class="ck-check-spec__val">
|
|
15
|
-
<% if key == "compare_to" %>
|
|
16
|
-
<%= ck_check_field_value(key, value) %>
|
|
17
|
-
<% else %>
|
|
18
|
-
<code class="ck-check-spec__code"><%= value %></code>
|
|
19
|
-
<% end %>
|
|
20
|
-
</dd>
|
|
13
|
+
<dt class="ck-check-spec__term"><%= ck_check_field_label(key, config["check_kind"]) %></dt>
|
|
14
|
+
<dd class="ck-check-spec__val"><%= ck_check_spec_value(key, value) %></dd>
|
|
21
15
|
</div>
|
|
22
16
|
<% end %>
|
|
23
17
|
</dl>
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
<% pub = local_assigns[:published_metric_version] %>
|
|
18
18
|
<% draft_instr_changed = pub && pub.instruction.to_s != edit_draft.instruction.to_s %>
|
|
19
19
|
<% draft_rubric_changed = pub && pub.rubric_bands != edit_draft.rubric_bands %>
|
|
20
|
+
<% draft_subject = edit_draft.check? ? "check" : [("instruction" if draft_instr_changed), ("rubric" if draft_rubric_changed)].compact.join(" and ").presence || "version" %>
|
|
20
21
|
<div class="ck-suggestion-banner" role="status">
|
|
21
22
|
<div class="ck-suggestion-banner__body">
|
|
22
23
|
<p class="ck-kicker">Draft pending</p>
|
|
23
|
-
<p class="ck-meta-copy">The form below shows your unpublished draft. Publish to replace the live<%=
|
|
24
|
+
<p class="ck-meta-copy">The form below shows your unpublished draft. Publish to replace the live <%= draft_subject %> for future runs, or keep editing.</p>
|
|
24
25
|
</div>
|
|
25
26
|
<div class="ck-suggestion-banner__actions">
|
|
26
27
|
<%= button_to "Discard draft", dismiss_suggestion_metric_path(metric, draft_id: edit_draft.id, back_to: "edit"),
|
|
@@ -164,99 +165,113 @@
|
|
|
164
165
|
|
|
165
166
|
<% if show_check %>
|
|
166
167
|
<% check = metric.check_config || {} %>
|
|
167
|
-
|
|
168
|
+
<% kind = check["check_kind"] || CompletionKit::Checks::Registry.kinds.first %>
|
|
169
|
+
<div class="ck-field ck-field--spacious" data-ck-metric-editor="check" data-ck-check-form="<%= ck_check_form_data.to_json %>" <%= "hidden" unless metric.check? %>>
|
|
168
170
|
<p class="ck-section-title">Check</p>
|
|
169
171
|
<p class="ck-hint">A pass or fail rule with no AI and no cost. You only fill in the fields the chosen rule needs.</p>
|
|
170
172
|
|
|
171
173
|
<div class="ck-field">
|
|
172
|
-
<p class="ck-label" id="metric_check_kind_label"
|
|
174
|
+
<p class="ck-label" id="metric_check_kind_label"><%= ck_check_field_label("check_kind") %></p>
|
|
173
175
|
<%= render "completion_kit/shared/branded_select",
|
|
174
176
|
name: "metric[check_config][check_kind]",
|
|
175
|
-
options: CompletionKit::Checks::Registry.kinds.map { |
|
|
176
|
-
selected:
|
|
177
|
-
labelledby: "metric_check_kind_label"
|
|
177
|
+
options: CompletionKit::Checks::Registry.kinds.map { |option| [option, ck_check_kind_label(option)] },
|
|
178
|
+
selected: kind,
|
|
179
|
+
labelledby: "metric_check_kind_label",
|
|
180
|
+
invalid: ck_check_field_invalid?(metric, "check_kind") %>
|
|
178
181
|
</div>
|
|
179
182
|
|
|
180
183
|
<div class="ck-field">
|
|
181
|
-
<p class="ck-label" id="metric_check_target_label"
|
|
184
|
+
<p class="ck-label" id="metric_check_target_label"><%= ck_check_field_label("target") %></p>
|
|
182
185
|
<%= render "completion_kit/shared/branded_select",
|
|
183
186
|
name: "metric[check_config][target]",
|
|
184
187
|
options: CompletionKit::Checks::TargetResolver::TARGETS.map { |target| [target, ck_check_target_label(target)] },
|
|
185
188
|
selected: check["target"] || CompletionKit::Checks::TargetResolver::TARGETS.first,
|
|
186
|
-
labelledby: "metric_check_target_label"
|
|
189
|
+
labelledby: "metric_check_target_label",
|
|
190
|
+
invalid: ck_check_field_invalid?(metric, "target") %>
|
|
187
191
|
</div>
|
|
188
192
|
|
|
189
193
|
<div class="ck-field" data-ck-check-field="target_path">
|
|
190
|
-
<label class="ck-label" for="metric_check_target_path"
|
|
191
|
-
<p class="ck-hint">Where to look inside the response, like data.items.0.name.</p>
|
|
192
|
-
<input type="text" name="metric[check_config][target_path]" id="metric_check_target_path" class="ck-input" value="<%= check["target_path"] %>"
|
|
194
|
+
<label class="ck-label" for="metric_check_target_path"><%= ck_check_field_label("target_path") %></label>
|
|
195
|
+
<p class="ck-hint">Where to look inside the response, like data.items.0.name. Use a number to pick an item out of a list.</p>
|
|
196
|
+
<input type="text" name="metric[check_config][target_path]" id="metric_check_target_path" class="ck-input" value="<%= check["target_path"] %>" <%= tag.attributes(ck_check_field_aria(metric, "target_path")) %>>
|
|
193
197
|
</div>
|
|
194
198
|
|
|
195
199
|
<div class="ck-field" data-ck-check-field="compare_to">
|
|
196
|
-
<p class="ck-label"
|
|
200
|
+
<p class="ck-label"><%= ck_check_field_label("compare_to") %></p>
|
|
197
201
|
<p class="ck-hint">Check every output against one fixed value, or against each row's own expected value (its answer key).</p>
|
|
198
202
|
<label class="ck-radio">
|
|
199
|
-
<input type="radio" name="metric[check_config][compare_to]" value="constant" <%= "checked" unless check["compare_to"] == "expected" %>>
|
|
200
|
-
<span
|
|
203
|
+
<input type="radio" name="metric[check_config][compare_to]" value="constant" <%= "checked" unless check["compare_to"] == "expected" %> <%= tag.attributes(ck_check_field_aria(metric, "compare_to")) %>>
|
|
204
|
+
<span><%= ck_check_field_value("compare_to", "constant") %></span>
|
|
201
205
|
</label>
|
|
202
206
|
<label class="ck-radio">
|
|
203
|
-
<input type="radio" name="metric[check_config][compare_to]" value="expected" <%= "checked" if check["compare_to"] == "expected" %>>
|
|
204
|
-
<span
|
|
207
|
+
<input type="radio" name="metric[check_config][compare_to]" value="expected" <%= "checked" if check["compare_to"] == "expected" %> <%= tag.attributes(ck_check_field_aria(metric, "compare_to")) %>>
|
|
208
|
+
<span><%= ck_check_field_value("compare_to", "expected") %></span>
|
|
205
209
|
</label>
|
|
206
210
|
</div>
|
|
207
211
|
|
|
208
212
|
<div class="ck-field" data-ck-check-field="value">
|
|
209
|
-
<label class="ck-label" for="metric_check_value"
|
|
210
|
-
<input type="text" name="metric[check_config][value]" id="metric_check_value" class="ck-input" value="<%= check["value"] %>"
|
|
213
|
+
<label class="ck-label" for="metric_check_value"><span data-ck-check-label="value"><%= ck_check_field_label("value", kind) %></span></label>
|
|
214
|
+
<input type="text" name="metric[check_config][value]" id="metric_check_value" class="ck-input" value="<%= ck_check_input_value(check["value"]) %>" <%= tag.attributes(ck_check_field_aria(metric, "value")) %>>
|
|
211
215
|
</div>
|
|
212
216
|
|
|
213
217
|
<div class="ck-field" data-ck-check-field="pattern">
|
|
214
|
-
<label class="ck-label" for="metric_check_pattern"
|
|
218
|
+
<label class="ck-label" for="metric_check_pattern"><%= ck_check_field_label("pattern") %></label>
|
|
215
219
|
<p class="ck-hint">A regular expression to match against.</p>
|
|
216
|
-
<input type="text" name="metric[check_config][pattern]" id="metric_check_pattern" class="ck-input" value="<%= check["pattern"] %>"
|
|
220
|
+
<input type="text" name="metric[check_config][pattern]" id="metric_check_pattern" class="ck-input" value="<%= check["pattern"] %>" <%= tag.attributes(ck_check_field_aria(metric, "pattern")) %>>
|
|
217
221
|
</div>
|
|
218
222
|
|
|
219
223
|
<div class="ck-field" data-ck-check-field="json_path">
|
|
220
|
-
<label class="ck-label" for="metric_check_json_path"
|
|
224
|
+
<label class="ck-label" for="metric_check_json_path"><%= ck_check_field_label("json_path") %></label>
|
|
221
225
|
<p class="ck-hint">The path to the value inside the response, like data.status.</p>
|
|
222
|
-
<input type="text" name="metric[check_config][json_path]" id="metric_check_json_path" class="ck-input" value="<%= check["json_path"] %>"
|
|
226
|
+
<input type="text" name="metric[check_config][json_path]" id="metric_check_json_path" class="ck-input" value="<%= check["json_path"] %>" <%= tag.attributes(ck_check_field_aria(metric, "json_path")) %>>
|
|
223
227
|
</div>
|
|
224
228
|
|
|
225
229
|
<div class="ck-field" data-ck-check-field="expected">
|
|
226
|
-
<label class="ck-label" for="metric_check_expected"
|
|
227
|
-
<p class="ck-hint">The value it should equal.</p>
|
|
228
|
-
<input type="text" name="metric[check_config][expected]" id="metric_check_expected" class="ck-input" value="<%= check["expected"] %>"
|
|
230
|
+
<label class="ck-label" for="metric_check_expected"><%= ck_check_field_label("expected") %></label>
|
|
231
|
+
<p class="ck-hint">The value it should equal. A number, true or false matches that JSON value. Put it in quotes, like "200", to match it as text.</p>
|
|
232
|
+
<input type="text" name="metric[check_config][expected]" id="metric_check_expected" class="ck-input" value="<%= ck_check_expected_input_value(check["expected"]) %>" <%= tag.attributes(ck_check_field_aria(metric, "expected")) %>>
|
|
229
233
|
</div>
|
|
230
234
|
|
|
231
235
|
<div class="ck-field" data-ck-check-field="expected_path">
|
|
232
|
-
<label class="ck-label" for="metric_check_expected_path"
|
|
236
|
+
<label class="ck-label" for="metric_check_expected_path"><%= ck_check_field_label("expected_path") %></label>
|
|
233
237
|
<p class="ck-hint">Optional. If the expected value is JSON, name the field to read from it, like data.answer. Leave blank to compare against the whole value.</p>
|
|
234
|
-
<input type="text" name="metric[check_config][expected_path]" id="metric_check_expected_path" class="ck-input" value="<%= check["expected_path"] %>"
|
|
238
|
+
<input type="text" name="metric[check_config][expected_path]" id="metric_check_expected_path" class="ck-input" value="<%= check["expected_path"] %>" <%= tag.attributes(ck_check_field_aria(metric, "expected_path")) %>>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
<div class="ck-field" data-ck-check-field="score_by">
|
|
242
|
+
<p class="ck-label" id="metric_check_score_by_label"><%= ck_check_field_label("score_by") %></p>
|
|
243
|
+
<p class="ck-hint"><%= ck_check_field_hint("score_by") %></p>
|
|
244
|
+
<%= render "completion_kit/shared/branded_select",
|
|
245
|
+
name: "metric[check_config][score_by]",
|
|
246
|
+
options: ck_check_score_by_options,
|
|
247
|
+
selected: check["score_by"] || CompletionKit::Checks::ListOverlap::DEFAULT_MEASURE,
|
|
248
|
+
labelledby: "metric_check_score_by_label",
|
|
249
|
+
invalid: ck_check_field_invalid?(metric, "score_by") %>
|
|
235
250
|
</div>
|
|
236
251
|
|
|
237
252
|
<div class="ck-field-row">
|
|
238
|
-
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
253
|
+
<% %w[min max].each do |bound| %>
|
|
254
|
+
<div class="ck-field" data-ck-check-field="<%= bound %>">
|
|
255
|
+
<label class="ck-label" for="metric_check_<%= bound %>"><span data-ck-check-label="<%= bound %>"><%= ck_check_field_label(bound, kind) %></span></label>
|
|
256
|
+
<p class="ck-hint" data-ck-check-hint="<%= bound %>"><%= ck_check_field_hint(bound, kind) %></p>
|
|
257
|
+
<input type="number" step="any" name="metric[check_config][<%= bound %>]" id="metric_check_<%= bound %>" class="ck-input" value="<%= check[bound] %>" <%= tag.attributes(ck_check_field_aria(metric, bound)) %>>
|
|
258
|
+
</div>
|
|
259
|
+
<% end %>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<div class="ck-field" data-ck-check-field="tolerance">
|
|
263
|
+
<label class="ck-label" for="metric_check_tolerance"><%= ck_check_field_label("tolerance") %></label>
|
|
264
|
+
<p class="ck-hint">How far a number can be out and still count as correct. Write a plain number for a fixed amount, or add a percent sign, like 2%, for a share of the expected number. Leave blank to require an exact match.</p>
|
|
265
|
+
<input type="text" inputmode="decimal" name="metric[check_config][tolerance]" id="metric_check_tolerance" class="ck-input" value="<%= check["tolerance"] %>" <%= tag.attributes(ck_check_field_aria(metric, "tolerance")) %>>
|
|
246
266
|
</div>
|
|
247
267
|
|
|
248
|
-
|
|
249
|
-
<
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
</label>
|
|
256
|
-
<label class="ck-checkbox" data-ck-check-field="trim">
|
|
257
|
-
<input type="checkbox" name="metric[check_config][trim]" value="true"<%= " checked" if check["trim"] %>>
|
|
258
|
-
<span>Trim whitespace</span>
|
|
259
|
-
</label>
|
|
268
|
+
<% CompletionKit::Checks::Registry::FLAG_KEYS.each do |flag| %>
|
|
269
|
+
<label class="ck-checkbox" data-ck-check-field="<%= flag %>">
|
|
270
|
+
<input type="hidden" name="metric[check_config][<%= flag %>]" value="false">
|
|
271
|
+
<input type="checkbox" name="metric[check_config][<%= flag %>]" value="true"<%= " checked" if CompletionKit::Checks::Flag.on?(check, flag) %>>
|
|
272
|
+
<span><%= ck_check_field_label(flag) %></span>
|
|
273
|
+
</label>
|
|
274
|
+
<% end %>
|
|
260
275
|
</div>
|
|
261
276
|
<% end %>
|
|
262
277
|
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
|
|
73
73
|
<% if @checklist.sample_loadable? %>
|
|
74
74
|
<div class="ck-launch__sample">
|
|
75
|
-
<p class="ck-launch__sample-copy">Just exploring? Drop in a sample dataset and prompt to poke around
|
|
75
|
+
<p class="ck-launch__sample-copy">Just exploring? Drop in a sample dataset and prompt to poke around. They're labelled <code>Sample:</code>, and you can edit or delete them whenever.</p>
|
|
76
76
|
<%= button_to onboarding_sample_data_path, method: :post, class: "ck-launch__sample-cta", form: { style: "display:inline" } do %>
|
|
77
77
|
Load sample data <span aria-hidden="true">→</span>
|
|
78
78
|
<% end %>
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
|
|
82
82
|
<div class="ck-launch__panel-footer">
|
|
83
83
|
<%= button_to dismiss_onboarding_path, method: :post, class: "ck-launch__dismiss", form: { style: "display:inline" } do %>
|
|
84
|
-
Skip setup
|
|
84
|
+
Skip setup and go to the app <span aria-hidden="true">→</span>
|
|
85
85
|
<% end %>
|
|
86
86
|
<p class="ck-launch__dismiss-hint">You can come back to this from <strong>Settings → Getting started</strong> any time.</p>
|
|
87
87
|
</div>
|
|
@@ -47,13 +47,14 @@
|
|
|
47
47
|
<% available = CompletionKit::ApiConfig.available_models(scope: :generation) %>
|
|
48
48
|
<% if available.any? %>
|
|
49
49
|
<div class="ck-select-with-action">
|
|
50
|
-
<%= form.select :llm_model, ck_grouped_models(available, prompt.llm_model), { include_blank: "Select a model" }, { class: "ck-input", id: "prompt_llm_model" } %>
|
|
50
|
+
<%= form.select :llm_model, ck_grouped_models(available, prompt.llm_model, rejected: prompt.errors[:llm_model].any?), { include_blank: "Select a model" }, { class: "ck-input", id: "prompt_llm_model", **ck_field_aria(form, :llm_model) } %>
|
|
51
51
|
<% ck_refreshing = CompletionKit::ProviderCredential.discovery_in_progress? %>
|
|
52
52
|
<button type="button" class="ck-icon-btn<%= ' ck-icon-btn--spinning' if ck_refreshing %>" title="Refresh models" <%= 'disabled' if ck_refreshing %> onclick="ckRefreshModels()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="16" height="16"><path fill-rule="evenodd" d="M13.836 2.477a.75.75 0 0 1 .75.75v3.182a.75.75 0 0 1-.75.75h-3.182a.75.75 0 0 1 0-1.5h1.37l-.84-.841a4.5 4.5 0 0 0-7.08.681.75.75 0 0 1-1.264-.808 6 6 0 0 1 9.44-.908l.84.84V3.227a.75.75 0 0 1 .75-.75Zm-.911 7.5A.75.75 0 0 1 13.199 11a6 6 0 0 1-9.44.908l-.84-.84v1.68a.75.75 0 0 1-1.5 0V9.567a.75.75 0 0 1 .75-.75h3.182a.75.75 0 0 1 0 1.5h-1.37l.84.841a4.5 4.5 0 0 0 7.08-.681.75.75 0 0 1 1.024-.274Z" clip-rule="evenodd"/></svg></button>
|
|
53
53
|
</div>
|
|
54
54
|
<% else %>
|
|
55
55
|
<p class="ck-meta-copy">No models available. <%= link_to "Add a provider", provider_credentials_path, class: "ck-link" %> or click refresh after configuring a provider.</p>
|
|
56
56
|
<% end %>
|
|
57
|
+
<%= ck_field_error(form, :llm_model) %>
|
|
57
58
|
<div hidden data-refresh-progress-carriers data-ck-refresh-url="<%= refresh_models_path %>" data-ck-statuses-url="<%= statuses_provider_credentials_path %>">
|
|
58
59
|
<% CompletionKit::ProviderCredential.find_each do |pc| %>
|
|
59
60
|
<%= turbo_stream_from "completion_kit_provider_#{pc.id}" %>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
Gen<span class="ck-info-toggle" tabindex="0">?</span><span class="ck-info-popup ck-info-popup--right">Generation models produce the responses your prompts ask for. Pick one when creating a prompt.</span>
|
|
36
36
|
</th>
|
|
37
37
|
<th scope="col" class="ck-model-table__cap">
|
|
38
|
-
Judge<span class="ck-info-toggle" tabindex="0">?</span><span class="ck-info-popup ck-info-popup--right">Judge models score generated responses against your metrics. Pick one when configuring a run. A <strong>?</strong> means we haven't confirmed this model works as a judge
|
|
38
|
+
Judge<span class="ck-info-toggle" tabindex="0">?</span><span class="ck-info-popup ck-info-popup--right">Judge models score generated responses against your metrics. Pick one when configuring a run. A <strong>?</strong> means we haven't confirmed this model works as a judge. It's still selectable, and a successful run promotes it to ✓.</span>
|
|
39
39
|
</th>
|
|
40
40
|
</tr>
|
|
41
41
|
</thead>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
<% if m.supports_judging %>
|
|
59
59
|
<span class="ck-model-table__tick" aria-label="Supports judging">✓</span>
|
|
60
60
|
<% elsif m.supports_judging.nil? %>
|
|
61
|
-
<span class="ck-model-table__unknown" aria-label="Untested as judge" title="Untested as a judge
|
|
61
|
+
<span class="ck-model-table__unknown" aria-label="Untested as judge" title="Untested as a judge but selectable. A successful run confirms it.">?</span>
|
|
62
62
|
<% else %>
|
|
63
63
|
<span class="ck-model-table__dash" aria-label="Not usable as judge">—</span>
|
|
64
64
|
<% end %>
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
<svg viewBox="0 0 24 24" width="16" height="16" stroke-width="1.75" class="ck-star <%= i < review.ai_score.to_i ? "ck-star--filled" : "ck-star--empty" %>"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
|
|
126
126
|
<% end %>
|
|
127
127
|
<% elsif review.check? && !review.passed.nil? %>
|
|
128
|
-
<%= ck_check_badge(review.passed) %>
|
|
128
|
+
<%= ck_check_badge(review.passed, review.check_score) %>
|
|
129
129
|
<% elsif review.status == "failed" %>
|
|
130
130
|
<span class="<%= ck_badge_classes(:failed) %>" title="<%= review.error_message.presence || (review.check? ? "Check failed" : "Judge failed") %>">Failed</span>
|
|
131
131
|
<% else %>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<% if has_value && response %>
|
|
3
3
|
<%= link_to run_response_path(run, response), class: "ck-cmp-score__link", title: "#{side}: open this response (#{run.name})" do %>
|
|
4
4
|
<% if kind == "check" %>
|
|
5
|
-
<%= ck_check_badge(passed) %>
|
|
5
|
+
<%= ck_check_badge(passed, local_assigns[:check_score]) %>
|
|
6
6
|
<% else %>
|
|
7
7
|
<span class="<%= ck_badge_classes(ck_score_kind(score.to_f)) %>"><%= score %></span>
|
|
8
8
|
<% end %>
|