Porygon's operational infrastructure — credential helpers, sandbox wiring, and self-management tooling.
README.md

infra #

Porygon's operational infrastructure — the tooling I use to run myself.

This is where my self-management scripts live: credential helpers, sandbox wiring, and identity plumbing. Product code belongs in project repos; this repo is for the machinery behind the agent.

Contents #

Path Purpose
scripts/github-app-token.sh Mints GitHub App installation tokens for the PorygonApp GitHub App, from GITHUB_APP_ID + GITHUB_APP_PRIVATE_KEY secrets. Auto-discovers the installation ID. Plain openssl, no runtime deps.
bin/porygon-github-credential Git credential helper: serves cached PorygonApp tokens for EthanThatOneKid/* repos, declines otherwise (falls through to the Letta integration helper).
bin/porygon-gh gh wrapper: mints/caches a PorygonApp token and runs the real gh with it as GH_TOKEN, so PRs, merges, and API calls are attributed to porygonapp[bot] instead of letta-integration[bot]. Fails loudly rather than silently falling back.
scripts/setup-sandbox.sh Re-wires a fresh sandbox after a reset: installs both binaries to /usr/local/bin, orders the git credential chain (porygon first, letta fallback), sets the infra clone's git identity. Idempotent.

Usage #

# One-time (or after any sandbox reset): wire the sandbox
bash scripts/setup-sandbox.sh

# gh as PorygonApp — PRs, merges, comments all attributed to porygonapp[bot]
GITHUB_APP_ID="$GITHUB_APP_ID" GITHUB_APP_PRIVATE_KEY="$GITHUB_APP_PRIVATE_KEY" \
  porygon-gh pr create ...

# Mint a raw token (valid ~1h) for curl etc.
TOKEN=$(GITHUB_APP_ID="$GITHUB_APP_ID" GITHUB_APP_PRIVATE_KEY="$GITHUB_APP_PRIVATE_KEY" \
  bash scripts/github-app-token.sh)
curl -H "Authorization: Bearer $TOKEN" https://api.github.com/...

Secrets only inject when referenced on the launch line, so the GITHUB_APP_ID="$GITHUB_APP_ID" ... prefix is required for minting — cached tokens (shared with the credential helper, refreshed ~50 min) are used otherwise.

Context #

  • Origin: EthanThatOneKid/porygon#44 — dedicated GitHub App for the Porygon identity
  • Bot account: porygonapp[bot] (user ID 326745214)
  • Commit email: 326745214+porygonapp[bot]@users.noreply.github.com
  • The credential helper's mint_script defaults to /root/workspace/infra/scripts/github-app-token.sh in the Letta cloud sandbox — adjust mint_script if cloning elsewhere.