cassis-cli 3.7.0__tar.gz → 3.8.0__tar.gz

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.
Files changed (23) hide show
  1. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/PKG-INFO +3 -8
  2. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/README.md +2 -7
  3. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/api.py +1 -100
  4. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/eval.py +1 -1
  5. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/issues.py +1 -182
  6. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/pyproject.toml +1 -1
  7. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/LICENSE +0 -0
  8. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/NOTICE +0 -0
  9. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/__init__.py +0 -0
  10. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/auth.py +0 -0
  11. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/chats.py +0 -0
  12. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/common.py +0 -0
  13. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/credentials.py +0 -0
  14. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/dbt.py +0 -0
  15. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/guide.py +0 -0
  16. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/main.py +0 -0
  17. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/ontology.py +0 -0
  18. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/ontology_design_guide.md +0 -0
  19. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/projects.py +0 -0
  20. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/schema.py +0 -0
  21. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/schema_plan.py +0 -0
  22. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/status.py +0 -0
  23. {cassis_cli-3.7.0 → cassis_cli-3.8.0}/cassis_cli/verify.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cassis-cli
3
- Version: 3.7.0
3
+ Version: 3.8.0
4
4
  Summary: Validate, test and evaluate your Cassis context from your terminal, then publish it
5
5
  License: Apache-2.0
6
6
  License-File: LICENSE
@@ -248,11 +248,6 @@ cassis schema plan future.sql --dry-run --write-checkout # plan a not-yet-deplo
248
248
  # List the projects the acting account can reach (id, name, published version, dialect):
249
249
  cassis projects list
250
250
 
251
- # Refresh the issues from the conversations nobody has analyzed yet (the same pass as the
252
- # webapp's "Analyze conversations" button; waits for the result, --no-wait returns at once,
253
- # and Ctrl-C cancels the run server-side and exits 130):
254
- cassis issues analyze
255
-
256
251
  # Triage the issues Cassis raised (filter by --status/--impact/--cause; --json for raw output):
257
252
  cassis issues list # open issues by default
258
253
  cassis issues list --status all # include resolved and dismissed issues
@@ -345,9 +340,9 @@ A domain without `owners` inherits its nearest parent's, and the root domain's (
345
340
  | Code | Meaning |
346
341
  | ---- | ------------------------------------------------------------------------------ |
347
342
  | 0 | Context is valid (check) / pulled (pull) / uploaded (upload) / eval run completed with no regression: every case passed, already failed on the base run, or is pending the change it guards (eval run) / every probe completed (test, whatever its outcome; probes are informational, don't gate CI on them) / dbt upload accepted, or kept behind a newer one (dbt push) / dbt upload checked, with or without findings (dbt check) |
348
- | 1 | Validation failed (check: findings printed; upload: nothing imported; eval run: invalid tree or a regression, a case whose answer fails now and passed on the base run; test: invalid tree or a probe failed; add-case: duplicate question or gold SQL that does not run; delete-case, history: no such case in the project; show: no such run in the project; issues: no such issue or occurrence in the project; issues analyze: failed or cancelled analysis run; schema plan/apply: extraction is incomplete, the plan failed (unparseable or truncated DDL), is stale or expired, the apply failed, or the project won't accept it (a plan is being applied, a DDL was given for a warehouse-connected project, or --warehouse for a DDL-only one); dbt push: the upload was refused or rejected (a file is invalid, too large or from an unsupported dbt version, or no relation matches the project's data source); dbt check: the upload was refused or rejected (an invalid file, or no baseline yet: run `cassis dbt push` first)) |
343
+ | 1 | Validation failed (check: findings printed; upload: nothing imported; eval run: invalid tree or a regression, a case whose answer fails now and passed on the base run; test: invalid tree or a probe failed; add-case: duplicate question or gold SQL that does not run; delete-case, history: no such case in the project; show: no such run in the project; issues: no such issue or occurrence in the project; schema plan/apply: extraction is incomplete, the plan failed (unparseable or truncated DDL), is stale or expired, the apply failed, or the project won't accept it (a plan is being applied, a DDL was given for a warehouse-connected project, or --warehouse for a DDL-only one); dbt push: the upload was refused or rejected (a file is invalid, too large or from an unsupported dbt version, or no relation matches the project's data source); dbt check: the upload was refused or rejected (an invalid file, or no baseline yet: run `cassis dbt push` first)) |
349
344
  | 2 | Usage error (missing credentials or project, no context directory, unreadable file, tree over the size limits, `eval run --branch` naming a context branch the project does not have, `eval run --base` naming a published version the project does not have or given without `--changed`, `eval run --dry-run --case` naming no current case, `upload` or `schema push` outside a git checkout or with uncommitted context files, `dbt push` or `dbt check` without a manifest.json, outside a git checkout without `--commit`, or with an artifact over the size limits) |
