Skip to content

Commit 8d00299

Browse files
committed
refactor(platform): finalize the V2 architecture
Harden run admission, sandbox lifecycle, tenancy, migrations, and release orchestration. Tighten auth, observability, and UI boundaries. Remove V1, token-cost accounting, legacy compatibility, dead packages, and test harnesses. Align preview routing with the owned production wildcard.
1 parent e7277e0 commit 8d00299

730 files changed

Lines changed: 94710 additions & 49025 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dependency-cruiser.cjs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/** @type {import('dependency-cruiser').IConfiguration} */
2+
module.exports = {
3+
forbidden: [
4+
{
5+
name: "no-circular",
6+
severity: "error",
7+
from: { path: "^(apps|packages)/" },
8+
to: { circular: true },
9+
},
10+
{
11+
name: "shared-packages-must-not-import-deployables",
12+
severity: "error",
13+
from: { path: "^packages/" },
14+
to: { path: "^apps/" },
15+
},
16+
{
17+
name: "deployables-must-not-import-other-deployables",
18+
severity: "error",
19+
from: { path: "^apps/([^/]+)/" },
20+
to: { path: "^apps/", pathNot: "^apps/$1/" },
21+
},
22+
{
23+
name: "tool-domains-must-not-import-peer-tool-domains",
24+
severity: "error",
25+
from: { path: "^packages/(tools-[^/]+)/" },
26+
to: { path: "^packages/tools-[^/]+/", pathNot: "^packages/$1/" },
27+
},
28+
{
29+
name: "vercel-web-must-not-import-worker-runtime-packages",
30+
severity: "error",
31+
from: { path: "^apps/web/" },
32+
to: {
33+
// Dependency Cruiser evaluates resolved file paths, not package specifiers.
34+
path: "^packages/(agent-core|auth|billing|byok|db|observability|tools-[^/]+)(/|$)",
35+
},
36+
},
37+
{
38+
name: "deployables-must-use-db-repositories",
39+
severity: "error",
40+
from: { path: "^apps/" },
41+
to: { path: "^packages/db/(src|dist)/schema(/|$)" },
42+
},
43+
],
44+
options: {
45+
doNotFollow: { path: "node_modules" },
46+
},
47+
};

.env.example

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,37 @@ CLOUDFLARE_API_TOKEN=
33
CLOUDFLARE_ACCOUNT_ID=
44
OUTPUT_DOWNLOAD_SIGNING_SECRET=
55

6-
# Blaxel
7-
BL_API_KEY=
8-
BL_WORKSPACE=cheatcode
9-
BL_REGION=us-pdx-1
10-
BLAXEL_SANDBOX_IMAGE=sandbox/cheatcode-sandbox:yoo6c20wgw03
11-
BLAXEL_SANDBOX_MEMORY_MB=4096
6+
# Daytona
7+
DAYTONA_API_KEY=
8+
DAYTONA_API_URL=https://app.daytona.io/api
9+
DAYTONA_PREVIEW_HOST_SUFFIXES=daytonaproxy01.net,proxy.daytona.work
10+
DAYTONA_TARGET=us
11+
DAYTONA_SANDBOX_SNAPSHOT=
12+
DAYTONA_WEBHOOK_SIGNING_SECRET=
13+
PREVIEW_TOKEN_SECRET=
1214

1315
# Supabase
14-
NEXT_PUBLIC_SUPABASE_URL=
15-
NEXT_PUBLIC_SUPABASE_ANON_KEY=
1616
DATABASE_URL=
1717
# SUPABASE_MIGRATION_URL belongs in .env.migrate only, never here.
1818

1919
# Clerk
20+
# Local development uses pk_test_/sk_test_ keys. Configure pk_live_/sk_live_ only
21+
# in Vercel Production and production Cloudflare Worker secrets.
2022
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
2123
CLERK_SECRET_KEY=
2224
# Optional PEM public key for networkless Clerk token verification.
2325
CLERK_JWT_KEY=
26+
CLERK_AUTHORIZED_PARTIES=http://localhost:3000,http://127.0.0.1:3000
2427
CLERK_WEBHOOK_SIGNING_SECRET=
2528

