Skip to content

[3.1] Create Telemetry Package #61

@adnaan

Description

@adnaan

Description

Create a package to capture and store generation events. This data drives the evolution system.

Depends on: Milestone 2 complete

Tasks

  • Create internal/telemetry/ package
  • Define GenerationEvent struct with all relevant fields
  • Create SQLite storage backend
  • Implement event capture with minimal overhead
  • Add privacy controls (can be disabled)
  • Create retention policy (auto-delete old events)

Acceptance Criteria

  • Every generation attempt is captured (when enabled)
  • Events include: command, inputs, kit, success/failure, errors, duration
  • Data stored in $XDG_CONFIG_HOME/lvt/telemetry.db (use os.UserConfigDir() in Go`
  • User can disable with LVT_TELEMETRY=false

Files to Create

internal/telemetry/
├── telemetry.go       # Main API
├── events.go          # Event types
├── store.go           # Storage interface
├── sqlite.go          # SQLite implementation
├── schema.sql         # Database schema
└── telemetry_test.go

Schema

CREATE TABLE generation_events (
    id TEXT PRIMARY KEY,
    timestamp DATETIME NOT NULL,
    command TEXT NOT NULL,
    inputs TEXT NOT NULL,  -- JSON
    kit TEXT,
    lvt_version TEXT,
    success BOOLEAN NOT NULL,
    validation_result TEXT,  -- JSON
    errors TEXT,  -- JSON
    duration_ms INTEGER,
    files_generated TEXT  -- JSON
);

-- Indexes for common queries
CREATE INDEX idx_events_timestamp ON generation_events(timestamp);
CREATE INDEX idx_events_success ON generation_events(success);
CREATE INDEX idx_events_command ON generation_events(command);
CREATE INDEX idx_events_kit ON generation_events(kit);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions