chore: add copyright headers, CI tests, and sanitize gitignore

This commit is contained in:
DmitrL-dev 2026-03-31 22:13:34 +10:00
parent 5cbb3d89d3
commit d1f844235e
325 changed files with 2267 additions and 902 deletions

31
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Go Tests
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.0'
cache: true
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Vet & Lint
run: |
go vet ./...
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...

35
.gitignore vendored Normal file
View file

@ -0,0 +1,35 @@
# Binaries
*.exe
*.exe~
*.dll
*.so
*.dylib
gomcp
soc
immune
sidecar
dist/
# Databases
*.db
*.sqlite
*.sqlite3
*.wal
*.shm
# Logs & Secrets
*.log
.env
*.key
.decisions.log
sentinel_leash
.rlm/
# IDE
.vscode/
.idea/
*.swp
*.swo
# Vendor
vendor/

View file

@ -1,18 +1,18 @@
# GoMCP: Recursive Language Model Server # GoMCP: The Secure Memory Core for AI Agents
![Go Version](https://img.shields.io/badge/Go-1.25.0-blue.svg) ![Go Version](https://img.shields.io/badge/Go-1.25.0-blue.svg)
![License](https://img.shields.io/badge/License-Apache_2.0-green.svg) ![License](https://img.shields.io/badge/License-Apache_2.0-green.svg)
![Protocol](https://img.shields.io/badge/MCP-Supported-orange.svg) ![Protocol](https://img.shields.io/badge/MCP-Supported-orange.svg)
> **The only Open-Source RLM (Recursive Language Model) Memory Server with Mathematically Proven Safety.** > **"Единственный RLM-сервер памяти с математически доказанной безопасностью (Sentinel Lattice). Работает локально, масштабируется глобально."**
GoMCP is the enterprise core of the Syntrex AI SOC ecosystem. It is an extremely fast, secure, and persistent Model Context Protocol (MCP) server entirely written in Go. GoMCP gives Large Language Models a permanent, evolving memory and self-modifying context, transforming standard text agents into self-improving persistent intelligences. GoMCP is the enterprise core of the Syntrex AI SOC ecosystem. It is an extremely fast, secure, and persistent Model Context Protocol (MCP) server entirely written in Go. GoMCP gives Large Language Models a permanent, evolving memory and self-modifying context, transforming standard text agents into self-improving persistent intelligences.
## 🚀 Key Features ## 🚀 Key Features
- **Context Consciousness Crystal (C³):** Hierarchical memory layers (L0-L3) combined with SQLite-backed temporal caching. - 🛡️ **Sentinel Lattice Primitives:** (TSA, CAFL, GPS...)
- **57+ Native MCP Tools:** Deeply integrated tools for agentic self-reflection, codebase navigation, and file editing. - **Sub-millisecond latency:** Pure Go execution with optional Rust bindings
- **Sub-millisecond latency:** Engineered for speed and durability under enterprise loads. - 🔌 **57+ Native MCP Tools:** Deeply integrated tools right out of the box
- **Secure by Default:** Zero-G execution environment and robust isolation from the main operating system logic. DoH shielding, uTLS protocols, and session resumption natively integrated. - 💾 **Persistent Causal Graph Memory:** Hierarchical memory layers (L0-L3) backed by robust SQLite temporal caching
## ⚡ Quick Start ## ⚡ Quick Start

22
add_headers.py Normal file
View file

@ -0,0 +1,22 @@
import os
import glob
HEADER = """// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
"""
def run():
for filepath in glob.glob("**/*.go", recursive=True):
if os.path.isfile(filepath):
with open(filepath, 'r', encoding='utf-8') as f:
content = f.read()
# Skip if already has header
if "Copyright 2026 Syntrex Lab" not in content:
with open(filepath, 'w', encoding='utf-8') as f:
f.write(HEADER + content)
if __name__ == '__main__':
run()

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// GoMCP v2 — High-performance Go-native MCP server for the RLM Toolkit. // GoMCP v2 — High-performance Go-native MCP server for the RLM Toolkit.
// Provides hierarchical persistent memory, cognitive state management, // Provides hierarchical persistent memory, cognitive state management,
// causal reasoning chains, and code crystal indexing. // causal reasoning chains, and code crystal indexing.

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package main provides the SENTINEL immune agent (SEC-002 eBPF Runtime Guard). // Package main provides the SENTINEL immune agent (SEC-002 eBPF Runtime Guard).
// //
// The immune agent monitors SOC processes at the kernel level using eBPF // The immune agent monitors SOC processes at the kernel level using eBPF

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package main provides the Universal Sidecar CLI entry point (§5.5). // Package main provides the Universal Sidecar CLI entry point (§5.5).
// //
// Usage: // Usage:

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package main provides the SOC Correlate process (SEC-001 Process Isolation). // Package main provides the SOC Correlate process (SEC-001 Process Isolation).
// //
// Responsibility: Receives persisted events from soc-ingest via IPC, // Responsibility: Receives persisted events from soc-ingest via IPC,

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package main provides the SOC Ingest process (SEC-001 Process Isolation). // Package main provides the SOC Ingest process (SEC-001 Process Isolation).
// //
// Responsibility: HTTP endpoint, authentication, secret scanner, // Responsibility: HTTP endpoint, authentication, secret scanner,

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package main provides the SOC Respond process (SEC-001 Process Isolation). // Package main provides the SOC Respond process (SEC-001 Process Isolation).
// //
// Responsibility: Receives incidents from soc-correlate via IPC, // Responsibility: Receives incidents from soc-correlate via IPC,

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package main provides the standalone SOC API server entry point. // Package main provides the standalone SOC API server entry point.
// //
// @title SYNTREX Sentinel SOC API // @title SYNTREX Sentinel SOC API
@ -29,10 +33,10 @@ import (
"syscall" "syscall"
"github.com/syntrex-lab/gomcp/internal/application/soc" "github.com/syntrex-lab/gomcp/internal/application/soc"
socdomain "github.com/syntrex-lab/gomcp/internal/domain/soc"
"github.com/syntrex-lab/gomcp/internal/domain/engines" "github.com/syntrex-lab/gomcp/internal/domain/engines"
"github.com/syntrex-lab/gomcp/internal/infrastructure/auth" socdomain "github.com/syntrex-lab/gomcp/internal/domain/soc"
"github.com/syntrex-lab/gomcp/internal/infrastructure/audit" "github.com/syntrex-lab/gomcp/internal/infrastructure/audit"
"github.com/syntrex-lab/gomcp/internal/infrastructure/auth"
"github.com/syntrex-lab/gomcp/internal/infrastructure/email" "github.com/syntrex-lab/gomcp/internal/infrastructure/email"
"github.com/syntrex-lab/gomcp/internal/infrastructure/logging" "github.com/syntrex-lab/gomcp/internal/infrastructure/logging"
"github.com/syntrex-lab/gomcp/internal/infrastructure/postgres" "github.com/syntrex-lab/gomcp/internal/infrastructure/postgres"
@ -274,4 +278,3 @@ func configureMemorySafety(logger *slog.Logger) {
"sys_mib", m.Sys/1024/1024, "sys_mib", m.Sys/1024/1024,
) )
} }

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// syntrex-proxy — transparent reverse proxy that scans LLM prompts. // syntrex-proxy — transparent reverse proxy that scans LLM prompts.
// //
// Usage: // Usage:

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package docs Code generated by swaggo/swag. DO NOT EDIT // Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs package docs

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package contextengine package contextengine
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package contextengine package contextengine
import ( import (
@ -5,9 +9,9 @@ import (
"path/filepath" "path/filepath"
"testing" "testing"
ctxdomain "github.com/syntrex-lab/gomcp/internal/domain/context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
ctxdomain "github.com/syntrex-lab/gomcp/internal/domain/context"
) )
func TestLoadConfig_FileNotExists(t *testing.T) { func TestLoadConfig_FileNotExists(t *testing.T) {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package contextengine implements the Proactive Context Engine. // Package contextengine implements the Proactive Context Engine.
// It automatically injects relevant memory facts into every MCP tool response // It automatically injects relevant memory facts into every MCP tool response
// via ToolHandlerMiddleware, so the LLM always has context without asking. // via ToolHandlerMiddleware, so the LLM always has context without asking.

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package contextengine package contextengine
import ( import (
@ -10,9 +14,9 @@ import (
"github.com/mark3labs/mcp-go/mcp" "github.com/mark3labs/mcp-go/mcp"
"github.com/syntrex-lab/gomcp/internal/domain/memory" "github.com/syntrex-lab/gomcp/internal/domain/memory"
ctxdomain "github.com/syntrex-lab/gomcp/internal/domain/context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
ctxdomain "github.com/syntrex-lab/gomcp/internal/domain/context"
) )
// --- Mock FactProvider --- // --- Mock FactProvider ---

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package contextengine — processor.go // Package contextengine — processor.go
// Processes unprocessed interaction log entries into session summary facts. // Processes unprocessed interaction log entries into session summary facts.
// This closes the memory loop: tool calls → interaction log → summary facts → boot instructions. // This closes the memory loop: tool calls → interaction log → summary facts → boot instructions.

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package contextengine package contextengine
import ( import (
@ -5,10 +9,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/syntrex-lab/gomcp/internal/domain/memory"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/domain/memory"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
) )
// --- mock FactStore for processor tests --- // --- mock FactStore for processor tests ---

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package contextengine package contextengine
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package contextengine package contextengine
import ( import (
@ -6,9 +10,9 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/syntrex-lab/gomcp/internal/domain/memory"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/domain/memory"
) )
// --- Mock FactStore for provider tests --- // --- Mock FactStore for provider tests ---

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package lifecycle manages graceful shutdown with auto-save of session state, // Package lifecycle manages graceful shutdown with auto-save of session state,
// cache flush, and database closure. // cache flush, and database closure.
package lifecycle package lifecycle

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package lifecycle package lifecycle
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package lifecycle package lifecycle
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package lifecycle package lifecycle
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package orchestrator package orchestrator
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package orchestrator package orchestrator
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package orchestrator implements the DIP Heartbeat Orchestrator. // Package orchestrator implements the DIP Heartbeat Orchestrator.
// //
// The orchestrator runs a background loop with 4 modules: // The orchestrator runs a background loop with 4 modules:

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package orchestrator package orchestrator
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import "time" import "time"

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package resilience implements the Sentinel Autonomous Resilience Layer (SARL). // Package resilience implements the Sentinel Autonomous Resilience Layer (SARL).
// //
// Five levels of autonomous self-recovery: // Five levels of autonomous self-recovery:

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resilience package resilience
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package resources provides MCP resource implementations. // Package resources provides MCP resource implementations.
package resources package resources

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package resources package resources
import ( import (
@ -5,11 +9,11 @@ import (
"encoding/json" "encoding/json"
"testing" "testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/domain/memory" "github.com/syntrex-lab/gomcp/internal/domain/memory"
"github.com/syntrex-lab/gomcp/internal/domain/session" "github.com/syntrex-lab/gomcp/internal/domain/session"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite" "github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
) )
func newTestProvider(t *testing.T) (*Provider, *sqlite.DB, *sqlite.DB) { func newTestProvider(t *testing.T) (*Provider, *sqlite.DB, *sqlite.DB) {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package shadow_ai implements the Sentinel Shadow AI Control Module. // Package shadow_ai implements the Sentinel Shadow AI Control Module.
// //
// Five levels of shadow AI management: // Five levels of shadow AI management:

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (
@ -1222,4 +1226,3 @@ func TestController_ReviewDocument_WithSecrets(t *testing.T) {
t.Fatal("blocked docs should not create approval") t.Fatal("blocked docs should not create approval")
} }
} }

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package shadow_ai package shadow_ai
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package sidecar package sidecar
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package sidecar implements the Universal Sidecar (§5.5) — a zero-dependency // Package sidecar implements the Universal Sidecar (§5.5) — a zero-dependency
// Go binary that runs alongside SENTINEL sensors, tails their STDOUT/logs, // Go binary that runs alongside SENTINEL sensors, tails their STDOUT/logs,
// and pushes parsed security events to the SOC Event Bus. // and pushes parsed security events to the SOC Event Bus.

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package sidecar package sidecar
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package sidecar package sidecar
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package sidecar package sidecar
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package soc provides SOC analytics: event trends, severity distribution, // Package soc provides SOC analytics: event trends, severity distribution,
// top sources, MITRE ATT&CK coverage, and time-series aggregation. // top sources, MITRE ATT&CK coverage, and time-series aggregation.
package soc package soc

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package soc package soc
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package soc package soc
import ( import (
@ -524,4 +528,3 @@ func TestE2E_CrescendoEscalation(t *testing.T) {
assert.Equal(t, domsoc.SeverityCritical, lastInc.Severity) assert.Equal(t, domsoc.SeverityCritical, lastInc.Severity)
assert.Contains(t, lastInc.MITREMapping, "T1059") assert.Contains(t, lastInc.MITREMapping, "T1059")
} }

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package soc package soc
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package soc package soc
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package soc provides application services for the SENTINEL AI SOC subsystem. // Package soc provides application services for the SENTINEL AI SOC subsystem.
package soc package soc
@ -213,7 +217,6 @@ func (s *Service) TestWebhook() []WebhookResult {
return wh.NotifyIncident("webhook_test", testIncident) return wh.NotifyIncident("webhook_test", testIncident)
} }
// Drain puts the service into drain mode (§15.7 Stage 1). // Drain puts the service into drain mode (§15.7 Stage 1).
// New events are rejected with ErrDraining; existing processing continues. // New events are rejected with ErrDraining; existing processing continues.
func (s *Service) Drain() { func (s *Service) Drain() {
@ -301,6 +304,7 @@ func (s *Service) runRetentionPurge() {
} }
} }
} }
// IngestEvent processes an incoming security event through the SOC pipeline. // IngestEvent processes an incoming security event through the SOC pipeline.
// Returns the event ID and any incident created by correlation. // Returns the event ID and any incident created by correlation.
// //
@ -1161,7 +1165,7 @@ func (s *Service) Dashboard(tenantID string) (*DashboardData, error) {
return nil, err return nil, err
} }
lastHourEvents, err := s.repo.CountEventsSince(tenantID, time.Now().Add(-1 * time.Hour)) lastHourEvents, err := s.repo.CountEventsSince(tenantID, time.Now().Add(-1*time.Hour))
if err != nil { if err != nil {
return nil, err return nil, err
} }

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package soc package soc
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package soc package soc
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package soc package soc
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package soc provides a threat intelligence feed integration // Package soc provides a threat intelligence feed integration
// for enriching SOC events and correlation rules. // for enriching SOC events and correlation rules.
// //

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package soc package soc
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package webhook provides outbound SOAR webhook notifications // Package webhook provides outbound SOAR webhook notifications
// for the SOC pipeline. Fires HTTP POST on incident creation/update. // for the SOC pipeline. Fires HTTP POST on incident creation/update.
package soc package soc
@ -80,8 +84,6 @@ func NewWebhookNotifier(config WebhookConfig) *WebhookNotifier {
} }
} }
// NotifyIncident sends an incident webhook to all configured endpoints. // NotifyIncident sends an incident webhook to all configured endpoints.
// Non-blocking: fires goroutines for each endpoint. // Non-blocking: fires goroutines for each endpoint.
func (w *WebhookNotifier) NotifyIncident(eventType string, incident *domsoc.Incident) []WebhookResult { func (w *WebhookNotifier) NotifyIncident(eventType string, incident *domsoc.Incident) []WebhookResult {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package tools — Apathy Detection and Apoptosis Recovery (DIP H1.4). // Package tools — Apathy Detection and Apoptosis Recovery (DIP H1.4).
// //
// This file implements: // This file implements:

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (

View file

@ -1,12 +1,16 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (
"context" "context"
"testing" "testing"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
) )
func newTestCausalService(t *testing.T) *CausalService { func newTestCausalService(t *testing.T) *CausalService {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (

View file

@ -1,12 +1,16 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (
"context" "context"
"testing" "testing"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
) )
func newTestCrystalService(t *testing.T) *CrystalService { func newTestCrystalService(t *testing.T) *CrystalService {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
// DecisionRecorder is the interface for recording tamper-evident decisions (v3.7). // DecisionRecorder is the interface for recording tamper-evident decisions (v3.7).

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package tools provides application-level tool services that bridge // Package tools provides application-level tool services that bridge
// domain logic with MCP tool handlers. // domain logic with MCP tool handlers.
package tools package tools

View file

@ -1,13 +1,17 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (
"context" "context"
"testing" "testing"
"github.com/syntrex-lab/gomcp/internal/domain/memory"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/domain/memory"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
) )
func newTestFactService(t *testing.T) *FactService { func newTestFactService(t *testing.T) *FactService {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package tools provides application-level tool services. // Package tools provides application-level tool services.
// This file adds the Intent Distiller MCP tool integration (DIP H0.2). // This file adds the Intent Distiller MCP tool integration (DIP H0.2).
package tools package tools

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (

View file

@ -1,13 +1,17 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (
"context" "context"
"testing" "testing"
"github.com/syntrex-lab/gomcp/internal/domain/session"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/domain/session"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
) )
func newTestSessionService(t *testing.T) *SessionService { func newTestSessionService(t *testing.T) *SessionService {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (

View file

@ -1,12 +1,16 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package tools package tools
import ( import (
"context" "context"
"testing" "testing"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/infrastructure/sqlite"
) )
func newTestSystemService(t *testing.T) *SystemService { func newTestSystemService(t *testing.T) *SystemService {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package config package config
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package config package config
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package alert defines the Alert domain entity and severity levels // Package alert defines the Alert domain entity and severity levels
// for the DIP-Watcher proactive monitoring system. // for the DIP-Watcher proactive monitoring system.
package alert package alert

View file

@ -1,12 +1,16 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package alert_test package alert_test
import ( import (
"testing" "testing"
"time" "time"
"github.com/syntrex-lab/gomcp/internal/domain/alert"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/domain/alert"
) )
func TestAlert_New(t *testing.T) { func TestAlert_New(t *testing.T) {

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package alert package alert
import "sync" import "sync"

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package causal defines domain entities for causal reasoning chains. // Package causal defines domain entities for causal reasoning chains.
package causal package causal

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package causal package causal
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package circuitbreaker implements a state machine that controls // Package circuitbreaker implements a state machine that controls
// the health of recursive pipelines (DIP H1.1). // the health of recursive pipelines (DIP H1.1).
// //

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package circuitbreaker package circuitbreaker
import ( import (

View file

@ -1,3 +1,7 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
// Package context defines domain entities for the Proactive Context Engine. // Package context defines domain entities for the Proactive Context Engine.
// The engine automatically injects relevant memory facts into every tool response, // The engine automatically injects relevant memory facts into every tool response,
// ensuring the LLM always has context without explicitly requesting it. // ensuring the LLM always has context without explicitly requesting it.

View file

@ -1,12 +1,16 @@
// Copyright 2026 Syntrex Lab. All rights reserved.
// Use of this source code is governed by an Apache-2.0 license
// that can be found in the LICENSE file.
package context package context
import ( import (
"testing" "testing"
"time" "time"
"github.com/syntrex-lab/gomcp/internal/domain/memory"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/syntrex-lab/gomcp/internal/domain/memory"
) )
// --- ScoredFact tests --- // --- ScoredFact tests ---

Some files were not shown because too many files have changed in this diff Show more