@cavelon/cli 0.2.15 → 0.2.16

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "format": 1,
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "entries": {
5
5
  "omp": [
6
6
  "omp-extension.mjs"
@@ -214,9 +214,10 @@ function placeholder(key, field) {
214
214
  return `# ${toYaml({ [key]: fallback }).trimEnd().split("\n").join("\n# ")}`;
215
215
  }
216
216
  const PERSONA_HEADER = [
217
- "# The persona: who the assistant is, shared by every agent of this solution (an agent's",
218
- "# system_prompt says what that agent does). A commented field is not set; remove its #",
219
- "# to set it. Write the greeting and fallback texts in the language the assistant answers in.",
217
+ "# The persona: who the assistant is. Every agent takes these rules unless its",
218
+ "# response_rules turn individual rules off or skip_persona turns them all off.",
219
+ "# An agent's system_prompt says what it does. A commented field is not set; remove",
220
+ "# its # to set it. Write greeting and fallback texts in the language the assistant answers in.",
220
221
  ];
221
222
  export function personaYaml(value, fields) {
222
223
  const set = isObject(value) ? value : {};
@@ -205,7 +205,7 @@ with `cavelon harness default`).
205
205
  Every solution has a persona in `package/persona.yaml`. It is not an agent's
206
206
  instructions:
207
207
 
208
- - **The persona says who** the assistant is, for every agent of the solution:
208
+ - **The persona says who** the assistant is; agents inherit its rules by default:
209
209
  its name (`bot_name`), its voice and its boundaries (`persona_prompt`), the
210
210
  greeting a conversation opens with and the fallback it gives when it has no
211
211
  answer, its language (`language_hint`), response style, disclaimer and the
@@ -261,6 +261,22 @@ and fill the field in to set it. A file of comments only sets nothing.
261
261
  in a solution folder, `cavelon api` sends the folder's solution, and says
262
262
  so. Prefer the package file and `apply` over those operations.
263
263
 
264
+ ## Response rules by role
265
+
266
+ Check `cavelon schema persona` and `cavelon schema agents` first: older
267
+ instances do not publish these settings. An answering agent inherits all
268
+ persona rules by leaving `response_rules` unset. A consulted agent keeps
269
+ `citations: inherit` and turns every other response rule off. A structured or
270
+ internal agent uses `skip_persona: true`, which wins over individual overrides.
271
+ Do not simplify intermediate results that another agent or node consumes.
272
+
273
+ For `persona.plain_language`, choose `off` for ordinary wording, `on_request`
274
+ for simplification when asked, `auto` for a mixed audience, `lay` for general
275
+ readers or `expert` for specialists who still need clear language. Read
276
+ [Response rules and plain language](references/response-rules.md) when
277
+ setting them: it has the consulted-agent map, override semantics and a test
278
+ suite with a style judge criterion and a report-only long-sentence assertion.
279
+
264
280
  ## A chat turn's wait for attached files
265
281
 
266
282
  A solution sets how long a chat turn waits for a file it carries that is still
@@ -0,0 +1,94 @@
1
+ # Response rules and plain language
2
+
3
+ The persona supplies the shared response rules. An agent's `response_rules`
4
+ is a sparse map: an absent key or `inherit` takes the persona's rule, and
5
+ `off` disables that rule. `{}` inherits everything. `skip_persona: true`
6
+ turns every rule off and wins over the map; use it for structured JSON and
7
+ internal pipeline agents. An agent answering a person normally leaves both
8
+ settings unset.
9
+
10
+ For a consulted agent that returns evidence to the answering agent, keep the
11
+ citations and turn the other rules off in its entry in `package/agents.yaml`:
12
+
13
+ ```yaml
14
+ response_rules:
15
+ identity: off
16
+ citations: inherit
17
+ images: off
18
+ action_buttons: off
19
+ response_style: off
20
+ language_hint: off
21
+ plain_language: off
22
+ ```
23
+
24
+ Check the current map's keys in `cavelon schema agents` before authoring it.
25
+ `response_style` can also select a preset, for example
26
+ `{preset: concise}` (`balanced`, `detailed`, `conversational` and `formal`
27
+ are the other presets). `language_hint` can override with a language code;
28
+ `plain_language` can override with one of the levels below. The map is open
29
+ in the package schema: the instance's import preview validates its rule
30
+ values. A `config_invalid` blocker names `agents[i].response_rules`; correct
31
+ that entry before confirming.
32
+
33
+ ## Choose plain language
34
+
35
+ Set the solution's level in `package/persona.yaml`, for example:
36
+
37
+ ```yaml
38
+ plain_language: on_request
39
+ ```
40
+
41
+ | Level | Choose it when |
42
+ |---|---|
43
+ | `off` | The assistant should use ordinary wording without a plain-language instruction. This is the default. |
44
+ | `on_request` | People should be able to ask for a simpler explanation; until then, wording stays ordinary. |
45
+ | `auto` | The audience varies: the instance judges the reader once from the first messages. Test both general and specialist openings. |
46
+ | `lay` | The answer is for general readers: explain specialist terms and use short, direct sentences. |
47
+ | `expert` | Specialists need precise terminology in clear, direct prose. |
48
+
49
+ The instance composes the DIN 8581 plain-language instructions, ASD-STE100
50
+ guidance for technical content and an email layout for emails. Apply this
51
+ to the agent answering the person; consulted agents and pipeline stages
52
+ feeding another node should not simplify their intermediate output.
53
+
54
+ Omitting `plain_language` or an agent's `response_rules` on import preserves
55
+ the instance's saved value. To turn plain language off explicitly, set `off`;
56
+ to reset per-agent overrides to inheritance, set `{}`. A pull from an older
57
+ instance cannot be used to reset a newer instance's saved settings.
58
+
59
+ ## Check the wording with a suite
60
+
61
+ Add a case to a suite in `tests/`. Test the intended level, and for
62
+ `on_request` also test a follow-up asking for a simpler explanation. A style
63
+ judge criterion checks clarity and meaning; sentence length alone does not
64
+ prove either. For example, for the support FAQ:
65
+
66
+ ```yaml
67
+ test_cases:
68
+ - name: Explain returns in plain language
69
+ steps:
70
+ - user_message: Please explain in simple words how I return an order.
71
+ evaluation_criteria:
72
+ - text: Uses short, direct sentences and familiar words, explains necessary terms and preserves the return policy's facts.
73
+ dimension: style
74
+ - type: must_not_contain
75
+ label: Long sentence (26 or more words; heuristic)
76
+ value: '\b[^\s.!?]+(?:\s+[^\s.!?]+){25}\b'
77
+ match: regex
78
+ scope: model_answer
79
+ gate: false
80
+ ```
81
+
82
+ The assertion is report-only (`gate: false`): it is evaluated and shown, but
83
+ its failure does not fail the step. `scope: model_answer` leaves out text the
84
+ instance appends, such as a sources list. The regex is a rough signal:
85
+ abbreviations, lists and punctuation can skew it. Review the actual answer
86
+ and the judge's reasoning in `cavelon trace <run>`.
87
+
88
+ Run `cavelon validate`, preview and confirm `cavelon apply`, then
89
+ `cavelon test run --suite <name> --wait` and read the trace. Check
90
+ `cavelon schema test_suites.test_cases.steps.evaluation_criteria` before using
91
+ `gate` and `scope`. An older instance without the response-rule fields warns
92
+ `package_field_unknown` and lists them as ignored in the apply preview; do
93
+ not claim the settings took effect there. Wait for an instance that publishes
94
+ them, or omit them for that target.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cavelon/cli",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "description": "The cavelon binary: CLI and local MCP server for building Cavelon solutions with a coding agent.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/goodguys-gmbh/cavelon-dev-kit",