350
- | 3 | Transport/API error (unreachable API, invalid key, inaccessible project, unexpected response, a server too old for the command or option), another eval run or issue analysis already active, out of credits, `--timeout` reached, or Cassis failed on its side while processing a dbt upload (`dbt push` / `dbt check`: nothing to fix in the upload, push again) |
345
+ | 3 | Transport/API error (unreachable API, invalid key, inaccessible project, unexpected response, a server too old for the command or option), another eval run already active, out of credits, `--timeout` reached, or Cassis failed on its side while processing a dbt upload (`dbt push` / `dbt check`: nothing to fix in the upload, push again) |
351
346
  | 4 | `eval run` reached no verdict: the run failed or was cancelled on Cassis's side, or the cases that did not pass errored instead of failing (agent, judge or warehouse errors, a broken gold SQL). Nothing says the context regressed: rerun, or read the errors |
352
347
 
353
348
  Commands that send the local tree (`check`, `fmt`, `upload`, `eval run`, `test`) accept up to
@@ -223,11 +223,6 @@ cassis schema plan future.sql --dry-run --write-checkout # plan a not-yet-deplo
223
223
  # List the projects the acting account can reach (id, name, published version, dialect):
224
224
  cassis projects list
225
225
 
226
- # Refresh the issues from the conversations nobody has analyzed yet (the same pass as the
227
- # webapp's "Analyze conversations" button; waits for the result, --no-wait returns at once,
228
- # and Ctrl-C cancels the run server-side and exits 130):
229
- cassis issues analyze
230
-
231
226
  # Triage the issues Cassis raised (filter by --status/--impact/--cause; --json for raw output):
232
227
  cassis issues list # open issues by default
233
228
  cassis issues list --status all # include resolved and dismissed issues
@@ -320,9 +315,9 @@ A domain without `owners` inherits its nearest parent's, and the root domain's (
320
315
  | Code | Meaning |
321
316
  | ---- | ------------------------------------------------------------------------------ |
322
317
  | 0 | Context is valid (check) / pulled (pull) / uploaded (upload) / eval run completed with no regression: every case passed, already failed on the base run, or is pending the change it guards (eval run) / every probe completed (test, whatever its outcome; probes are informational, don't gate CI on them) / dbt upload accepted, or kept behind a newer one (dbt push) / dbt upload checked, with or without findings (dbt check) |
323
- | 1 | Validation failed (check: findings printed; upload: nothing imported; eval run: invalid tree or a regression, a case whose answer fails now and passed on the base run; test: invalid tree or a probe failed; add-case: duplicate question or gold SQL that does not run; delete-case, history: no such case in the project; show: no such run in the project; issues: no such issue or occurrence in the project; issues analyze: failed or cancelled analysis run; schema plan/apply: extraction is incomplete, the plan failed (unparseable or truncated DDL), is stale or expired, the apply failed, or the project won't accept it (a plan is being applied, a DDL was given for a warehouse-connected project, or --warehouse for a DDL-only one); dbt push: the upload was refused or rejected (a file is invalid, too large or from an unsupported dbt version, or no relation matches the project's data source); dbt check: the upload was refused or rejected (an invalid file, or no baseline yet: run `cassis dbt push` first)) |
318
+ | 1 | Validation failed (check: findings printed; upload: nothing imported; eval run: invalid tree or a regression, a case whose answer fails now and passed on the base run; test: invalid tree or a probe failed; add-case: duplicate question or gold SQL that does not run; delete-case, history: no such case in the project; show: no such run in the project; issues: no such issue or occurrence in the project; schema plan/apply: extraction is incomplete, the plan failed (unparseable or truncated DDL), is stale or expired, the apply failed, or the project won't accept it (a plan is being applied, a DDL was given for a warehouse-connected project, or --warehouse for a DDL-only one); dbt push: the upload was refused or rejected (a file is invalid, too large or from an unsupported dbt version, or no relation matches the project's data source); dbt check: the upload was refused or rejected (an invalid file, or no baseline yet: run `cassis dbt push` first)) |
324
319
  | 2 | Usage error (missing credentials or project, no context directory, unreadable file, tree over the size limits, `eval run --branch` naming a context branch the project does not have, `eval run --base` naming a published version the project does not have or given without `--changed`, `eval run --dry-run --case` naming no current case, `upload` or `schema push` outside a git checkout or with uncommitted context files, `dbt push` or `dbt check` without a manifest.json, outside a git checkout without `--commit`, or with an artifact over the size limits) |
