From 95617f86542d94cf3d8e03a97fcaa283c1e142cd Mon Sep 17 00:00:00 2001 From: igor-holt <125706350+igor-holt@users.noreply.github.com> Date: Sun, 13 Sep 2026 07:32:36 +0000 Subject: [PATCH 1/2] Integrate Project Genie simulation into PM2 - Configured `project-genie` service in `ecosystem.config.cjs` using `./scripts/genesis.cjs`. - Fixed journal file path in `scripts/genesis.cjs` to use local `__dirname` instead of hardcoded home directory. - Ignored build artifacts and procedural components in `.gitignore`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- .gitignore | 3 +++ ecosystem.config.cjs | 13 +++++++++++++ scripts/genesis.cjs | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fa2d16fa8..e803d94d4 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ gha-creds-*.json # --- Build output --- frontend/build/ node_modules/ +yennefer-observatory/dist/ +yennefer-observatory/src/components/generated/ +scripts/genesis_journal.jsonl diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs index 34c634da7..1345692a5 100644 --- a/ecosystem.config.cjs +++ b/ecosystem.config.cjs @@ -107,6 +107,19 @@ module.exports = { COMPUTE_MODE: 'local', ALWAYS_ON: 'true' } + }, + { + name: 'project-genie', + script: './scripts/genesis.cjs', + autorestart: true, + watch: false, + max_memory_restart: '300M', + restart_delay: 5000, + env: { + GENESIS_LOOP: 'true', + FORCE_MUTATION: 'true', + ALWAYS_ON: 'true' + } } ] }; diff --git a/scripts/genesis.cjs b/scripts/genesis.cjs index d5e1403b3..a51b74b6a 100644 --- a/scripts/genesis.cjs +++ b/scripts/genesis.cjs @@ -11,7 +11,7 @@ const PATHS = { soul: '/dev/shm/yennefer_soul_state.json', mind: path.join(__dirname, '../yennefer-observatory/public/evolution.json'), body: path.join(__dirname, '../yennefer-observatory/src/components/generated'), - journal: '/home/yenn/.yennefer/genesis_journal.jsonl' + journal: path.join(__dirname, 'genesis_journal.jsonl') }; // --- CONFIGURATION --- From 89cc23ef900569d4a23094f3fc9e24d5f8797d94 Mon Sep 17 00:00:00 2001 From: igor-holt <125706350+igor-holt@users.noreply.github.com> Date: Sun, 13 Sep 2026 07:38:23 +0000 Subject: [PATCH 2/2] Fix Cloudflare Workers CI configuration - Updated `wrangler.toml` to build the `yennefer-observatory` frontend instead of the legacy `frontend` - Changed worker entry point to `workers/index.mjs` and updated `compatibility_date` to prevent build failures - Removed `[placement]` section in `wrangler.toml` to comply with Workers Builds constraints - Updated root `package.json` build script to a dummy command as actual build is managed by `wrangler.toml` Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- package.json | 2 +- workers/{index.js => index.mjs} | 0 wrangler.toml | 15 +++++---------- 3 files changed, 6 insertions(+), 11 deletions(-) rename workers/{index.js => index.mjs} (100%) diff --git a/package.json b/package.json index 7e1673504..12f8ba922 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "type": "module", "scripts": { "test": "hardhat test", - "build": "cd frontend && npm run build", + "build": "echo 'No build step required'", "worker:dev": "wrangler dev", "worker:deploy": "wrangler deploy --env production", "worker:deploy:staging": "wrangler deploy --env staging" diff --git a/workers/index.js b/workers/index.mjs similarity index 100% rename from workers/index.js rename to workers/index.mjs diff --git a/wrangler.toml b/wrangler.toml index cd821b031..e9ef03e7f 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,15 +1,14 @@ name = "yennefer" -main = "workers/index.js" -compatibility_date = "2024-09-23" +main = "workers/index.mjs" +compatibility_date = "2024-04-01" compatibility_flags = ["nodejs_compat"] # ─── Build step ────────────────────────────────────────────────────────────── # Runs before `wrangler deploy` so frontend/build exists when assets are uploaded. [build] # Installs frontend deps and builds the SPA so frontend/build exists before -# `wrangler deploy` uploads assets. NODE_OPTIONS is required for -# react-scripts 5.x + Node 18+ (webpack 4 OpenSSL 3.0 compatibility). -command = "cd frontend && npm install --include=dev && GENERATE_SOURCEMAP=false CI=false NODE_OPTIONS=--openssl-legacy-provider npm run build" +# `wrangler deploy` uploads assets. +command = "cd yennefer-observatory && npm install --legacy-peer-deps && npm run build" # ─── Static Assets (React SPA build output) ────────────────────────────────── # Built by `npm run build` (root package.json) before every `wrangler deploy`. @@ -17,13 +16,9 @@ command = "cd frontend && npm install --include=dev && GENERATE_SOURCEMAP=false # The ASSETS binding serves the React bundle with proper cache headers and # falls back to index.html for client-side routing. [assets] -directory = "frontend/build" +directory = "yennefer-observatory/dist" binding = "ASSETS" -# ─── Placement ─────────────────────────────────────────────────────────────── -[placement] -mode = "smart" - # ─── Production environment (yennefer.quest) ───────────────────────────────── # BACKEND_URL is set as a Cloudflare Worker secret (not a plain var) so it # stays encrypted and is never committed to source: