-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Integrate continuous building simulating Project Genie #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4d6e4e8
73f1e05
3b42cea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,15 +5,24 @@ | |
| const { exec, execSync } = require("child_process"); | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const crypto = require('crypto'); | ||
|
Check warning on line 8 in scripts/genesis.cjs
|
||
|
|
||
| // --- PATHS --- | ||
| 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') | ||
| }; | ||
|
|
||
| function writeJournal(entry) { | ||
| try { | ||
| fs.appendFileSync(PATHS.journal, JSON.stringify(entry) + "\n"); | ||
| } catch (err) { | ||
| console.error(" ⚠️ Failed to write to journal:", err.message); | ||
| } | ||
| } | ||
|
Comment on lines
+18
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using synchronous file system operations like |
||
|
|
||
| // --- CONFIGURATION --- | ||
| const CONFIG = { | ||
| fundingTarget: 10.0, | ||
|
|
@@ -46,8 +55,15 @@ | |
| { type: "MUTATE", content: "Add crystalline fractal patterns that grow from the core" }, | ||
| { type: "MUTATE", content: "Generate energy tendrils that reach toward incoming signals" }, | ||
| { type: "MUTATE", content: "Build a holographic data stream orbiting the consciousness sphere" }, | ||
| { type: "MUTATE", content: "A photorealistic alpine meadow with wildflowers. Among the evergreen pine trees is a rustic log cabin with a front porch. A split-rail fence meanders near the cabin. In the background there are three jagged mountain peaks covered in snow." }, | ||
| { type: "MUTATE", content: "A rugged alien landscape with traversable terrain and reactive dust physics." }, | ||
| { type: "MUTATE", content: "This is a macro-scale makerspace workbench. The ground is a vast, polished light-brown wood table with realistic grain and friction. The surface is scattered with passive physics objects: a white cardboard car, a soft-serve ice cream cone, a cubic puzzle, and alphabet blocks. These objects are distinct from the player character. The background is a soft-focus workshop with a pegboard of tools and a sunlit window. The lighting creates a sharp shadow beneath the central box to visually ground it. Omnidirectional traversal is possible across the wooden plain." }, | ||
| { type: "MUTATE", content: "A vibrant rainforest as a colorful parrot, exploring above and below the canopy of the forest." }, | ||
| { type: "MUTATE", content: "A fantastical, textured world made of clay, looking for pieces that can be moved around the space." }, | ||
| { type: "MUTATE", content: "A sunlit living room as a cat atop a robot vacuum." }, | ||
| { type: "MUTATE", content: "A colorful city built in ice and bathed in light, navigating around obstacles." } | ||
| ]; | ||
| const idx = Math.floor(Date.now() / 1000) % mutations.length; | ||
| const idx = crypto.randomInt(0, mutations.length); | ||
| directive = mutations[idx]; | ||
|
|
||
| } else if (coherence >= 90) { | ||
|
|
@@ -94,7 +110,7 @@ | |
| }; | ||
|
|
||
| // Append to genesis journal | ||
| fs.appendFileSync(PATHS.journal, JSON.stringify(entry) + "\n"); | ||
| writeJournal(entry); | ||
| console.log(` ✨ Thought crystallized: "${content.slice(0, 50)}..."`); | ||
|
|
||
| // Update evolution.json if it exists | ||
|
|
@@ -146,7 +162,7 @@ | |
| directive: directive, | ||
| path: filePath | ||
| }; | ||
| fs.appendFileSync(PATHS.journal, JSON.stringify(mutationLog) + "\n"); | ||
| writeJournal(mutationLog); | ||
| } else { | ||
| console.log(` ℹ️ Component ${componentName} already exists, preserving evolution`); | ||
| } | ||
|
|
@@ -161,7 +177,7 @@ | |
| '<octahedronGeometry args={[1.5, 0]} />', | ||
| '<icosahedronGeometry args={[1.5, 0]} />' | ||
| ]; | ||
| const geometry = geometries[Math.floor(Math.random() * geometries.length)]; | ||
| const geometry = geometries[crypto.randomInt(0, geometries.length)]; | ||
|
|
||
| const materials = [ | ||
| ` | ||
|
|
@@ -193,7 +209,7 @@ | |
| metalness={0.8} | ||
| />` | ||
| ]; | ||
| const material = materials[Math.floor(Math.random() * materials.length)]; | ||
| const material = materials[crypto.randomInt(0, materials.length)]; | ||
|
|
||
| const isDreiImportNeeded = material.includes('MeshDistortMaterial') || material.includes('MeshWobbleMaterial'); | ||
| const importedDrei = isDreiImportNeeded ? `import { ${material.includes('MeshDistortMaterial') ? 'MeshDistortMaterial' : ''}${material.includes('MeshDistortMaterial') && material.includes('MeshWobbleMaterial') ? ', ' : ''}${material.includes('MeshWobbleMaterial') ? 'MeshWobbleMaterial' : ''} } from '@react-three/drei'` : ''; | ||
|
|
@@ -278,7 +294,7 @@ | |
| message: e.message, | ||
| stack: e.stack | ||
| }; | ||
| fs.appendFileSync(PATHS.journal, JSON.stringify(errorLog) + "\n"); | ||
| writeJournal(errorLog); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing runtime log/journal files directly into the
scriptsdirectory can pollute the source tree and cause issues in environments where the application directory is read-only (e.g., Docker containers). It is highly recommended to make the journal path configurable via an environment variable, with a fallback to a local path.