**New component:** - nexus/components/symbolic-debugger.js — Real-time debug overlay showing: - Active symbols with truth values (green=true, red=false) - FSM states for all registered agents - Reasoning paths with timestamps - Knowledge graph stats + mini visualization - Performance metrics (facts, rules, heap) **Features:** - Toggle with Ctrl+Shift+G - Auto-refresh every second when visible - Draggable overlay - Manual refresh button **Tests:** - tests/test_symbolic_debugger.js — 10 tests, all passing **Documentation:** - docs/symbolic-debugger.md — Usage guide Closes #871
72 lines
1.6 KiB
Markdown
72 lines
1.6 KiB
Markdown
# GOFAI Symbolic Engine Debugger Overlay
|
|
|
|
Refs: the-nexus #871
|
|
|
|
## Overview
|
|
|
|
A specialized debug overlay that shows the internal state of the Symbolic Engine in real-time. Press **Ctrl+Shift+G** to toggle.
|
|
|
|
## Features
|
|
|
|
### 1. Active Symbols Panel
|
|
Displays all facts currently in the symbolic engine with their truth values:
|
|
- Green ● = true
|
|
- Red ○ = false
|
|
|
|
### 2. FSM States Panel
|
|
Shows the current state of all registered finite state machines:
|
|
- Agent ID on the left
|
|
- Current state on the right (highlighted)
|
|
|
|
### 3. Reasoning Paths Panel
|
|
Chronological log of all reasoning steps:
|
|
- Timestamp
|
|
- Rule that fired
|
|
- Outcome produced
|
|
|
|
### 4. Knowledge Graph Panel
|
|
- Node count and edge count
|
|
- Mini visualization of graph topology (up to 15 nodes)
|
|
- Color-coded by type (Agent, Location, etc.)
|
|
|
|
### 5. Performance Metrics
|
|
- Number of facts
|
|
- Number of rules
|
|
- JavaScript heap usage (if available)
|
|
|
|
## Usage
|
|
|
|
```javascript
|
|
import { SymbolicDebugger } from './nexus/components/symbolic-debugger.js';
|
|
import { SymbolicEngine } from './nexus/symbolic-engine.js';
|
|
|
|
// Create engine
|
|
const engine = new SymbolicEngine();
|
|
|
|
// Initialize debugger
|
|
SymbolicDebugger.init({
|
|
engine: engine,
|
|
fsmRegistry: new Map(), // optional
|
|
knowledgeGraph: null // optional
|
|
});
|
|
|
|
// Show the overlay
|
|
SymbolicDebugger.show();
|
|
|
|
// Or toggle with Ctrl+Shift+G
|
|
```
|
|
|
|
## Auto-refresh
|
|
|
|
The debugger updates automatically every second when visible. Manual refresh via the ↻ button.
|
|
|
|
## Dragging
|
|
|
|
The overlay can be dragged by its header to reposition on screen.
|
|
|
|
## Testing
|
|
|
|
```bash
|
|
node tests/test_symbolic_debugger.js
|
|
```
|