feat: migrate docs site to Zensical with full nav and new sections

Replace Hugo+Docsy with Zensical (MkDocs Material). Restructure all
content under docs/ with explicit nav. Add 19 new Go package pages,
plus Agent, MCP, CoreTS, IDE, GUI, and AI (LEM) sections. PHP sidebar
restructured with collapsible Guides/Reference groups. Homepage now
has sidebar with Where to Start guide and Community links.

Tabs: Home | Go | PHP | TS | GUI | AI | Tools | Deploy | Publish

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-11 11:48:44 +00:00
parent 960092d991
commit a61000db6e
225 changed files with 1560 additions and 188 deletions

View file

@ -0,0 +1,39 @@
name: Build and Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Zensical
run: pip install zensical
- name: Build
run: zensical build
- name: Deploy to BunnyCDN
run: |
pip install s3cmd
cat > ~/.s3cfg <<EOCFG
[default]
access_key = $AWS_ACCESS_KEY_ID
secret_key = $AWS_SECRET_ACCESS_KEY
host_base = storage.bunnycdn.com
host_bucket = %(bucket)s.storage.bunnycdn.com
use_https = True
EOCFG
s3cmd sync site/ s3://core-help/ --delete-removed --acl-public
env:
AWS_ACCESS_KEY_ID: ${{ secrets.BUNNY_STORAGE_ZONE }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.BUNNY_STORAGE_KEY }}

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
site/
.cache/
.DS_Store

BIN
build/.DS_Store vendored

Binary file not shown.

BIN
build/php/.DS_Store vendored

Binary file not shown.

View file

