You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -147,7 +147,7 @@ Pass a JSON config with `--config <path>` (a local path or url). The schema:
147
147
|`sink`| Root directory for Standalone JSONL recordings. Proxy rows land under `<sink.dir>/<gateway_id>/proxy/`; OTLP rows land under `<sink.dir>/<gateway_id>/<signal>/`. Required when `otel` or `proxy` is set in Standalone mode. Accepted but unused in Gateway mode. |
148
148
|`central_server`| Gateway-mode Central server URL, identity settings, config poll interval, and optional `outbox_dir`. Gateway rows are first fsynced to this durable local outbox, then shipped to Central ingest. |
149
149
|`upload`| Optional. Enables the daily S3 parquet drain. See [S3 upload](#s3-upload). |
150
-
|`query`| Optional. Configures the local `ctvs query`Parquet cache. `query.parquet.enabled` defaults to `true`; `query.parquet.dir` defaults to `<recording-root>/.collectivus-query/parquet`. |
150
+
|`query`| Optional. Configures the local `ctvs query`query cache. `query.cache.enabled` defaults to `true`; `query.cache.dir` defaults to `<recording-root>/.collectivus-query/cache`. |
151
151
152
152
Add an `upload` block to drain JSONL to S3 once a day:
153
153
@@ -526,7 +526,7 @@ and [provider fields](https://developers.openai.com/codex/config-reference#model
526
526
## Local query
527
527
528
528
`ctvs query` reads local recordings only. It never contacts S3 and it does not
529
-
auto-refresh its Parquet cache unless you ask for that explicitly.
529
+
auto-refresh its query cache unless you ask for that explicitly.
Rows live in local Iceberg tables under the same partition directory. Refreshes
546
+
append from the last recorded JSONL cursor when possible; truncation, rewrite,
547
+
or schema drift starts a new source epoch.
546
548
547
549
Freshness is treated asymmetrically (since v1.7.0):
548
550
549
551
| Partition state | Behavior |
550
552
| --- | --- |
551
553
|`fresh`| Query proceeds silently. |
552
-
|`stale` (Parquet exists, may be outdated) | Query proceeds; a `warning: querying stale data; …` line is written to stderr. Stdout is unchanged. |
553
-
|`missing` (no Parquet at all) | Query exits with the exact file-targeted `ctvs query refresh …` command to run when the source file is known. |
554
+
|`stale` (cache exists, may be outdated) | Query proceeds; a `warning: querying stale data; …` line is written to stderr. Stdout is unchanged. |
555
+
|`missing` (no cache table/cursor) | Query exits with the exact file-targeted `ctvs query refresh …` command to run when the source file is known. |
554
556
555
557
Use `ctvs query refresh <file.jsonl>` to refresh selected source files, or
556
558
`ctvs query refresh --all [dataset]` when you explicitly want the broader
@@ -565,7 +567,7 @@ outdated data).
565
567
> unchanged; the new warning is written only to stderr. `missing`
566
568
> partitions still error.
567
569
568
-
Logical datasets are `logs`, `traces`, `metrics`, `proxy_messages`, and `gascity_messages`. `ctvs collect <file.jsonl> --name <name>` registers an external JSONL file as a dynamic table; names are normalized for SQL, so `--name random-log` becomes table `random_log`. Collection tables include `_ctvs_source_path`, `_ctvs_line_number`, `_ctvs_raw`, and inferred top-level JSON fields. `ctvs query schema <dataset>` prints the schema, and `ctvs query catalog` shows which datasets have source and cached rows.
570
+
Logical datasets are `logs`, `traces`, `metrics`, `proxy_messages`, and `gascity_messages`. `ctvs collect <file.jsonl> --name <name>` registers an external JSONL file as a dynamic table; `ctvs collect --glob '<pattern>' --name <name>` backs one table with many source files. Names are normalized for SQL, so `--name random-log` becomes table `random_log`. Collection tables include `_ctvs_source_path`, `_ctvs_line_number`, `_ctvs_raw`, and inferred top-level JSON fields. Deleted glob sources remain queryable from their cache-only partitions until the collection is removed. `ctvs query schema <dataset>` prints the schema, and `ctvs query catalog` shows which datasets have source and cached rows.
569
571
570
572
### Conversation log model
571
573
@@ -753,7 +755,7 @@ the binary into a per-invocation cache that is not stable across runs.
753
755
| `ctvs detach [--client claude\|codex\|all]` | Revert Claude Code and/or Codex without uninstalling the daemon |
754
756
| `ctvs status` | Print daemon (loaded / PID) and Claude Code (attached) state |
755
757
| `ctvs export --config <path> [...]` | Convert recorded JSONL to local Parquet without invoking the upload scheduler |
756
-
| `ctvs query <command> [...]` | Query local recordings through the explicit Parquet cache |
758
+
| `ctvs query <command> [...]` | Query local recordings through the explicit query cache |
757
759
| `ctvs collect <file.jsonl> --name <name>` | Register external JSONL as a dynamic query table |
`ctvs collect` registers an external local JSONL file as a dynamic SQL table and immediately refreshes its Parquet cache. Collection names are normalized for SQL (`random-log` -> `random_log`). Query them with `ctvs query sql "select * from random_log"`. Pass `--glob '<pattern>'` instead of a single path to back one logical table with many files; each matched file becomes its own cache partition and `_ctvs_source_path` tells you which file a row came from.
42
+
`ctvs collect` registers an external local JSONL file as a dynamic SQL table and immediately refreshes its query cache. Collection names are normalized for SQL (`random-log` -> `random_log`). Query them with `ctvs query sql "select * from random_log"`. Pass `--glob '<pattern>'` instead of a single path to back one logical table with many files; each matched file becomes its own cache partition and `_ctvs_source_path` tells you which file a row came from.
43
43
44
44
## Proxy conversation log model
45
45
@@ -107,7 +107,7 @@ Use `JSON_VALUE(<col>, '$.path')` to extract scalars from the `attributes` / `st
107
107
## Guardrails
108
108
109
109
- Do not assume the cache auto-refreshes. Query commands default to `--refresh never`, and stale partitions return data with a stderr warning rather than refreshing themselves.
110
-
- Always read stderr. A successful exit code does not mean the data is fresh — a `warning: querying stale data; …` line on stderr means stdout reflects outdated Parquet, and the user should be told before drawing conclusions.
110
+
- Always read stderr. A successful exit code does not mean the data is fresh — a `warning: querying stale data; …` line on stderr means stdout reflects outdated cache rows, and the user should be told before drawing conclusions.
111
111
- Do not paste `--config` into every command by habit. Use it when discovery shows the service is not using `~/.hyp/collectivus.json`.
112
112
- Do not read arbitrary Parquet files directly for `ctvs query sql`; the CLI only allows logical tables.
113
113
- Keep SQL read-only and use only logical datasets: `logs`, `traces`, `metrics`, `proxy_messages`, `gascity_messages`, and registered collection tables from `ctvs query catalog`.
Their Parquet cache lives under `<recording-root>/.collectivus-query/parquet/collections/<table>/data.parquet`. Names are normalized for SQL, so `--name random-log` exposes table `random_log`.
15
+
Their query cache lives under `<recording-root>/.collectivus-query/cache/collections/<table>/source=<hash>/cursor.json`, with rows stored in local Iceberg tables below each source partition. Names are normalized for SQL, so `--name random-log` exposes table `random_log`.
16
16
17
17
The cache is explicit. Query commands do not refresh it unless `--refresh always` is passed.
18
18
19
19
Freshness is asymmetric (since v1.7.0):
20
20
21
21
-`fresh` — query proceeds silently.
22
-
-`stale` (Parquet exists but may be outdated) — query proceeds and writes a `warning: querying stale data; N partition(s) outdated [...] — run '...' to update` line to stderr. Stdout is unchanged.
23
-
-`missing` (no Parquet at all) — query exits with the exact `ctvs query refresh ...` command to run.
22
+
-`stale` (cache exists but may be outdated) — query proceeds and writes a `warning: querying stale data; N partition(s) outdated [...] — run '...' to update` line to stderr. Stdout is unchanged.
23
+
-`missing` (no cache table/cursor) — query exits with the exact `ctvs query refresh ...` command to run.
24
24
25
25
Pass `--strict-freshness` to restore the pre-1.7 behavior where stale partitions are a hard error.
26
26
@@ -29,7 +29,7 @@ Commands default to `~/.hyp/collectivus.json`. If the running gateway or OTEL co
29
29
## Shared Options
30
30
31
31
-`--config <path|url>`: Collectivus config. Defaults to `~/.hyp/collectivus.json`.
32
-
-`--parquet-dir <dir>`: Override the query cache directory.
32
+
-`--cache-dir <dir>`: Override the query cache directory.
ctvs query sql "select * from random_log" --format json
72
72
```
73
73
74
-
`ctvs collect` stores the absolute source path (or glob) and immediately refreshes the Parquet cache. If the source file changes later, normal query freshness rules apply: stale cached data is queryable with a stderr warning, `--strict-freshness` turns that into an error, and `ctvs query refresh <file.jsonl>` refreshes selected files. Use `--refresh always` to refresh before running the query.
74
+
`ctvs collect` stores the absolute source path (or glob) and immediately refreshes the query cache. If the source file changes later, normal query freshness rules apply: stale cached data is queryable with a stderr warning, `--strict-freshness` turns that into an error, and `ctvs query refresh <file.jsonl>` refreshes selected files. Use `--refresh always` to refresh before running the query.
75
75
76
-
With `--glob`, one logical table is backed by many source files: each matched file becomes its own cache partition under `.collectivus-query/parquet/collections/<table>/source=<hash>/data.parquet`, and only files whose mtime/size changed re-materialize on refresh. Files that no longer match the glob are pruned from the cache on the next refresh. Inside SQL, use `_ctvs_source_path` to see which file a row came from.
76
+
With `--glob`, one logical table is backed by many source files: each matched file becomes its own cache partition under `.collectivus-query/cache/collections/<table>/source=<hash>/cursor.json`, and refresh appends from each file's recorded cursor when possible. Files that no longer match the glob remain queryable as cache-only partitions. Inside SQL, use `_ctvs_source_path` to see which file a row came from.
77
77
78
78
Collection tables always include `_ctvs_source_path`, `_ctvs_line_number`, and `_ctvs_raw`, plus inferred top-level JSON fields. Use `--timestamp-column <field>` when registering a file if `--from`, `--to`, `--since`, or `--date` should use a specific field.
79
79
@@ -82,7 +82,7 @@ Collection tables always include `_ctvs_source_path`, `_ctvs_line_number`, and `
82
82
-`logs`: OTLP log records. Common columns include `gateway_id`, `date`, `timestamp`, `observedTimestamp`, `severityNumber`, `severityText`, `serviceName`, `body`, `traceId`, `spanId`, `resource`, `scope`, and `attributes`.
83
83
-`traces`: OTLP spans. Common columns include `gateway_id`, `date`, `traceId`, `spanId`, `parentSpanId`, `name`, `kind`, `startTimestamp`, `endTimestamp`, `durationMs`, `status`, `serviceName`, `resource`, `scope`, and `attributes`.
84
84
-`metrics`: OTLP metric points. Common columns include `gateway_id`, `date`, `metricName`, `metricType`, `timestamp`, `startTimestamp`, `serviceName`, `value`, `valueInt`, `count`, `sum`, `unit`, `resource`, `scope`, and `attributes`.
85
-
-`proxy_messages`: One row per LLM proxy content part (text block, tool call, tool result, etc.), globally deduped by content-derived `message_id`. See **proxy_messages columns** below for the full 26-column schema; `gateway_id` and `date` are added as partition columns on the on-disk Parquet.
85
+
-`proxy_messages`: One row per LLM proxy content part (text block, tool call, tool result, etc.), globally deduped by content-derived `message_id`. See **proxy_messages columns** below for the full 26-column schema; `gateway_id` and `date` are added as partition columns in the query cache.
86
86
-`gascity_messages`: One row per content block from gascity-captured agent sessions (text, thinking, tool_use, tool_result, attachment). Captured by the `ctvs gascity` supervisor source — agent-attributed (`gascity_template` / `gascity_rig` / `gascity_alias`) and includes per-frame token usage with cache breakdown. Always fresh: the daemon writes Parquet directly to `~/.collectivus/sink/gascity_messages/date=<YYYY-MM-DD>/city=<name>/` (no JSONL stage, no `.meta.json` sidecar). The constant `gateway_id = 'gascity-scribe'` tags the source for cross-source UNIONs with `proxy_messages`. Run `ctvs query schema gascity_messages --format markdown` for the full 47-column schema.
87
87
88
88
Run `ctvs query schema <dataset> --format json` for the exact columns in the installed version.
@@ -120,7 +120,7 @@ Grain is one row per content part. Rows are deduplicated by `message_id` so a si
120
120
| 25 |`status`| JSON | yes | Sparse: `tool_status` on tool_result, `finish_reason` on the last assistant part, `error_code` / `error_message` on error blocks |`null` when no key applies. |
121
121
| 26 |`attributes`| JSON | yes |`request` settings (`max_tokens`, `thinking`, `output_config`, `context_management`, `stream`), `usage` (assistant only — `input_tokens`, `output_tokens`, `cache_read_tokens`, `cache_write_tokens`), `timing.latency_ms`, `client.claude_version`, `provider_raw.metadata`|`null` when no key applies. |
122
122
123
-
The on-disk Parquet additionally carries `gateway_id` (STRING, not null) as the leading column and `date` (STRING, not null) at the end. Both are partition keys; `date` is derived from `message_created_at` in UTC.
123
+
The query-cache table additionally carries `gateway_id` (STRING, not null) as the leading column and `date` (STRING, not null) at the end. Both are partition keys; `date` is derived from `message_created_at` in UTC.
0 commit comments