feat: Initialize Rust project with dependencies and tooling

Set up the GitLab Inbox (gi) CLI tool as a Rust 2024 edition project.

Dependencies organized by purpose:
- Database: rusqlite (bundled SQLite), sqlite-vec for vector search
- Serialization: serde/serde_json for GitLab API responses
- CLI: clap for argument parsing, dialoguer for interactive prompts,
  comfy-table for formatted output, indicatif for progress bars
- HTTP: reqwest with tokio async runtime for GitLab API calls
- Async: async-stream and futures for paginated API iteration
- Utilities: thiserror for error types, chrono for timestamps,
  flate2 for payload compression, sha2 for content hashing
- Logging: tracing with env-filter for structured debug output

Release profile optimized for small binary size (LTO, strip symbols).

Project structure follows standard Rust conventions with src/lib.rs
exposing modules and src/main.rs as CLI entry point.

Added .gitignore for Rust/Cargo artifacts and local database files.
Added AGENTS.md with TDD workflow guidance and beads issue tracking
integration instructions for AI-assisted development.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Taylor Eernisse
2026-01-26 11:27:30 -05:00
parent e846a39ce6
commit e065862f81
4 changed files with 2892 additions and 0 deletions

46
.gitignore vendored Normal file
View File

@@ -0,0 +1,46 @@
# Dependencies
node_modules/
# Build output
dist/
# Test coverage
coverage/
# IDE
.idea/
.vscode/
*.swp
*.swo
*~
# OS files
.DS_Store
Thumbs.db
# Environment
.env
.env.local
.env.*.local
# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Local config files
gi.config.json
# beads
.bv/
# SQLite databases (local development)
*.db
*.db-wal
*.db-shm
# Added by cargo
/target

166
AGENTS.md Normal file
View File

