Follow-ups from Codex review on #167, after the index walker floors venv/site-packages (FLOOR_DIRS) — so the danger (indexing installed deps) is resolved; these are init-UX completeness refinements:
-
Root-level entrypoints omitted when a package dir exists. A repo with both root manage.py/main.py AND a package dir: the package dir is the natural default, so the fallback never promotes ., and directly_contains_source returns false for . — so init -y writes only the package binding and omits the root entrypoints. Want: include the repo root (or root .py files) when it directly contains Python source alongside a package dir.
-
env-only repos still get python = ["."]. When the only .py files are under env//.env/, add_file_to_dir_counts increments the aggregate . candidate, which the fallback promotes (. isn't a dependency-named path). Now SAFE — the walker floors site-packages/.venv/venv/__pycache__, so python=["."] won't ingest the deps — but cosmetically the binding is broader than ideal. Want: don't promote . when its only Python files live under a dependency tree.
Both are in crates/rag-rat-cli/src/init/scan.rs (default_dir / candidate_dirs fallback / directly_contains_source). Deferred from #167 to keep the language PR focused; the walker floor + the fallback dependency-dir filter already shipped there cover the safety-critical part.
Follow-ups from Codex review on #167, after the index walker floors venv/site-packages (
FLOOR_DIRS) — so the danger (indexing installed deps) is resolved; these are init-UX completeness refinements:Root-level entrypoints omitted when a package dir exists. A repo with both root
manage.py/main.pyAND a package dir: the package dir is the natural default, so the fallback never promotes., anddirectly_contains_sourcereturns false for.— soinit -ywrites only the package binding and omits the root entrypoints. Want: include the repo root (or root.pyfiles) when it directly contains Python source alongside a package dir.env-only repos still get
python = ["."]. When the only.pyfiles are underenv//.env/,add_file_to_dir_countsincrements the aggregate.candidate, which the fallback promotes (.isn't a dependency-named path). Now SAFE — the walker floorssite-packages/.venv/venv/__pycache__, sopython=["."]won't ingest the deps — but cosmetically the binding is broader than ideal. Want: don't promote.when its only Python files live under a dependency tree.Both are in
crates/rag-rat-cli/src/init/scan.rs(default_dir/candidate_dirsfallback /directly_contains_source). Deferred from #167 to keep the language PR focused; the walker floor + the fallback dependency-dir filter already shipped there cover the safety-critical part.