When projectDesc is unset, synthesize a one-line description so a corpus still
gets a grounded persona instead of the generic fallback.
- index: on a fresh (first) index, summarize a sample of doc titles via the
generation model and cache it to project-desc.txt in the state dir. Runs once
(skipped when the file exists; reset clears it), after the .indexed sentinel
so a generation hiccup can't fail the index.
- api: resolve the persona description at request time — a manual projectDesc
(CLAN_RAG_PROJECT_DESC) always wins; otherwise read project-desc.txt lazily
(CLAN_RAG_PROJECT_DESC_FILE) so it applies as soon as the first index finishes,
no restart. Cached once read.
- module: pass CLAN_RAG_PROJECT to the indexer (sharpens the summary prompt) and
CLAN_RAG_PROJECT_DESC_FILE to the API (state-dir path).
- docs: clanService readme + project/projectDesc option descriptions cover the
persona split and the manual-overrides-generated behavior.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>