SYSTEM ARCHITECTURE

From GitHub URL to cited findings.

Two investigators, one Go backend. Issue Lens gathers repository evidence, uses a bounded AI tool loop, and returns a report for human review.

TypeScript / Go / SQLite / Clerk / OpenAI / AWS EC2

Issue Lens architecture: a TypeScript client connects through Cloudflare and Caddy to a single Go backend. Clerk verifies identity; issue and CI investigators use GitHub and OpenAI APIs. Runs and reports persist in SQLite. GitHub Actions deploys to EC2.
Issue Lens system architectureFull-size SVG

REQUEST FLOW

How an investigation runs

  1. Authenticate and submit

    The TypeScript client uses Clerk for Google or email sign-in. It submits a public GitHub issue or failed Actions run URL with a session token. Cloudflare and Caddy route the request to Go; the backend validates the token, URL, and run ownership.

  2. Select keys and queue the run

    A personal OpenAI key bypasses the shared key's one-AI-run-per-hour allowance, not provider or worker limits. Personal connection keys stay in account-scoped browser-tab storage and are sent with the run, never stored in the report database. An in-memory queue limits concurrent work.

  3. Collect evidence

    The issue investigator reads the report, discussion, related issues, and commit-pinned code. The CI investigator collects failed jobs and steps, bounded log excerpts, workflow configuration at the run's head commit, and changed files. Some CI logs require a GitHub token with read access.

  4. Run the bounded tool loop

    OpenAI requests read-only tools: search_issues, search_paths, search_code, and read_file. Go executes those retrieval operations and returns evidence to the model. Each run is capped at 10 model turns, 18 tool operations, 36 GitHub requests, and six minutes.

  5. Validate and persist

    Findings must reference retrieved evidence IDs. SQLite stores owner-scoped runs, evidence, events, reports, review state, and shared-key usage in a persistent Docker volume. Interrupted runs retain collected evidence; report generation can be retried from saved evidence.

  6. Review and export

    The client polls for progress and displays source-linked findings, confidence, open questions, and limitations. The user edits and approves the response draft, then copies it manually or exports the report as Markdown. Approval does not post anything to GitHub.

DEPLOYMENT

One application server

GitHub Actions builds the TypeScript frontend and runs Go tests before deployment over SSH and rsync. Docker Compose runs Caddy and the Go service on EC2. Go serves both the static frontend and REST API; only Caddy exposes public HTTP and HTTPS ports.

BOUNDARIES

Evidence, not an automatic fix

Repository code is never executed, patches are not applied, and responses are not posted automatically. AI mode sends collected evidence to OpenAI. CI credential redaction is best-effort; findings are hypotheses grounded in sources, not proof of a reproduced root cause.