cassis-cli 4.0.0__tar.gz → 4.0.2__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.
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/PKG-INFO +20 -8
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/README.md +19 -7
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/api.py +12 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/auth.py +17 -2
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/eval.py +24 -14
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/guide.py +1 -1
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/issues.py +21 -15
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/ontology.py +9 -10
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/ontology_design_guide.md +94 -21
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/pyproject.toml +1 -1
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/LICENSE +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/NOTICE +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/__init__.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/chats.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/common.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/credentials.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/dbt.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/main.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/projects.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/schema.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/schema_plan.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/status.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/tables.py +0 -0
- {cassis_cli-4.0.0 → cassis_cli-4.0.2}/cassis_cli/verify.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cassis-cli
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.2
|
|
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
|
|
@@ -36,7 +36,7 @@ Validate, test and evaluate your context from your terminal, then publish it. Th
|
|
|
36
36
|
- The CLI identifies itself to the API (`User-Agent: cassis-cli/<version>`), and successful API responses advertise the newest published version. When you are behind, commands print a one-line upgrade notice on stderr (purely informational; output and exit codes are unchanged).
|
|
37
37
|
- `cassis eval run` runs the project's eval suite against your local context files (scored in-memory, nothing is pushed to Cassis) and prints per-question results, so you can test the changes on your git branch before merging.
|
|
38
38
|
- `cassis context test` runs individual questions through the text-to-SQL agent using your local context files, so you can check that a change actually works (e.g. a new column gets picked), where `eval run` only checks for regressions on existing eval cases.
|
|
39
|
-
- `cassis eval cases add` adds a gold question/SQL case to the project's eval suite
|
|
39
|
+
- `cassis eval cases add` adds a gold question/SQL case to the project's eval suite, for an answer the project relies on: `eval run` then tells you when a change breaks it. Not every fix needs one. Cassis then runs the new case three times in the background, and `eval cases list` flags it if the attempts fail or disagree. When the fix is still in a pull request, pass `--pending-change`: the check waits for the next publication instead of failing on a context that lacks the change. `cassis context test -q "..." --save-case` does the same from a probe that succeeded on your checkout.
|
|
40
40
|
- `cassis eval run --repeat N` runs every case N times (2 to 5) on the same context and model and compares the attempts per case: which cases flipped, and whether a flip came from the agent writing different SQL or the judge ruling differently on the same SQL. `cassis eval runs show <run-id>` prints that comparison again. A repeat run measures noise: it opens no issue, is not the run shown before publishing, and exits 1 only when a case failed every attempt.
|
|
41
41
|
- Runs freeze their SQL dialect and query guidance. Runs with different source settings are kept separate when measuring noise; historical runs without those settings remain explicitly unknown.
|
|
42
42
|
- `cassis eval cases list`, `cassis eval cases show` and `cassis eval cases delete` maintain the suite. `cases list` prints one line per case, the cases asking for attention first: its id, its health over the latest results (noisy, failing, passing, or changed across configurations) with how many passed, and its question, then what to do about a case that needs it, whether it waits for the change it guards, an unstable check after creation, and gold SQL references the context lacks. `cases show <id>` prints one case in full: question, gold SQL, expected answer, comparison rules, linked issues, and how it has behaved across runs (pass rate, whether repeated runs under one configuration disagree, divergences and timings, a repeat run counted as one run with its attempts, each result's error and the comparison rule that decided it). `cases delete` prunes one that is stale or wrong (e.g. its gold SQL encodes a definition the context has since changed).
|
|
@@ -47,7 +47,7 @@ Validate, test and evaluate your context from your terminal, then publish it. Th
|
|
|
47
47
|
- DDL imports describe one schema snapshot/export file, including ordinary and materialized views; they do not replay incremental migrations. Extraction diagnostics include object names and statement locations. If extraction is incomplete, `schema plan` and `--dry-run` show the extracted inventory and exit 1; `apply`, `push`, and `--write-checkout` cannot save that result. Unknown column types are warnings when all output names are known. Plans also show object-kind, view-definition, comment, and constraint changes. `--json` preserves structured diagnostics and the server-capped inventory.
|
|
48
48
|
|
|
49
49
|
- `cassis status` shows the project's published version (number, label, git commit), whether unpublished changes await publication, the git-sync binding, a schema plan waiting to be applied, and how your local git HEAD relates to the published commit (in sync / N commits ahead / diverged). `cassis status --watch` polls until the published commit matches your local HEAD (e.g. right after merging a PR whose CI publishes the context) instead of watching the GitHub Actions tab.
|
|
50
|
-
- `cassis issues` triages the issues Cassis raised on the project (what it found wrong while answering questions: a context gap, missing data) without leaving the checkout: `issues list` (filterable by status, impact, cause and context domain, and showing each issue's domain so you can work through one domain at a time; and each issue's reach, the chat answers that used its context tables in the last 30 days), `issues show <id>` for the diagnosis, suggested action, the fix proposal and its changes, the questions
|
|
50
|
+
- `cassis issues` triages the issues Cassis raised on the project (what it found wrong while answering questions: a context gap, missing data) without leaving the checkout: `issues list` (filterable by status, impact, cause and context domain, and showing each issue's domain so you can work through one domain at a time; and each issue's reach, the chat answers that used its context tables in the last 30 days), `issues show <id>` for the diagnosis, suggested action, the fix proposal and its changes, the questions users were failing on, candidates for an eval case (with candidate SQL), its five newest occurrences (`--occurrences N` for more), its reach and evidence (removed from dbt, an AI review suggestion, user feedback, a failed eval, or the chat analysis) and the next step, `issues evidence <id> <occurrence-id>` for what the agent actually saw, and `issues resolve` / `dismiss` / `reopen` once you've acted on it (answering no at the `resolve` prompt says what to do instead). Resolving by hand starts the checks of the eval cases waiting for the issue. When the fix ships through a pull request, write the `Resolves <id>` line that `issues show` prints under `Next step` in the PR description instead: Cassis resolves the issue when the PR merges, and `issues show` then reports how it was closed and through which PR. Tables users asked for are not issues: see `cassis tables`.
|
|
51
51
|
- `cassis tables list` lists the warehouse tables users asked for that the context does not describe: one line per table, the most asked first, with a suggested domain (`--layer`, `--domain`, `--search`, `--offset` and `--limit` narrow and page it). `cassis tables dismiss <TABLE>...` records the tables the team will not add (`--undo` takes them back); a table you add leaves the list on its own once published.
|
|
52
52
|
- `cassis dbt push` sends your dbt project's artifacts (`target/manifest.json`, and `catalog.json` when present) to Cassis from the dbt project's CI, with the commit they were built from. Cassis checks the files, matches each dbt model, seed, snapshot and source to a table of the project's data source, and keeps the upload as the project's dbt baseline unless a newer one is already there. The command prints how many relations matched and how many tests they declare. Cassis compares the upload with the previous baseline and saves findings about the context the merged change puts in doubt for grouping and issue curation. The command distinguishes findings awaiting curation from published issues, printing the source observation for pending findings and links for published issues. Nothing the agent answers with changes.
|
|
53
53
|
- `cassis dbt check` runs the same comparison on a pull request, before the change merges: it uploads the PR's artifacts (after `dbt compile` on the production target), compares them with the baseline, and prints the context tables, columns, joins and metrics the change puts in doubt, with why it matters and the context change to make. Each finding also says its **reach**, how many chat answers used its context tables in the last 30 days, and within each section the most-reached objects print first, the order the Review page will show them in. Findings are advisory: nothing is filed, the baseline doesn't move, and the check exits 0 with or without findings.
|
|
@@ -107,8 +107,19 @@ copied credentials could remain usable until expiry.
|
|
|
107
107
|
|
|
108
108
|
Credential precedence is **`--api-key` → `CASSIS_API_KEY` → saved login**. An
|
|
109
109
|
explicit key that is rejected never falls back to a saved account. Logout does
|
|
110
|
-
not unset `CASSIS_API_KEY`. Keep API keys in CI secret variables as before
|
|
111
|
-
|
|
110
|
+
not unset `CASSIS_API_KEY`. Keep API keys in CI secret variables as before.
|
|
111
|
+
|
|
112
|
+
A **gateway key** (an admin-created delegation key) lets a company agent run the
|
|
113
|
+
CLI for many people with one key. The key can act as anyone in the organization,
|
|
114
|
+
so it never reaches the agent's sandbox: a proxy outside it holds the key and, on
|
|
115
|
+
each request, sets the `Authorization` header and the `X-Cassis-User-Email`
|
|
116
|
+
header naming the person the agent acts for (replacing any the sandbox sent).
|
|
117
|
+
Inside the sandbox, `CASSIS_API_URL` points at the proxy and `CASSIS_API_KEY`
|
|
118
|
+
holds a placeholder. Each command runs as the named person, with their role, and
|
|
119
|
+
`cassis auth status` shows that person's account. Changes made through a gateway
|
|
120
|
+
go through a pull request: `cassis context upload` and `cassis schema push` are
|
|
121
|
+
refused to a gateway key (`cassis schema apply`, which only writes your checkout,
|
|
122
|
+
still works).
|
|
112
123
|
|
|
113
124
|
Server selection is **`--api-url` → `CASSIS_API_URL` →
|
|
114
125
|
`https://app.getcassis.com`**. Pass the server flag to each command, or set the
|
|
@@ -199,7 +210,7 @@ carrying the same sensitivity as the queries themselves when you decide who can
|
|
|
199
210
|
# (one full agent run per question, expect ~30-90s each; repeat -q for several):
|
|
200
211
|
cassis context test --project ... -q "How much was refunded last month?" -q "Net revenue in Q1?"
|
|
201
212
|
|
|
202
|
-
#
|
|
213
|
+
# An answer the project relies on? Keep the probe as an eval case in the same command
|
|
203
214
|
# (question + the SQL it produced; a probe that failed or asked is skipped):
|
|
204
215
|
cassis context test --project ... -q "Net revenue in Q1?" --save-case
|
|
205
216
|
|
|
@@ -271,8 +282,9 @@ cassis tables dismiss CORE.PAYMENTS RAW.SESSION
|
|
|
271
282
|
# Read what the agent saw for readable occurrences (ids from `issues show`; several at once):
|
|
272
283
|
cassis issues evidence 019f0000-0000-7000-8000-0000000000e1 019f0000-0000-7000-8000-0000000000c1
|
|
273
284
|
|
|
274
|
-
# Close the loop once the fix is published (or reopen).
|
|
275
|
-
#
|
|
285
|
+
# Close the loop once the fix is published (or reopen). On a project synced with its git
|
|
286
|
+
# repository, put `Resolves <id>` in the pull request's description instead and the merge
|
|
287
|
+
# closes the issue; a project published by `cassis context upload` needs this command:
|
|
276
288
|
cassis issues resolve 019f0000-0000-7000-8000-0000000000e1 --published
|
|
277
289
|
cassis issues dismiss 019f0000-0000-7000-8000-0000000000e1 019f0000-0000-7000-8000-0000000000e2 --reason duplicate
|
|
278
290
|
cassis issues reopen 019f0000-0000-7000-8000-0000000000e1
|
|
@@ -11,7 +11,7 @@ Validate, test and evaluate your context from your terminal, then publish it. Th
|
|
|
11
11
|
- The CLI identifies itself to the API (`User-Agent: cassis-cli/<version>`), and successful API responses advertise the newest published version. When you are behind, commands print a one-line upgrade notice on stderr (purely informational; output and exit codes are unchanged).
|
|
12
12
|
- `cassis eval run` runs the project's eval suite against your local context files (scored in-memory, nothing is pushed to Cassis) and prints per-question results, so you can test the changes on your git branch before merging.
|
|
13
13
|
- `cassis context test` runs individual questions through the text-to-SQL agent using your local context files, so you can check that a change actually works (e.g. a new column gets picked), where `eval run` only checks for regressions on existing eval cases.
|
|
14
|
-
- `cassis eval cases add` adds a gold question/SQL case to the project's eval suite
|
|
14
|
+
- `cassis eval cases add` adds a gold question/SQL case to the project's eval suite, for an answer the project relies on: `eval run` then tells you when a change breaks it. Not every fix needs one. Cassis then runs the new case three times in the background, and `eval cases list` flags it if the attempts fail or disagree. When the fix is still in a pull request, pass `--pending-change`: the check waits for the next publication instead of failing on a context that lacks the change. `cassis context test -q "..." --save-case` does the same from a probe that succeeded on your checkout.
|
|
15
15
|
- `cassis eval run --repeat N` runs every case N times (2 to 5) on the same context and model and compares the attempts per case: which cases flipped, and whether a flip came from the agent writing different SQL or the judge ruling differently on the same SQL. `cassis eval runs show <run-id>` prints that comparison again. A repeat run measures noise: it opens no issue, is not the run shown before publishing, and exits 1 only when a case failed every attempt.
|
|
16
16
|
- Runs freeze their SQL dialect and query guidance. Runs with different source settings are kept separate when measuring noise; historical runs without those settings remain explicitly unknown.
|
|
17
17
|
- `cassis eval cases list`, `cassis eval cases show` and `cassis eval cases delete` maintain the suite. `cases list` prints one line per case, the cases asking for attention first: its id, its health over the latest results (noisy, failing, passing, or changed across configurations) with how many passed, and its question, then what to do about a case that needs it, whether it waits for the change it guards, an unstable check after creation, and gold SQL references the context lacks. `cases show <id>` prints one case in full: question, gold SQL, expected answer, comparison rules, linked issues, and how it has behaved across runs (pass rate, whether repeated runs under one configuration disagree, divergences and timings, a repeat run counted as one run with its attempts, each result's error and the comparison rule that decided it). `cases delete` prunes one that is stale or wrong (e.g. its gold SQL encodes a definition the context has since changed).
|
|
@@ -22,7 +22,7 @@ Validate, test and evaluate your context from your terminal, then publish it. Th
|
|
|
22
22
|
- DDL imports describe one schema snapshot/export file, including ordinary and materialized views; they do not replay incremental migrations. Extraction diagnostics include object names and statement locations. If extraction is incomplete, `schema plan` and `--dry-run` show the extracted inventory and exit 1; `apply`, `push`, and `--write-checkout` cannot save that result. Unknown column types are warnings when all output names are known. Plans also show object-kind, view-definition, comment, and constraint changes. `--json` preserves structured diagnostics and the server-capped inventory.
|
|
23
23
|
|
|
24
24
|
- `cassis status` shows the project's published version (number, label, git commit), whether unpublished changes await publication, the git-sync binding, a schema plan waiting to be applied, and how your local git HEAD relates to the published commit (in sync / N commits ahead / diverged). `cassis status --watch` polls until the published commit matches your local HEAD (e.g. right after merging a PR whose CI publishes the context) instead of watching the GitHub Actions tab.
|
|
25
|
-
- `cassis issues` triages the issues Cassis raised on the project (what it found wrong while answering questions: a context gap, missing data) without leaving the checkout: `issues list` (filterable by status, impact, cause and context domain, and showing each issue's domain so you can work through one domain at a time; and each issue's reach, the chat answers that used its context tables in the last 30 days), `issues show <id>` for the diagnosis, suggested action, the fix proposal and its changes, the questions
|
|
25
|
+
- `cassis issues` triages the issues Cassis raised on the project (what it found wrong while answering questions: a context gap, missing data) without leaving the checkout: `issues list` (filterable by status, impact, cause and context domain, and showing each issue's domain so you can work through one domain at a time; and each issue's reach, the chat answers that used its context tables in the last 30 days), `issues show <id>` for the diagnosis, suggested action, the fix proposal and its changes, the questions users were failing on, candidates for an eval case (with candidate SQL), its five newest occurrences (`--occurrences N` for more), its reach and evidence (removed from dbt, an AI review suggestion, user feedback, a failed eval, or the chat analysis) and the next step, `issues evidence <id> <occurrence-id>` for what the agent actually saw, and `issues resolve` / `dismiss` / `reopen` once you've acted on it (answering no at the `resolve` prompt says what to do instead). Resolving by hand starts the checks of the eval cases waiting for the issue. When the fix ships through a pull request, write the `Resolves <id>` line that `issues show` prints under `Next step` in the PR description instead: Cassis resolves the issue when the PR merges, and `issues show` then reports how it was closed and through which PR. Tables users asked for are not issues: see `cassis tables`.
|
|
26
26
|
- `cassis tables list` lists the warehouse tables users asked for that the context does not describe: one line per table, the most asked first, with a suggested domain (`--layer`, `--domain`, `--search`, `--offset` and `--limit` narrow and page it). `cassis tables dismiss <TABLE>...` records the tables the team will not add (`--undo` takes them back); a table you add leaves the list on its own once published.
|
|
27
27
|
- `cassis dbt push` sends your dbt project's artifacts (`target/manifest.json`, and `catalog.json` when present) to Cassis from the dbt project's CI, with the commit they were built from. Cassis checks the files, matches each dbt model, seed, snapshot and source to a table of the project's data source, and keeps the upload as the project's dbt baseline unless a newer one is already there. The command prints how many relations matched and how many tests they declare. Cassis compares the upload with the previous baseline and saves findings about the context the merged change puts in doubt for grouping and issue curation. The command distinguishes findings awaiting curation from published issues, printing the source observation for pending findings and links for published issues. Nothing the agent answers with changes.
|
|
28
28
|
- `cassis dbt check` runs the same comparison on a pull request, before the change merges: it uploads the PR's artifacts (after `dbt compile` on the production target), compares them with the baseline, and prints the context tables, columns, joins and metrics the change puts in doubt, with why it matters and the context change to make. Each finding also says its **reach**, how many chat answers used its context tables in the last 30 days, and within each section the most-reached objects print first, the order the Review page will show them in. Findings are advisory: nothing is filed, the baseline doesn't move, and the check exits 0 with or without findings.
|
|
@@ -82,8 +82,19 @@ copied credentials could remain usable until expiry.
|
|
|
82
82
|
|
|
83
83
|
Credential precedence is **`--api-key` → `CASSIS_API_KEY` → saved login**. An
|
|
84
84
|
explicit key that is rejected never falls back to a saved account. Logout does
|
|
85
|
-
not unset `CASSIS_API_KEY`. Keep API keys in CI secret variables as before
|
|
86
|
-
|
|
85
|
+
not unset `CASSIS_API_KEY`. Keep API keys in CI secret variables as before.
|
|
86
|
+
|
|
87
|
+
A **gateway key** (an admin-created delegation key) lets a company agent run the
|
|
88
|
+
CLI for many people with one key. The key can act as anyone in the organization,
|
|
89
|
+
so it never reaches the agent's sandbox: a proxy outside it holds the key and, on
|
|
90
|
+
each request, sets the `Authorization` header and the `X-Cassis-User-Email`
|
|
91
|
+
header naming the person the agent acts for (replacing any the sandbox sent).
|
|
92
|
+
Inside the sandbox, `CASSIS_API_URL` points at the proxy and `CASSIS_API_KEY`
|
|
93
|
+
holds a placeholder. Each command runs as the named person, with their role, and
|
|
94
|
+
`cassis auth status` shows that person's account. Changes made through a gateway
|
|
95
|
+
go through a pull request: `cassis context upload` and `cassis schema push` are
|
|
96
|
+
refused to a gateway key (`cassis schema apply`, which only writes your checkout,
|
|
97
|
+
still works).
|
|
87
98
|
|
|
88
99
|
Server selection is **`--api-url` → `CASSIS_API_URL` →
|
|
89
100
|
`https://app.getcassis.com`**. Pass the server flag to each command, or set the
|
|
@@ -174,7 +185,7 @@ carrying the same sensitivity as the queries themselves when you decide who can
|
|
|
174
185
|
# (one full agent run per question, expect ~30-90s each; repeat -q for several):
|
|
175
186
|
cassis context test --project ... -q "How much was refunded last month?" -q "Net revenue in Q1?"
|
|
176
187
|
|
|
177
|
-
#
|
|
188
|
+
# An answer the project relies on? Keep the probe as an eval case in the same command
|
|
178
189
|
# (question + the SQL it produced; a probe that failed or asked is skipped):
|
|
179
190
|
cassis context test --project ... -q "Net revenue in Q1?" --save-case
|
|
180
191
|
|
|
@@ -246,8 +257,9 @@ cassis tables dismiss CORE.PAYMENTS RAW.SESSION
|
|
|
246
257
|
# Read what the agent saw for readable occurrences (ids from `issues show`; several at once):
|
|
247
258
|
cassis issues evidence 019f0000-0000-7000-8000-0000000000e1 019f0000-0000-7000-8000-0000000000c1
|
|
248
259
|
|
|
249
|
-
# Close the loop once the fix is published (or reopen).
|
|
250
|
-
#
|
|
260
|
+
# Close the loop once the fix is published (or reopen). On a project synced with its git
|
|
261
|
+
# repository, put `Resolves <id>` in the pull request's description instead and the merge
|
|
262
|
+
# closes the issue; a project published by `cassis context upload` needs this command:
|
|
251
263
|
cassis issues resolve 019f0000-0000-7000-8000-0000000000e1 --published
|
|
252
264
|
cassis issues dismiss 019f0000-0000-7000-8000-0000000000e1 019f0000-0000-7000-8000-0000000000e2 --reason duplicate
|
|
253
265
|
cassis issues reopen 019f0000-0000-7000-8000-0000000000e1
|
|
@@ -32,6 +32,10 @@ USER_AGENT = f"cassis-cli/{__version__}"
|
|
|
32
32
|
# Response header the CI endpoints set to the newest cassis-cli on PyPI.
|
|
33
33
|
LATEST_VERSION_HEADER = "x-cassis-cli-latest"
|
|
34
34
|
|
|
35
|
+
# Set by the server on a 403 whose message is the whole explanation (an identity a gateway named,
|
|
36
|
+
# a write a delegation key may not make, a role that does not allow the action); valued with a code.
|
|
37
|
+
REFUSAL_HEADER = "X-Cassis-Refusal"
|
|
38
|
+
|
|
35
39
|
_upgrade_notice_shown = False
|
|
36
40
|
|
|
37
41
|
|
|
@@ -157,6 +161,10 @@ def _project_scope_error(response: httpx.Response) -> ApiError:
|
|
|
157
161
|
except ValueError:
|
|
158
162
|
detail = None
|
|
159
163
|
prefix = f"{detail} " if isinstance(detail, str) and detail else ""
|
|
164
|
+
if prefix and response.headers.get(REFUSAL_HEADER):
|
|
165
|
+
# The server says who may do this and how to fix it (a refused gateway identity, a write
|
|
166
|
+
# closed to delegation keys, an Explorer's role): a --project hint would send the agent astray.
|
|
167
|
+
return ApiError(f"{prefix}(HTTP {response.status_code}).")
|
|
160
168
|
return ApiError(
|
|
161
169
|
f"{prefix}(HTTP {response.status_code}). Check --project and that "
|
|
162
170
|
"the acting account belongs to the project's organization and has permission."
|
|
@@ -325,6 +333,8 @@ def get_projects(
|
|
|
325
333
|
|
|
326
334
|
if response.status_code == 401:
|
|
327
335
|
raise AuthError(_REJECTED_CREDENTIAL)
|
|
336
|
+
if response.status_code == 403 and response.headers.get(REFUSAL_HEADER):
|
|
337
|
+
raise _project_scope_error(response)
|
|
328
338
|
if response.status_code >= 400:
|
|
329
339
|
raise ApiError(f"Cassis API returned HTTP {response.status_code}: {response.text[:500]}")
|
|
330
340
|
result = _parse_json_response(response, url)
|
|
@@ -1557,6 +1567,8 @@ def get_chats(
|
|
|
1557
1567
|
raise AuthError(_REJECTED_CREDENTIAL)
|
|
1558
1568
|
if response.status_code == 404 and chat_id and _detail_or_text(response) == "Chat not found":
|
|
1559
1569
|
raise ChatNotFoundError("Conversation not found or not accessible to this API key.")
|
|
1570
|
+
if response.status_code == 403 and response.headers.get(REFUSAL_HEADER):
|
|
1571
|
+
raise _project_scope_error(response)
|
|
1560
1572
|
if response.status_code in (403, 404):
|
|
1561
1573
|
raise ApiError(
|
|
1562
1574
|
f"Conversation access denied (HTTP {response.status_code}). Check --project and the API key’s read access and project scope."
|
|
@@ -39,10 +39,25 @@ def account_info(server: str, credential: str) -> dict:
|
|
|
39
39
|
"Credential expired, revoked, or invalid for this server. Run cassis logout then cassis login, or check your API key."
|
|
40
40
|
)
|
|
41
41
|
if response.status_code == 403:
|
|
42
|
-
|
|
42
|
+
# A refused delegated identity explains itself (header missing or misplaced, user suspended, ...).
|
|
43
|
+
detail = _detail(response)
|
|
44
|
+
raise CredentialError(detail or "Access denied for this account.")
|
|
43
45
|
if response.status_code != 200:
|
|
44
46
|
raise CredentialError(f"Cannot inspect this account (HTTP {response.status_code}). Check the server version.")
|
|
45
|
-
|
|
47
|
+
try:
|
|
48
|
+
return response.json()
|
|
49
|
+
except ValueError as exc:
|
|
50
|
+
raise CredentialError(
|
|
51
|
+
f"Cassis at {server} returned a non-JSON response: check --api-url and any proxy in between."
|
|
52
|
+
) from exc
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _detail(response: httpx.Response) -> Optional[str]:
|
|
56
|
+
try:
|
|
57
|
+
detail = response.json().get("detail")
|
|
58
|
+
except ValueError:
|
|
59
|
+
return None
|
|
60
|
+
return detail if isinstance(detail, str) and detail else None
|
|
46
61
|
|
|
47
62
|
|
|
48
63
|
def login(
|
|
@@ -772,10 +772,12 @@ def add_case(
|
|
|
772
772
|
) -> None:
|
|
773
773
|
"""Add a gold test case to the project's eval suite.
|
|
774
774
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
775
|
+
For an answer the project relies on: the question and its correct SQL
|
|
776
|
+
become a gold case, so `cassis eval run` tells you when a change breaks
|
|
777
|
+
it. A fix does not need a case; the context design guide
|
|
778
|
+
(`cassis/AGENTS.md`, "Eval cases") says what earns one. On an executable
|
|
779
|
+
data source the gold SQL is run before the case is stored, so a case
|
|
780
|
+
that cannot execute never enters the suite.
|
|
779
781
|
The SQL comes from --gold-sql (inline) or --gold-sql-file (a file path;
|
|
780
782
|
prefer it for multi-line SQL, which shell quoting mangles inline).
|
|
781
783
|
--expect says what a correct response does: answer (the default, so
|
|
@@ -2445,11 +2447,10 @@ def _print_selection(selection: dict, *, verbose: bool = False) -> None:
|
|
|
2445
2447
|
|
|
2446
2448
|
# How many uncovered tables the selection names before counting the rest.
|
|
2447
2449
|
_UNCOVERED_SHOWN = 10
|
|
2448
|
-
|
|
2449
|
-
"
|
|
2450
|
-
'
|
|
2451
|
-
"
|
|
2452
|
-
"until the change is published."
|
|
2450
|
+
_UNCOVERED_HINT = (
|
|
2451
|
+
"No case reads this change, so the run says nothing about it: probe it with "
|
|
2452
|
+
'`cassis context test -q "..."`. A change does not need an eval case of its own; add one only for an '
|
|
2453
|
+
"answer the project relies on, when the maintainer agrees (`cassis eval cases add --pending-change`)."
|
|
2453
2454
|
)
|
|
2454
2455
|
|
|
2455
2456
|
|
|
@@ -2472,7 +2473,7 @@ def _print_uncovered(selection: dict, *, selected: int) -> None:
|
|
|
2472
2473
|
for domain in domains:
|
|
2473
2474
|
typer.secho(f" New domain with no case: {domain}", fg=typer.colors.YELLOW)
|
|
2474
2475
|
if tables or domains or (nothing_selected and not unchanged):
|
|
2475
|
-
typer.echo(" " +
|
|
2476
|
+
typer.echo(" " + _UNCOVERED_HINT)
|
|
2476
2477
|
|
|
2477
2478
|
|
|
2478
2479
|
def _wait_for_run(
|
|
@@ -2524,18 +2525,27 @@ def _wait_for_run(
|
|
|
2524
2525
|
def on_auth_error(exc: AuthError) -> None:
|
|
2525
2526
|
typer.secho(f"{exc} The run keeps going server-side.", fg=typer.colors.RED, err=True)
|
|
2526
2527
|
|
|
2528
|
+
# The run outlives the wait: name the commands that pick it up again, an agent cannot open the webapp.
|
|
2529
|
+
# They carry the project and a non-default server, so they work from any directory as printed.
|
|
2530
|
+
target = f" --project {project_id}"
|
|
2531
|
+
if api_url.rstrip("/") != DEFAULT_API_URL:
|
|
2532
|
+
target += f" --api-url {api_url}"
|
|
2533
|
+
pick_up = (
|
|
2534
|
+
f"`cassis eval runs watch {run_id}{target}` waits for it again, `cassis eval runs show {run_id}{target}` "
|
|
2535
|
+
"prints it (or says it is still in progress)."
|
|
2536
|
+
)
|
|
2537
|
+
|
|
2527
2538
|
def on_give_up(exc: ApiError, failures: int) -> None:
|
|
2528
2539
|
typer.secho(
|
|
2529
|
-
f"Polling failed {failures} times in a row ({exc}). "
|
|
2530
|
-
"
|
|
2540
|
+
f"Polling failed {failures} times in a row ({exc}). Giving up — the run keeps going server-side: "
|
|
2541
|
+
f"{pick_up}",
|
|
2531
2542
|
fg=typer.colors.RED,
|
|
2532
2543
|
err=True,
|
|
2533
2544
|
)
|
|
2534
2545
|
|
|
2535
2546
|
def on_timeout(_snapshot: "tuple[dict[str, Any], list[dict[str, Any]]]") -> None:
|
|
2536
2547
|
typer.secho(
|
|
2537
|
-
f"Timed out after {timeout:g}s waiting for run {run_id}. "
|
|
2538
|
-
"The run keeps going server-side — see the webapp's Evals page.",
|
|
2548
|
+
f"Timed out after {timeout:g}s waiting for run {run_id}. The run keeps going server-side: {pick_up}",
|
|
2539
2549
|
fg=typer.colors.YELLOW,
|
|
2540
2550
|
err=True,
|
|
2541
2551
|
)
|
|
@@ -31,7 +31,7 @@ GUIDE_FILENAME = "AGENTS.md"
|
|
|
31
31
|
# Monotonic version of the doctrine text below. Bump it whenever
|
|
32
32
|
# ontology_design_guide.md changes (a backend test enforces the pairing) — it
|
|
33
33
|
# is what lets an older writer recognize a newer guide and leave it alone.
|
|
34
|
-
DOCTRINE_VERSION =
|
|
34
|
+
DOCTRINE_VERSION = 16
|
|
35
35
|
|
|
36
36
|
# Must stay byte-identical to backend/app/services/ontology_guide.py::_BANNER —
|
|
37
37
|
# the server-side git export writes the same file, and differing banners would
|
|
@@ -224,13 +224,16 @@ def show(
|
|
|
224
224
|
help="How many of each issue's newest occurrences to print.",
|
|
225
225
|
),
|
|
226
226
|
) -> None:
|
|
227
|
-
"""Show issues: each one's diagnosis, fix proposal,
|
|
228
|
-
|
|
229
|
-
`Next step` says how the issue closes: a
|
|
230
|
-
contains `Resolves <id>`,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
227
|
+
"""Show issues: each one's diagnosis, fix proposal, failing questions, and its evidence.
|
|
228
|
+
|
|
229
|
+
`Next step` says how the issue closes: on a project synced with its git
|
|
230
|
+
repository, a pull request whose description contains `Resolves <id>`,
|
|
231
|
+
which Cassis resolves when it merges; on a project published by `cassis
|
|
232
|
+
context upload`, `cassis issues resolve` once the fix is published. On an open
|
|
233
|
+
issue, `Guard questions` are the questions users were failing on:
|
|
234
|
+
candidates for an eval case, not a list to add (`cassis context test -q
|
|
235
|
+
... --save-case --issue <id>` keeps one). Each occurrence's id feeds
|
|
236
|
+
`cassis issues evidence`, which prints
|
|
234
237
|
everything the agent saw. An issue prints its newest occurrences, five
|
|
235
238
|
unless `--occurrences` asks for more; `occurrence_count` is how many it
|
|
236
239
|
has. `--json` prints the same facts, an unset field left out. Several ids
|
|
@@ -346,7 +349,7 @@ def _print_fix_proposal(proposal: "Optional[dict[str, Any]]") -> None:
|
|
|
346
349
|
|
|
347
350
|
|
|
348
351
|
def _print_guard(guard: "Optional[dict[str, Any]]") -> None:
|
|
349
|
-
"""The open issue's failing questions
|
|
352
|
+
"""The open issue's failing questions, candidates for eval cases, and how to add one."""
|
|
350
353
|
if not guard or not guard.get("questions"):
|
|
351
354
|
return
|
|
352
355
|
typer.echo("")
|
|
@@ -525,10 +528,12 @@ def resolve(
|
|
|
525
528
|
) -> None:
|
|
526
529
|
"""Mark issues resolved: the context change that fixes them is published.
|
|
527
530
|
|
|
528
|
-
|
|
529
|
-
in the
|
|
530
|
-
|
|
531
|
-
|
|
531
|
+
On a project synced with its git repository (`cassis status` says so),
|
|
532
|
+
prefer writing `Resolves <id>` in the description of the pull request that
|
|
533
|
+
ships the fix: Cassis resolves the issue itself when the PR merges, and
|
|
534
|
+
records the PR on it. Use this command for outcomes that never go through
|
|
535
|
+
a PR, and on a project published by `cassis context upload`, where the
|
|
536
|
+
mention is not read. Exits 0 on success, 1 when an issue does not exist in
|
|
532
537
|
the project (the others are still resolved), 2 on usage errors, 3 on
|
|
533
538
|
transport/API errors.
|
|
534
539
|
"""
|
|
@@ -544,12 +549,13 @@ def resolve(
|
|
|
544
549
|
mentions = ", ".join(f"`Resolves {issue_id}`" for issue_id in ids)
|
|
545
550
|
resolves = "resolves the issue when it merges" if len(ids) == 1 else "resolves each issue when it merges"
|
|
546
551
|
typer.echo(
|
|
547
|
-
"Nothing sent. Ship the fix first: a
|
|
548
|
-
f"{mentions} {resolves}, with no command to run.",
|
|
552
|
+
"Nothing sent. Ship the fix first: on a project synced with its git repository, a pull "
|
|
553
|
+
f"request whose description contains {mentions} {resolves}, with no command to run.",
|
|
549
554
|
err=True,
|
|
550
555
|
)
|
|
551
556
|
typer.echo(
|
|
552
|
-
|
|
557
|
+
"For a fix published another way, `cassis context upload` included, run "
|
|
558
|
+
f"`cassis issues resolve {shown} --published` once it is.",
|
|
553
559
|
err=True,
|
|
554
560
|
)
|
|
555
561
|
raise typer.Exit(EXIT_USAGE)
|
|
@@ -129,10 +129,12 @@ def check(
|
|
|
129
129
|
|
|
130
130
|
warnings = result.get("warnings") or []
|
|
131
131
|
ref_warnings = [w for w in warnings if w.get("stage") == "references"]
|
|
132
|
-
|
|
133
|
-
#
|
|
134
|
-
|
|
135
|
-
eval_warnings = [
|
|
132
|
+
# An older server also sends, in the evals stage, the changes no case
|
|
133
|
+
# reads (`[eval_coverage]`); they are not unresolved cases, so they are
|
|
134
|
+
# dropped here, neither printed nor counted.
|
|
135
|
+
eval_warnings = [
|
|
136
|
+
w for w in warnings if w.get("stage") == "evals" and not str(w.get("message", "")).startswith("[eval_coverage]")
|
|
137
|
+
]
|
|
136
138
|
# Everything else is the quality audit; bucketing by "not one of the
|
|
137
139
|
# stages named here" keeps a warning stage this CLI predates visible
|
|
138
140
|
# instead of silently dropped.
|
|
@@ -163,10 +165,6 @@ def check(
|
|
|
163
165
|
if not json_output:
|
|
164
166
|
# What this change does to the eval suite first, then the advisory
|
|
165
167
|
# findings about the tree as a whole, then one line that sums it up.
|
|
166
|
-
_print_warning_group(
|
|
167
|
-
coverage_warnings,
|
|
168
|
-
f"{len(coverage_warnings)} change(s) no eval case guards:",
|
|
169
|
-
)
|
|
170
168
|
_print_warning_group(
|
|
171
169
|
eval_warnings,
|
|
172
170
|
f"{len(eval_warnings)} eval case(s) whose gold SQL does not fully resolve against this context; "
|
|
@@ -182,7 +180,6 @@ def check(
|
|
|
182
180
|
f"{len(audit_warnings)} context quality warning(s), advisory, never fail the check:",
|
|
183
181
|
)
|
|
184
182
|
counts = [
|
|
185
|
-
(len(coverage_warnings), "unguarded change"),
|
|
186
183
|
(len(eval_warnings), "unresolved eval case"),
|
|
187
184
|
(len(ref_warnings), "schema reference warning"),
|
|
188
185
|
(len(audit_warnings), "quality warning"),
|
|
@@ -647,7 +644,9 @@ def test(
|
|
|
647
644
|
if not json_output:
|
|
648
645
|
_print_test_outcome(q, outcome)
|
|
649
646
|
if not save_case and _probe_succeeded(outcome):
|
|
650
|
-
typer.echo(
|
|
647
|
+
typer.echo(
|
|
648
|
+
" --save-case keeps this probe as an eval case; add one only for an answer the project relies on."
|
|
649
|
+
)
|
|
651
650
|
if outcome.get("status") != "completed":
|
|
652
651
|
failed = True
|
|
653
652
|
if save_case:
|
|
@@ -583,9 +583,11 @@ move. Same human opt-in, front-loaded:
|
|
|
583
583
|
its owning layer immediately (§11). If filling shows the approved tree is wrong
|
|
584
584
|
— a domain overloads, or wants to split — stop and return to 2 rather than keep
|
|
585
585
|
filling into it.
|
|
586
|
-
4. **
|
|
587
|
-
|
|
588
|
-
|
|
586
|
+
4. **Probe.** Ask the questions the new domain's users will ask (`cassis
|
|
587
|
+
context test -q "…"`, §13) and read the SQL. A new domain does not need an
|
|
588
|
+
eval case of its own: `cassis eval run --changed` names the new domains and
|
|
589
|
+
changed tables no case reads, so you know what a run did not test. An answer
|
|
590
|
+
the business will rely on is a candidate for a case (§14).
|
|
589
591
|
|
|
590
592
|
---
|
|
591
593
|
|
|
@@ -621,25 +623,28 @@ context. The MCP tools named below are for an agent that has no shell.
|
|
|
621
623
|
cases the change affects, and names what no case covers. A case already
|
|
622
624
|
failing on the base, or already noisy (its verdicts differ on identical
|
|
623
625
|
inputs), is listed apart and is not a regression.
|
|
624
|
-
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
`cassis context test -q "…" --save-case`
|
|
630
|
-
(probing again updates it while it is pending; a case
|
|
631
|
-
kept as it is)
|
|
632
|
-
|
|
626
|
+
- An eval case is not a step of every change. The probe shows the fix works
|
|
627
|
+
and `cassis eval run` checks the answers already protected; most changes
|
|
628
|
+
need nothing more. When the change restores or adds an answer that earns a
|
|
629
|
+
case (§14), propose it (the question, the expected SQL, who relies on the
|
|
630
|
+
answer) and add it when the maintainer agrees: `cassis eval cases add
|
|
631
|
+
--pending-change`, or `cassis context test -q "…" --save-case` to keep a
|
|
632
|
+
successful probe (probing again updates it while it is pending; a case
|
|
633
|
+
already checked is kept as it is). The case stays pending until the change
|
|
634
|
+
is published: other runs list it but count no verdict on it, then Cassis
|
|
635
|
+
checks it. A question the agent has to ask a clarification about is no
|
|
636
|
+
case: write it with the detail it lacks and probe it again.
|
|
633
637
|
|
|
634
638
|
Merging the pull request syncs and publishes the context; nothing reaches
|
|
635
639
|
production answers until then. `cassis status` says whether the published
|
|
636
640
|
version contains your merge (`--watch` waits until it does).
|
|
637
641
|
|
|
638
642
|
To find what to fix, `cassis issues list` ranks the open issues and `cassis
|
|
639
|
-
issues show <id>...` gives each one's diagnosis, fix proposal and questions
|
|
640
|
-
|
|
641
|
-
newest verdicts, why it failed, its open issues), and
|
|
642
|
-
<id>...` the detail of the few cases worth
|
|
643
|
+
issues show <id>...` gives each one's diagnosis, fix proposal and the questions
|
|
644
|
+
users were failing on; `cassis eval cases list` is the suite's triage view
|
|
645
|
+
(each case's health, newest verdicts, why it failed, its open issues), and
|
|
646
|
+
`cassis eval cases show <id>...` the detail of the few cases worth
|
|
647
|
+
investigating.
|
|
643
648
|
|
|
644
649
|
When the change fixes Cassis issues, say so in the pull request instead of
|
|
645
650
|
closing them by hand. Write one mention per issue in the PR description:
|
|
@@ -647,11 +652,11 @@ closing them by hand. Write one mention per issue in the PR description:
|
|
|
647
652
|
`Fixes` are accepted too). `cassis issues show <id>` prints the line to copy
|
|
648
653
|
under `Next step`. Cassis resolves each mentioned issue when the pull
|
|
649
654
|
request merges and the context is published, and records the pull request on
|
|
650
|
-
the issue, so the resolution carries the change that earned it.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
issue (`--issue <id>`, or `issue_id` over MCP) makes the case wait for
|
|
654
|
-
issue's resolution, the publication that carries the fix.
|
|
655
|
+
the issue, so the resolution carries the change that earned it. The questions
|
|
656
|
+
`cassis issues show <id>` (or `get_issue` over MCP) lists for an issue are
|
|
657
|
+
candidates for a case, not a list to add. When one earns a case (§14), passing
|
|
658
|
+
the issue (`--issue <id>`, or `issue_id` over MCP) makes the case wait for
|
|
659
|
+
that issue's resolution, the publication that carries the fix.
|
|
655
660
|
|
|
656
661
|
Resolving by hand is for outcomes that never go through a pull request:
|
|
657
662
|
`cassis issues resolve <id>`, or `update_issue_status` over MCP. It needs the
|
|
@@ -663,5 +668,73 @@ reads as a gap that was never fixed.
|
|
|
663
668
|
|
|
664
669
|
---
|
|
665
670
|
|
|
671
|
+
## 14. Eval cases: what earns a place
|
|
672
|
+
|
|
673
|
+
An eval case is a question with the SQL a correct answer runs (the expected
|
|
674
|
+
SQL, `--gold-sql`), or a question a correct response declines (`--expect
|
|
675
|
+
cannot-answer`). The suite is a regression check: it tells whoever changes the
|
|
676
|
+
context that an answer someone relies on just broke. It does not measure how
|
|
677
|
+
often users get a right answer, and a pass says the answer matches the expected
|
|
678
|
+
SQL, not that the expected SQL is right.
|
|
679
|
+
|
|
680
|
+
Adding a case is a decision, not a step of every change. A fix does not need
|
|
681
|
+
one, nor does a new domain, and a longer suite is not a better one: each case
|
|
682
|
+
costs a run, a reading when it fails and an update when the business changes.
|
|
683
|
+
Propose a case when an answer earns it; the maintainer decides.
|
|
684
|
+
|
|
685
|
+
- **A case protects an answer someone would act on.** It comes from a wrong
|
|
686
|
+
answer a user got, a figure the team reports, or a rule that must not break
|
|
687
|
+
(never extract a contact list). Name that source when you propose the case: a
|
|
688
|
+
conversation, an issue, a dashboard or a report, a page of the context. If
|
|
689
|
+
nobody would do anything when it fails, it is not a case.
|
|
690
|
+
- **Two people who know the business would give the same answer from the
|
|
691
|
+
question as written.** Keep the user's words and language, and add what
|
|
692
|
+
decides the result: period, population, grain, ranking, the tie-break of a
|
|
693
|
+
top N. When the context leaves the choice open, that is a question for the
|
|
694
|
+
business and a gap to close in the context, not a case.
|
|
695
|
+
- **The question never states the rule it tests.** A case that protects the
|
|
696
|
+
definition of an active customer asks about "active customers"; it does not
|
|
697
|
+
spell out the 90 days.
|
|
698
|
+
- **A person vouches for the expected SQL.** SQL kept from your own probe shows
|
|
699
|
+
only that the agent agrees with itself. The best start is SQL the team
|
|
700
|
+
already runs, the query behind a dashboard or a report people read: ask the
|
|
701
|
+
maintainer for it, keep it as close as the context allows and say what you
|
|
702
|
+
changed. Show the expected SQL to the person who relies on the answer, or to
|
|
703
|
+
the maintainer, and say whether it was ever executed: on a data source
|
|
704
|
+
Cassis cannot query, nothing runs it for you. Add a case nobody has confirmed
|
|
705
|
+
only when the maintainer asks for it, and say so in the pull request.
|
|
706
|
+
- **The expected SQL returns what the question asks for and nothing else.**
|
|
707
|
+
What it returns is what an answer is compared with, and text values are
|
|
708
|
+
compared as written: return stored values, never a label of your own. Use
|
|
709
|
+
only tables, columns and values the context states.
|
|
710
|
+
- **Dates are computed from the current date in the SQL**, never written as
|
|
711
|
+
literals, unless the question names the date. A case must still be right next
|
|
712
|
+
month.
|
|
713
|
+
- **A question the agent must decline comes with its neighbour.** Take it from
|
|
714
|
+
a real conversation where declining was right, and pair it with the closest
|
|
715
|
+
question the context can answer, kept as an ordinary case: without the pair,
|
|
716
|
+
a context that refuses everything passes. A pass says the agent declined, not
|
|
717
|
+
that it gave the right reason, so read the reply once.
|
|
718
|
+
- **A question that needs a clarification is written with the user's reply.**
|
|
719
|
+
Fold in what the user actually answered, in their words. A reply nobody gave
|
|
720
|
+
is a business decision: ask for it, do not guess it.
|
|
721
|
+
- **Start small, and keep the suite alive.** Ten to twenty cases a person has
|
|
722
|
+
confirmed protect a project better than a hundred nobody reads, and one case
|
|
723
|
+
that exercises three rules is worth more than three cases with one each. A
|
|
724
|
+
case enters when an answer earns it, not with every fix, and cases leave
|
|
725
|
+
too: propose retiring a case that can no longer fail, that repeats another,
|
|
726
|
+
or whose answer nobody would defend. Deleting or replacing a case is the
|
|
727
|
+
maintainer's decision, and an expected SQL never changes to make a run pass.
|
|
728
|
+
- **A case added with a fix has to be able to fail.** Say whether it fails on
|
|
729
|
+
the published context. One that passes before and after the fix protects the
|
|
730
|
+
answer and proves nothing about the fix.
|
|
731
|
+
- **Read a failure before believing it.** The fault is in the context, the
|
|
732
|
+
case, the scoring or the agent, and only reading the result tells which. On a
|
|
733
|
+
data source Cassis cannot query, a model compares the two SQL statements and
|
|
734
|
+
can fail an answer a person would accept: run `cassis eval run --case <id>
|
|
735
|
+
--repeat 3` before concluding.
|
|
736
|
+
|
|
737
|
+
---
|
|
738
|
+
|
|
666
739
|
*This guide is the single canonical home for Cassis context modeling doctrine.
|
|
667
740
|
When a new pattern generalizes beyond one project, it belongs here.*
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|