Files
ottyl/tickets/018-boolean-param-kind.md
T
2026-09-05 19:29:01 +01:00

1.6 KiB

Support a boolean param kind that's always present (true/false, not omitted)

Discovered while scoping the "IsError" docs use case (see ticket 019): declaring a param today always requires a capture group, and a param is omitted from a line's fields (not false/empty) whenever its regex doesn't match (src/engine.rs, LogEntryDto::params build path — "A param is omitted (not included as null/empty) when its regex/capture group doesn't match"). There's also no boolean kind — MetricPrimitiveKind (src/data_value.rs) only has String, Number, Timestamp, Duration.

This blocks a use case like declaring a param IsError that's true for any message matching error (case-insensitively) and false for every other message — today a non-matching line just doesn't get the param at all, and there's no boolean type to hold the result even if it did.

Acceptance criteria

  • MetricPrimitiveKind gains a Boolean variant (src/data_value.rs), serialized as "boolean" consistent with the other lowercase kinds.
  • A param declared with kind Boolean doesn't require (or use) a capture group for its value — its value is whether message_match_regex matches the line, case-insensitively or per the regex's own flags.
  • A Boolean-kind param is present on every line as true or false (never omitted), unlike capture-based params.
  • Params UI (Params.tsx) offers boolean as a kind option and hides/disables the capture-group input when it's selected (or clarifies it's unused).
  • Existing string/number/timestamp/duration param behavior (including the "omitted when unmatched" semantics for those) is unchanged.