Compare commits

..

9 Commits

Author SHA1 Message Date
Alexander Whitestone
68802dc7d9 fix: closes #715
Some checks failed
CI / test (pull_request) Failing after 10s
CI / validate (pull_request) Failing after 14s
Review Approval Gate / verify-review (pull_request) Failing after 2s
2026-04-12 12:27:36 -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
bf477382ba Merge pull request '[GOFAI] Resonance Linking' (#1293) from feat/resonance-linker-1776010647557 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:17:33 +00:00
fba972f8be Add ResonanceLinker
Some checks failed
CI / test (pull_request) Failing after 10s
CI / validate (pull_request) Failing after 15s
Review Approval Gate / verify-review (pull_request) Failing after 3s
2026-04-12 16:17:28 +00:00
6786e65f3d Merge pull request '[GOFAI] Layer 4 — Reasoning & Decay' (#1292) from feat/gofai-layer-4-v2 into main
Some checks failed
Deploy Nexus / deploy (push) Failing after 2s
Staging Verification Gate / verify-staging (push) Failing after 3s
2026-04-12 16:15:29 +00:00
62a6581827 Add rules
Some checks failed
CI / test (pull_request) Failing after 10s
CI / validate (pull_request) Failing after 15s
Review Approval Gate / verify-review (pull_request) Failing after 3s
2026-04-12 16:15:24 +00:00
797f32a7fe Add Reasoner 2026-04-12 16:15:23 +00:00
80eb4ff7ea Enhance MemoryOptimizer 2026-04-12 16:15:22 +00:00
9 changed files with 58 additions and 130 deletions

23
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';
@@ -66,9 +66,6 @@ let workshopScanMat = null;
let workshopPanelRefreshTimer = 0;
let lastFocusedPortal = null;
// ═══ VISITOR / OPERATOR MODE ═══
let uiMode = 'visitor'; // 'visitor' | 'operator'
// ═══ NAVIGATION SYSTEM ═══
const NAV_MODES = ['walk', 'orbit', 'fly'];
let navModeIdx = 0;
@@ -600,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() {
@@ -669,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);
@@ -757,7 +754,6 @@ async function init() {
enterPrompt.addEventListener('click', () => {
enterPrompt.classList.add('fade-out');
document.body.classList.add('visitor-mode');
document.getElementById('hud').style.display = 'block';
setTimeout(() => { enterPrompt.remove(); }, 600);
}, { once: true });
@@ -1841,18 +1837,6 @@ function createAmbientStructures() {
}
// ═══ NAVIGATION MODE ═══
// ═══ VISITOR / OPERATOR MODE TOGGLE ═══
function toggleUIMode() {
uiMode = uiMode === 'visitor' ? 'operator' : 'visitor';
document.body.classList.remove('visitor-mode', 'operator-mode');
document.body.classList.add(uiMode + '-mode');
const label = document.getElementById('mode-label');
const icon = document.querySelector('#mode-toggle-btn .hud-icon');
if (label) label.textContent = uiMode === 'visitor' ? 'VISITOR' : 'OPERATOR';
if (icon) icon.textContent = uiMode === 'visitor' ? '👁' : '⚙';
addChatMessage('system', `Switched to ${uiMode.toUpperCase()} mode.`);
}
function cycleNavMode() {
navModeIdx = (navModeIdx + 1) % NAV_MODES.length;
const mode = NAV_MODES[navModeIdx];
@@ -2046,7 +2030,6 @@ function setupControls() {
document.getElementById('portal-close-btn').addEventListener('click', closePortalOverlay);
document.getElementById('vision-close-btn').addEventListener('click', closeVisionOverlay);
document.getElementById('mode-toggle-btn').addEventListener('click', toggleUIMode);
document.getElementById('atlas-toggle-btn').addEventListener('click', openPortalAtlas);
document.getElementById('atlas-close-btn').addEventListener('click', closePortalAtlas);
}

View File

@@ -1,4 +1,4 @@
const GiteaApiUrl = 'https://forge.alexanderwhitestone.com/api/v1';
const giteaApiUrl = 'https://forge.alexanderwhitestone.com/api/v1';
const token = process.env.GITEA_TOKEN; // Should be stored securely in environment variables
const repos = ['hermes-agent', 'the-nexus', 'timmy-home', 'timmy-config'];
@@ -13,31 +13,6 @@ const branchProtectionSettings = {
// Special handling for the-nexus (CI disabled)
};
async function applyBranchProtection(repo) {
try {
const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {
method: 'POST',
headers: {
'Authorization': `token ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
...branchProtectionSettings,
// Special handling for the-nexus (CI disabled)
requiredStatusChecks: repo === 'the-nexus' ? false : true
})
});
if (!response.ok) {
throw new Error(`Failed to apply branch protection to ${repo}: ${await response.text()}`);
}
console.log(`✅ Branch protection applied to ${repo}`);
} catch (error) {
console.error(`❌ Error applying branch protection to ${repo}: ${error.message}`);
}
}
async function applyBranchProtection(repo) {
try {
const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {

View File

@@ -113,10 +113,6 @@
<!-- Top Right: Agent Log & Atlas Toggle -->
<div class="hud-top-right">
<button id="mode-toggle-btn" class="hud-icon-btn mode-toggle" title="Toggle Mode">
<span class="hud-icon">👁</span>
<span class="hud-btn-label" id="mode-label">VISITOR</span>
</button>
<button id="atlas-toggle-btn" class="hud-icon-btn" title="Portal Atlas">
<span class="hud-icon">🌐</span>
<span class="hud-btn-label">ATLAS</span>

View File

@@ -1,13 +1,18 @@
class MemoryOptimizer {
constructor(options = {}) {
this.threshold = options.threshold || 0.8;
this.decayRate = options.decayRate || 0.05;
this.threshold = options.threshold || 0.3;
this.decayRate = options.decayRate || 0.01;
this.lastRun = Date.now();
}
optimize(memory) {
console.log('Optimizing memory...');
// Heuristic-based pruning
return memory.filter(m => m.strength > this.threshold);
optimize(memories) {
const now = Date.now();
const elapsed = (now - this.lastRun) / 1000;
this.lastRun = now;
return memories.map(m => {
const decay = (m.importance || 1) * this.decayRate * elapsed;
return { ...m, strength: Math.max(0, (m.strength || 1) - decay) };
}).filter(m => m.strength > this.threshold || m.locked);
}
}
export default MemoryOptimizer;

View File

@@ -0,0 +1,14 @@
class Reasoner:
def __init__(self, rules):
self.rules = rules
def evaluate(self, entries):
return [r['action'] for r in self.rules if self._check(r['condition'], entries)]
def _check(self, cond, entries):
if cond.startswith('count'):
# e.g. count(type=anomaly)>3
p = cond.replace('count(', '').split(')')
key, val = p[0].split('=')
count = sum(1 for e in entries if e.get(key) == val)
return eval(f"{count}{p[1]}")
return False

View File

@@ -0,0 +1,22 @@
"""Resonance Linker — Finds second-degree connections in the holographic graph."""
class ResonanceLinker:
def __init__(self, archive):
self.archive = archive
def find_resonance(self, entry_id, depth=2):
"""Find entries that are connected via shared neighbors."""
if entry_id not in self.archive._entries: return []
entry = self.archive._entries[entry_id]
neighbors = set(entry.links)
resonance = {}
for neighbor_id in neighbors:
if neighbor_id in self.archive._entries:
for second_neighbor in self.archive._entries[neighbor_id].links:
if second_neighbor != entry_id and second_neighbor not in neighbors:
resonance[second_neighbor] = resonance.get(second_neighbor, 0) + 1
return sorted(resonance.items(), key=lambda x: x[1], reverse=True)

View File

@@ -0,0 +1,6 @@
[
{
"condition": "count(type=anomaly)>3",
"action": "alert"
}
]

View File

@@ -11,7 +11,7 @@ const ASSETS_TO_CACHE = [
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CachedName).then(cache => {
caches.open(CACHE_NAME).then(cache => {
return cache.addAll(ASSETS_TO_CACHE);
})
);

View File

@@ -2077,76 +2077,3 @@ canvas#nexus-canvas {
font-style: italic;
padding: 4px 0;
}
/* ═══════════════════════════════════════════════════════
VISITOR / OPERATOR MODE
═══════════════════════════════════════════════════════ */
.mode-toggle {
border-color: #4af0c0 !important;
}
.mode-toggle .hud-icon {
font-size: 16px;
}
#mode-label {
color: #4af0c0;
font-weight: 600;
}
/* Visitor mode: hide operator-only panels */
body.visitor-mode .gofai-hud,
body.visitor-mode .hud-debug,
body.visitor-mode .hud-agent-log,
body.visitor-mode .archive-health-dashboard,
body.visitor-mode .memory-feed,
body.visitor-mode .memory-inspect-panel,
body.visitor-mode .memory-connections-panel,
body.visitor-mode .memory-filter,
body.visitor-mode #mem-palace-container,
body.visitor-mode #mem-palace-controls,
body.visitor-mode #mempalace-results,
body.visitor-mode .nexus-footer {
display: none !important;
}
/* Visitor mode: simplify bannerlord status */
body.visitor-mode #bannerlord-status {
display: none !important;
}
/* Visitor mode: add a subtle visitor badge */
body.visitor-mode .hud-location::after {
content: '⬡ VISITOR';
margin-left: 12px;
font-size: 9px;
letter-spacing: 0.15em;
color: #4af0c0;
opacity: 0.7;
font-family: 'Orbitron', sans-serif;
vertical-align: middle;
}
/* Operator mode: add operator badge */
body.operator-mode .hud-location::after {
content: '⬢ OPERATOR';
margin-left: 12px;
font-size: 9px;
letter-spacing: 0.15em;
color: #ffd700;
opacity: 0.8;
font-family: 'Orbitron', sans-serif;
vertical-align: middle;
}
/* Operator mode: golden accent on toggle */
body.operator-mode .mode-toggle {
border-color: #ffd700 !important;
}
body.operator-mode #mode-label {
color: #ffd700;
}