2629
# Polar
27-
NEXT_PUBLIC_POLAR_PRO_MONTHLY_PRODUCT_ID=
2830
POLAR_ACCESS_TOKEN=
31+
POLAR_SERVER=production
2932
POLAR_WEBHOOK_SECRET=
33+
POLAR_PRODUCT_ID_PRO=
34+
POLAR_PRODUCT_ID_PREMIUM=
35+
POLAR_PRODUCT_ID_ULTRA=
36+
POLAR_PRODUCT_ID_MAX=
3037

3138
# Composio
3239
COMPOSIO_API_KEY=
@@ -41,3 +48,4 @@ INTERNAL_MAINTENANCE_SECRET=
4148

4249
# Gateway
4350
NEXT_PUBLIC_GATEWAY_URL=http://localhost:8787
51+
NEXT_PUBLIC_PREVIEW_HOSTNAME=trycheatcode.com

.env.migrate.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
# Supabase admin/DDL connection for the same project used by Hyperdrive, or
33
# apply the migration through Supabase MCP and verify the Worker route.
44
SUPABASE_MIGRATION_URL=postgresql://postgres:postgres@localhost:54322/postgres
5+
SUPABASE_MIGRATION_EXPECTED_HOST=localhost
6+
SUPABASE_MIGRATION_EXPECTED_DATABASE=postgres
7+
SUPABASE_MIGRATION_EXPECTED_ROLE=postgres
8+
# Query once from the intended database: select system_identifier from pg_control_system();
9+
# SUPABASE_MIGRATION_EXPECTED_SYSTEM_IDENTIFIER=replace_me
10+
# Required for audit archive applies so Wrangler cannot select an unintended account.
11+
# CLOUDFLARE_ACCOUNT_ID=00000000000000000000000000000000

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @iamjr15

.github/dependabot.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: npm
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
day: monday
9+
time: "04:00"
10+
timezone: Asia/Kolkata
11+
open-pull-requests-limit: 10
12+
groups:
13+
workspace-minor-and-patch:
14+
patterns:
15+
- "*"
16+
update-types:
17+
- minor
18+
- patch
19+
20+
- package-ecosystem: npm
21+
directories:
22+
- /infra/containers/sandbox/app-generators
23+
- /infra/containers/sandbox/app-templates/expo
24+
- /infra/containers/sandbox/app-templates/next
25+
- /infra/containers/sandbox/browser-driver
26+
- /infra/containers/sandbox/doc-runtime
27+
- /infra/containers/sandbox/extension-overrides/parquet-viewer
28+
- /infra/containers/sandbox/package-manager
29+
schedule:
30+
interval: weekly
31+
day: monday
32+
time: "04:30"
33+
timezone: Asia/Kolkata
34+
open-pull-requests-limit: 10
35+
groups:
36+
sandbox-runtime-minor-and-patch:
37+
patterns:
38+
- "*"
39+
update-types:
40+
- minor
41+
- patch
42+
43+
- package-ecosystem: docker
44+
directory: /infra/containers/sandbox
45+
schedule:
46+
interval: weekly
47+
day: monday
48+
time: "05:00"
49+
timezone: Asia/Kolkata
50+
open-pull-requests-limit: 5
51+
52+
- package-ecosystem: pip
53+
directory: /infra/containers/sandbox
54+
schedule:
55+
interval: weekly
56+
day: monday
57+
time: "05:15"
58+
timezone: Asia/Kolkata
59+
open-pull-requests-limit: 5
60+
61+
- package-ecosystem: github-actions
62+
directory: /
63+
schedule:
64+
interval: weekly
65+
day: monday
66+
time: "05:30"
67+
timezone: Asia/Kolkata
68+
open-pull-requests-limit: 5
69+
groups:
70+
actions:
71+
patterns:
72+
- "*"

0 commit comments

Comments
 (0)