Skip to content

distributed event pipeline — Go side#175

Draft
motatoes wants to merge 1 commit intomainfrom
feat/cf-pipeline
Draft

distributed event pipeline — Go side#175
motatoes wants to merge 1 commit intomainfrom
feat/cf-pipeline

Conversation

@motatoes
Copy link
Copy Markdown
Contributor

Companion to the Cloudflare Workers + D1 schema + CreditAccount DO in diggerhq/opencomputer-infra-internal. This is the Go half: Redis Streams replacing NATS, HMAC-signed event forwarding to the CF events-ingest Worker, HMAC-authed /admin/halt-org + /admin/resume-org endpoints called by the CF CreditAccount DO, and a 60s halt_reconciler safety-net pull of /internal/halt-list from the CF api-edge Worker.

Runs alongside existing PG billing unchanged (CF-parallel mode): the DO mirrors orgs.free_credits_remaining_cents rather than replacing it, and halt/resume dispatches are idempotent against the existing hibernate.

Highlights:

  • Worker XADDs to events:{cell_id} stream every 2s; CP forwarder drains via XREADGROUP + XAUTOCLAIM, enriches each envelope with (org_id, plan) via PG lookup, and ships HMAC-signed batches to the CF ingest Worker.
  • cfg.CellID (OPENSANDBOX_CELL_ID, defaults "dev-cell-a") is the new deployment identifier; cfg.Region retained for AWS/Azure/S3 duties. Renaming the two fully is deferred to the CF-authoritative cutover.
  • usage_collector emits usage_tick events every 60s so CF can aggregate billing independently of PG.
  • NATS fully removed: event_publisher, sync_consumer, controlplane/server.go (orphaned — no external callers), and nats.go deps gone.

Companion to the Cloudflare Workers + D1 schema + CreditAccount DO in
diggerhq/opencomputer-infra-internal. This is the Go half: Redis Streams
replacing NATS, HMAC-signed event forwarding to the CF events-ingest
Worker, HMAC-authed /admin/halt-org + /admin/resume-org endpoints called
by the CF CreditAccount DO, and a 60s halt_reconciler safety-net pull of
/internal/halt-list from the CF api-edge Worker.

Runs alongside existing PG billing unchanged (CF-parallel mode): the DO
mirrors orgs.free_credits_remaining_cents rather than replacing it, and
halt/resume dispatches are idempotent against the existing hibernate.

Highlights:
- Worker XADDs to events:{cell_id} stream every 2s; CP forwarder drains
  via XREADGROUP + XAUTOCLAIM, enriches each envelope with (org_id, plan)
  via PG lookup, and ships HMAC-signed batches to the CF ingest Worker.
- cfg.CellID (OPENSANDBOX_CELL_ID, defaults "dev-cell-a") is the new
  deployment identifier; cfg.Region retained for AWS/Azure/S3 duties.
  Renaming the two fully is deferred to the CF-authoritative cutover.
- usage_collector emits usage_tick events every 60s so CF can aggregate
  billing independently of PG.
- NATS fully removed: event_publisher, sync_consumer, controlplane/server.go
  (orphaned — no external callers), and nats.go deps gone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opensandbox Ready Ready Preview, Comment Apr 20, 2026 7:43pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant