feat(cli): wiki compile/list/check command group (F-12)

Adds codex wiki compile/list/check Typer subgroup to cli.py.
Adds wiki_dir, wiki_llm_model, wiki_llm_url, wiki_top_k settings
to config.py (F-12 section only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-06-13 20:22:55 +02:00
parent aee00515f4
commit 4d361fd8dc
2 changed files with 264 additions and 4 deletions

View File

@@ -84,6 +84,80 @@ class Settings(BaseSettings):
),
)
# ------------------------------------------------------------------
# F-09 Rich Parsing — MathPix + pix2tex + figures
# ------------------------------------------------------------------
mathpix_app_id: str | None = Field(
default=None,
description=(
"MathPix application ID for the MathPix API "
"(env var: MATHPIX_APP_ID). Optional — pix2tex is used as fallback."
),
)
mathpix_app_key: str | None = Field(
default=None,
description=(
"MathPix application key for the MathPix API "
"(env var: MATHPIX_APP_KEY). Optional — pix2tex is used as fallback."
),
)
pix2tex_fallback: bool = Field(
default=True,
description=(
"Enable pix2tex LatexOCR as the local fallback for formula extraction "
"when MathPix credentials are not set. Disable only for testing."
),
)
figures_dir: str = Field(
default="figures/",
description=(
"Directory where extracted figure images (PNG) are written. "
"Relative paths are resolved from the current working directory."
),
)
# ------------------------------------------------------------------
# F-12 Wiki-Compile
# ------------------------------------------------------------------
wiki_dir: str = Field(
default="wiki/",
description=(
"Directory where compiled wiki pages are written. "
"Relative paths are resolved from the current working directory."
),
)
wiki_llm_model: str = Field(
default="qwen2.5:7b",
description=(
"Ollama model name used for wiki synthesis. "
"Must be available at the configured Ollama endpoint (WIKI_LLM_URL or "
"OLLAMA_BASE_URL). Default: qwen2.5:7b (qwen-light profile on Jetson)."
),
)
wiki_llm_url: str | None = Field(
default=None,
description=(
"Ollama base URL for wiki synthesis. "
"When None, falls back to OLLAMA_BASE_URL "
"(http://192.168.178.103:11434 for the Jetson). "
"Set WIKI_LLM_URL to override."
),
)
wiki_top_k: int = Field(
default=12,
gt=0,
description=(
"Number of top chunks retrieved per concept for wiki synthesis. "
"Higher values improve recall at the cost of a larger LLM prompt."
),
)
@lru_cache(maxsize=1)
def get_settings() -> Settings: