monoscope/cli
Anthony Alaribe 545ae6bf0c fix(cli): a bare search term is full-text again, not an unknown field
`monoscope logs search POISON_ROW_DROPPED` — the example in the command's own
--help and in docs/cli.md — has been exiting with

    invalid query: Unknown field "POISON_ROW_DROPPED"

since field validation landed in e7ad369. Nothing was wrong with the search
itself: `buildSearchParams` rewrites a bare term into `body has "X" or summary
has "X"` before it goes on the wire, and that is valid. But `validateEventsOpts`
validated `opts.query` — the raw term, before the rewrite — so the parser was
asked to resolve a search term as a column and the CLI exited before the rewrite
ever ran.

Validate the text that will actually be sent. Confirmed in ghci against this
tree: parseQueryToAST "chunkevt" is Left, and the rewritten form is Right.

Server-side is unaffected: the API only ever received the rewritten query, so
this was never visible through the web UI or a direct API call.

The two halves drifting apart is the actual defect, so the doctests on
rewriteBareQuery now assert that its output parses, not just what it looks like.
History 2026-08-12 11:41:29 +02:00
..
CLI fix(cli): a bare search term is full-text again, not an unknown field 2026-08-12 11:41:29 +02:00
exe Split the CLI into its own package so it no longer needs libpq 2026-08-06 01:17:03 +02:00
test Fix the trace waterfall's parent linking, logfmt escaping, and the 90d scan 2026-08-06 16:46:48 +02:00
monoscope-cli.cabal Drop helpers left orphaned by the new renderers 2026-08-06 03:06:30 +02:00