Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@






#!/usr/bin/env python3
"""
WSGI entry point for Linux Kernel Visualization Backend.
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h2>Linux Kernel Ring 0 Visualization</h2>
<script src="/static/js/right-semicircle-menu.js?v=48"></script>
<script src="/static/js/kernel-dna.js?v=31"></script>
<script src="/static/js/network-stack.js?v=6"></script>
<script src="/static/js/devices-belt.js?v=14"></script>
<script src="/static/js/devices-belt.js?v=23"></script>
<script src="/static/js/crypto-belt.js?v=50"></script>
<script src="/static/js/security-belt.js?v=13"></script>
<script src="/static/js/filesystem-map.js?v=10"></script>
Expand Down
1 change: 1 addition & 0 deletions kernel_ai/api/rest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""REST API under ``/api``."""
from flask import Blueprint
from kernel_ai.http import api as h

Expand Down
7 changes: 7 additions & 0 deletions kernel_ai/collectors/proc_fs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Filesystem collectors for kernel introspection.

Tests should patch functions in ``kernel_ai.collectors.proc_fs`` (or this module's
attributes) rather than the whole webapp.
"""

from __future__ import annotations


Expand Down
2 changes: 2 additions & 0 deletions kernel_ai/hooks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Global Flask hooks (CORS, cache headers, request id)."""

import logging
import time
from uuid import uuid4
Expand Down
2 changes: 2 additions & 0 deletions kernel_ai/http/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""HTTP route registration."""

from kernel_ai.http.register import register_http_routes

__all__ = ["register_http_routes"]
2 changes: 2 additions & 0 deletions kernel_ai/services/core_observability.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Core observability helpers extracted from webapp."""

from __future__ import annotations

import logging
Expand Down
2 changes: 2 additions & 0 deletions kernel_ai/services/execution.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Execution context and kernel DNA services."""

from __future__ import annotations

import os
Expand Down
2 changes: 2 additions & 0 deletions kernel_ai/services/infra_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Shared infrastructure utilities."""

from __future__ import annotations

import os
Expand Down
2 changes: 2 additions & 0 deletions kernel_ai/services/kernel_maps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Kernel syscall maps and subsystem mapping helpers."""

from __future__ import annotations


Expand Down
2 changes: 2 additions & 0 deletions kernel_ai/services/syscalls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Syscall and kernel telemetry helpers."""

from __future__ import annotations

import os
Expand Down
2 changes: 2 additions & 0 deletions kernel_ai/views/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""HTML and public page blueprints."""

from kernel_ai.views.pages import bp as pages_bp

__all__ = ["pages_bp"]
1 change: 1 addition & 0 deletions kernel_ai/views/pages.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Site pages: index, subsystem HTML, and health."""
from flask import Blueprint
from kernel_ai.http import pages as h

Expand Down
1 change: 1 addition & 0 deletions static/js/active-connections.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Module for working with active network connections
class ActiveConnectionsManager {
constructor() {
debugLog("ActiveConnectionsManager: constructor called");

Check failure on line 4 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'debugLog' is not defined
this.currentConnections = [];
this.updateInterval = null;
this.updateCallback = null;
Expand All @@ -11,14 +12,14 @@
// Update active connections data
async updateConnectionsTable() {
try {
debugLog("ActiveConnectionsManager: updateConnectionsTable called");

Check failure on line 15 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'debugLog' is not defined
const response = await fetch('/api/active-connections');
const data = await response.json();

debugLog("API response:", data);

Check failure on line 19 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'debugLog' is not defined

if (data.connections) {
debugLog("Total connections:", data.connections.length);

Check failure on line 22 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'debugLog' is not defined

// Filter out local connections (127.0.0.1, 0.0.0.0)
const filteredConnections = data.connections.filter(conn => {
Expand All @@ -31,8 +32,8 @@

this.currentConnections = filteredConnections;

debugLog("Filtered connections:", this.currentConnections.length);

Check failure on line 35 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'debugLog' is not defined
debugLog("Filtered out:", data.connections.length - this.currentConnections.length, "local connections");

Check failure on line 36 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'debugLog' is not defined

this.renderConnectionsTable();

Expand All @@ -43,7 +44,7 @@
}
} catch (error) {
console.error('Error getting active connections:', error);
debugLog('Using fallback data...');

Check failure on line 47 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'debugLog' is not defined
this.useFallbackData();
}
}
Expand All @@ -66,11 +67,11 @@
renderConnectionsTable() {
// Do not render connections if Kernel Matrix View is active
if (window.kernelContextMenu && window.kernelContextMenu.currentView === 'matrix') {
debugLog('⏸️ Skipping active connections render - Matrix View is active');

Check failure on line 70 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'debugLog' is not defined
return;
}

const svg = d3.select('svg');

Check failure on line 74 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'd3' is not defined

// Clear old elements
svg.selectAll('.connection-row, .connection-box, .connection-text, .connection-details, .connection-header').remove();
Expand Down Expand Up @@ -148,7 +149,7 @@
const normalizedProtocol = String(protocol || "").toUpperCase();
const normalizedState = String(stateCode).toUpperCase();
if (normalizedProtocol.includes("UDP")) return "DATAGRAM";
return tcpStates[normalizedState] || normalizedState;

Check warning on line 152 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

Generic Object Injection Sink
}

buildSocketTooltipHtml(connection) {
Expand Down Expand Up @@ -215,7 +216,7 @@
attachSocketTooltipHandlers(selection, connection) {
selection
.on("mouseover", (event) => {
d3.selectAll(".socket-tooltip").remove();

Check failure on line 219 in static/js/active-connections.js

View workflow job for this annotation

GitHub Actions / security

'd3' is not defined
const tooltip = d3.select("body")
.append("div")
.attr("class", "tooltip socket-tooltip")
Expand Down
Loading
Loading