From 6193f5630d2c66b7e05c3249338a009c980c5197 Mon Sep 17 00:00:00 2001 From: Tarik Moussa Date: Mon, 15 Jun 2026 11:13:52 +0200 Subject: [PATCH] docs: fix two doc/code contradictions (audit D-2, D-4) - D-2 config.py: graph_cite_boost_alpha described the OLD inverted formula (score = dense * (1 + alpha*pr)); the code divides distance. Document the actual boosted_distance = distance / (1 + alpha*pr). - D-4 synthesis.py: write_leads claimed an 'append-only' INDEX.md that keeps previously-recorded ids; _update_index actually rebuilds from on-disk glob. Docstring now matches the implementation. Co-Authored-By: Claude Fable 5 --- codex/config.py | 3 ++- codex/synthesis.py | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/codex/config.py b/codex/config.py index dfe27f2..a642a3d 100644 --- a/codex/config.py +++ b/codex/config.py @@ -295,7 +295,8 @@ class Settings(BaseSettings): le=1.0, description=( "Weight of the PageRank citation-boost in hybrid search. " - "Final score = dense_score * (1 + alpha * pagerank_score). " + "boosted_distance = distance / (1 + alpha * pagerank_score) — dividing " + "lowers the cosine distance of high-PageRank papers (lower = closer). " "Set to 0.0 to disable the boost without removing the flag." ), ) diff --git a/codex/synthesis.py b/codex/synthesis.py index 6bfb68c..ff86e89 100644 --- a/codex/synthesis.py +++ b/codex/synthesis.py @@ -773,10 +773,11 @@ def write_leads(leads: list[Lead], leads_dir: str) -> None: * Grounded leads → ``leads_dir/grounded/.md`` * Conjectures → ``leads_dir/conjectures/.md`` (HARD invariant) - The function ALSO maintains an append-only ``leads_dir/INDEX.md``: - a previously-recorded id is kept on subsequent runs even if it is - overwritten with a newer body. The two sections (grounded / - conjectures) are visibly separated. + The function ALSO rebuilds ``leads_dir/INDEX.md`` from the on-disk files on + every run (see :func:`_update_index`): it reflects whatever lead files + currently exist under ``grounded/`` and ``conjectures/``, listed as two + visibly separated sections. It is not append-only — a deleted lead file + drops out of the index on the next run. Notes -----