Compare commits

...

3 Commits

Author SHA1 Message Date
Alexander Whitestone
d5099a18c6 Wire heartbeat into NexusMind consciousness loop
Some checks failed
CI / test (pull_request) Failing after 9s
CI / validate (pull_request) Failing after 15s
Review Approval Gate / verify-review (pull_request) Failing after 3s
The heartbeat module existed but was never called. Now write_heartbeat fires:
- On startup (cycle 0, status thinking)
- After every successful think cycle
- On graceful shutdown (status idle)

This gives the watchdog a signal that the mind is alive, not just running.
2026-04-12 12:45:58 -04:00
aab3e607eb Merge pull request '[GOFAI] Resonance Viz Integration' (#1297) from feat/resonance-viz-integration-1776010801023 into main
Some checks failed
Deploy Nexus / deploy (push) Failing after 3s
Staging Verification Gate / verify-staging (push) Failing after 3s
2026-04-12 16:20:09 +00:00
fe56ece1ad Integrate ResonanceVisualizer into app.js
Some checks failed
CI / test (pull_request) Failing after 10s
CI / validate (pull_request) Failing after 16s
Review Approval Gate / verify-review (pull_request) Failing after 3s
2026-04-12 16:20:03 +00:00
2 changed files with 25 additions and 3 deletions

6
app.js
View File

@@ -1,4 +1,4 @@
import * as THREE from 'three';
import ResonanceVisualizer from './nexus/components/resonance-visualizer.js';\nimport * as THREE from 'three';
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
@@ -597,7 +597,7 @@ class PSELayer {
let pseLayer;
let metaLayer, neuroBridge, cbr, symbolicPlanner, knowledgeGraph, blackboard, symbolicEngine, calibrator;
let resonanceViz, metaLayer, neuroBridge, cbr, symbolicPlanner, knowledgeGraph, blackboard, symbolicEngine, calibrator;
let agentFSMs = {};
function setupGOFAI() {
@@ -666,7 +666,7 @@ async function init() {
scene = new THREE.Scene();
scene.fog = new THREE.FogExp2(0x050510, 0.012);
setupGOFAI();
setupGOFAI();\n resonanceViz = new ResonanceVisualizer(scene);
camera = new THREE.PerspectiveCamera(65, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.copy(playerPos);

View File

@@ -45,6 +45,7 @@ from nexus.perception_adapter import (
)
from nexus.experience_store import ExperienceStore
from nexus.groq_worker import GroqWorker
from nexus.heartbeat import write_heartbeat
from nexus.trajectory_logger import TrajectoryLogger
logging.basicConfig(
@@ -286,6 +287,13 @@ class NexusMind:
self.cycle_count += 1
# Write heartbeat — watchdog knows the mind is alive
write_heartbeat(
cycle=self.cycle_count,
model=self.model,
status="thinking",
)
# Periodically distill old memories
if self.cycle_count % 50 == 0 and self.cycle_count > 0:
await self._distill_memories()
@@ -383,6 +391,13 @@ class NexusMind:
salience=1.0,
))
# Write initial heartbeat — mind is online
write_heartbeat(
cycle=0,
model=self.model,
status="thinking",
)
while self.running:
try:
await self.think_once()
@@ -423,6 +438,13 @@ class NexusMind:
log.info("Nexus Mind shutting down...")
self.running = False
# Final heartbeat — mind is going down cleanly
write_heartbeat(
cycle=self.cycle_count,
model=self.model,
status="idle",
)
# Final stats
stats = self.trajectory_logger.get_session_stats()
log.info(f"Session stats: {json.dumps(stats, indent=2)}")