Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

feat(forge-opengit): webhook ingest + /webhooks/:forge registry

2 months ago

54473bf
Authored
grim8/17/2026, 6:24:38 AM
Adds the inbound half of the open-git adapter and turns the webhook route
into one param route over a compiler-enforced registry.

- packages/forge-opengit: signature verification (own copy of the sha256
  scheme — adapters never import siblings) and normalization
- POST /webhooks/:forge over Record<Forge, ForgeWebhook>. A param route
  invites two holes; both are shut by construction: :forge is parsed with
  forgeSchema so an unknown value 404s before the body is read, and the
  Record fails to compile until a new forge has a verifier and headers
- an unset per-forge secret returns 503, never "accept everything"
- insertRawEvent's forge is typed from the catalog instead of a hand-written
  union that silently rejected a newly live forge
- opengit is status: live for INGEST — it can store events, not read repos

THE ACTOR GAP: open-git's pull_request payload carries no author. Verified
against the sender (create-pull-request.ts calls emitPullRequestWebhooks
without one, though actorProfileId is in scope). Those events normalize to
null rather than inventing a contributor; comments carry comment.author and
normalize for real. 8 of 9 rules are declared unusable on opengit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Parentf95f0c8

16 files changed
  • apps/api/package.json+1−0
  • apps/api/src/routes/webhooks.ts+111−41
  • apps/worker/package.json+1−0
  • apps/worker/src/forge-runtime.ts+11−3
  • bun.lock+5−6
  • packages/contracts/src/forges.ts+10−5
  • packages/contracts/src/rules.ts+24−2
  • packages/core/src/rules/forge-support.test.ts+18
−13
  • packages/db/src/services/events.ts+5−2
  • packages/forge-opengit/package.json+19−0
  • packages/forge-opengit/src/index.ts+14−0
  • packages/forge-opengit/src/webhook/normalize.test.ts+115−0
  • packages/forge-opengit/src/webhook/normalize.ts+131−0
  • packages/forge-opengit/src/webhook/verify.ts+34−0
  • packages/forge-opengit/tsconfig.json+4−0
  • scripts/check-boundaries.ts+2−1