Michael Usachenko activity https://gitlab.com/michaelusa 2026-03-18T23:56:40Z tag:gitlab.com,2026-03-18:5219847729 Michael Usachenko deleted project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:56:40Z michaelusa Michael Usachenko

Michael Usachenko (50ba1344) at 18 Mar 23:56

tag:gitlab.com,2026-03-18:5219847614 Michael Usachenko accepted merge request !596: feat(pipeline): hoist up query pipeline as its own crate + decouple formatting at GitLab.org / orbit / GitLab ... 2026-03-18T23:56:33Z michaelusa Michael Usachenko

What does this MR do and why?

The query pipeline was a single module inside gkg-server, tightly coupled to gRPC streaming, ClickHouse, and JWT authentication. This made it impossible to reuse for local query execution (e.g. MR 590 which runs queries against DuckDB from the CLI).

This MR breaks the pipeline into layered crates so that the core framework and shared logic can be composed differently depending on the context — full server pipeline with auth/redaction/hydration, or a minimal local pipeline that skips all of that.

How it works

The pipeline is built around a PipelineStage trait with a .then() chain pattern. Each stage reads the previous stage's output from a shared context, does its work, and returns its own output. The runner enforces stage ordering at compile time via phantom types.

The server composes all eight stages:

Security → Compilation → Execution → Extraction → Authorization → Redaction → Hydration → Output

The CLI can compose just the stages it needs:

Compilation → Execution → Extraction → Output

Same framework, same shared stages, different composition.

Formatting (Graph, Goon) is no longer a pipeline stage — it happens after the pipeline returns, so the caller decides how to present results.

Crate structure

graph TD
    QP["querying-pipeline — framework<br/>(PipelineStage, PipelineRunner, context, observer)"]
    QT["querying-types — data model<br/>(QueryResult, NodeRef, ResourceCheck)"]
    QSS["querying-shared-stages — reusable stages<br/>(Compilation, Extraction, Output + inter-stage types)"]
    QF["querying-formatters — output formatting<br/>(GraphFormatter, GoonFormatter, row_to_json)"]
    SRV["gkg-server/pipeline — server stages<br/>(Security, ClickHouse executor, Authorization,<br/>Redaction, Hydration)"]

    QP --> QT
    QSS --> QP
    QSS --> QT
    QF --> QSS
    QF --> QT
    SRV --> QP
    SRV --> QSS
    SRV --> QF

Other notable changes

  • query_pipeline/ renamed to pipeline/ in gkg-server
  • All stages are stateless unit structs — per-request data (claims, gRPC stream, ClickHouse client) lives in a typed extension map on the pipeline context
  • Removed the RedactionMessage generic that previously threaded through the entire pipeline — the authorization stage now uses ExecuteQueryMessage directly
  • QueryPipelineService is no longer generic over a formatter type

Testing

All 124 unit tests pass. Full workspace clippy clean. Integration tests updated for new imports.

Enables MR 590 (local DuckDB query execution in CLI).

tag:gitlab.com,2026-03-18:5219847608 Michael Usachenko pushed to project branch main at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:56:33Z michaelusa Michael Usachenko

Michael Usachenko (3f30fb60) at 18 Mar 23:56

Merge branch 'querying-pipeline-types-crates' into 'main'

... and 1 more commit

tag:gitlab.com,2026-03-18:5219840712 Michael Usachenko commented on merge request !596 at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:50:48Z michaelusa Michael Usachenko

Not a serious concern right now - will look into profiling soon

tag:gitlab.com,2026-03-18:5219837427 Michael Usachenko pushed to project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:48:10Z michaelusa Michael Usachenko

Michael Usachenko (50ba1344) at 18 Mar 23:48

chore: readd comments

tag:gitlab.com,2026-03-18:5219827271 Michael Usachenko pushed to project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:42:42Z michaelusa Michael Usachenko

Michael Usachenko (e42542b9) at 18 Mar 23:42

fix: remove mutex

tag:gitlab.com,2026-03-18:5219818113 Michael Usachenko commented on merge request !596 at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:37:23Z michaelusa Michael Usachenko

I ended up removing mutex all together

tag:gitlab.com,2026-03-18:5219806445 Michael Usachenko commented on merge request !596 at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:29:25Z michaelusa Michael Usachenko

we can eventually rename it - but this is a good first step

tag:gitlab.com,2026-03-18:5219805304 Michael Usachenko pushed to project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:28:48Z michaelusa Michael Usachenko

