quantum-code-weaver-engine / components /architecture-diagram.js
BrandonHatch's picture
CRITICAL STOP. You have generated a Frontend Dashboard Simulation. I DO NOT WANT A DASHBOARD. I DO NOT WANT HTML OR JAVASCRIPT.
c3fa188 verified
class ArchitectureDiagram extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.diagram-container {
background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
border-radius: 16px;
padding: 2rem;
border: 1px solid rgba(6, 182, 212, 0.3);
position: relative;
overflow: hidden;
}
.diagram-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
position: relative;
z-index: 1;
}
.component {
position: relative;
background: rgba(30, 41, 59, 0.8);
border-radius: 12px;
padding: 1.5rem;
border: 1px solid;
transition: all 0.3s ease;
cursor: pointer;
min-height: 180px;
}
.component:hover {
transform: translateY(-5px);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.brain-component {
border-color: rgba(6, 182, 212, 0.5);
background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05));
}
.muscle-component {
border-color: rgba(139, 92, 246, 0.5);
background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
}
.nervous-component {
border-color: rgba(239, 68, 68, 0.5);
background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}
.memory-component {
border-color: rgba(16, 185, 129, 0.5);
background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}
.component-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 1rem;
}
.component-icon {
width: 48px;
height: 48px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
}
.brain-icon {
background: linear-gradient(135deg, #06b6d4, #0891b2);
color: white;
}
.muscle-icon {
background: linear-gradient(135deg, #8b5cf6, #7c3aed);
color: white;
}
.nervous-icon {
background: linear-gradient(135deg, #ef4444, #dc2626);
color: white;
}
.memory-icon {
background: linear-gradient(135deg, #10b981, #059669);
color: white;
}
.component-title {
font-size: 1.25rem;
font-weight: 700;
}
.component-description {
color: #94a3b8;
font-size: 0.875rem;
line-height: 1.5;
margin-bottom: 0.5rem;
}
.component-stats {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-item {
display: flex;
flex-direction: column;
align-items: center;
}
.stat-value {
font-weight: 700;
font-size: 1.25rem;
}
.stat-label {
font-size: 0.75rem;
color: #94a3b8;
}
.connections {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
z-index: 0;
}
.connection-line {
stroke: rgba(6, 182, 212, 0.3);
stroke-width: 2;
stroke-dasharray: 5, 5;
animation: flow 3s infinite linear;
}
@keyframes flow {
from { stroke-dashoffset: 0; }
to { stroke-dashoffset: 20; }
}
@media (max-width: 768px) {
.diagram-grid {
grid-template-columns: 1fr;
}
}
</style>
<div class="diagram-container">
<div class="connections">
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<line class="connection-line" x1="25%" y1="50%" x2="45%" y2="50%"/>
<line class="connection-line" x1="55%" y1="50%" x2="75%" y2="50%"/>
<line class="connection-line" x1="40%" y1="50%" x2="40%" y2="80%"/>
<line class="connection-line" x1="60%" y1="50%" x2="60%" y2="80%"/>
</svg>
</div>
<div class="diagram-grid">
<div class="component brain-component" data-component="brain">
<div class="component-header">
<div class="component-icon brain-icon">
<i data-feather="cpu"></i>
</div>
<h3 class="component-title">The Brain</h3>
</div>
<p class="component-description">
Local LLM orchestrator scoring and routing code candidates with zero heavy generation.
</p>
<div class="component-stats">
<div class="stat-item">
<span class="stat-value shimmer-text">JSON Only</span>
<span class="stat-label">IO Format</span>
</div>
<div class="stat-item">
<span class="stat-value shimmer-text">Async</span>
<span class="stat-label">Processing</span>
</div>
</div>
</div>
<div class="component muscle-component" data-component="muscle">
<div class="component-header">
<div class="component-icon muscle-icon">
<i data-feather="activity"></i>
</div>
<h3 class="component-title">The Muscle</h3>
</div>
<p class="component-description">
Cloud LLM workers generating high-volume, parallel code in AST-compliant format.
</p>
<div class="component-stats">
<div class="stat-item">
<span class="stat-value shimmer-text">5-10x</span>
<span class="stat-label">Parallel</span>
</div>
<div class="stat-item">
<span class="stat-value shimmer-text">Stateless</span>
<span class="stat-label">Workers</span>
</div>
</div>
</div>
<div class="component nervous-component" data-component="nervous">
<div class="component-header">
<div class="component-icon nervous-icon">
<i data-feather="radio"></i>
</div>
<h3 class="component-title">Nervous System</h3>
</div>
<p class="component-description">
Redis Pub/Sub queues implementing the hot event loop for async decoupling.
</p>
<div class="component-stats">
<div class="stat-item">
<span class="stat-value shimmer-text">Pub/Sub</span>
<span class="stat-label">Pattern</span>
</div>
<div class="stat-item">
<span class="stat-value shimmer-text">Real-time</span>
<span class="stat-label">Events</span>
</div>
</div>
</div>
<div class="component memory-component" data-component="memory">
<div class="component-header">
<div class="component-icon memory-icon">
<i data-feather="database"></i>
</div>
<h3 class="component-title">Long-Term Memory</h3>
</div>
<p class="component-description">
Neo4j verification graph storing only successful state transitions.
</p>
<div class="component-stats">
<div class="stat-item">
<span class="stat-value shimmer-text">Verified</span>
<span class="stat-label">Only</span>
</div>
<div class="stat-item">
<span class="stat-value shimmer-text">Graph DB</span>
<span class="stat-label">Storage</span>
</div>
</div>
</div>
</div>
</div>
`;
// Add event listeners to components
setTimeout(() => {
this.shadowRoot.querySelectorAll('.component').forEach(component => {
component.addEventListener('click', () => {
const compType = component.getAttribute('data-component');
this.showComponentDetails(compType);
});
});
// Replace feather icons
if (window.feather) {
feather.replace();
}
}, 100);
}
showComponentDetails(componentType) {
const details = {
'brain': {
title: 'The Brain - Orchestrator',
description: 'Local LLM responsible for verification, scoring, and routing. Works only with summarized state objects to maintain context economy.',
attributes: ['Zero heavy generation', 'JSON-in/JSON-out only', 'Hot state processing', 'Promote/Prune/Spawn decisions']
},
'muscle': {
title: 'The Muscle - Workers',
description: 'Stateless cloud LLM functions that receive Task Specs and return raw AST-compliant code or diffs.',
attributes: ['Parallel execution (5-10 workers)', 'No memory of graph', 'High-volume generation', 'Stateless functions']
},
'nervous': {
title: 'Nervous System - Redis',
description: 'Implements the Hot Event Loop using Pub/Sub queues to decouple orchestrator from workers.',
attributes: ['queue:tasks for pending jobs', 'queue:results for candidates', 'Fully async processing', 'Context summarization']
},
'memory': {
title: 'Long-Term Memory - Neo4j',
description: 'Stores the Verification Graph containing only verified state transitions that pass tests/compiles.',
attributes: ['Nodes = Verified states', 'Edges = Derivation paths', 'No failed attempts', 'Prevents graph bloat']
}
};
const detail = details[componentType];
if (detail) {
const alertHtml = `
<strong>${detail.title}</strong><br><br>
${detail.description}<br><br>
<strong>Key Attributes:</strong><br>
${detail.attributes.map(attr => `• ${attr}`).join('<br>')}
`;
alert(alertHtml);
}
}
}
customElements.define('architecture-diagram', ArchitectureDiagram);