Skip to content

Commit 58f96ca

Browse files
hyperpolymathclaude
andcommitted
docs(sustainabot): add Green Web integration docs, fix Oikos→SustainaBot naming
Document the Hypatia green_web.ex → fleet_dispatcher → SustainaBot pipeline in both README.adoc and ARCHITECTURE.md. Fix "Oikos Bot" naming remnants in the GitHub App setup guide. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ee0276e commit 58f96ca

3 files changed

Lines changed: 39 additions & 3 deletions

File tree

bots/sustainabot/ARCHITECTURE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,26 @@ sustainabot ──────── SARIF ──────── GitHub Secur
135135
| |
136136
| +── shared-context ──── Cross-bot findings
137137
|
138+
|── hypatia (green_web.ex) ──── Green Web hosting/CDN/registry checks
139+
| | Routes via fleet_dispatcher.ex
140+
| +── reportEcoScore ──── GraphQL mutation → eco_score findings
141+
|
138142
+── .bot_directives/ ────────── Per-repo permission control
139143
```
140144

145+
### Hypatia Green Web Integration
146+
147+
SustainaBot receives infrastructure-level sustainability findings from Hypatia's
148+
`green_web.ex` rule module via the fleet dispatch pipeline:
149+
150+
1. **Hypatia** scans repos for hosting provider, CDN, container registry choices
151+
2. **fleet_dispatcher.ex** classifies Green Web findings as `:control` actions
152+
3. **`dispatch_to_sustainabot/1`** sends a `reportEcoScore` GraphQL mutation
153+
4. **SustainaBot** incorporates the infrastructure eco score and generates fix suggestions
154+
155+
This separates concerns: Hypatia owns *detection* (scanning 500+ repos), SustainaBot
156+
owns *action* (PRs, badges, SARIF annotations).
157+
141158
## Scoring
142159

143160
### Health Index

bots/sustainabot/README.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,25 @@ def is_high_energy(energy_joules: Float) -> Bool
181181

182182
Built-in policies (in `policies/`): energy threshold, carbon budget, memory efficiency, security-sustainability correlation.
183183

184+
=== Green Web Integration
185+
186+
SustainaBot receives **Green Web findings** from https://github.com/hyperpolymath/hypatia[Hypatia]'s neurosymbolic scanner. Hypatia's `green_web.ex` rule module detects:
187+
188+
* Non-green hosting providers (AWS, Vultr, GoDaddy, etc.)
189+
* Missing Green Web Foundation badges in README
190+
* Non-green CDN providers (CloudFront, StackPath)
191+
* Non-green container registries
192+
193+
Hypatia routes these findings through its **fleet dispatcher** as `:control` actions, which arrive at SustainaBot via the `reportEcoScore` GraphQL mutation. SustainaBot then:
194+
195+
1. Incorporates the hosting/infrastructure eco score into its overall `HealthIndex`
196+
2. Generates SARIF annotations with fix suggestions (e.g., migrate from AWS to Hetzner)
197+
3. Opens PRs to add Green Web Foundation badges where missing
198+
199+
This creates a full pipeline: **Hypatia detects** → **fleet dispatcher routes** → **SustainaBot acts**.
200+
201+
See https://api.thegreenwebfoundation.org[Green Web Foundation API] for domain verification.
202+
184203
=== Fleet Integration
185204

186205
SustainaBot runs as a https://github.com/hyperpolymath/gitbot-fleet[gitbot-fleet] member for multi-repo orchestration:

bots/sustainabot/docs/GITHUB_APP_SETUP.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# GitHub App Setup Guide
55

6-
This guide explains how to create and configure a GitHub App for Oikos Bot.
6+
This guide explains how to create and configure a GitHub App for SustainaBot.
77

88
## Prerequisites
99

@@ -18,7 +18,7 @@ This guide explains how to create and configure a GitHub App for Oikos Bot.
1818

1919
| Field | Value |
2020
|-------|-------|
21-
| **GitHub App name** | Oikos Bot (or your chosen name) |
21+
| **GitHub App name** | SustainaBot (or your chosen name) |
2222
| **Homepage URL** | Your repo URL |
2323
| **Webhook URL** | `https://your-domain.com/webhooks/github` |
2424
| **Webhook secret** | Generate a secure random string |
@@ -81,7 +81,7 @@ For production, use a secrets manager. For Kubernetes:
8181
apiVersion: v1
8282
kind: Secret
8383
metadata:
84-
name: oikos-bot
84+
name: sustainabot
8585
type: Opaque
8686
stringData:
8787
GITHUB_APP_ID: "123456"

0 commit comments

Comments
 (0)