canonic query
Resolve, compile, and execute a semantic query read-only.
| Flag | Description |
|---|---|
--metrics | Metric name(s): comma-separated and/or repeatable (--metrics a,b == --metrics a --metrics b). |
--dimensions | Dimension name(s): same comma/repeat rules as --metrics. |
--filter | A filter as field=value or field:op:value (repeatable), e.g. amount:>:100, status:!=:refunded, status:in:paid,refunded. |
--file, -f | Semantic query JSON file. |
--harness | Benchmark/CI mode: run matching assertions and exit 10 (ASSERTION_FAILED) on a mismatch. |
--metrics/--dimensions/--filter and -f are mutually exclusive; pick one way to build the query per invocation; passing both is a usage error. The flags build the identical SemanticQuery a JSON file would deserialize: {"metrics": [...], "dimensions": [...], "filters": [...], "limit": null}. Use -f once a query grows more filters or joins than is comfortable inline. Without --harness, any matching assertions are informational only and never block. With --json, the output matches the MCP query tool’s payload byte-for-byte.
If a
--dimensions name exists on more than one join-reachable source, the query fails with ambiguous and a candidates list of alias.dimension values to qualify with; see Resolving ambiguous.canonic sql
Execute a read-only SQL string on a named connection; the escape hatch for when no metric/dimension covers the question.
| Argument / Flag | Description |
|---|---|
statement | A read-only SELECT statement (positional). |
--connection, -c | Connection id (defaults to project.default_connection). |
SELECT statements are rejected with READ_ONLY_VIOLATION (exit 11).
canonic assert
Run the accuracy harness over all loaded assertions and gate on the result; this is the CI integration that turns “>90% accuracy” from aspirational into measured.
| Flag | Description |
|---|---|
--min-accuracy | Accuracy floor for the CI gate (default 1.0; every assertion must hold). Below it, exits 10 (ASSERTION_FAILED). |
contracts/assertions/ is compiled, executed read-only, and compared to its expected value within tolerance. The harness reports accuracy = passed / total and prints any diverging checks.