Repository navigation
feat(scope): add query --follow and search-fields commands - #28
Merged
Merged
Conversation
- query --follow true polls the whole live range on an interval and streams one NDJSON line per changed result to stdout, so a Python consumer can tail a live NT session instead of re-running query in a loop. Rejects log sessions (fixed end, would repeat forever) and resolves the default/ambiguous session the same way the daemon does. No daemon changes needed: it's a client-side polling loop over the existing /query endpoint. - search-fields <substr> filters a session's field list (from /info) by case-insensitive substring, for writing SPL queries against logs with hundreds of NT keys. Also client-side, no new daemon endpoint. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
rylero
marked this pull request as ready for review
July 6, 2026 06:56
rylero
added a commit
that referenced
this pull request
Jul 6, 2026
…python client SKILL.md hadn't been updated for #27 (claudescope-py) or #28 (--follow/search-fields), and this branch adds --format csv/parquet on top -- the agent-facing guide was missing all four. Documents: - search-fields command - --format csv/parquet output for query/query-multi --union true - query --follow true live streaming (NDJSON, incompatible with --format/--out) - the claudescope-py Python client, recommended over --format for Python consumers since it builds a DataFrame directly Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
rylero
added a commit
that referenced
this pull request
Jul 6, 2026
* feat(scope): add --format csv to query/query-multi CSV output lets query results feed pandas.read_csv() directly without a JSON parsing round-trip. Columns are the union of all row keys, sorted alphabetically with Timestamp pinned first for determinism across heterogeneous rows (e.g. stats/timechart by group). query-multi requires --union true since comparison mode isn't row-shaped. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * feat(scope): add --format parquet, fix CSV bool dtype Parquet preserves native bool/float64/string types and true nulls for missing columns, unlike CSV which must stringify everything. Column type per field is inferred from non-nil values (bool/float64/ string), falling back to a stringified UTF8 column on any mix so the writer never errors on unexpected value shapes. Also fix CSV output to write bools as "True"/"False" instead of Go's lowercase "true"/"false" -- pandas.read_csv's C parser only recognizes the capitalized form as boolean, otherwise the column comes back as object dtype. Adds github.com/parquet-go/parquet-go as a new dependency. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs(scope): update SKILL.md for csv/parquet, follow, search-fields, python client SKILL.md hadn't been updated for #27 (claudescope-py) or #28 (--follow/search-fields), and this branch adds --format csv/parquet on top -- the agent-facing guide was missing all four. Documents: - search-fields command - --format csv/parquet output for query/query-multi --union true - query --follow true live streaming (NDJSON, incompatible with --format/--out) - the claudescope-py Python client, recommended over --format for Python consumers since it builds a DataFrame directly Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(scope): stop parquet writer from nulling falsy values Found via end-to-end testing against a real .wpilog and pandas (not just Go-side round-trip tests): rowsToParquet wrote rows via GenericWriter's map/reflect path (w.Write([]map[string]any{...})), whose isNullValue check (parquet-go's column_buffer_reflect.go) treats any Go zero value -- false, 0.0, "" -- as equivalent to an absent key for Optional columns. A real Enabled=false or a sensor reading of exactly 0.0 was silently coming back as a Parquet null (NaN/None in pandas), which is a correctness bug that would corrupt real telemetry data on release. Fix: build parquet.Row values manually with explicit definition levels (1 = present, 0 = null) via schema.Lookup for each column's index, bypassing the reflect path entirely. Verified against real pandas: false/0.0/"" now round-trip as themselves, while genuinely missing columns (e.g. an unmatched lookup join) still round-trip as null. Added a regression test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
query --follow true [--interval-ms <n>]polls the whole live range on an interval and streams one NDJSON line per changed result to stdout, so a Python/pandas consumer can tail a live NT session instead of re-invokingqueryin a loop. Client-side only (no daemon change): rejects log sessions since their end is fixed, and resolves the default/ambiguous session the same way the daemon's own resolution does.search-fields <substr> [--session <id>]filters a session's field list (pulled from the existing/infoendpoint) by case-insensitive substring, for writing SPL queries against logs with hundreds of NT keys. Also client-side, no new daemon endpoint.Both were scoped in
handoff-claudescope-live-streaming-and-field-search.mdas independent, previously-unstarted features. Neither depends on the in-flight--format csv/parquetwork in #26 or the planned Python wrapper.Test plan
go build ./...andgo test ./...passsearch-fields(case-insensitivity, no-match, missing-arg)--follow's session resolution (rejects log sessions, defaults to sole session, ambiguous-session error, no-session error)🤖 Generated with Claude Code