<< All versions

Skill v1.0.1

Automated scan100/100
opentidehq/language-server/catalogs

+3 new

──Details
PublishedOctober 29, 2026 at 05:45 PM
Content Hashsha256:03698f2c50c709b6...
Git SHA92542783cee2
Bump Typepatch
Compare with v1.0.0
──Files
Files (1 file, 11.1 KB)
SKILL.md11.1 KBactive
SKILL.md · 108 lines · 11.1 KB

name: catalogs description: Load opentide catalogs and conformance corpora. Covers include_str, OnceLock, toml 0.8, HighlightSpec capture freezes, Tide catalogs generated by opentide (one row per schema revision), and external KQL/SPL/Elastic fault twins. Use when editing catalogs/, highlights/spec.toml, testdata/conformance, or scripts/sync_opentide_schemas.py. license: EUPL-1.2 metadata: version: "1.0.1" author: opentidehq


Catalogs and conformance

Catalogs are data compiled into the binary. The engine does not read them from disk at request time. A workspace override path exists for the Tide field catalog and deprecations (.opentide/lsp/catalogs/generated/fields.json and deprecations.json, written by opentide generate schemas); the bundled files under catalogs/ are the fallback.

Read references/highlight-spec.md before touching highlights/spec.toml or a capture name.

How a catalog is loaded

  1. TOML (or JSON for generated Tide fields) lives in catalogs/.
  2. The engine include_str!s it with a path relative to the source file (../../../catalogs/...).
  3. A serde::Deserialize struct matches the file. #[serde(default)] on optional arrays.
  4. toml::from_str (toml 0.8) parses it inside OnceLock so each profile is parsed once per process. Catalog::cached is the pattern in opentide-kql and opentide-spl.
  5. Tests construct the catalog through that cache. They do not open the TOML themselves unless they are checking the sync script.

Adding a key to a row struct without #[serde(default)] rejects every existing file that omits the key. Add the field as Option or #[serde(default)], then fill the catalogs.

Do not parse catalogs with serde_yaml. Do not switch catalog files to JSON unless the file is already generated JSON (catalogs/tide/generated/fields.json).

KQL and SPL catalogs

PathContents
catalogs/kql/core/operators, scalar operators, functions, types, evaluate plugins, operator options
catalogs/kql/sentinel/tables and columns
catalogs/kql/defender/tables and columns
catalogs/spl/commands, command options, fields, datamodels, macros

KQL profiles are Core, Sentinel, and Defender. Sentinel analysis is the default for a raw .kql file. Defender is selected when the Tide field path contains defender_for_endpoint. A function that exists only in one profile must not be marked known in the other.

Signatures and operator options are copied from public docs (Microsoft Learn for KQL, Splunk Search Reference for SPL). scripts/sync_kql_learn_signatures.py is the generator. Do not invent a parameter the Learn page does not list. Cite the page in the catalog citation field when the row has one.

Unknown operators, functions, tables, and commands are diagnostics (kql_unknown_operator, kql_unknown_function, kql_unknown_table, spl_unknown_command), not grammar errors. A function row with deprecated = "<replacement>" is a deprecated alias Learn names on the replacement's article; the engine warns kql_deprecated_function and leaves it out of completion. evaluate calls are checked against evaluate-plugins.toml, not functions. render parses and warns kql_render_not_valid. Control commands warn kql_control_command_unsupported.

Slow-query warnings (kql_where_not_first, kql_unscoped_search, spl_wildcard, spl_leading_not, and the rest of opentide_core::codes) come from the perf modules. They are warnings about public query shapes, not style nits. Do not add a warning that contradicts docs/kql/ or docs/spl/.

Elastic catalogs

PathContents
catalogs/esql/commands, functions, operators, cast types with applies_to lifecycle and per-release versions
catalogs/eql/functions (arity, case-insensitive ~ support), pipes
catalogs/ecs/Elastic Common Schema fields: type, level, short description, allowed values (scripts/sync_ecs_fields.py, Apache-2.0, NOTICE)

scripts/sync_esql_catalog.py and scripts/sync_eql_catalog.py regenerate them from a pinned elastic/elasticsearch docs commit. Elastic's docs are not EUPL-compatible, so the catalogs keep facts only (names, signatures, arity, versions) and the summaries are written in the scripts. Do not paste Elastic prose into a catalog. The 9.x docs do not list 8.19 or 9.0, so sync_esql_catalog.py --branches also reads each release branch (8.19, 9.0 … 9.6) and writes versions, the lines that accept each command, function, and cast type (types.toml). esql_unavailable uses those lists: information when an older supported line lacks a name, a warning when the newest does too, an error only for snapshot-only names. Lifecycle::after_floor (first documented at 9.2 or later is missing on 8.19) is the fallback for a row without versions.

ECS is never a closed list: elastic-1.0 says field names MUST NOT be checked against one. opentide-ecs feeds completion and hover (wired in opentide-analysis/src/ecs.rs), and a hint only where a known field's type makes the query suspicious. An unknown field is never a diagnostic.

Tide objects

