feat: derive GOFAI perception from live Nexus state

This commit is contained in:
Alexander Whitestone
2026-04-12 20:46:29 -04:00
parent 2500366821
commit 970a810e52

10
app.js
View File

@@ -650,11 +650,17 @@ function setupGOFAI() {
symbolicPlanner.addAction('Stabilize Matrix', { energy: 50 }, { stability: 1.0 });
}
function deriveGOFAIState(elapsed) {
const activeBars = powerMeterBars.reduce((n, _, i) => n + ((((Math.sin(elapsed * 2 + i * 0.5) * 0.5) + 0.5) > (i / Math.max(powerMeterBars.length, 1))) ? 1 : 0), 0);
const energy = Math.round((activeBars / Math.max(powerMeterBars.length, 1)) * 100);
const stability = Math.max(0.1, Math.min(1, (wsConnected ? 0.55 : 0.2) + (agents.length * 0.05) - (portals.length * 0.03) - (activePortal ? 0.1 : 0) - (portalOverlayActive ? 0.05 : 0)));
return { stability, energy, activePortals: activePortal ? 1 : 0 };
}
function updateGOFAI(delta, elapsed) {
const startTime = performance.now();
// Simulate perception
neuroBridge.perceive({ stability: 0.3, energy: 80, activePortals: 1 });
neuroBridge.perceive(deriveGOFAIState(elapsed));
agentFSMs['timmy']?.update(symbolicEngine.facts);
// Run reasoning