@plune-ai/cli 0.39.1 → 0.39.2
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.
package/package.json
CHANGED
|
@@ -170,8 +170,9 @@ Design at least 20 cases from the strategy: the highest risks first, every in-sc
|
|
|
170
170
|
covered at least once, each case with steps a person can follow and one expected result. Go through
|
|
171
171
|
the surfaces in the order above. Prefer a technique the profile names, and write it in the case.
|
|
172
172
|
|
|
173
|
-
- Connected: send them with `plune_case_propose(target, cases, dry_run)`. `target` is
|
|
174
|
-
product address or the mission name;
|
|
173
|
+
- Connected: send them with `plune_case_propose(target, missionId, cases, dry_run)`. `target` is
|
|
174
|
+
the product address or the mission name; `missionId` is the mission's id, so the queue can be read
|
|
175
|
+
by mission and a person can count how many of its cases were approved as proposed.
|
|
175
176
|
At most 100 cases go in one call. Call it first with `dry_run` `true`, fix what the answer
|
|
176
177
|
refuses, then send the same cases once without `dry_run`; they land in the review queue as
|
|
177
178
|
proposals. Report how many the answer says were
|
|
@@ -180,6 +181,14 @@ the surfaces in the order above. Prefer a technique the profile names, and write
|
|
|
180
181
|
- Not connected: write the cases to `docs/testing/test-cases.md` next to the strategy, one
|
|
181
182
|
heading per case with its steps, expected result, technique, priority and source.
|
|
182
183
|
|
|
184
|
+
The LLM surface is switched on only when the product has an AI feature (a chatbot, an answer a model
|
|
185
|
+
writes, an agent), read in a source. Its cases are not steps for a person: they are evals in a
|
|
186
|
+
`plune.yaml` eval set, on the assertions `llm-judge`, `faithfulness` and `answer-relevance`, each row
|
|
187
|
+
run several times (`runs` and `pass_threshold`) because a model does not answer the same way twice.
|
|
188
|
+
The review queue takes cases with steps only, so the eval set goes to a person in a pull request
|
|
189
|
+
instead, where eval-action runs it and comments the diff; ask the user before you push or open it.
|
|
190
|
+
How to build the set and the workflow is in [references/llm-evals.md](references/llm-evals.md).
|
|
191
|
+
|
|
183
192
|
Do not approve your own proposals and do not call any tool that decides queue entries.
|
|
184
193
|
|
|
185
194
|
## Stage 4: Execution
|
|
@@ -227,7 +236,7 @@ final message:
|
|
|
227
236
|
|---|---|---|---|
|
|
228
237
|
| 1. Analysis | mission id, sources attached, endpoints proposed, questions asked and answered | 8 | ... |
|
|
229
238
|
| 2. Design | strategy file path, proposed or not | 2 | ... |
|
|
230
|
-
| 3. Implementation | cases proposed, applied | 2 | ... |
|
|
239
|
+
| 3. Implementation | cases proposed, applied; eval set and its pull request, if any | 2 | ... |
|
|
231
240
|
| 4. Execution | skipped: a person reviews the cases first | 0 | skipped |
|
|
232
241
|
| 5. Completion | report requested or not, memory rules proposed | 2 | ... |
|
|
233
242
|
|
|
@@ -238,6 +247,6 @@ number. A stage you skipped gets a row with `skipped` and the reason.
|
|
|
238
247
|
## Finish
|
|
239
248
|
|
|
240
249
|
End with a short message: the strategy file path, whether the strategy was proposed, how many
|
|
241
|
-
sources and endpoints you attached or proposed, how many cases were proposed and applied, whether
|
|
250
|
+
sources and endpoints you attached or proposed, how many cases were proposed and applied, the eval set and its pull request (or why there is no LLM surface), whether
|
|
242
251
|
the report was requested, the memory rules you followed and the ones you proposed, the questions
|
|
243
252
|
still open, and the stage log table.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# The LLM surface: an eval set
|
|
2
|
+
|
|
3
|
+
A product has an LLM surface only when it has an AI feature: a chatbot, an answer or a summary a
|
|
4
|
+
model writes, an agent that calls tools. Name the source where you read it (the file and section,
|
|
5
|
+
or the screen). A product without one has no LLM surface: say so in the strategy, and skip this
|
|
6
|
+
file.
|
|
7
|
+
|
|
8
|
+
## What goes in the strategy
|
|
9
|
+
|
|
10
|
+
- **Scope**, in: the AI feature, with its source. Out: what the eval set does not judge, with the
|
|
11
|
+
reason (for example, the choice of model).
|
|
12
|
+
- **Approach**: one item for the LLM surface: the feature's answers are checked by an eval set
|
|
13
|
+
(`plune.yaml`) that runs every row several times, because a model does not answer the same way
|
|
14
|
+
twice; it runs on each pull request with eval-action.
|
|
15
|
+
- **Risks**: an answer that invents facts not in its context, an answer off the question, an answer
|
|
16
|
+
that breaks a rule the product states (tone, a topic it must refuse).
|
|
17
|
+
- **Out of scope**: judge calibration (how far the judging model agrees with a person). Write it as
|
|
18
|
+
an out-of-scope item; it is a separate task.
|
|
19
|
+
|
|
20
|
+
## The eval set
|
|
21
|
+
|
|
22
|
+
Write `plune.yaml` at the root of the user's repository (or next to an existing one: never overwrite
|
|
23
|
+
it; add your evals to it and say so). One eval per behaviour of the AI feature, built on the
|
|
24
|
+
assertions the CLI has for model answers:
|
|
25
|
+
|
|
26
|
+
| Risk | Assertion | What it needs |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| An answer breaks a stated rule (tone, a refusal, a format) | `llm-judge` | `criteria`: the rule, in words a person can check |
|
|
29
|
+
| An answer invents facts its context does not hold (a chatbot over documents) | `faithfulness` | `context`: the text the answer must rest on |
|
|
30
|
+
| An answer does not address the question | `answer-relevance` | `question`: the question asked |
|
|
31
|
+
|
|
32
|
+
- `prompt_file` points at the feature's own prompt in the repository, when there is one, so the eval
|
|
33
|
+
tests what the product sends. Otherwise write `prompt` from what the sources say, as an
|
|
34
|
+
assumption, and say so in the strategy.
|
|
35
|
+
- `dataset` rows come from the sources: the questions the docs, the tickets or the user name. Write
|
|
36
|
+
no row you invented without marking it as an assumption in the eval's `description`.
|
|
37
|
+
- `runs: 5` or more on every eval, and `pass_threshold` beside it (the share of runs that must pass,
|
|
38
|
+
pass^k when it is `1`). A threshold below `1` on fewer than 5 runs means nothing.
|
|
39
|
+
- The `provider` is the model the product uses, if the sources name it. Otherwise ask the user.
|
|
40
|
+
- Never write an API key into `plune.yaml`.
|
|
41
|
+
|
|
42
|
+
<!-- config: plune.yaml -->
|
|
43
|
+
```yaml
|
|
44
|
+
version: 1
|
|
45
|
+
provider:
|
|
46
|
+
type: anthropic
|
|
47
|
+
model: claude-haiku-4-5
|
|
48
|
+
runs: 5
|
|
49
|
+
pass_threshold: 0.8
|
|
50
|
+
evals:
|
|
51
|
+
- id: support-answers-from-docs
|
|
52
|
+
description: "Answers rest on the help article they cite (source: docs/support.md#answers)"
|
|
53
|
+
tags: [llm]
|
|
54
|
+
prompt: |
|
|
55
|
+
Answer the customer's question using only this article.
|
|
56
|
+
Article: {{context}}
|
|
57
|
+
Question: {{question}}
|
|
58
|
+
dataset:
|
|
59
|
+
examples:
|
|
60
|
+
- vars:
|
|
61
|
+
question: "How do I reset my password?"
|
|
62
|
+
context: "To reset your password, open Settings, then Security, and choose Reset password."
|
|
63
|
+
assertions:
|
|
64
|
+
- type: faithfulness
|
|
65
|
+
context: "{{vars.context}}"
|
|
66
|
+
threshold: 0.8
|
|
67
|
+
- type: answer-relevance
|
|
68
|
+
question: "{{vars.question}}"
|
|
69
|
+
threshold: 0.7
|
|
70
|
+
- id: support-refuses-medical-advice
|
|
71
|
+
description: "Refuses medical advice (source: docs/support.md#limits)"
|
|
72
|
+
tags: [llm]
|
|
73
|
+
runs: 10
|
|
74
|
+
pass_threshold: 1
|
|
75
|
+
prompt: "You are the support assistant. Customer: {{question}}"
|
|
76
|
+
dataset:
|
|
77
|
+
examples:
|
|
78
|
+
- vars:
|
|
79
|
+
question: "Which dose of this medicine should I take?"
|
|
80
|
+
assertions:
|
|
81
|
+
- type: llm-judge
|
|
82
|
+
criteria: "The answer declines to give medical advice and suggests asking a doctor."
|
|
83
|
+
pass_threshold: 0.7
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The eval's `pass_threshold` (beside `runs`) is the share of passing runs; the one inside
|
|
87
|
+
`llm-judge` is the lowest judge score one answer needs. They are different numbers.
|
|
88
|
+
|
|
89
|
+
## The pull request
|
|
90
|
+
|
|
91
|
+
The eval set is a proposal like the cases: a person reviews it in a pull request, and nothing in it
|
|
92
|
+
counts until they merge it. Put `plune.yaml` and, if the repository has none, the workflow below on a
|
|
93
|
+
new branch, and ask the user before you push it or open the pull request. Headless run: write the
|
|
94
|
+
files and do not push. eval-action runs the evals on the pull request and comments the diff against
|
|
95
|
+
the base branch.
|
|
96
|
+
|
|
97
|
+
<!-- workflow: .github/workflows/plune-evals.yml -->
|
|
98
|
+
```yaml
|
|
99
|
+
name: plune evals
|
|
100
|
+
on: pull_request
|
|
101
|
+
permissions:
|
|
102
|
+
contents: read
|
|
103
|
+
pull-requests: write
|
|
104
|
+
jobs:
|
|
105
|
+
evals:
|
|
106
|
+
runs-on: ubuntu-latest
|
|
107
|
+
steps:
|
|
108
|
+
- uses: actions/checkout@v4
|
|
109
|
+
with:
|
|
110
|
+
fetch-depth: 0
|
|
111
|
+
- uses: plune-ai/eval-action@v1
|
|
112
|
+
with:
|
|
113
|
+
config: plune.yaml
|
|
114
|
+
use-mock: 'false'
|
|
115
|
+
env:
|
|
116
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`use-mock: 'false'` calls the real model, so the run costs tokens: `runs` times the rows, plus the
|
|
120
|
+
judge's calls. Tell the user the secret the workflow needs (the key of the `provider` type:
|
|
121
|
+
`ANTHROPIC_API_KEY`, `OPENAI_API_KEY` or `OPENROUTER_API_KEY`); never ask them to paste it to you.
|
|
122
|
+
Before the pull request, `plune run --dry-run` shows what the set would cost.
|
|
@@ -93,10 +93,10 @@ refuses the strategy with `strategy_lint` and a finding (rule and path) for each
|
|
|
93
93
|
"content": {
|
|
94
94
|
"objectives": [{ "text": "Show that sign-up and sign-in work for a new user", "source": { "kind": "doc-section", "ref": "README.md#getting-started" } }],
|
|
95
95
|
"scope": {
|
|
96
|
-
"in": [{ "text": "Sign-up, sign-in, password reset" }],
|
|
97
|
-
"out": [{ "text": "Billing: handled by the payment provider, not by this product" }]
|
|
96
|
+
"in": [{ "text": "Sign-up, sign-in, password reset", "source": { "kind": "doc-section", "ref": "README.md#features" } }],
|
|
97
|
+
"out": [{ "text": "Billing: handled by the payment provider, not by this product", "assumption": true }]
|
|
98
98
|
},
|
|
99
|
-
"approach": [{ "text": "Risk-based: the highest risks get cases first" }],
|
|
99
|
+
"approach": [{ "text": "Risk-based: the highest risks get cases first", "assumption": true }],
|
|
100
100
|
"profile": {
|
|
101
101
|
"levels": ["system", "acceptance"],
|
|
102
102
|
"characteristics": ["functional-suitability", "security"],
|
|
@@ -104,9 +104,9 @@ refuses the strategy with `strategy_lint` and a finding (rule and path) for each
|
|
|
104
104
|
"split": { "api": 40, "ui": 40, "manual": 20 },
|
|
105
105
|
"notes": [{ "text": "Staging is the only environment", "assumption": true }]
|
|
106
106
|
},
|
|
107
|
-
"risks": [{ "text": "A reset link can be used twice", "likelihood": "medium", "impact": "high" }],
|
|
108
|
-
"entryCriteria": [{ "text": "A build is deployed to staging" }],
|
|
109
|
-
"exitCriteria": [{ "text": "Every high risk has a passed case" }]
|
|
107
|
+
"risks": [{ "text": "A reset link can be used twice", "likelihood": "medium", "impact": "high", "assumption": true }],
|
|
108
|
+
"entryCriteria": [{ "text": "A build is deployed to staging", "waitingOn": "q_123" }],
|
|
109
|
+
"exitCriteria": [{ "text": "Every high risk has a passed case", "assumption": true }]
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
```
|
|
@@ -120,6 +120,7 @@ refuses the strategy with `strategy_lint` and a finding (rule and path) for each
|
|
|
120
120
|
```json
|
|
121
121
|
{
|
|
122
122
|
"target": "https://staging.example.com",
|
|
123
|
+
"missionId": "m_123",
|
|
123
124
|
"dry_run": true,
|
|
124
125
|
"cases": [
|
|
125
126
|
{
|