Skip to content

feat(worker): add production runtime - #53

Merged
SuPuHe merged 2 commits into
developfrom
feature/production-worker-runtime
Sep 9, 2026
Merged

SuPuHe merged 2 commits into
developfrom
feature/production-worker-runtime

Conversation

@SuPuHe

@SuPuHe SuPuHe commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a runnable production worker process for durable OneShot settlement and recovery.

Scope and acceptance criteria

  • Production worker entry point with startup migration, restart recovery, continuous PostgreSQL outbox polling, health/readiness, and graceful shutdown.
  • Real Privy Node signing, Arc receipt observation, Subgraph MCP discovery, and Vertex advisory recovery wired fail-closed.
  • Outbox jobs are marked DELIVERED only after handler success; failures remain retryable.
  • Dedicated Dockerfile.worker, worker scripts, and documented environment contract.
  • Provider/configuration/rollback/restart and API-to-worker replay tests added.
  • No secrets, generated browser artifacts, unrelated changes, or weakened checks.

Product and security invariants

  • Tenant isolation remains fail-closed.
  • Sponsor authorization, auditability, and daily caps remain enforced where applicable.
  • Recipients cannot modify sponsor controls or access sponsor-only data.
  • No secret, token, production identifier, or personal data is committed or pasted into review prompts.
  • Settlement remains testnet-only and UNKNOWN never grants blind retry authority.

Invariant notes:

Privy policy identity is re-observed, Arc receipts are identity-bound, Graph and Vertex remain candidate/advisory only, and settlement permission is never inferred from external-index absence or delay.

Validation

Commands and results:

pnpm test: PASS (60 files, 911 tests)
pnpm build: PASS
pnpm lint: PASS
pnpm typecheck: PASS
pnpm check:generated: PASS
pnpm validate:fixtures: PASS
pnpm --filter @oneshot/worker typecheck: PASS
pnpm --filter @oneshot/worker test: PASS (32 tests)
pnpm --filter @oneshot/storage-postgres test: PASS (8 tests)
PostgreSQL/Testcontainers integration: NOT VERIFIED locally; Docker is unavailable on the development host.

The first CI run exposed a 500 in the production-runtime E2E because its API-side IntentLedger was missing required now and nextAttemptId dependencies. Commit da65a162308c2652807672f32919c7fe431876fc supplies deterministic dependencies; the test still asserts create 202, COMMITTED, replay 200, and exactly one submission.

Independent review evidence

Gate A — original worker-runtime candidate

  • Base commit SHA: c38511c3981bbd70c6f4abd7a4ce469000cda878
  • Candidate tree SHA: 52ec4ffc958e5515d5a47b29d290ee6aa48ac505
  • Candidate commit SHA: 3b23a3c4401d68dd1e4ca540f00fece7a6eabed9
  • Reviewer tool/model: free-pi-cli / glm-5.3-flash
  • Verdict: VERDICT: PASS

Gate A — E2E fix candidate

  • Base commit SHA: c38511c3981bbd70c6f4abd7a4ce469000cda878

  • Reviewed staged tree SHA: 10f94fa9a5e8f5345ff92afd5b1d16497e53c977

  • Committed head SHA: da65a162308c2652807672f32919c7fe431876fc

  • Committed tree SHA: 10f94fa9a5e8f5345ff92afd5b1d16497e53c977

  • Reviewer tool/model: free-pi-cli / glm-5.3-flash

  • Verdict: VERDICT: PASS

  • Findings/residual risks: Testcontainers E2E and Docker image build require a container-capable environment; worker test sources are outside the current tsc project.

  • The current committed tree equals the Gate A reviewed tree.

Gate B — exact remote PR head

  • Pull request URL/number: feat(worker): add production runtime #53

  • Remote head commit SHA: pending CI

  • Remote head tree SHA: 10f94fa9a5e8f5345ff92afd5b1d16497e53c977

  • Reviewer tool/model: pending

  • Verdict: pending

  • Findings or residual risks: pending

  • Gate B reviewed the current remote head and matches Gate A's approved tree.

  • All applicable CI checks pass.

Risk and rollback

  • Residual risks: Dockerfile worker build and PostgreSQL E2E require container execution; workspace dependency audit retains pre-existing Graph CLI/Wrangler advisories.
  • Rollback or recovery plan: revert commit da65a162308c2652807672f32919c7fe431876fc or redeploy the prior API/worker image; durable UNKNOWN intents remain reconciliation-bound.

Human merge

  • A human owner has reviewed the evidence and will perform the merge.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
oneshot da65a16 Sep 09 2026, 06:30 PM

@SuPuHe
SuPuHe marked this pull request as ready for review September 9, 2026 18:37
@SuPuHe
SuPuHe merged commit 7ae55c8 into develop Sep 9, 2026
5 checks passed
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