Michael Usachenko (ba3d8445) at 18 Mar 23:28

Merge remote-tracking branch 'origin/main' into querying-pipeline-t...

... and 2 more commits

tag:gitlab.com,2026-03-18:5219801414 Michael Usachenko pushed to project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:27:27Z michaelusa Michael Usachenko

Michael Usachenko (65f5e359) at 18 Mar 23:27

fix: integration bug

tag:gitlab.com,2026-03-18:5219795245 Michael Usachenko commented on merge request !596 at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:24:42Z michaelusa Michael Usachenko

I think remove-llm-comments in AGENTS.md did this unknowningly, will revert

tag:gitlab.com,2026-03-18:5219787822 Michael Usachenko commented on merge request !596 at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:19:34Z michaelusa Michael Usachenko

I don't think it makes sense - query engine should be a pure function - separation of concerns

tag:gitlab.com,2026-03-18:5219775908 Michael Usachenko pushed to project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T23:12:02Z michaelusa Michael Usachenko

Michael Usachenko (da444520) at 18 Mar 23:12

feat: formatter crate

... and 2 more commits

tag:gitlab.com,2026-03-18:5219740281 Michael Usachenko deleted project branch add-ast-grep-skill at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T22:55:24Z michaelusa Michael Usachenko

Michael Usachenko (0b8a962f) at 18 Mar 22:55

tag:gitlab.com,2026-03-18:5219740124 Michael Usachenko pushed to project branch main at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T22:55:18Z michaelusa Michael Usachenko

Michael Usachenko (970dde94) at 18 Mar 22:55

Merge branch 'add-ast-grep-skill' into 'main'

... and 1 more commit

tag:gitlab.com,2026-03-18:5219740118 Michael Usachenko accepted merge request !595: feat(tooling): add ast-grep skill for structural code search and rewrite at GitLab.org / orbit / GitLab Knowle... 2026-03-18T22:55:18Z michaelusa Michael Usachenko

Summary

  • Install ast-grep 0.42.0 via mise (cargo backend) for AST-based code search and rewrite
  • Add .claude/skills/ast-grep/SKILL.md teaching the agent when and how to use ast-grep instead of text-based Grep/Edit for structural code transformations
  • Update AGENTS.md/CLAUDE.md with ast-grep references in "Where to find things" and "Code quality" sections

What the skill covers

  • Pattern search (ast-grep run -p) and batch rewrite (-r ... -U)
  • YAML inline rules with relational (has/inside + stopBy: end) and composite (all/any/not) logic
  • --json output, --debug-query, --selector, constraints
  • Key Rust node kinds (non-obvious mappings like try_expression for ?, function_modifiers for async)
  • Shell escaping guidance

Testing

All examples validated against the codebase:

Feature Status
Pattern search ($X.unwrap()) Verified
Rewrite preview + apply (-U) Verified
Relational rules (inside impl_item) Verified
--json structured output Verified
--debug-query (cst/ast/pattern) Verified
--selector (field_declaration) Verified
constraints (metavar regex) Verified
Composite rules (all + not + has) Verified
Bare .unwrap() ERROR warning Verified
Node kinds (try_expression, etc.) Verified
tag:gitlab.com,2026-03-18:5219718197 Michael Usachenko pushed to project branch add-ast-grep-skill at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T22:44:31Z michaelusa Michael Usachenko

Michael Usachenko (0b8a962f) at 18 Mar 22:44

fix(tooling): prefix ast-grep commands with mise exec --

tag:gitlab.com,2026-03-18:5219714039 Michael Usachenko pushed to project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T22:43:06Z michaelusa Michael Usachenko

Michael Usachenko (e083f272) at 18 Mar 22:43

fix: remove reexports

... and 1 more commit

tag:gitlab.com,2026-03-18:5219679545 Michael Usachenko pushed to project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T22:23:31Z michaelusa Michael Usachenko

Michael Usachenko (0ee8a9d5) at 18 Mar 22:23

fix: remove input param in execute

tag:gitlab.com,2026-03-18:5219613858 Michael Usachenko pushed to project branch querying-pipeline-types-crates at GitLab.org / orbit / GitLab Knowledge Graph 2026-03-18T21:53:10Z michaelusa Michael Usachenko

Michael Usachenko (d98e92eb) at 18 Mar 21:53

fix: remove redaction phase generic rec