scripts/sync_opentide_schemas.py runs opentide's own generator (python -m opentide.generation.lsp_catalog) and writes catalogs/tide/generated/, the reference schemas and the highlights key list; it needs an opentide that ships the generator (uv run --project ../opentide python scripts/sync_opentide_schemas.py from a checkout). Rows are keyed by schema id; lookups resolve an object's metadata.schema, a bare family or unknown revision taking the newest, and a family-keyed catalog (an older workspace one) applying to every revision. Required fields, closed objects and legacy keys come from the catalog: never hard-code a revision check in Rust. scripts/requirements-opentide.txt pins the opentide release pydantic_object_issues.py uses as its oracle. Pydantic is the CLI authority. The LSP emits the same {code, field_path, severity} with ranges. scripts/pydantic_object_issues.py is the comparison source. Do not re-encode the object schema as hand-written Rust structs when the generated field catalog already has the answer.

Vocabularies live in catalogs/tide/vocabs/*.vocab.toml and load once (OnceLock in vocabs.rs). An unknown vocab value is vocab_unknown. Deprecated fields use the generated deprecation list (deprecated_field).

Injection, from language_for_field_path:

Field pathLanguage
configurations.sentinel.queryKQL
configurations.defender_for_endpoint.queryKQL
configurations.splunk.query and legacy configurations.splunk.searchSPL
configurations.elastic.query and threat.queryES\QL, EQL, kuery, or Lucene from type and language (elastic_query_language)
response.procedure.searches[].query with system: elasticthe entry's language; none when omitted
configurations.crowdstrike.*unsupported
markdown fieldsHighlightSpec markdown.*, not a query engine

Block-scalar indent is stripped for analysis. Tokens are remapped onto the original YAML coordinates. Do not highlight the dedented buffer's offsets.

Conformance

testdata/conformance/external/<id>/ holds real public rules and a .broken. twin (frobnicate or .show for KQL, notacommand for SPL). crates/opentide-analysis/tests/external_corpus.rs does not require the full valid file to parse; the oracle does (see Oracles below), and every rule in the corpus parses today. The test keeps the full rule, finds the longest prefix that parses (at most 16 lines, and the prefix must contain |), injects the fault on that prefix, and requires kql_unknown_operator or spl_unknown_command. The broken full file must produce at least one diagnostic. A corpus that catches the fault on fewer than 5 KQL prefixes or 2 SPL prefixes fails. The Elastic twins (esql/, eql/, lucene/, SigmaHQ conversions under DRL-1.1, listed in sigma.tsv) are checked by crates/opentide-analysis/tests/external_elastic.rs: every valid file is free of errors and every .broken. twin has one. Two verdict tables sit beside them: lucene-queryparser/cases.tsv (Apache Lucene's own parser tests, checked by crates/opentide-lucene/tests/lucene_queryparser_cases.rs) and kuery-opensearch-dashboards/cases.tsv (OpenSearch Dashboards' kuery tests, checked by crates/opentide-kuery/tests/opensearch_dashboards_cases.rs, with a : → :) fault twin per accepted query). Each line is accept or reject; a disagreement is either fixed or listed in the test's EXCEPTIONS with its reason. Sources and licenses are testdata/conformance/external/SOURCES.md. Do not add a rule whose license is unclear, and do not trim a public rule down to the prefix the grammar already accepts.

testdata/conformance/pydantic/ and crates/opentide-analysis/tests/tide_corpus.rs check object issues against the opentide CLI's Pydantic models.

Oracles

.github/workflows/oracle.yml compares the engine with Microsoft Kusto.Language, Splunk's search parser, and the Elastic and Lucene parsers (@elastic/esql, Elasticsearch's EqlBase.g4, Kibana's kuery grammar.peggy, Lucene's QueryParser; scripts/oracles/README.md). The Elastic job also runs every rule in a pinned elastic/detection-rules checkout. It runs every corpus query, external rule, perf sample, probe in testdata/oracles/<lang>/, and Tide rule query through both sides, and compares catalog names with GlobalState.Default and searchbnf.conf. testdata/oracles/exceptions.toml is the exact ledger of disagreements: an unlisted one fails, and so does a listed one that is gone.

  • A grammar or catalog fix that closes a gap deletes its path or name from the ledger in the same change. CI tells you which.
  • A new form from a real rule gets a one-line probe in testdata/oracles/<lang>/, not a trimmed copy of the rule.
  • A .broken. twin must break the query for the reference too. Inject the fault on a live line, never inside a comment or string.
  • The references are CI-only. Do not vendor Kusto.Language, Splunk, a Splunk SDK, or an Elastic or Lucene parser; the Elastic grammars and jars are fetched by pinned SHA-256 into a git-ignored cache. scripts/license-scan.sh checks release artifacts.

Configuration TOML is not a catalog yet

Issue #64 (children #65–#68) will vendor Pydantic JSON Schema for .opentide/configurations/**/*.toml after opentide#374. Until that pin exists:

  • Do not hand-write a JSON Schema, a tree-sitter TOML grammar, or HighlightSpec captures for TOML.
  • Do not validate sharing.toml inside opentide-tide.
  • Cargo.toml and catalogs/**/*.toml are not opentide-config documents.

Checks

bash
cargo test -p opentide-kql -p opentide-spl -p opentide-tide -p opentide-analysis
cargo run -p opentide-lsp -- generate-highlights --check

Schema sync: python scripts/sync_opentide_schemas.py --check with opentide installed passes (labels aside, the catalogs match what it generates). The opentide canary workflow (.github/workflows/opentide-canary.yml) runs it daily against opentide development and reports drift in its summary without failing the build: when it reports drift, regenerate with that opentide and commit.

← v1.0.0All versionsv1.0.2 →