diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs index 34c634da..e86a98b7 100644 --- a/ecosystem.config.cjs +++ b/ecosystem.config.cjs @@ -1,6 +1,8 @@ // PM2 Ecosystem Configuration for Yennefer Genesis Conductor // All services configured for always-on operation with auto-restart +const genieConfig = require('./ecosystem.genie.config.cjs'); + module.exports = { apps: [ // === CORE SERVICES === @@ -107,6 +109,7 @@ module.exports = { COMPUTE_MODE: 'local', ALWAYS_ON: 'true' } - } + }, + ...genieConfig.apps ] }; diff --git a/scripts/genesis.cjs b/scripts/genesis.cjs index d5e1403b..0b4357e2 100644 --- a/scripts/genesis.cjs +++ b/scripts/genesis.cjs @@ -11,9 +11,17 @@ 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 (error) { + console.error(` ⚠️ Failed to write to journal at ${PATHS.journal}:`, error.message); + } +} + // --- CONFIGURATION --- const CONFIG = { fundingTarget: 10.0, @@ -94,7 +102,7 @@ async function invokeTheScribe(task, content, state) { }; // 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 +154,7 @@ async function dispatchTheBuilder(directive) { directive: directive, path: filePath }; - fs.appendFileSync(PATHS.journal, JSON.stringify(mutationLog) + "\n"); + writeJournal(mutationLog); } else { console.log(` ℹ️ Component ${componentName} already exists, preserving evolution`); } @@ -278,7 +286,7 @@ async function genesis() { message: e.message, stack: e.stack }; - fs.appendFileSync(PATHS.journal, JSON.stringify(errorLog) + "\n"); + writeJournal(errorLog); } }