autosolve

command module
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

README

autosolve

CI Go Reference License

Available languages: English, Русский

Lightweight daemon that polls GitHub repositories and dispatches AI agents to solve issues automatically.

Original project vision: docs/IDEA.md

Navigation

Tech Stack

Component Technology
Language Go
Database SQLite (pure Go, WAL mode)
Migrations goose
SQL codegen sqlc
DI Wire
Observability OpenTelemetry (traces, metrics, logs → OTLP/gRPC)
CLI cobra + viper

Quick Start

Prerequisites
  • Go 1.26+
  • Task (optional, but recommended)
Setup
git clone https://github.com/thumbrise/autosolve.git
cd autosolve
go mod download
cp config.yml.example config.yml

Edit config.yml — at minimum set your GitHub token and target repositories:

github:
  token: ghp_your_token_here
  repositories:
    - owner: your-org
      name: your-repo
OpenTelemetry

Disabled by default.

You can collect OpenTelemetry data via configuration variables with standard OTEL semantic:

otel:
  sdkDisabled: true
  serviceName: autosolve
  resourceAttributes: "service.version=1.0.0,deployment.environment=production"
  propagators: "tracecontext,baggage"
  traces:
    exporter: otlp
    sampler: parentbased_always_on
    samplerArg: "1.0"
  metrics:
    exporter: otlp
  logs:
    exporter: otlp
  exporter:
    endpoint: "localhost:4317"
    protocol: grpc
    headers: "uptrace-dsn=http://aiji-qvjRjFBnObLuzAkpA@localhost:14318?grpc=14317"
    timeout: 10s

All config fields can be overridden via environment variables with AUTOSOLVE_ prefix. Example: otel.serviceNameAUTOSOLVE_OTEL_SERVICENAME.

See: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/

Migrate database
go run . migrate up -y

Start scheduler
go run . schedule

Or using Task:

task up

Architecture

cmd/                    CLI entry points (cobra)
internal/
├── bootstrap/          App init (Bootstrap → Wire → Kernel)
├── config/             Typed config structs (viper-backed)
├── domain/             Business logic
│   ├── issue/          Issue parser (Worker)
│   ├── repository/     Repository validator (Preflight)
│   └── spec/           Task specs
│       └── tenants/    Tenant definitions (e.g. RepoTenant)
├── application/        Orchestration layer
│   ├── schedule.go     Two-phase Scheduler
│   ├── planner.go      Per-repo task planning
│   ├── contracts.go    Preflight / Worker interfaces
│   └── registry.go     Task registration
└── infrastructure/     External dependencies
    ├── config/         Config loading (viper reader, validator)
    ├── github/         GitHub API client + rate limiter
    ├── dal/            Data access layer
    │   ├── model/      Domain models
    │   ├── queries/    Raw SQL files (sqlc source)
    │   ├── repositories/ Repository implementations
    │   └── sqlcgen/    sqlc-generated code
    ├── database/       SQLite connection + goose migrator
    ├── logger/         slog setup
    └── telemetry/      OTEL SDK bootstrap
pkg/
└── longrun/            Task orchestration with per-error retry and backoff

The scheduler runs in two phases:

  1. Preflights — one-shot tasks (e.g. validate repository access via GitHub API). All must pass before workers start.
  2. Workers — long-running interval tasks (e.g. poll and parse issues). If any worker fails permanently, all others are cancelled.

Commands

Command Description
schedule Start the polling daemon
migrate up [N] Apply pending migrations (all by default)
migrate up:fresh Drop all tables and re-run all migrations
migrate down <N|*> Roll back N migrations (or all with *)
migrate status Show migration status
migrate create <name> Create a new SQL migration file
migrate redo Roll back and re-apply the last migration

Development

task generate   # sqlc + wire + license headers
task lint        # golangci-lint + license-eye + govulncheck + sqlfluff + sqlcgen type check
task test        # unit tests + benchmarks

Current Status

Epic v1 is in progress — see Epic: v1 architecture redesign.

What works today:

  • Multi-repo GitHub issue polling with state persistence in SQLite
  • Repository validation preflight
  • Rate limiting via HTTP transport
  • goose migrations + sqlc-generated DAL
  • Full OTEL observability (traces, metrics, logs)
  • Two-phase scheduler with per-error retry and exponential backoff

License

Apache License 2.0

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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