@cavelon/cli 0.2.15 → 0.2.17

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.
@@ -0,0 +1,48 @@
1
+ # Check the connection before instance work
2
+
3
+ Loaded skills, a plugin marked installed, and a successful MCP handshake are
4
+ different from a working, authenticated instance connection. Before the first
5
+ instance operation for a selected solution folder in this session:
6
+
7
+ If this client intentionally uses CLI-only access, start with
8
+ `cavelon whoami --json` in the selected folder/target instead. Do not report
9
+ a missing MCP connection for a setup that does not use MCP. For native
10
+ Cavelon integrations, discover their `whoami` tool as you would an MCP tool.
11
+
12
+ 1. For an MCP/native-tool integration, discover the Cavelon tools in the
13
+ **actual coding-agent session**. Use the
14
+ client's tool search where tools are deferred; not seeing an eagerly listed
15
+ tool does not establish that the server is absent. Find `whoami`, rather
16
+ than guessing a client-specific tool prefix.
17
+ 2. Call that `whoami`, with the same `solution_dir` and tenant selection
18
+ the task will use. On success, briefly tell the person that Cavelon is
19
+ connected and authenticated and check the returned target and permissions.
20
+ A successful call does not grant permissions its credential lacks.
21
+ 3. If discovery or the call fails, **tell the person before proceeding**:
22
+
23
+ | Observation | What to explain and how to recover |
24
+ |---|---|
25
+ | No usable Cavelon tools after discovery, or a transport failure | Cavelon's MCP connection is unavailable in this session. In Claude Code open `/mcp`, inspect the Cavelon server and reconnect it. Run `cavelon setup --check --agents claude` in a terminal for installation/start/login diagnostics; repair what it reports, then restart or reconnect the coding agent. Other clients use their own MCP/tools panel. |
26
+ | `no_instance` | No instance is selected for this folder. Check its `cavelon.yaml`/environment; for a new setup, a person runs `cavelon login --instance <url>` in their own terminal. |
27
+ | No token, expired/revoked token or an authentication refusal | Explain that Cavelon needs login again. A person runs `cavelon login --instance <url>` themselves. Never read, request or paste their token. |
28
+ | Network, TLS, DNS or instance failure | Explain that the instance cannot be reached and pass on the error's safe repair hint. Do not describe it as a missing plugin or ask for another token without an authentication error. |
29
+ | Permission or tenant refusal | The server is reachable, but this credential cannot perform that operation or enter that tenant. Follow the returned permission/target guidance. |
30
+
31
+ **Do not silently fall back.** A working CLI is a valid alternative, but say
32
+ "Cavelon MCP is unavailable; I am using the CLI instead" and check
33
+ `cavelon whoami --json` for the selected folder/target before using it. The
34
+ same permissions and confirmation rules apply. Offline authoring and
35
+ formatting may continue; do not claim instance validation, a test run, an
36
+ import or a deployment without a successful result from that operation.
37
+
38
+ Report a warning once while its cause stays the same. Check again after a
39
+ reconnect, login, selected-target change or subsequent connection failure,
40
+ and announce recovery once. Do not probe the connection before every tool.
41
+
42
+ Claude Code's plugin startup hook shows a notice in a Cavelon workspace,
43
+ including repositories with child solutions. It checks only whether `cavelon`
44
+ or `npx` is on PATH, without executing either, fetching packages, reading
45
+ credentials or contacting the instance. Its notice says the connection is
46
+ **not yet verified**, not failed. SessionStart runs before MCP is available;
47
+ the in-session check above supplies the actual evidence. A new-solution
48
+ request in an unrelated folder gets this check when the skill is first used.
@@ -6,10 +6,17 @@ license: Apache-2.0
6
6
 
7
7
  # Testing and optimizing a Cavelon solution
8
8
 
9
- A solution is ready when its test suites pass on the instance, not when the
10
- package validates. Test against a draft solution or a test tenant
9
+ Readiness comes from the instance's published test gate and other checks;
10
+ package validation alone does not establish it. Test against a draft solution or a test tenant
11
11
  (`--env test`), never by trying things on an active solution.
12
12
 
13
+ Before instance tests, follow cavelon-loop's connection readiness check:
14
+ discover the actual session's Cavelon tools and call `whoami`. Tell the
15
+ person immediately if discovery, login or instance access fails. Announce
16
+ CLI fallback and check its `whoami` too; never claim tests ran without their
17
+ successful instance results. Loaded skills alone do not prove connectivity.
18
+ An intentionally CLI-only setup checks `cavelon whoami --json` directly.
19
+
13
20
  ## Canvas debug readiness
14
21
 
15
22
  For a newly authored ordinary chat/trigger solution, check its connected
@@ -50,8 +57,11 @@ Write cases for:
50
57
 
51
58
  A step's `evaluation_criteria` can hold, besides the judge's criteria (plain
52
59
  sentences), **assertions**: objects with a `type` and a `value`, checked in
