|
| 1 | +# Platform Design — Phase 5 Infrastructure |
| 2 | + |
| 3 | +Design specs for features requiring deployment infrastructure. |
| 4 | +Code is buildable; deployment needs human action (account setup, DNS, secrets). |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## A: Arbiter Cloud (REST API) |
| 9 | + |
| 10 | +**What**: Hosted scoring API — `POST /score` with a GitHub URL, get a score back. |
| 11 | + |
| 12 | +**Architecture**: |
| 13 | +``` |
| 14 | +Client → Arbiter API (Cloudflare Workers or Fly.io) |
| 15 | + ├── Clone repo (shallow, temp) |
| 16 | + ├── Run analyzers |
| 17 | + ├── Return JSON score |
| 18 | + └── Record in audit trail |
| 19 | +``` |
| 20 | + |
| 21 | +**Endpoints**: |
| 22 | +- `POST /v1/score` — score a repo by URL |
| 23 | +- `POST /v1/certify` — full certification |
| 24 | +- `GET /v1/leaderboard` — current leaderboard |
| 25 | +- `GET /v1/health` — service health |
| 26 | + |
| 27 | +**Auth**: API key in `X-Arbiter-Key` header. Free tier: 10 scores/day. Paid: unlimited. |
| 28 | + |
| 29 | +**Deployment**: `arbiter serve` already exists. Wrap in Dockerfile, deploy to Fly.io. |
| 30 | + |
| 31 | +**Human action needed**: |
| 32 | +- [ ] Create Fly.io account or Cloudflare Workers project |
| 33 | +- [ ] Set up domain: api.hummbl.io or arbiter.hummbl.io |
| 34 | +- [ ] Configure secrets: GITHUB_TOKEN for cloning |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## B: GitHub App |
| 39 | + |
| 40 | +**What**: Install on an org → automatic PR quality checks on every push. |
| 41 | + |
| 42 | +**How it works**: |
| 43 | +1. PR opened → GitHub sends webhook to Arbiter API |
| 44 | +2. Arbiter clones the PR branch |
| 45 | +3. Runs `arbiter diff --base main` |
| 46 | +4. Posts score as PR check + comment |
| 47 | +5. Fails the check if below threshold |
| 48 | + |
| 49 | +**App manifest** (register at github.com/settings/apps/new): |
| 50 | +```yaml |
| 51 | +name: HUMMBL Arbiter |
| 52 | +description: Deterministic code quality scoring |
| 53 | +url: https://hummbl.io/audit |
| 54 | +webhook_url: https://api.hummbl.io/github/webhook |
| 55 | +permissions: |
| 56 | + checks: write |
| 57 | + pull_requests: write |
| 58 | + contents: read |
| 59 | +events: |
| 60 | + - pull_request |
| 61 | +``` |
| 62 | +
|
| 63 | +**Human action needed**: |
| 64 | +- [ ] Register GitHub App at github.com/settings/apps |
| 65 | +- [ ] Set webhook secret |
| 66 | +- [ ] Deploy webhook receiver (part of Arbiter Cloud API) |
| 67 | +- [ ] Create installation flow page on hummbl.io |
| 68 | +
|
| 69 | +--- |
| 70 | +
|
| 71 | +## C: Dashboard |
| 72 | +
|
| 73 | +**What**: Web UI showing fleet scores, trends, team leaderboard. |
| 74 | +
|
| 75 | +**Architecture**: Static HTML generated by `arbiter leaderboard --html` + weekly GitHub Action. |
| 76 | +For v1, no backend needed — just static files served from GitHub Pages or hummbl.io. |
| 77 | + |
| 78 | +**Pages**: |
| 79 | +- `/leaderboard` — top repos by quality score (generated weekly) |
| 80 | +- `/repo/:name` — individual repo score card (future) |
| 81 | +- `/certify` — certification status page (future) |
| 82 | + |
| 83 | +**Human action needed**: |
| 84 | +- [ ] Add GitHub Pages to arbiter repo, or |
| 85 | +- [ ] Deploy to hummbl.io/audit subdirectory |
| 86 | +- [ ] Wire weekly Action to push generated HTML |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## Implementation Order |
| 91 | + |
| 92 | +1. **PyPI package** (this PR) — enables `pip install arbiter-score` |
| 93 | +2. **Leaderboard HTML** (parallel PR) — static page ready to deploy |
| 94 | +3. **Webhooks** (parallel PR) — notification module |
| 95 | +4. **Arbiter Cloud** — after PyPI is live, wrap `serve` in Docker |
| 96 | +5. **GitHub App** — after Cloud API is live |
| 97 | +6. **Dashboard** — leaderboard HTML is v1; expand later |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +*Powered by [HUMMBL](https://hummbl.io) — governed AI for enterprise.* |
0 commit comments