Skip to content

feat: platform-independent runtime adapters and standalone test suite - #121

Merged
KingDoxik merged 9 commits into
mainfrom
feat/platform-independence
Aug 5, 2026
Merged

feat: platform-independent runtime adapters and standalone test suite#121
KingDoxik merged 9 commits into
mainfrom
feat/platform-independence

Conversation

@KingDoxik

Copy link
Copy Markdown
Contributor

Replaces the orbian integration with first-party platform contracts, adds an Effect Cluster adapter, and makes this repository fully standalone — it now runs its own self-host stack and every test suite without the private repository.

Platform independence

Queues, durable workflows, cron, and durable entities sit behind thin first-party contracts (@voidhash/platform); runtime backends are swappable per primitive, not per provider.

  • Restore @voidhash/platform and @voidhash/platform-node; drop every @orbian/* dependency, the workspace escape into a sibling checkout, and the tarball-pinning release script. The repository installs standalone again.
  • Add @voidhash/platform-cluster: durable workflows on ClusterWorkflowEngine, cron on ClusterCron, queues on PersistedQueue, and a durable entity host on Sharding, with single-node (Postgres) and in-memory topologies.
  • Extract the shared Effect workflow-engine mapping to @voidhash/platform/EffectWorkflowRunner, so the node and cluster adapters differ only in the engine they install (platform-node's runner drops from 233 lines to 10).
  • Add @voidhash/platform/conformance — one suite every adapter must pass. It runs unmodified against the memory host, the in-memory cluster, and cluster-over-Postgres, which is what makes "swappable" verifiable rather than aspirational.

Self-host as the development environment

  • docker-compose.dev.yml publishes Postgres and the compiler to the host; the production compose stays locked down.
  • pnpm stack:up brings up the full stack (Postgres, ClickHouse, MinIO, Mailpit, compiler, app); pnpm test:integration runs every suite against it.
  • .env.example documents every variable, including a "Values you must provide" section (WorkOS, model providers, encryption key).

Standalone tests

The core integration harness moves into packages/core/test/_testing/ — the location the tsconfig alias already named. The seam between the suite and whichever composition runs it is one injected contract, CoreTestConnections (db, clickhouse, workos). This repository supplies an env-driven global setup over the self-host stack; downstream compositions provision their own environment and inject the same shape.

packages/core no longer excludes integration tests from typecheck, so drift is caught.

Verification

Against the full local stack: 921 tests across 8 suites, no skips — platform-node 42 (incl. S3/SMTP/Chromium), platform-cluster 43 (incl. conformance on real Postgres), selfhost-entry 62 (incl. ClickHouse + compiler), core 688, backend rpc-smoke 6, agent 15, db 1, mimic-db 64 — plus both e2e smokes (selfhost:smoke, selfhost:release-smoke) and the full unit + typecheck sweep.

The conformance kit found five real bugs while being written, three of them silent — most notably PersistedQueue's maxAttempts being bound into SQL against an INT column, where Number.MAX_SAFE_INTEGER broke the take query and a blanket catchCause reported the failure as "empty queue".

Notes for review

  • Known limitations are documented rather than hidden: the cluster queue delivers one message per batch, cluster entities have no WebSocket sessions, and the shard-ownership check is advisory.
  • selfhost/entry still composes platform-node; switching that composition is the natural follow-up.
  • Includes pre-existing in-flight DATABASE_DIRECT_* work that was already in the tree and too entangled to split cleanly.

🤖 Generated with Claude Code

Replace the orbian integration with first-party platform contracts, add an
Effect Cluster adapter, and make this repository fully standalone: it runs
its own self-host stack and every test suite without the private repository.

Platform
- Restore `@voidhash/platform` contracts and `@voidhash/platform-node`, and
  drop every `@orbian/*` dependency, workspace escape, and release script.
- Add `@voidhash/platform-cluster`: durable workflows on ClusterWorkflowEngine,
  cron on ClusterCron, queues on PersistedQueue, and a durable entity host on
  Sharding, with single-node and in-memory topologies.
- Extract the shared Effect workflow-engine mapping to
  `@voidhash/platform/EffectWorkflowRunner` so node and cluster adapters differ
  only in the engine they install.
- Add `@voidhash/platform/conformance`: one suite every adapter must pass, run
  against the memory, node, and cluster backends.

Self-host as the development environment
- Add a compose dev overlay publishing Postgres and the compiler to the host,
  `pnpm stack:up`, and `pnpm test:integration` covering eight suites.
- Document every variable, including operator-provided ones, in `.env.example`.

Standalone tests
- Move the core integration harness into `packages/core/test/_testing/`, with
  `CoreTestConnections` as the environment contract a composition injects and
  an env-driven global setup over the self-host stack.
- Stop excluding integration tests from typecheck.
@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown

Too many files changed for review (705 files, 100 file limit).

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

Thank you for following the naming conventions for pull request titles! 🙏

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

Install the packages built from 0063b90:

@voidhash/paywalls

pnpm add @voidhash/paywalls@https://pkg.voidha.sh/paywalls/0063b90

@voidhash/node

pnpm add @voidhash/node@https://pkg.voidha.sh/node/0063b90

@voidhash/web

pnpm add @voidhash/web@https://pkg.voidha.sh/web/0063b90

voidhash-cli

pnpm add voidhash-cli@https://pkg.voidha.sh/cli/0063b90

@voidhash/react-native

pnpm add @voidhash/react-native@https://pkg.voidha.sh/react-native/0063b90

Internal workspace deps (generated-clients, shared, studio) are published at the same sha and resolved automatically.

Replace the sha with pr-121 or the branch name to always get the latest build of this PR.

KingDoxik and others added 8 commits August 5, 2026 11:19
The landing page and the design-system site are cloud-company surfaces
rather than open-core product surface, so they move to the host repository
and this app keeps only what a self-hosted deployment needs.

- `/` now hands off to the studio. The route shell stays here because a
  host cannot add a second `/` route without colliding with this one;
  instead `_marketing/index.tsx` renders `features/www/marketing-home-slot`,
  which hosts replace the same way as the other extension points.
- `features/www/landing` and the whole `features/design` + `routes/design`
  tree move out. `hero-shader` stays as `components/hero-shader` because
  the auth pages use it, and `lib/waitlist` / `lib/paths` stay because the
  studio and auth flows depend on them.
- `source.config.ts` keeps only the product-docs collection. A host that
  adds documentation surfaces replaces this config wholesale, since two
  `mdx()` instances would clobber each other's `.source` output.
- Drop `features/www/{button,logo,refraction-stripes,section,navbar,hero}`
  and the `voidhash-gradient-*` cluster, which were reachable only from the
  unreferenced `hero/hero.tsx` that this change removes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
refactor(www): move the marketing and design sites to the host build
…lf-host app

- promote @voidhash/backend to packages/backend with a curated exports map
- merge platform-node + platform-cluster into @voidhash/platform-selfhost;
  the Postgres queue/workflow/cron engines are replaced by Effect Cluster
- add WebSocket sessions and a SQL alarm control plane to the cluster
  entity host; delete the Postgres entity host
- move the composition app selfhost/entry -> apps/backend (@voidhash/backend-app)
- isolate test-built cluster topologies onto a DATABASE_PLATFORM_* database
  so they cannot steal shards from the running app
- add scripts/check-platform-seam.mjs: packages/** must not bind the
  platform-selfhost adapter at runtime
- fix selfhost CI env propagation (--env-file + GITHUB_ENV), the voidql
  compatibility test connections, and the mimic entity-session attachment bug
- pin fumadocs-openapi to 11.2.2 and Node to 22.23.2

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@KingDoxik
KingDoxik merged commit 1c7cfe8 into main Aug 5, 2026
7 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