53
- code before the judge runs. A failed assertion fails the step whatever the
54
- judge says, so use them for facts with one right answer:
60
+ code before the judge runs. A failed gating assertion fails the step whatever
61
+ the judge says, so use them for facts with one right answer. Where the schema
62
+ offers `gate: false`, a report-only assertion is evaluated and shown without
63
+ failing the step; the plain-language reference in cavelon-authoring has an
64
+ example. Check the criterion schema before using that field.
55
65
 
56
66
  | Type | Value | Passes when |
57
67
  |---|---|---|
@@ -151,7 +161,9 @@ each call under your shell's time limit). `test run --wait --timeout 5m` does
151
161
  both in one call where your client allows long commands; when its wait ends
152
162
  first, its last line is the command that resumes, with the same timeout. Exit 1 after a run
153
163
  means a case failed, even though the run itself finished; the output names the
154
- cases that did not pass and why, and `cavelon trace <run>` shows each one. Exit
164
+ cases that did not pass and why, and `cavelon trace <run>` shows each one.
165
+ This case-result exit code is separate from the instance's readiness verdict,
166
+ which can use a configured pass threshold, tag minimums and gate profile. Exit
155
167
  1 also means the run measured nothing comparable (steps not run, technical
156
168
  errors, no pass rate): it is no evidence the solution works, so do not go on to
157
169
  `activate`; find the cause and run again. Exit 5 means answers wait for a
@@ -174,9 +186,16 @@ The case's own reason (which knowledge base, which value) is in the output of
174
186
  Without `--suite`, `test run` runs every suite of the solution except those
175
187
  that never vote in readiness: a campaign's question check (tagged `engagement`
176
188
  and `rule:<id>`, made by the Admin's Engagement editor, and never part of the
177
- package). They are listed under `skipped` and never change the exit code; a
178
- failed question there is a content gap for the campaign's author.
179
- `--suite <name>` runs one when asked.
189
+ package), or a suite a person switched out of the vote. They are listed under
190
+ `skipped` and never change the exit code; a failed question there is a content
191
+ gap for the campaign's author. `--suite <name>` runs one when asked.
192
+
193
+ `--profile <key>` runs a suite's run profile (its `settings.profiles`, chosen
194
+ by tags) instead of the whole suite, for example a smoke profile before a
195
+ deploy; without `--suite`, every suite that has it, the others skipped as
196
+ `no_profile`. Where a suite's `gate.profile` names a profile, only a run of it
197
+ counts for publishing: run that one before asking for activation. `--tags`
198
+ runs the cases carrying one of the tags and never counts for publishing.
180
199
 
181
200
  ## Database query tools
182
201
 
@@ -279,8 +298,10 @@ the Admin. Then:
279
298
  says how to fix it.
280
299
 
281
300
  Unattended schedules, where offered by the instance, are enabled by a person in
282
- the Admin. A schedule or automatic run is useful regression evidence but does
283
- not replace the latest manually started whole-suite run required for activation.
301
+ the Admin. A schedule or automatic run is useful regression evidence. Before
302
+ activation/publication, run the manual selection required by the instance's
303
+ published readiness policy: its gate profile when configured, otherwise the
304
+ whole suite. A whole-suite run does not substitute for a required gate profile.
284
305
  Read the instance's current Graph Check errors and published catalog; fix the
285
306
  named node/configuration before trying activation again.
286
307
 
@@ -412,7 +433,8 @@ previews first and is the person's decision: show the preview; over MCP the
412
433
  client asks them when you confirm with its token, and from your shell they run
413
434
  the confirm command in their own terminal. Do not add a separate chat approval
414
435
  before that native dialog; an explicitly enabled YOLO mode still asks for this
415
- critical change. When every suite passes,
436
+ critical change. Review test failures and run the readiness selection required
437
+ by the instance; when its published readiness checks pass,
416
438
  `cavelon activate --harness <name or slug>` goes through the readiness gate; if the
417
439
  token may not activate, a person activates in the Admin. A solution that a
418
440
  channel or an active trigger reaches goes live for them at once, so its
@@ -422,6 +444,5 @@ whose reach or route effect is unknown. It needs no confirm only when no
422
444
  channel or active trigger reaches it and readiness explicitly says
423
445
  `takes_default_route: false`. The preview reserves no route state; the
424
446
  successful result's `took_default_route` fields report the actual effect.
425
- Show it; over MCP the
426
- client asks them when you confirm with its token, and from your shell they run
427
- the confirm command in their own terminal.
447
+ Where the preview requires a person, show it and use that single native
448
+ approval or the person's own-terminal command.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cavelon/cli",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
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",
@@ -46,7 +46,7 @@
46
46
  "@types/node": "^20.19.0",
47
47
  "esbuild": "0.28.2",
48
48
  "eslint": "^10.12.0",
49
- "typebox": "1.4.2",
49
+ "typebox": "1.4.3",
50
50
  "typescript": "~6.0.3",
51
51
  "typescript-eslint": "^8.71.0",
52
52
  "vitest": "^4.0.0",