@ -1,55 +0,0 @@
# Discovery: L1 Packages vs Standalone php-* Modules
**Issue:** #3
**Date:** 2026-02-21
**Status:** Complete findings filed as issues #4, #5, #6, #7
## L1 Packages (Boot.php files under src/Core/)
| Package | Path | Has Standalone? |
|---------|------|----------------|
| Activity | `src/Core/Activity/` | No |
| Bouncer | `src/Core/Bouncer/` | No |
| Bouncer/Gate | `src/Core/Bouncer/Gate/` | No |
| Cdn | `src/Core/Cdn/` | No |
| Config | `src/Core/Config/` | No |
| Console | `src/Core/Console/` | No |
| Front | `src/Core/Front/` | No (root) |
| Front/Admin | `src/Core/Front/Admin/` | Partial `core/php-admin` extends |
| Front/Api | `src/Core/Front/Api/` | Partial `core/php-api` extends |
| Front/Cli | `src/Core/Front/Cli/` | No |
| Front/Client | `src/Core/Front/Client/` | No |
| Front/Components | `src/Core/Front/Components/` | No |
| Front/Mcp | `src/Core/Front/Mcp/` | Intentional `core/php-mcp` fills |
| Front/Stdio | `src/Core/Front/Stdio/` | No |
| Front/Web | `src/Core/Front/Web/` | No |
| Headers | `src/Core/Headers/` | No |
| Helpers | `src/Core/Helpers/` | No |
| Lang | `src/Core/Lang/` | No |
| Mail | `src/Core/Mail/` | No |
| Media | `src/Core/Media/` | No |
| Search | `src/Core/Search/` | No (admin search is separate concern) |
| Seo | `src/Core/Seo/` | No |
## Standalone Repos
| Repo | Package | Namespace | Relationship |
|------|---------|-----------|-------------|
| `core/php-tenant` | `host-uk/core-tenant` | `Core\Tenant\` | Extension |
| `core/php-admin` | `host-uk/core-admin` | `Core\Admin\` | Extends Front/Admin |
| `core/php-api` | `host-uk/core-api` | `Core\Api\` | Extends Front/Api |
| `core/php-content` | `host-uk/core-content` | `Core\Mod\Content\` | Extension |
| `core/php-commerce` | `host-uk/core-commerce` | `Core\Mod\Commerce\` | Extension |
| `core/php-agentic` | `host-uk/core-agentic` | `Core\Mod\Agentic\` | Extension |
| `core/php-mcp` | `host-uk/core-mcp` | `Core\Mcp\` | Fills Front/Mcp shell |
| `core/php-developer` | `host-uk/core-developer` | `Core\Developer\` | Extension (also needs core-admin) |
| `core/php-devops` | *(DevOps tooling)* | N/A | Not a PHP module |
## Overlaps Found
See issues filed:
- **#4** `Front/Api` rate limiting vs `core/php-api` `RateLimitApi` middleware double rate limiting risk
- **#5** `Core\Search` vs `core/php-admin` search subsystem dual registries
- **#6** `Core\Activity` UI duplicated in `core/php-admin` and `core/php-developer`
- **#7** Summary issue with full analysis

39
docs/agent/index.md Normal file
View file

@ -0,0 +1,39 @@
---
title: Agent
description: Agent orchestration platform — Claude Code plugins, Go agent framework, and Laravel agent package
---
# Agent
`forge.lthn.ai/core/agent`
A monorepo containing the agent orchestration platform for Host UK. Combines Go and PHP into a single codebase that powers AI agent tooling across the stack.
## What's Inside
### Claude Code Plugins
A collection of Claude Code plugins for the Host UK federated monorepo:
| Plugin | Description |
|--------|-------------|
| **code** | Core development — hooks, scripts, data collection |
| **review** | Code review automation |
### Go Agent Framework
131 Go files providing the agent runtime, session management, and orchestration layer.
### Laravel Agent Package
231 PHP files providing the Laravel integration — agent sessions, plans, tool handlers, and the agentic portal backend.
## Repository
- **Source**: [forge.lthn.ai/core/agent](https://forge.lthn.ai/core/agent)
- **Go module**: `forge.lthn.ai/core/agent`
- **Composer**: `lthn/agentic`
## Absorbed Archives
This repo consolidates code from the now-archived `go-agent`, `go-agentic`, and `php-agentic` packages. The `php-devops` functionality is also planned to be implemented here.

57
docs/ai/index.md Normal file
View file

@ -0,0 +1,57 @@
---
title: AI
description: LEM — Lethean Evaluation Model, training pipeline, scoring, and inference
---
# AI
`forge.lthn.ai/lthn/lem`
LEM (Lethean Evaluation Model) is an AI training and evaluation platform. A 1-billion-parameter model trained with 5 axioms consistently outperforms untrained models 27 times its size. 29 models tested, 3,000+ individual runs, two independent probe sets. Fully reproducible on Apple Silicon.
## Benchmark Highlights
| Model | Params | v2 Score | Notes |
|-------|--------|----------|-------|
| Gemma3 12B + LEK kernel | 12B | **23.66** | Best kernel-boosted |
| Gemma3 27B + LEK kernel | 27B | 23.26 | |
| **LEK-Gemma3 1B baseline** | **1B** | **21.74** | **Axioms in weights** |
| Base Gemma3 4B | 4B | 21.12 | Untrained |
| Base Gemma3 12B | 12B | 20.47 | Untrained |
## Packages
### pkg/lem
The core engine — 75+ files covering the full pipeline:
- **Training**: distillation, conversation generation, attention analysis, grammar integration
- **Scoring**: heuristic probes, tiered scoring, coverage analysis, judge evaluation
- **Inference**: Metal and mlx-lm backends, worker pool, client API
- **Data**: InfluxDB time-series storage, Parquet export, zstd compression, ingestion
- **Publishing**: Forgejo, Hugging Face, Docker registry integration
- **Analytics**: cluster analysis, feature extraction, metrics, comparison tools
### pkg/lab
LEM Lab — model store, configuration, local experimentation environment.
### pkg/heuristic
Standalone heuristic scoring engine for probe evaluation.
## Binaries
| Command | Purpose |
|---------|---------|
| `lemcmd` | Main CLI — training, scoring, publishing |
| `scorer` | Standalone scoring binary |
| `lem-desktop` | Desktop app (LEM Lab UI) |
| `composure-convert` | Training data format conversion |
| `dedup-check` | Dataset deduplication checker |
## Repository
- **Source**: [forge.lthn.ai/lthn/lem](https://forge.lthn.ai/lthn/lem)
- **Go module**: `forge.lthn.ai/lthn/lem`
- **Models**: [huggingface.co/lthn](https://huggingface.co/lthn)

32
docs/getting-started.md Normal file
View file

@ -0,0 +1,32 @@
---
title: Where to Start
description: Choose your path through the Core platform based on what you're building
---
# Where to Start
Not sure where to begin? Pick the path that matches what you're building.
## I want to build a Go application
1. Read the [Go overview](go/index.md) to understand the DI framework
2. Follow the [Getting Started guide](go/getting-started.md) for setup
3. Explore [Go Packages](go/packages/index.md) for AI, ML, crypto, and more
## I want to build a PHP application
1. Read the [PHP overview](php/index.md) for the framework architecture
2. Follow [Installation](php/getting-started/installation.md) and [Quick Start](php/getting-started/quick-start.md)
3. Learn about [Modules](php/framework/modules.md) and [Events](php/framework/events.md)
## I want to use the CLI
1. Read the [CLI overview](cli/index.md) for all available commands
2. Run `core doctor` to check your environment
3. Explore [Multi-Repo tools](cli/dev/index.md) for managing multiple repositories
## I want to deploy
1. Choose a [deployment target](deploy/index.md) — Docker, PHP, or LinuxKit
2. Set up CI with [`core ci`](cli/ci/index.md)
3. [Publish](publish/index.md) to package managers, registries, or GitHub

36
docs/go/packages/go-ai.md Normal file
View file

@ -0,0 +1,36 @@
# go-ai
MCP (Model Context Protocol) hub for the Lethean AI stack.
**Module**: `forge.lthn.ai/core/go-ai`
Exposes 49 tools across file operations, directory management, language detection, RAG vector search, ML inference and scoring, process management, WebSocket streaming, browser automation via Chrome DevTools Protocol, JSONL metrics, and an IDE bridge to the Laravel core-agentic backend. The package is a pure library — the Core CLI (`core mcp serve`) imports it and handles transport selection (stdio, TCP, or Unix socket).
## Quick Start
```go
import "forge.lthn.ai/core/go-ai/mcp"
svc, err := mcp.New(
mcp.WithWorkspaceRoot("/path/to/project"),
mcp.WithProcessService(ps),
)
// Run as stdio server (default for AI client subprocess integration)
err = svc.Run(ctx)
// Or TCP: MCP_ADDR=127.0.0.1:9100 triggers ServeTCP automatically
```
## Tool Categories
| Category | Tools | Description |
|----------|-------|-------------|
| File | 8 | Read, write, search, glob, patch files |
| Directory | 4 | List, create, move, tree |
| Language | 3 | Detect, grammar, translate |
| RAG | 5 | Ingest, search, embed, index, stats |
| ML | 6 | Generate, score, probe, model management |
| Process | 4 | Start, stop, list, logs |
| WebSocket | 3 | Connect, send, subscribe |
| Browser | 5 | Navigate, click, read, screenshot, evaluate |
| Metrics | 3 | Write, query, dashboard |
| IDE | 8 | Bridge to core-agentic Laravel backend |

View file

@ -0,0 +1,15 @@
---
title: go-ansible
description: Ansible executor for programmatic playbook and ad-hoc command execution
---
# go-ansible
`forge.lthn.ai/core/go-ansible`
Go wrapper around Ansible for executing playbooks and ad-hoc commands programmatically. Provides a clean API for running Ansible operations with structured output parsing and SSH client abstraction for testing.
## Key Types
- `Executor` — runs Ansible playbooks and ad-hoc commands, captures structured output
- `MockSSHClient` — test double for SSH connections, enables unit testing without live hosts

View file

@ -0,0 +1,16 @@
---
title: go-api
description: REST framework with OpenAPI SDK generation, built on Gin
---
# go-api
`forge.lthn.ai/core/go-api`
HTTP REST framework built on Gin with automatic OpenAPI spec generation and client SDK output. Provides a route group interface for modular endpoint registration and includes health check endpoints out of the box.
## Key Types
- `Engine` — HTTP server wrapping Gin with OpenAPI integration and middleware pipeline
- `healthGroup` — built-in health check route group for liveness and readiness probes
- `RouteGroup` — interface for modular route registration

View file

@ -0,0 +1,42 @@
# go-blockchain
Pure Go implementation of the Lethean blockchain protocol.
**Module**: `forge.lthn.ai/core/go-blockchain`
Provides chain configuration, core cryptographic data types, CryptoNote wire serialisation, and LWMA difficulty adjustment for the Lethean CryptoNote/Zano-fork chain. Lineage: CryptoNote to IntenseCoin (2017) to Lethean to Zano rebase.
## Quick Start
```go
import (
"forge.lthn.ai/core/go-blockchain/config"
"forge.lthn.ai/core/go-blockchain/types"
"forge.lthn.ai/core/go-blockchain/wire"
"forge.lthn.ai/core/go-blockchain/difficulty"
)
// Query the active hardfork version at a given block height
version := config.VersionAtHeight(config.MainnetForks, 10081) // returns HF2
// Encode and decode a Lethean address
addr := &types.Address{SpendPublicKey: spendKey, ViewPublicKey: viewKey}
encoded := addr.Encode(config.AddressPrefix)
decoded, prefix, err := types.DecodeAddress(encoded)
// Varint encoding for the wire protocol
buf := wire.EncodeVarint(0x1eaf7)
val, n, err := wire.DecodeVarint(buf)
// Calculate next block difficulty
nextDiff := difficulty.NextDifficulty(timestamps, cumulativeDiffs, 120)
```
## Packages
| Package | Description |
|---------|-------------|
| `config` | Hardfork schedule, network parameters, address prefixes |
| `types` | Addresses, keys, hashes, amounts |
| `wire` | CryptoNote binary serialisation, varint codec |
| `difficulty` | LWMA difficulty adjustment algorithm |

View file

@ -0,0 +1,16 @@
---
title: go-build
description: Build system, release publishers, and SDK generation
---
# go-build
`forge.lthn.ai/core/go-build`
Build system that auto-detects project types (Go, Wails, Docker, LinuxKit, C++) and produces cross-compiled binaries, archives, and checksums. Includes release publishers for GitHub, Docker registries, npm, Homebrew, Scoop, AUR, and Chocolatey. Also provides SDK generation for API clients.
## Packages
- `pkg/build/` — project-type detection, cross-compilation, archiving
- `pkg/release/` — changelog generation, publisher pipeline
- `pkg/sdk/` — client SDK generation from OpenAPI specs

View file

@ -0,0 +1,15 @@
---
title: go-cache
description: In-memory cache with expiry support
---
# go-cache
`forge.lthn.ai/core/go-cache`
Lightweight in-memory cache for Go applications. Stores key-value pairs with optional expiry.
## Key Types
- `Cache` — thread-safe in-memory key-value store
- `Entry` — single cached item with value and expiry metadata

View file

@ -0,0 +1,16 @@
---
title: go-config
description: Configuration service for the Core DI container
---
# go-config
`forge.lthn.ai/core/go-config`
Configuration management service that integrates with the Core dependency injection container. Handles loading, merging, and accessing typed configuration values for services registered in the Core runtime.
## Key Types
- `Config` — configuration data holder with typed accessors
- `Service` — Core-integrated service that manages configuration lifecycle
- `ServiceOptions` — options for configuring the service registration

View file

@ -0,0 +1,18 @@
---
title: go-container
description: Container runtime, LinuxKit builder, and dev environment management
---
# go-container
`forge.lthn.ai/core/go-container`
Container runtime abstraction supporting multiple hypervisors for running LinuxKit-based images and managing development environments. Handles image building, VM lifecycle, and port forwarding across QEMU and HyperKit backends.
## Key Types
- `Container` — manages container lifecycle (create, start, stop, remove)
- `RunOptions` — configuration for container execution (ports, volumes, environment)
- `HypervisorOptions` — shared configuration across hypervisor backends
- `QemuHypervisor` — QEMU-based VM backend
- `HyperkitHypervisor` — HyperKit-based VM backend (macOS)

View file

@ -0,0 +1,38 @@
# go-crypt
Cryptographic primitives, authentication, and trust policy engine.
**Module**: `forge.lthn.ai/core/go-crypt`
Provides symmetric encryption (ChaCha20-Poly1305 and AES-256-GCM with Argon2id KDF), OpenPGP challenge-response authentication with online and air-gapped courier modes, Argon2id password hashing, RSA-OAEP key generation, RFC-0004 deterministic content hashing, and a three-tier agent trust policy engine with an audit log and approval queue.
## Quick Start
```go
import (
"forge.lthn.ai/core/go-crypt/crypt"
"forge.lthn.ai/core/go-crypt/auth"
"forge.lthn.ai/core/go-crypt/trust"
)
// Encrypt with ChaCha20-Poly1305 + Argon2id KDF
ciphertext, err := crypt.Encrypt(plaintext, passphrase)
// OpenPGP authentication
a := auth.New(medium, auth.WithSessionStore(auth.NewSQLiteSessionStore(dbPath)))
session, err := a.Login(userID, password)
// Trust policy evaluation
engine := trust.NewPolicyEngine(registry)
decision := engine.Evaluate("Charon", "repo.push", "core/go-crypt")
```
## Packages
| Package | Description |
|---------|-------------|
| `crypt` | ChaCha20-Poly1305, AES-256-GCM, Argon2id KDF |
| `auth` | OpenPGP challenge-response, session management |
| `trust` | Three-tier policy engine, audit log, approval queue |
| `hash` | RFC-0004 deterministic content hashing |
| `keys` | RSA-OAEP key generation |

View file

@ -0,0 +1,38 @@
# go-devops
Infrastructure and build automation library for the Lethean ecosystem.
**Module**: `forge.lthn.ai/core/go-devops`
Provides a native Go Ansible playbook executor (~30 modules over SSH without shelling out), a multi-target build pipeline with project type auto-detection (Go, Wails, Docker, C++, LinuxKit, Taskfile), code signing (macOS codesign, GPG, Windows signtool), release orchestration with changelog generation and eight publisher backends (GitHub Releases, Docker, Homebrew, npm, AUR, Scoop, Chocolatey, LinuxKit), Hetzner Cloud and Robot API clients, CloudNS DNS management, container/VM management via QEMU and Hyperkit, an OpenAPI SDK generator (TypeScript, Python, Go, PHP), and a developer toolkit with cyclomatic complexity analysis, vulnerability scanning, and coverage trending.
## Quick Start
```go
import (
"forge.lthn.ai/core/go-devops/ansible"
"forge.lthn.ai/core/go-devops/build"
"forge.lthn.ai/core/go-devops/release"
)
// Run an Ansible playbook over SSH
pb, _ := ansible.ParsePlaybook("playbooks/deploy.yml")
inv, _ := ansible.ParseInventory("inventory.yml")
pb.Run(ctx, inv)
// Build and release
artifacts, _ := build.Build(ctx, ".")
release.Publish(ctx, releaseCfg, false)
```
## Key Packages
| Package | Description |
|---------|-------------|
| `ansible` | Native Go Ansible executor (~30 modules) |
| `build` | Multi-target build pipeline with auto-detection |
| `release` | Changelog generation + 8 publisher backends |
| `hetzner` | Hetzner Cloud and Robot API clients |
| `cloudns` | CloudNS DNS management |
| `sdk` | OpenAPI SDK generator |
| `devkit` | Complexity analysis, vuln scanning, coverage |

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