Skip to content

Server entry point #28

@JaimeStill

Description

@JaimeStill

Context

Part of Objective #2 (Kernel Interface). Server binary that starts the kernel as an HTTP service with all subsystems wired together.

Depends on: #27 (HTTP API with SSE streaming)

Scope

  • cmd/server/main.go — HTTP server with handler routing via http.ServeMux
  • Server configuration: listen address, kernel config file path, read/write timeouts
  • Built-in tool registration (shared with or extracted from cmd/kernel/tools.go)
  • Graceful shutdown with signal handling (SIGINT/SIGTERM) and shutdown timeout
  • Structured logging via observer → slog adapter
  • Scalar UI: Standalone Bun project in scalar/ directory. Fetches GET /openapi.json from the running kernel server. Fully separate from the Go binary — no embedding, no //go:embed. Development-time only.

Approach

  • New cmd/server/main.go with flag parsing, config loading, kernel initialization
  • HTTP server wraps api.Handler with http.ServeMux routing
  • Signal handling with context cancellation for graceful shutdown
  • scalar/ directory contains standalone Bun project with Scalar API reference UI

Acceptance Criteria

  • Server binary starts and serves HTTP API
  • Configuration via flags and config file
  • Built-in tools registered
  • Graceful shutdown on SIGINT/SIGTERM
  • Structured logging via observer → slog
  • Scalar Bun project in scalar/ fetches and renders OpenAPI spec
  • End-to-end: start server, create session, run prompt, observe SSE stream

Metadata

Metadata

Assignees

Labels

featureNew functionalitykernelkernel runtime subsystem

Type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions