extract-sample-cache-data

command
v0.0.0-...-6520280 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

extract-sample-cache-data

Extracts a sample of author_login_cache pairs from the claude-leaderboard database for testing purposes.

Purpose

This tool reads from the claude-leaderboard's author_login_cache table and outputs a CSV sample containing between 10-100 pairs. It ensures both valid logins and NULL logins are included (if available), and preserves the original ISO 8601 timestamp format with microsecond precision.

Building

cd /home/coding/commitgraph
go build -o extract-sample-cache-data ./cmd/extract-sample-cache-data/

Usage

Basic usage:

./extract-sample-cache-data -output sample.csv

With custom sample size:

./extract-sample-cache-data -output sample.csv -count 25

With custom database path:

./extract-sample-cache-data -output sample.csv -db /path/to/hot.db

Options

  • -db: Path to claude-leaderboard SQLite database (default: ~/backups/claude-leaderboard/hot.db)
  • -output: Output CSV file path (required)
  • -count: Number of pairs to extract, between 10-100 inclusive (default: 50)

Output Format

The output CSV has three columns:

  • author_email: Email address of the author
  • github_login: GitHub username/login (literal string "NULL" for unresolved identities)
  • resolved_at: ISO 8601 timestamp with microsecond precision

Example:

author_email,github_login,resolved_at
bot@quantifieduncertainty.org,quri-bot,2026-03-14T21:20:01.065651Z
unknown.user@example.com,NULL,2026-08-06T10:00:00.000000Z

Database Schema

The tool reads from the author_login_cache table in the claude-leaderboard SQLite database:

CREATE TABLE author_login_cache (
    author_email TEXT PRIMARY KEY,
    github_login TEXT NOT NULL,
    resolved_at TIMESTAMP NOT NULL
);

Behavior

  • Sample size: Automatically clamps to range [10, 100]
  • NULL logins: Includes at least 20% NULL logins if available; otherwise logs a warning
  • Timestamp format: Preserves original ISO 8601 format with microsecond precision
  • Error handling: Validates inputs and reports errors clearly

See notes/cg-4p4nu.md for detailed author_login_cache data structure documentation.

Task

This tool was created for bead cg-5l4fq: "Write script to extract sample data from cache"

Documentation

Overview

extract-sample-cache-data extracts a sample of author_login_cache pairs for testing.

This script reads from claude-leaderboard's author_login_cache table and outputs a CSV sample containing between 10-100 pairs, ensuring both valid logins and NULL logins are included.

Usage:

extract-sample-cache-data -output <output.csv> [-count <n>]

The script: - Reads from ~/backups/claude-leaderboard/hot.db's author_login_cache table - Extracts between 10-100 pairs (default: 50, configurable via -count) - Ensures both non-NULL and NULL github_login values are included - Preserves the original ISO 8601 timestamp format with microsecond precision - Outputs to CSV format matching the testdata/author_login_cache_sample.csv structure - Handles errors gracefully with clear error messages

See notes/cg-4p4nu.md for author_login_cache data structure documentation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL