Skip to content

Update README.md - #1

Open
Krishcalin wants to merge 1 commit into
mainfrom
Krishcalin-patch-1
Open

Update README.md#1
Krishcalin wants to merge 1 commit into
mainfrom
Krishcalin-patch-1

Conversation

@Krishcalin

Copy link
Copy Markdown
Owner

No description provided.

Krishcalin added a commit that referenced this pull request Aug 1, 2026
LOQL is a Splunk-SPL-shaped pipeline language (search | stats | timechart | ...) that
compiles to PARAMETERIZED SQL over the month-partitioned events table — the first
backbone of the Splunk-class transformation (docs/SPLUNK_TRANSFORMATION_ROADMAP.md).
Analyst hunting, and later dashboards/RBA row-filters/federation, all hang off this
compiler.

New pure package app/loql/:
- nodes.py    frozen AST contract
- parser.py   lexer + recursive-descent parser — the security gate (malformed -> LoqlError)
- compiler.py pure Query -> (sql, params) CTE chain; EVERY user value/jsonb key/glob is a
              bound %s param and identifiers pass _ident() — the whole injection story
- run.py      DB execution boundary + guardrails (statement_timeout + row cap)
Batch-1 commands: search where eval fields rename sort head dedup stats top rare bin
timechart, with stats/timechart funcs (count/sum/avg/min/max/dc/values/list), schema-on-read
over raw jsonb, relative-time (_time > "-24h") and wildcard (host="web*") matching.

POST /api/v1/query (API-key auth) + config guardrails LOQL_DEFAULT_LIMIT / LOQL_MAX_ROWS /
LOQL_TIMEOUT_MS / LOQL_MAX_AGG_ELEMS so one heavy query can't starve ingest on the shared
Postgres.

Hardened by a read-only adversarial-verify pass (12 agents) — 6 confirmed defects (all
fail-closed, none actual injection), all fixed + regression-tested:
- top/rare on a raw field emitted 2 %s but bound 1 param (dangling placeholder) -> resolve
  the field once and GROUP BY output ordinal (like timechart); top ... by g percent is now
  per-group (PARTITION BY) not the grand total.
- the recursive-descent parser had no depth cap -> deep parens/NOT raised RecursionError
  (HTTP 500) -> added a nesting-depth guard (LoqlError) + a RecursionError safety net.
- list()/values() array_agg was unbounded (LIMIT counts rows, not cell size) -> [1:cap]
  slice via LOQL_MAX_AGG_ELEMS.
- POST /query with a non-string 'query' raised AttributeError (500) -> a type guard returns
  a clean 400.

Tests: test_loql.py 38 unit (parser/compiler snapshots + the injection invariant + the 4
verify regressions) + integration; test_integration_api.py /api/v1/query. Unit suite
284 -> 322. Docs: docs/LOQL.md reference + README section + CLAUDE + .env.

Co-Authored-By: Claude Fable 5.0 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant