- Go 99%
- Shell 0.7%
- Dockerfile 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .claude | ||
| .forgejo/workflows | ||
| .githooks | ||
| api | ||
| cmd | ||
| docs | ||
| explanation | ||
| mcp | ||
| pkg | ||
| report | ||
| scripts | ||
| telemetry | ||
| test/e2e | ||
| .containerignore | ||
| .gitignore | ||
| .golangci.yml | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| Containerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| README.md | ||
Longshot-api
Magic Bean's server side for Longshot, in Go, published on one host, https://data-services.magicbean.dev, a path
prefix per root. Each root is its own service:
| Root | Binary | What it does | Public address |
|---|---|---|---|
telemetry/ |
cmd/telemetry |
Crash reports in, one comment per crash on Longshot's issue 81 out; performance summaries in, Prometheus metrics out; the launcher's failed builds in, one comment per failure on the build issue out (BUILD_ISSUE), and with the statistics ticked how every build ended and its stages' times, counted for Prometheus |
/telemetry/crash, /telemetry/perf, /telemetry/build |
mcp/ |
cmd/mcp-gate |
The sign-in in front of every MCP server (Discord's, and Forgejo's for /mcp/issue): the OAuth servers MCP clients log in with, and Traefik's check on each request |
/mcp/<name> (Grafana's: /mcp/grafana), and the sign-in at /oauth/ and /.well-known/ |
mcp/issue/ |
cmd/mcp-issue |
The bug reporter people's AIs talk to: it finds the issues and pull requests a problem already has, asks for what the issue forms need, and opens an issue or adds to one with the person's own forge login (the work is report/'s) |
/mcp/issue |
Shared code is in pkg/, packages that know nothing of Longshot and that every service may reuse: an issue tracker
interface with Forgejo behind it (pkg/issues, pkg/forgejo), identity tokens (pkg/authn), OAuth, Discord, OTLP,
the Prometheus text format, and so on.
This repository is the app: code, tests and images. The Kubernetes definitions that run it are in
Bean-Ops (deploy/).
Work on it
scripts/install-hooks.sh once per clone: the pre-commit hook lints what you commit
scripts/lint.sh golangci-lint (pinned), gofmt/goimports, go vet
go test -race ./... the unit tests, and the checks that generated docs are current
go test -tags e2e ./test/e2e/... the binaries end to end, against fake Forgejo, Prometheus and Discord
scripts/docs.sh regenerates the docs under docs/ and api/ (go generate ./...); --check fails if stale
podman build --target telemetry . the images (targets telemetry, mcp-gate, mcp-issue): static, distroless, nonroot
CI (.forgejo/workflows/ci.yml) runs all of these on every pull request and builds the images; on main it
pushes them to the forge's registry as longshot-api-telemetry, longshot-api-mcp-gate and
longshot-api-mcp-issue, tagged by commit. It needs the repository's REGISTRY_TOKEN (package read/write). main takes reviewed pull requests only.
Documentation
- docs/architecture/index.md: how the services, Traefik, Forgejo, Prometheus and Discord fit together, and how a request is authenticated.
- explanation/: sequence diagrams of the crash reports (manual, asked first, always sent), the performance statistics, the MCP sign-in, and querying the data through MCP.
- docs/architecture/dependencies.md: the package graph (generated).
- docs/reference/: every package's documentation (generated from the code's comments).
- api/telemetry.json, api/mcp-gate.json and api/mcp-issue.json: the HTTP APIs, OpenAPI 3.1 (generated).
- api/telemetry.md: each telemetry payload (crash, perf, build) as a table, field by field, with its answers and an example the relay accepts (generated from the same schema).
License
GPL-3.0-or-later, as Longshot. See LICENSE.