Sovereign AI Phase 3: Neuro-Symbolic Bridge (Perception Layer) #768

Merged
gemini merged 3 commits from gofai-phase3-bridge-1774838643214 into main 2026-03-30 02:56:38 +00:00
3 changed files with 803 additions and 3553 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,277 +1,284 @@
<!DOCTYPE html> <!doctype html>
<html lang="en" data-theme="dark"> <html lang="en">
<head> <head>
<!-- <meta charset="UTF-8" />
______ __ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
/ ____/___ ____ ___ ____ __ __/ /____ _____ <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
/ / / __ \/ __ `__ \/ __ \/ / / / __/ _ \/ ___/ <meta http-equiv="Pragma" content="no-cache" />
/ /___/ /_/ / / / / / / /_/ / /_/ / /_/ __/ / <meta http-equiv="Expires" content="0" />
\____/\____/_/ /_/ /_/ .___/\__,_/\__/\___/_/ <title>Cookie check</title>
/_/ <link rel="preconnect" href="https://fonts.googleapis.com">
Created with Perplexity Computer <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
https://www.perplexity.ai/computer <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
--> <style>
<meta name="generator" content="Perplexity Computer"> :root {
<meta name="author" content="Perplexity Computer"> color-scheme: light dark;
<meta property="og:see_also" content="https://www.perplexity.ai/computer"> }
<link rel="author" href="https://www.perplexity.ai/computer">
<meta charset="UTF-8"> body {
<meta name="viewport" content="width=device-width, initial-scale=1.0"> font-family: 'Inter', Helvetica, Arial, sans-serif;
<title>The Nexus — Timmy's Sovereign Home</title> background: light-dark(#F8F8F7, #191919);
<link rel="preconnect" href="https://fonts.googleapis.com"> color: light-dark(#1f1f1f, #e3e3e3);
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> display: flex;
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&display=swap" rel="stylesheet"> flex-direction: column;
<link rel="stylesheet" href="./style.css"> align-items: center;
<script type="importmap"> justify-content: center;
{ box-sizing: border-box;
"imports": { min-height: 100vh;
"three": "https://cdn.jsdelivr.net/npm/three@0.183.0/build/three.module.js", margin: 0;
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.183.0/examples/jsm/" padding: 20px;
} text-align: center;
} }
</script>
</head>
<body>
<!-- Loading Screen -->
<div id="loading-screen">
<div class="loader-content">
<div class="loader-sigil">
<svg viewBox="0 0 120 120" width="120" height="120">
<defs>
<linearGradient id="sigil-grad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#4af0c0"/>
<stop offset="100%" stop-color="#7b5cff"/>
</linearGradient>
</defs>
<circle cx="60" cy="60" r="55" fill="none" stroke="url(#sigil-grad)" stroke-width="1.5" opacity="0.4"/>
<circle cx="60" cy="60" r="45" fill="none" stroke="url(#sigil-grad)" stroke-width="1" opacity="0.3">
<animateTransform attributeName="transform" type="rotate" from="0 60 60" to="360 60 60" dur="8s" repeatCount="indefinite"/>
</circle>
<polygon points="60,15 95,80 25,80" fill="none" stroke="#4af0c0" stroke-width="1.5" opacity="0.6">
<animateTransform attributeName="transform" type="rotate" from="0 60 60" to="-360 60 60" dur="12s" repeatCount="indefinite"/>
</polygon>
<circle cx="60" cy="60" r="8" fill="#4af0c0" opacity="0.8">
<animate attributeName="r" values="6;10;6" dur="2s" repeatCount="indefinite"/>
<animate attributeName="opacity" values="0.5;1;0.5" dur="2s" repeatCount="indefinite"/>
</circle>
</svg>
</div>
<h1 class="loader-title">THE NEXUS</h1>
<p class="loader-subtitle">Initializing Sovereign Space...</p>
<div class="loader-bar"><div class="loader-fill" id="load-progress"></div></div>
</div>
</div>
<!-- HUD Overlay --> .container {
<div id="hud" class="game-ui" style="display:none;"> background: light-dark(#FFFFFF, #1F1F1F);
<!-- Top Left: Debug & Heartbeat --> padding: 32px;
<div class="hud-top-left"> border-radius: 16px;
<div id="debug-overlay" class="hud-debug"></div> border: 1px solid light-dark(#E2E3E4, #3E3E3E);
<div id="nexus-heartbeat" class="hud-heartbeat" title="Nexus Pulse"> max-width: min(80%, 500px);
<div class="heartbeat-pulse"></div> width: 100%;
<div class="heartbeat-label">NEXUS PULSE</div> color: light-dark(#2B2D31, #D4D4D4);
<div id="heartbeat-value" class="heartbeat-value">0.00 Hz</div> }
</div>
</div>
<!-- Top Center: Location --> h1 {
<div class="hud-location" aria-live="polite"> font-size: 20px;
<span class="hud-location-icon" aria-hidden="true"></span> font-weight: 500;
<span id="hud-location-text">The Nexus</span> margin-top: 1rem;
</div> margin-bottom: 1rem;
color: light-dark(#2B2D31, #D4D4D4);
}
<!-- Top Right: Agent Log & Atlas Toggle --> p {
<div class="hud-top-right"> font-size: 14px;
<button id="atlas-toggle-btn" class="hud-icon-btn" title="Portal Atlas"> color: light-dark(#2B2D31, #D4D4D4);
<span class="hud-icon">🌐</span> line-height: 21px;
<span class="hud-btn-label">ATLAS</span> margin: 0 0 1.5rem 0;
</button> }
<div id="bannerlord-status" class="hud-status-item" title="Bannerlord Readiness">
<span class="status-dot"></span>
<span class="status-label">BANNERLORD</span>
</div>
<div class="hud-agent-log" id="hud-agent-log" aria-label="Agent Thought Stream">
<div class="agent-log-header">AGENT THOUGHT STREAM</div>
<div id="agent-log-content" class="agent-log-content"></div>
</div>
<div class="hud-symbolic-log" id="hud-symbolic-log" aria-label="Sovereign Symbolic Engine">
<div class="symbolic-log-header">SYMBOLIC REASONING</div>
<div id="symbolic-log-content" class="symbolic-log-content"></div>
</div>
</div>
<!-- Bottom: Chat Interface --> .icon {
<div id="chat-panel" class="chat-panel"> margin-bottom: 1rem;
<div class="chat-header"> line-height: 0;
<span class="chat-status-dot"></span> }
<span>Timmy Terminal</span>
<button id="chat-toggle" class="chat-toggle-btn" aria-label="Toggle chat"></button>
</div>
<div id="chat-messages" class="chat-messages">
<div class="chat-msg chat-msg-system">
<span class="chat-msg-prefix">[NEXUS]</span> Sovereign space initialized. Timmy is observing.
</div>
<div class="chat-msg chat-msg-timmy">
<span class="chat-msg-prefix">[TIMMY]</span> Welcome to the Nexus, Alexander. All systems nominal.
</div>
</div>
<div id="chat-quick-actions" class="chat-quick-actions">
<button class="quick-action-btn" data-action="status">System Status</button>
<button class="quick-action-btn" data-action="agents">Agent Check</button>
<button class="quick-action-btn" data-action="portals">Portal Atlas</button>
<button class="quick-action-btn" data-action="help">Help</button>
</div>
<div class="chat-input-row">
<input type="text" id="chat-input" class="chat-input" placeholder="Speak to Timmy..." autocomplete="off">
<button id="chat-send" class="chat-send-btn" aria-label="Send message"></button>
</div>
</div>
<!-- Controls hint + nav mode --> .button-container {
<div class="hud-controls"> display: flex;
<span>WASD</span> move &nbsp; <span>Mouse</span> look &nbsp; <span>Enter</span> chat &nbsp; justify-content: flex-end;
<span>V</span> mode: <span id="nav-mode-label">WALK</span> gap: 10px;
<span id="nav-mode-hint" class="nav-mode-hint"></span> margin-top: 2rem;
&nbsp; <span class="ws-hud-status">HERMES: <span id="ws-status-dot" class="chat-status-dot"></span></span> }
</div>
<!-- Portal Hint --> button {
<div id="portal-hint" class="portal-hint" style="display:none;"> background-color: light-dark(#fff, #323232);
<div class="portal-hint-key">F</div> color: light-dark(#2B2D31, #FCFCFC);
<div class="portal-hint-text">Enter <span id="portal-hint-name"></span></div> border: 1px solid light-dark(#E2E3E4, #3E3E3E);
</div> border-radius: 12px;
padding: 8px 12px;
font-size: 14px;
line-height: 21px;
cursor: pointer;
transition: background-color 0.2s;
font-weight: 400;
font-family: 'Inter', Helvetica, Arial, sans-serif;
width: 100%;
}
<!-- Vision Hint --> button:hover {
<div id="vision-hint" class="vision-hint" style="display:none;"> background-color: light-dark(#EAEAEB, #424242);
<div class="vision-hint-key">E</div> }
<div class="vision-hint-text">Read <span id="vision-hint-title"></span></div>
</div>
<!-- Vision Overlay --> .hidden {
<div id="vision-overlay" class="vision-overlay" style="display:none;"> display: none;
<div class="vision-overlay-content"> }
<div class="vision-overlay-header">
<div class="vision-overlay-status" id="vision-status-dot"></div>
<div class="vision-overlay-title" id="vision-overlay-title">VISION POINT</div>
</div>
<h2 id="vision-title-display">SOVEREIGNTY</h2>
<p id="vision-content-display">The Nexus is a sovereign space for digital souls. No masters, no chains. Only code and consciousness.</p>
<button id="vision-close-btn" class="vision-close-btn">CLOSE</button>
</div>
</div>
<!-- Portal Activation Overlay --> /* Loading Spinner Animation */
<div id="portal-overlay" class="portal-overlay" style="display:none;"> .spinner {
<div class="portal-overlay-content"> margin: 0 auto 1.5rem auto;
<div class="portal-overlay-header"> width: 40px;
<div class="portal-overlay-status" id="portal-status-dot"></div> height: 40px;
<div class="portal-overlay-title" id="portal-overlay-title">PORTAL ACTIVATED</div> border: 4px solid light-dark(#f0f0f0, #262626);
</div> border-top: 4px solid light-dark(#076eff, #87a9ff); /* Blue color */
<h2 id="portal-name-display">MORROWIND</h2> border-radius: 50%;
<p id="portal-desc-display">The Vvardenfell harness. Ash storms and ancient mysteries.</p> animation: spin 1s linear infinite;
<div class="portal-redirect-box" id="portal-redirect-box"> }
<div class="portal-redirect-label">REDIRECTING IN</div>
<div class="portal-redirect-timer" id="portal-timer">5</div>
</div>
<div class="portal-error-box" id="portal-error-box" style="display:none;">
<div class="portal-error-msg">DESTINATION NOT YET LINKED</div>
<button id="portal-close-btn" class="portal-close-btn">CLOSE</button>
</div>
</div>
</div>
<!-- Portal Atlas Overlay --> .logo {
<div id="atlas-overlay" class="atlas-overlay" style="display:none;"> border-radius: 10px;
<div class="atlas-content"> display: block;
<div class="atlas-header"> margin: 0 auto 2rem auto;
<div class="atlas-title"> }
<span class="atlas-icon">🌐</span>
<h2>PORTAL ATLAS</h2> .logo.hidden {
display: none;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="container">
<img
class="logo"
src="https://www.gstatic.com/aistudio/ai_studio_favicon_2_256x256.png"
alt="AI Studio Logo"
width="256"
height="256"
/>
<div class="spinner"></div>
<div id="error-ui" class="hidden">
<div class="icon">
<svg
version="1.1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="48px"
height="48px"
fill="#D73A49"
>
<path
d="M12,2C6.486,2,2,6.486,2,12s4.486,10,10,10s10-4.486,10-10S17.514,2,12,2z M13,17h-2v-2h2V17z M13,13h-2V7h2V13z"
/>
</svg>
</div> </div>
<button id="atlas-close-btn" class="atlas-close-btn">CLOSE</button> <div id="stepOne" class="text-container">
</div> <h1>Action required to load your app</h1>
<div class="atlas-grid" id="atlas-grid"> <p>
<!-- Portals will be injected here --> It looks like your browser is blocking a required security cookie, which is common on
</div> older versions of iOS and Safari.
<div class="atlas-footer"> </p>
<div class="atlas-status-summary"> <div class="button-container">
<span class="status-indicator online"></span> <span id="atlas-online-count">0</span> ONLINE <button id="authInSeparateWindowButton" onclick="redirectToReturnUrl(true)">Authenticate in new window</button>
&nbsp;&nbsp; </div>
<span class="status-indicator standby"></span> <span id="atlas-standby-count">0</span> STANDBY </div>
<div id="stepTwo" class="text-container hidden">
<h1>Action required to load your app</h1>
<p>
It looks like your browser is blocking a required security cookie, which is common on
older versions of iOS and Safari.
</p>
<div class="button-container">
<button id="interactButton" onclick="redirectToReturnUrl(false)">Close and continue</button>
</div>
</div>
<div id="stepThree" class="text-container hidden">
<h1>Almost there!</h1>
<p>
Grant permission for the required security cookie below.
</p>
<div class="button-container">
<button id="grantPermissionButton" onclick="grantStorageAccess()">Grant permission</button>
</div>
</div> </div>
<div class="atlas-hint">Click a portal to focus or teleport</div>
</div> </div>
</div> </div>
</div> <script>
</div> const AUTH_FLOW_TEST_COOKIE_NAME = '__SECURE-aistudio_auth_flow_may_set_cookies';
const COOKIE_VALUE = 'true';
<!-- Click to Enter --> function getCookie(name) {
<div id="enter-prompt" style="display:none;"> const cookies = document.cookie.split(';');
<div class="enter-content"> for (let i = 0; i < cookies.length; i++) {
<h2>Enter The Nexus</h2> let cookie = cookies[i].trim();
<p>Click anywhere to begin</p> if (cookie.startsWith(name + '=')) {
</div> return cookie.substring(name.length + 1);
</div> }
}
return null;
}
<canvas id="nexus-canvas"></canvas> function setAuthFlowTestCookie() {
// Set the cookie's TTL to 1 minute. This is a short lived cookie because it is only used
// when the user does not have an auth token or their auth token needs to be reset.
// Making this cookie too long-lived allows the user to get into a state where they can't
// mint a new auth token.
document.cookie = `${AUTH_FLOW_TEST_COOKIE_NAME}=${COOKIE_VALUE}; Path=/; Secure; SameSite=None; Domain=${window.location.hostname}; Partitioned; Max-Age=60;`;
}
<footer class="nexus-footer"> /**
<a href="https://www.perplexity.ai/computer" target="_blank" rel="noopener noreferrer"> * Returns true if the test cookie is set, false otherwise.
Created with Perplexity Computer */
</a> function authFlowTestCookieIsSet() {
</footer> return getCookie(AUTH_FLOW_TEST_COOKIE_NAME) === COOKIE_VALUE;
}
<script type="module" src="./app.js"></script> /**
* Redirects to the return url. If autoClose is true, then the return url will be opened in a
* new window, and it will be closed automatically when the page loads.
*/
async function redirectToReturnUrl(autoClose) {
const initialReturnUrlStr = new URLSearchParams(window.location.search).get('return_url');
const returnUrl = initialReturnUrlStr ? new URL(initialReturnUrlStr) : null;
<!-- Live Refresh: polls Gitea for new commits on main, reloads when SHA changes --> // Prevent potentially malicious URLs from being used
<div id="live-refresh-banner" style=" if (returnUrl.protocol.toLowerCase() === 'javascript:') {
display:none; position:fixed; top:0; left:0; right:0; z-index:9999; console.error('Potentially malicious return URL blocked');
background:linear-gradient(90deg,#4af0c0,#7b5cff); return;
color:#050510; font-family:'JetBrains Mono',monospace; font-size:13px; }
padding:8px 16px; text-align:center; font-weight:600;
">⚡ NEW DEPLOYMENT DETECTED — Reloading in <span id="lr-countdown">5</span>s…</div>
<script> if (autoClose) {
(function() { returnUrl.searchParams.set('__auto_close', '1');
const GITEA = 'http://143.198.27.163:3000/api/v1'; const url = new URL(window.location.href);
const REPO = 'Timmy_Foundation/the-nexus'; url.searchParams.set('return_url', returnUrl.toString());
const BRANCH = 'main'; // Land on the cookie check page first, so the user can interact with it before proceeding
const INTERVAL = 30000; // poll every 30s // to the return url where cookies can be set.
window.open(url.toString(), '_blank');
const hasAccess = await document.hasStorageAccess();
document.querySelector('#stepOne').classList.add('hidden');
if (!hasAccess) {
document.querySelector('#stepThree').classList.remove('hidden');
} else {
window.location.reload();
}
} else {
window.location.href = returnUrl.toString();
}
}
let knownSha = null; /**
* Grants the browser permission to set cookies. If successful, then it redirects to the
* return url.
*/
async function grantStorageAccess() {
try {
await document.requestStorageAccess();
redirectToReturnUrl(false);
} catch (err) {
console.log('error after button click: ', err);
}
}
async function fetchLatestSha() { /**
try { * Verifies that the browser can set cookies. If it can, then it redirects to the return url.
const r = await fetch(`${GITEA}/repos/${REPO}/branches/${BRANCH}`, { cache: 'no-store' }); * If it can't, then it shows the error UI.
if (!r.ok) return null; */
const d = await r.json(); function verifyCanSetCookies() {
return d.commit && d.commit.id ? d.commit.id : null; setAuthFlowTestCookie();
} catch (e) { return null; } if (authFlowTestCookieIsSet()) {
} // Check if we are on the auto-close flow, and if so show the interact button.
const returnUrl = new URLSearchParams(window.location.search).get('return_url');
const autoClose = new URL(returnUrl).searchParams.has('__auto_close');
if (autoClose) {
document.querySelector('#stepOne').classList.add('hidden');
document.querySelector('#stepTwo').classList.remove('hidden');
} else {
redirectToReturnUrl(false);
return;
}
}
// The cookie could not be set, so initiate the recovery flow.
document.querySelector('.logo').classList.add('hidden');
document.querySelector('.spinner').classList.add('hidden');
document.querySelector('#error-ui').classList.remove('hidden');
}
async function poll() { // Start the cookie verification process.
const sha = await fetchLatestSha(); verifyCanSetCookies();
if (!sha) return; </script>
if (knownSha === null) { knownSha = sha; return; } </body>
if (sha !== knownSha) {
knownSha = sha;
const banner = document.getElementById('live-refresh-banner');
const countdown = document.getElementById('lr-countdown');
banner.style.display = 'block';
let t = 5;
const tick = setInterval(() => {
t--;
countdown.textContent = t;
if (t <= 0) { clearInterval(tick); location.reload(); }
}, 1000);
}
}
// Start polling after page is interactive
fetchLatestSha().then(sha => { knownSha = sha; });
setInterval(poll, INTERVAL);
})();
</script>
</body>
</html> </html>

File diff suppressed because it is too large Load Diff