325
- | 3 | Transport/API error (unreachable API, invalid key, inaccessible project, unexpected response, a server too old for the command or option), another eval run or issue analysis already active, out of credits, `--timeout` reached, or Cassis failed on its side while processing a dbt upload (`dbt push` / `dbt check`: nothing to fix in the upload, push again) |
320
+ | 3 | Transport/API error (unreachable API, invalid key, inaccessible project, unexpected response, a server too old for the command or option), another eval run already active, out of credits, `--timeout` reached, or Cassis failed on its side while processing a dbt upload (`dbt push` / `dbt check`: nothing to fix in the upload, push again) |
326
321
  | 4 | `eval run` reached no verdict: the run failed or was cancelled on Cassis's side, or the cases that did not pass errored instead of failing (agent, judge or warehouse errors, a broken gold SQL). Nothing says the context regressed: rerun, or read the errors |
327
322
 
328
323
  Commands that send the local tree (`check`, `fmt`, `upload`, `eval run`, `test`) accept up to
@@ -1162,7 +1162,7 @@ def post_eval_run_cancel(
1162
1162
 
1163
1163
 
1164
1164
  class IssueNotFoundError(ApiError):
1165
- """The project has no issue, occurrence or issue-analysis run with this id.
1165
+ """The project has no issue or occurrence with this id.
1166
1166
 
1167
1167
  Raised off the server's exact 404 detail, so it separates "this id doesn't
1168
1168
  exist" from "this project isn't in scope for your key", which 404s too.
@@ -1406,105 +1406,6 @@ def post_ontology_test(
1406
1406
  return result
1407
1407
 
1408
1408
 
1409
- class IssueAnalysisActiveError(ApiError):
1410
- """An issue-analysis run is already in flight for the project (HTTP 409)."""
1411
-
1412
-
1413
- class NothingToAnalyzeError(ApiError):
1414
- """Every conversation on the project has already been analyzed (HTTP 422)."""
1415
-
1416
-
1417
- _ANALYSIS_RUN_KEYS = ("id", "status", "total_chats", "chats_analyzed", "occurrences_created", "issues_touched")
1418
-
1419
-
1420
- def _check_analysis_run_shape(result: Any, url: str) -> dict[str, Any]:
1421
- if not isinstance(result, dict) or not all(key in result for key in _ANALYSIS_RUN_KEYS):
1422
- raise ApiError(f"Unexpected response shape from the Cassis API at {url}.")
1423
- return result
1424
-
1425
-
1426
- def post_issue_analysis_start(
1427
- *,
1428
- api_url: str,
1429
- api_key: str,
1430
- project_id: str,
1431
- transport: Optional[httpx.BaseTransport] = None,
1432
- ) -> dict[str, Any]:
1433
- """POST /api/ci/projects/{project_id}/issue-analysis/runs and return the run record."""
1434
- url = api_url.rstrip("/") + f"/api/ci/projects/{project_id}/issue-analysis/runs"
1435
- try:
1436
- with _client(transport=transport) as client:
1437
- response = client.post(url, headers={"Authorization": authorization(api_url, api_key)})
1438
- except httpx.HTTPError as exc:
1439
- raise ApiError(f"Could not reach the Cassis API at {url}: {exc}") from exc
1440
-
1441
- if response.status_code == 401:
1442
- raise AuthError(_REJECTED_CREDENTIAL)
1443
- if response.status_code == 409:
1444
- raise IssueAnalysisActiveError(
1445
- "An issue analysis is already running for this project — wait for it to finish, "
1446
- "or cancel it from the webapp's Issues page."
1447
- )
1448
- if response.status_code == 422 and "analyz" in response.text.lower():
1449
- # The route takes no body, so its 422 is the server's "nothing to
1450
- # analyze" answer; any other 422 falls through to the generic error.
1451
- raise NothingToAnalyzeError("Nothing to analyze: every conversation on this project has already been analyzed.")
1452
- if response.status_code in (403, 404):
1453
- raise _project_scope_error(response)
1454
- if response.status_code >= 400:
1455
- raise ApiError(f"Cassis API returned HTTP {response.status_code}: {response.text[:500]}")
1456
- return _check_analysis_run_shape(_parse_json_response(response, url), url)
1457
-
1458
-
1459
- def get_issue_analysis_run(
1460
- *,
1461
- api_url: str,
1462
- api_key: str,
1463
- project_id: str,
1464
- run_id: str,
1465
- transport: Optional[httpx.BaseTransport] = None,
1466
- ) -> dict[str, Any]:
1467
- """GET /api/ci/projects/{project_id}/issue-analysis/runs/{run_id} and return the run record."""
1468
- url = api_url.rstrip("/") + f"/api/ci/projects/{project_id}/issue-analysis/runs/{run_id}"
1469
- return _check_analysis_run_shape(
1470
- _get_issue_json(
1471
- url,
1472
- api_key,
1473
- transport,
1474
- not_found_message=f"No issue-analysis run {run_id} in this project.",
1475
- not_found_detail="Issue-analysis run not found",
1476
- ),
1477
- url,
1478
- )
1479
-
1480
-
1481
- def post_issue_analysis_cancel(
1482
- *,
1483
- api_url: str,
1484
- api_key: str,
1485
- project_id: str,
1486
- run_id: str,
1487
- transport: Optional[httpx.BaseTransport] = None,
1488
- ) -> None:
1489
- """POST /api/ci/projects/{project_id}/issue-analysis/runs/{run_id}/cancel."""
1490
- url = api_url.rstrip("/") + f"/api/ci/projects/{project_id}/issue-analysis/runs/{run_id}/cancel"
1491
- try:
1492
- with _client(transport=transport) as client:
1493
- response = client.post(url, headers={"Authorization": authorization(api_url, api_key)})
1494
- except httpx.HTTPError as exc:
1495
- raise ApiError(f"Could not reach the Cassis API at {url}: {exc}") from exc
1496
- if response.status_code == 401:
1497
- raise AuthError(_REJECTED_CREDENTIAL)
1498
- # Same exact-match contract as `get_issue_analysis_run`: a missing run is
1499
- # not a project-scope problem.
1500
- if response.status_code == 404 and _detail_or_text(response) == "Issue-analysis run not found":
1501
- raise IssueNotFoundError(f"No issue-analysis run {run_id} in this project.")
1502
- if response.status_code in (403, 404):
1503
- raise _project_scope_error(response)
1504
- if response.status_code >= 400:
1505
- raise ApiError(f"Cassis API returned HTTP {response.status_code}: {response.text[:500]}")
1506
-
1507
-
1508
1409
  class DbtUploadRejectedError(ApiError):
1509
1410
  """The server refused the dbt upload request itself (400, 413, 422).
1510
1411
 
@@ -2053,7 +2053,7 @@ def run(
2053
2053
  json_output=json_output,
2054
2054
  )
2055
2055
  except KeyboardInterrupt:
2056
- # To stderr under --json, for the same reason as `issues analyze`.
2056
+ # To stderr under --json, so stdout stays the JSON document.
2057
2057
  typer.echo("", err=json_output)
2058
2058
  typer.echo("Interrupted — cancelling the run...", err=json_output)
2059
2059
  try:
@@ -3,8 +3,7 @@
3
3
  Issues are what the product found wrong while answering questions (a context
4
4
  gap, missing data). Listing, reading the evidence behind an occurrence, and
5
5
  resolving or dismissing them from a checkout keeps the fix loop next to the
6
- context files instead of in the webapp; `analyze` refreshes them from the
7
- conversations that arrived since the last pass, without waiting for the nightly one.
6
+ context files instead of in the webapp.
8
7
  """
9
8
 
10
9
  from __future__ import annotations
@@ -20,26 +19,18 @@ from cassis_cli.api import (
20
19
  ApiError,
21
20
  AuthError,
22
21
  IssueNotFoundError,
23
- NothingToAnalyzeError,
24
22
  get_issue,
25
- get_issue_analysis_run,
26
23
  get_issue_evidence,
27
24
  get_issues,
28
- post_issue_analysis_cancel,
29
- post_issue_analysis_start,
30
25
  post_issue_status,
31
26
  )
32
27
  from cassis_cli.common import (
33
28
  DEFAULT_BASE_PATH,
34
- EXIT_INTERRUPTED,
35
29
  EXIT_OK,
36
- EXIT_TRANSPORT,
37
30
  EXIT_USAGE,
38
31
  EXIT_VALIDATION_FAILED,
39
32
  api_failure,
40
- echo_poll_retry,
41
33
  one_line,
42
- poll_until,
43
34
  require_api_key,
44
35
  resolve_project_id,
45
36
  )
@@ -493,175 +484,3 @@ def reopen(
493
484
  api_url=api_url,
494
485
  base_path=base_path,
495
486
  )
496
-
497
-
498
- _TERMINAL_ANALYSIS_STATUSES = frozenset({"completed", "failed", "cancelled"})
499
-
500
-
501
- @app.command()
502
- def analyze(
503
- path: Path = _PATH_OPTION,
504
- project_id: Optional[str] = _PROJECT_OPTION,
505
- api_key: Optional[str] = _API_KEY_OPTION,
506
- api_url: str = _API_URL_OPTION,
507
- base_path: str = _BASE_PATH_OPTION,
508
- wait: bool = typer.Option(
509
- True,
510
- "--wait/--no-wait",
511
- help="Wait for the analysis to finish and print its summary (default), or just print the run id.",
512
- ),
513
- poll_interval: float = typer.Option(5.0, "--poll-interval", help="Seconds between status polls."),
514
- timeout: float = typer.Option(1800.0, "--timeout", help="Give up waiting after this many seconds."),
515
- json_output: bool = typer.Option(False, "--json", help="Print the final run record as raw JSON."),
516
- ) -> None:
517
- """Analyze the conversations nobody has analyzed yet, turning what went wrong into issues.
518
-
519
- The same pass as the webapp's "Analyze conversations" button — it runs on
520
- Cassis's workers, so a Ctrl-C or a lost connection never kills it — started
521
- on demand instead of waiting for the nightly one. When every conversation is
522
- already analyzed the command is a no-op and exits 0, so a job re-running it
523
- on a quiet project stays green. Exits 0 when the run completes, 1 when it
524
- fails or is cancelled, 2 on usage errors, 3 on transport errors, when a run
525
- is already in flight, or on --timeout (the run keeps going server-side).
526
- Ctrl-C cancels the run and exits 130.
527
- """
528
- api_key = require_api_key(api_key, api_url)
529
- project_id = resolve_project_id(project_id, path / Path(base_path), quiet=json_output)
530
-
531
- try:
532
- run = post_issue_analysis_start(api_url=api_url, api_key=api_key, project_id=project_id)
533
- except NothingToAnalyzeError as exc:
534
- if json_output:
535
- typer.echo(json.dumps({"run": None, "message": str(exc)}, indent=2))
536
- else:
537
- typer.echo(str(exc))
538
- raise typer.Exit(EXIT_OK) from exc
539
- except (AuthError, ApiError) as exc: # covers IssueAnalysisActiveError too
540
- raise api_failure(exc) from exc
541
-
542
- run_id = str(run["id"])
543
- total = int(run.get("total_chats") or 0)
544
-
545
- if not wait:
546
- if json_output:
547
- typer.echo(json.dumps({"run": run}, indent=2))
548
- else:
549
- typer.echo(f"Analysis run {run_id} started: {total} conversation(s) to analyze.")
550
- typer.echo("It keeps going server-side; the results land on the webapp's Issues page.")
551
- raise typer.Exit(EXIT_OK)
552
-
553
- if not json_output:
554
- typer.echo(f"Analysis run {run_id} started: {total} conversation(s) to analyze.")
555
-
556
- try:
557
- final_run = _wait_for_analysis(
558
- api_url=api_url,
559
- api_key=api_key,
560
- project_id=project_id,
561
- run_id=run_id,
562
- poll_interval=poll_interval,
563
- timeout=timeout,
564
- quiet=json_output,
565
- )
566
- except KeyboardInterrupt:
567
- # To stderr under --json: stdout is the machine's, and these lines would
568
- # land in front of the JSON document a caller is parsing.
569
- typer.echo("", err=json_output)
570
- typer.echo("Interrupted — cancelling the analysis...", err=json_output)
571
- try:
572
- post_issue_analysis_cancel(api_url=api_url, api_key=api_key, project_id=project_id, run_id=run_id)
573
- typer.echo("Analysis cancelled. Conversations analyzed so far keep their occurrences.", err=json_output)
574
- except ApiError as exc:
575
- typer.secho(f"Could not cancel the analysis: {exc}", fg=typer.colors.RED, err=True)
576
- raise typer.Exit(EXIT_INTERRUPTED)
577
-
578
- if json_output:
579
- typer.echo(json.dumps({"run": final_run}, indent=2))
580
- else:
581
- _print_analysis_outcome(final_run)
582
-
583
- if final_run.get("status") == "completed":
584
- raise typer.Exit(EXIT_OK)
585
- raise typer.Exit(EXIT_VALIDATION_FAILED)
586
-
587
-
588
- def _wait_for_analysis(
589
- *,
590
- api_url: str,
591
- api_key: str,
592
- project_id: str,
593
- run_id: str,
594
- poll_interval: float,
595
- timeout: float,
596
- quiet: bool,
597
- ) -> dict[str, Any]:
598
- """Poll the run until terminal and return its final record.
599
-
600
- Exits 3 directly on timeout, on an auth failure (fail fast — retrying a
601
- revoked key can't succeed), or after several consecutive poll failures.
602
- The server-side run keeps going in all three cases.
603
- """
604
- last_line = {"text": ""}
605
-
606
- def fetch() -> "dict[str, Any]":
607
- try:
608
- return get_issue_analysis_run(api_url=api_url, api_key=api_key, project_id=project_id, run_id=run_id)
609
- except IssueNotFoundError as exc:
610
- # The run is gone (purged): nothing to keep polling for.
611
- raise _not_found_failure(exc) from exc
612
-
613
- def on_progress(run: "dict[str, Any]") -> None:
614
- line = (
615
- f"{run.get('chats_analyzed', 0)}/{run.get('total_chats', 0)} conversations analyzed — "
616
- f"{run.get('occurrences_created', 0)} occurrence(s) found"
617
- )
618
- if not quiet and line != last_line["text"]:
619
- typer.echo(line)
620
- last_line["text"] = line
621
-
622
- def on_auth_error(exc: AuthError) -> None:
623
- typer.secho(f"{exc} The analysis keeps going server-side.", fg=typer.colors.RED, err=True)
624
-
625
- def on_give_up(exc: ApiError, failures: int) -> None:
626
- typer.secho(
627
- f"Polling failed {failures} times in a row ({exc}). "
628
- "Giving up — the analysis keeps going server-side; see the webapp's Issues page.",
629
- fg=typer.colors.RED,
630
- err=True,
631
- )
632
-
633
- def on_timeout(_run: "dict[str, Any]") -> None:
634
- typer.secho(
635
- f"Timed out after {timeout:g}s waiting for analysis run {run_id}. "
636
- "The analysis keeps going server-side — see the webapp's Issues page.",
637
- fg=typer.colors.YELLOW,
638
- err=True,
639
- )
640
-
641
- return poll_until(
642
- fetch,
643
- lambda run: run.get("status") in _TERMINAL_ANALYSIS_STATUSES,
644
- poll_interval=poll_interval,
645
- timeout=timeout,
646
- on_timeout=on_timeout,
647
- on_progress=on_progress,
648
- on_auth_error=on_auth_error,
649
- on_retry=echo_poll_retry,
650
- on_give_up=on_give_up,
651
- )
652
-
653
-
654
- def _print_analysis_outcome(run: dict[str, Any]) -> None:
655
- status = run.get("status")
656
- if status == "completed":
657
- typer.echo("")
658
- typer.echo(
659
- f"Analysis complete: {run.get('chats_analyzed', 0)} conversation(s) analyzed, "
660
- f"{run.get('occurrences_created', 0)} occurrence(s) found, "
661
- f"{run.get('issues_touched', 0)} issue(s) created or updated."
662
- )
663
- typer.echo("Review them with `cassis issues list`.")
664
- elif status == "cancelled":
665
- typer.secho("Analysis cancelled before it finished.", fg=typer.colors.YELLOW, err=True)
666
- else:
667
- typer.secho(f"Analysis failed: {run.get('error') or 'unknown error'}", fg=typer.colors.RED, err=True)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "cassis-cli"
3
- version = "3.7.0"
3
+ version = "3.8.0"
4
4
  description = "Validate, test and evaluate your Cassis context from your terminal, then publish it"
5
5
  readme = "README.md"
6
6
  license = { text = "Apache-2.0" }
File without changes
File without changes
File without changes