Skip to content

Protocol plugin architecture: MySQL/PostgreSQL tracing (deferred, see ROADMAP.md P4-4) #6

Description

@epli2

Tracking issue for deferred protocol-plugin work, split out of #2 (closed).

Background

#2 implemented MySQL wire-protocol tracing via the LD_PRELOAD backend: crates/phantom-core/src/mysql.rs, crates/phantom-storage/src/fjall_mysql.rs, plus TUI display support. It's a substantial, working implementation, but was closed rather than merged — see the closing comment on #2 for the full rationale. Summary:

  1. Concept fit: the current ROADMAP.md (§2) redefines Phantom as an HTTP-focused "local-first API development toolbox" (observe/perturb/record-replay/spec-gen). Landing a second protocol before the HTTP core (persistent CA, compression, TUI usability, JSONL schema versioning) is finished would double maintenance surface prematurely.
  2. Design mismatch: Add MySQL trace functionality #2 added HttpTrace-parallel types rather than a shared event model, and is LD_PRELOAD-only (Linux, no TLS), asymmetric with the primary proxy backend.
  3. Staleness: based on a main several months old; would need a full rebase against current src/main.rs / phantom-tui.

What to do when this is picked back up

Per ROADMAP.md P4-4, this should not be re-merged as-is. Prerequisite design work:

  • Generalize phantom_core::trace::HttpTrace into something like enum TraceEvent { Http(HttpTrace), Db(DbTrace), … } (or a trait-based equivalent) so storage, TUI, and JSONL output can handle event kinds without hardcoding HTTP.
  • Write an RFC (docs/rfcs/NNN-protocol-plugins.md) covering the event model change before implementation.
  • Decide capture-backend story for DB protocols on the (cross-platform) proxy backend, not just LD_PRELOAD.
  • gRPC (HTTP/2-based) is called out in the roadmap as a lower-effort first protocol-plugin candidate, since it can extend the existing proxy rather than requiring a new backend.

Reference

  • Original implementation: Add MySQL trace functionality #2 (branch claude/add-mysql-trace-m434f)
  • Roadmap items: ROADMAP.md §1.2 (PR evaluation), §9 ADR-1, task P4-4

Gate: per ROADMAP.md §9, Phase 4 items (including this one) should only be picked up after Phase 3 completes and there's an external signal of demand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions