lci-server-lifecycle

Trace and probe lci's per-root index server lifecycle, socket routes, and reaper.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/standardbeagle/lci-cpp --skill lci-server-lifecycle-standardbeagle
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: lci-server-lifecycle
Source: https://github.com/standardbeagle/lci-cpp/tree/main/.agents/skills/lci-server-lifecycle
Command: npx skills add https://github.com/standardbeagle/lci-cpp --skill lci-server-lifecycle-standardbeagle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Navigating lci's daemon architecture is hard: the per-root index server involves auto-spawn logic, a Unix-socket HTTP route table, an instance registry, and multiple shutdown paths (idle timeout, RSS cap, root-gone reaper, LRU eviction) spread across many source files. This Skill maps every surface to exact file and line locations so you can trace, debug, or modify server behavior without grepping the whole codebase. ## Core Features & Use Cases - Complete code map: Tables linking every CLI verb (lci server, servers, shutdown, status), socket path helper, registry function, and HTTP route to precise source locations in src/cli/ and src/server/. - Config and invariants reference: Documents server { idle_timeout_sec, max_instances, max_rss_mb } defaults plus traps like lock-free read paths, /ping not stamping activity, and exactly-once shutdown semantics. - Probe recipes and tests: Ready-to-run commands for listing servers, curling the Unix socket directly, verifying loopback-only posture, and running targeted gtest filters. - Use Case: You need to debug why an lci server did not exit after its project root was deleted. Use this Skill to jump straight to reaper_loop in src/server/server.cpp, check the root-gone invariant, and run ServerReaperTest.RootDeletionStopsServer. ## Quick Start Ask the AI to use the lci-server-lifecycle skill to trace how lci shutdown --all finds and stops running index servers.

Frequently Asked Questions about lci-server-lifecycle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I list and stop running lci index servers?▼

Run `lci servers --json` to list registry-tracked servers with PID, idle time, and root, then `lci shutdown --all` to stop them. These commands read the instance registry only and never spawn new servers.

How does lci auto-spawn its index server?▼

Any query command calls `ensure_server_running`, which probes liveness, spawns a detached server if none exists, then waits up to 30 seconds for bind plus an indexing-ready wait bounded by `performance.indexing_timeout_sec`. Later commands reuse the warmed server.

Does the lci server expose a network port?▼

No. On POSIX systems lci binds only an AF_UNIX socket with mode 0600; loopback TCP on 127.0.0.1 is used only on Windows. There is no 0.0.0.0 binding, so the server has no network exposure on Unix.

Why does my lci server exit unexpectedly?▼

The server exits when idle past `idle_timeout_sec` (default 1800s), one reaper tick after its root is deleted, when anonymous RSS exceeds `max_rss_mb` after malloc_trim, or when evicted past `max_instances` by a newer server. Note `/ping` does not reset the idle timer.

How do I query the lci server socket directly with curl?▼

Find the socket at /tmp/lci-<uid>-<hash>.sock, then run `curl --unix-socket <path> http://lci/status` for GET endpoints or POST to /stats, /search, or /shutdown. GET supports only /ping, /status, and /stats.

What are the limitations of lci's daemon model?▼

The index is in-memory only, so every server start re-parses the corpus and idle exit plus a 30-minute pause costs a full re-index. Listener caps are compile-time constants, and `lci servers` cannot see embedded servers in `lci mcp` fallback processes.