@@ -0,0 +1,166 @@
# AGENTS.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## TDD Requirements
Test-first development is mandatory:
1. **RED** - Write failing test first
2. **GREEN** - Minimal implementation to pass
3. **REFACTOR** - Clean up while green
## Key Patterns
Find the simplest solution that meets all acceptance criteria.
Use third party libraries whenever there's a well-maintained, active, and widely adopted solution (for example, date-fns for TS date math)
Build extensible pieces of logic that can easily be integrated with other pieces.
DRY principles should be loosely held.
Architecture MUST be clear and well thought-out. Ask the user for clarification whenever ambiguity is discovered around architecture, or you think a better approach than planned exists.
## Beads Rust Workflow Integration
This project uses [beads_viewer](https://github.com/Dicklesworthstone/beads_viewer) for issue tracking. Issues are stored in `.beads/` and tracked in git.
### Essential Commands
```bash
# View issues (launches TUI - NOT FOR AGENT USE, human only)
bv
# CLI commands for agents (use --json for machine-readable output)
br ready --json # Show issues ready to work (no blockers)
br list --status=open --json # All open issues
br show <id> --json # Full issue details with dependencies
br create --title="..." --type=task --priority=2
br update <id> --status=in_progress
br close <id> --reason="Completed"
br close <id1> <id2> # Close multiple issues at once
br sync # Commit and push changes
```
### Robot Mode (Agent-Optimized bv Commands)
Use `bv --robot-*` flags for structured JSON output optimized for AI agents:
```bash
# Essential robot commands
bv --robot-triage # THE MEGA-COMMAND: unified analysis, recommendations, health
bv --robot-next # Single top recommendation (minimal output)
bv --robot-plan # Dependency-respecting execution plan
bv --robot-priority # Priority recommendations with reasoning
bv --robot-insights # Deep graph analysis (PageRank, bottlenecks, etc.)
# File impact analysis (check before editing)
bv --robot-impact <file> # Risk assessment for modifying files
bv --robot-file-beads <path> # What beads have touched this file?
bv --robot-file-hotspots # High-churn files (conflict zones)
bv --robot-related <bead-id> # Find related beads
# Filtering options (work with most robot commands)
bv --robot-triage --robot-by-label=backend
bv --robot-priority --robot-min-confidence=0.7
bv --robot-insights --label=api # Scope to label subgraph
```
Run `bv -robot-help` for complete robot mode documentation.
### Workflow Pattern
1. **Start**: Run `br ready` to find actionable work
2. **Claim**: Use `br update <id> --status=in_progress`
3. **Work**: Implement the task
4. **Complete**: Use `br close <id>`
5. **Sync**: Always run `br sync` at session end
### Key Concepts
- **Dependencies**: Issues can block other issues. `br ready` shows only unblocked work.
- **Priority**: P0=critical, P1=high, P2=medium, P3=low, P4=backlog (use numbers, not words)
- **Types**: task, bug, feature, epic, question, docs
- **Blocking**: `br dep add <issue> <depends-on>` to add dependencies
### Session Protocol
**Before ending any session, run this checklist:**
```bash
git status # Check what changed
git add <files> # Stage code changes
br sync # Commit beads changes
git commit -m "..." # Commit code
br sync # Commit any new beads changes
git push # Push to remote
```
### Best Practices
- Check `br ready` at session start to find available work
- Update status as you work (in_progress → closed)
- Create new issues with `br create` when you discover tasks
- Use descriptive titles and set appropriate priority/type
- Always `br sync` before ending session
<!-- end-br-agent-instructions -->
<!-- bv-agent-instructions-v1 -->
---
## Beads Workflow Integration
This project uses [beads_viewer](https://github.com/Dicklesworthstone/beads_viewer) for issue tracking. Issues are stored in `.beads/` and tracked in git.
### Essential Commands
```bash
# View issues (launches TUI - avoid in automated sessions)
bv
# CLI commands for agents (use these instead)
bd ready # Show issues ready to work (no blockers)
bd list --status=open # All open issues
bd show <id> # Full issue details with dependencies
bd create --title="..." --type=task --priority=2
bd update <id> --status=in_progress
bd close <id> --reason="Completed"
bd close <id1> <id2> # Close multiple issues at once
bd sync # Commit and push changes
```
### Workflow Pattern
1. **Start**: Run `bd ready` to find actionable work
2. **Claim**: Use `bd update <id> --status=in_progress`
3. **Work**: Implement the task
4. **Complete**: Use `bd close <id>`
5. **Sync**: Always run `bd sync` at session end
### Key Concepts
- **Dependencies**: Issues can block other issues. `bd ready` shows only unblocked work.
- **Priority**: P0=critical, P1=high, P2=medium, P3=low, P4=backlog (use numbers, not words)
- **Types**: task, bug, feature, epic, question, docs
- **Blocking**: `bd dep add <issue> <depends-on>` to add dependencies
### Session Protocol
**Before ending any session, run this checklist:**
```bash
git status # Check what changed
git add <files> # Stage code changes
bd sync # Commit beads changes
git commit -m "..." # Commit code
bd sync # Commit any new beads changes
git push # Push to remote
```
### Best Practices
- Check `bd ready` at session start to find available work
- Update status as you work (in_progress → closed)
- Create new issues with `bd create` when you discover tasks
- Use descriptive titles and set appropriate priority/type
- Always `bd sync` before ending session
<!-- end-bv-agent-instructions -->

2620
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

60
Cargo.toml Normal file
View File

@@ -0,0 +1,60 @@
[package]
name = "gi"
version = "0.1.0"
edition = "2024"
description = "GitLab Knowledge Engine - semantic search for GitLab issues, MRs, and discussions"
authors = ["Taylor Eernisse"]
license = "MIT"
[[bin]]
name = "gi"
path = "src/main.rs"
[dependencies]
# Database
rusqlite = { version = "0.38", features = ["bundled"] }
sqlite-vec = "0.1"
# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# CLI
clap = { version = "4", features = ["derive"] }
dialoguer = "0.12"
console = "0.16"
indicatif = "0.18"
comfy-table = "7"
open = "5"
# HTTP
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
# Async streaming for pagination
async-stream = "0.3"
futures = { version = "0.3", default-features = false, features = ["alloc"] }
# Utilities
thiserror = "2"
dirs = "6"
url = "2"
urlencoding = "2"
sha2 = "0.10"
flate2 = "1"
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["v4"] }
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-indicatif = "0.3"
[dev-dependencies]
tempfile = "3"
wiremock = "0.6"
[profile.release]
lto = true
codegen-units = 1
strip = true