---
phase: 08-cleanup
plan: "01"
type: execute
wave: 1
depends_on: []
files_modified:
  - src/corpus_analyzer/ingest/indexer.py
  - src/corpus_analyzer/config/schema.py
  - tests/ingest/test_indexer.py
  - tests/config/test_schema.py
autonomous: true
requirements:
  - CLEAN-01

must_haves:
  truths:
    - "grep -r use_llm_classification . (in src/ and tests/) returns zero results"
    - "uv run pytest -v passes with no failures or regressions"
    - "uv run mypy src/ passes clean"
    - "uv run ruff check . passes clean"
  artifacts:
    - path: "src/corpus_analyzer/ingest/indexer.py"
      provides: "index_source() without use_llm_classification parameter"
      contains: "def index_source"
    - path: "src/corpus_analyzer/config/schema.py"
      provides: "SourceConfig without use_llm_classification field"
      contains: "class SourceConfig"
    - path: "tests/ingest/test_indexer.py"
      provides: "Updated test call sites with no use_llm_classification kwarg"
    - path: "tests/config/test_schema.py"
      provides: "Deleted test for removed use_llm_classification field"
  key_links:
    - from: "src/corpus_analyzer/ingest/indexer.py"
      to: "src/corpus_analyzer/search/classifier.py"
      via: "classify_file(... use_llm=False)"
      pattern: "classify_file.*use_llm=False"
    - from: "src/corpus_analyzer/config/schema.py"
      to: "src/corpus_analyzer/ingest/indexer.py"
      via: "SourceConfig used as source param — use_llm_classification field gone from both"
      pattern: "class SourceConfig"
---

<objective>
Remove the dead `use_llm_classification` parameter from `index_source()` and its companion field from `SourceConfig`, along with all test call sites and the test that existed only to verify the removed field.

Purpose: The parameter is marked "Unused legacy param (kept for compatibility)" in its own docstring. SourceConfig.use_llm_classification defaults to False and is never set to True in production use. Removing it shrinks the public API surface and eliminates confusion about whether LLM classification is active.

Output: Four modified files with no trace of `use_llm_classification` in source or tests.
</objective>

<execution_context>
@/home/ollie/.claude/get-shit-done/workflows/execute-plan.md
@/home/ollie/.claude/get-shit-done/templates/summary.md
</execution_context>

<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/08-cleanup/08-CONTEXT.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Establish green baseline</name>
  <files></files>
  <action>
    Before making any code changes, run the full test suite to establish a passing baseline. This confirms no pre-existing failures that could mask regressions.

    Run: `uv run pytest -v`

    Record the pass/fail count. If any tests fail at this point, stop and report — do NOT proceed with removal until baseline is clean.
  </action>
  <verify>
    <automated>cd /home/ollie/Development/Tools/vibe_coding/corpus-analyzer && uv run pytest -v --tb=short 2>&1 | tail -5</automated>
    <manual>All tests pass (0 failures, 0 errors)</manual>
  </verify>
  <done>Full test suite passes with zero failures before any changes are made.</done>
</task>

<task type="auto">
  <name>Task 2: Remove use_llm_classification from source code</name>
  <files>
    src/corpus_analyzer/ingest/indexer.py
    src/corpus_analyzer/config/schema.py
  </files>
  <action>
    Make the following changes atomically (both files in one pass):

    **1. `src/corpus_analyzer/config/schema.py`**

    In `SourceConfig`, delete the entire `use_llm_classification` field and its docstring block (lines 70–76 approximately):
    ```python
    use_llm_classification: bool = False
    """Whether to use LLM-based classification for construct type detection.
    ...
    """
    ```
    Nothing else in this file changes.

    **2. `src/corpus_analyzer/ingest/indexer.py`**

    In `index_source()`:

    a) Remove the `use_llm_classification: bool = True,` parameter from the function signature (it is the third positional parameter, before the keyword-only `graph_store`).

    b) Remove the corresponding docstring line:
    ```
    use_llm_classification: Unused legacy param (kept for compatibility).
    ```

    c) Change line 392 (the `classify_file` call) from:
    ```python
    use_llm=source.use_llm_classification,
    ```
    to:
    ```python
    use_llm=False,
    ```
    This is correct: the field defaulted to `False`, and with it removed we must pass `False` directly so rule-based classification continues. Do NOT make it `True` or remove the argument entirely (classify_file defaults to `use_llm=True` which would change behaviour).

    After edits, verify no other dynamic references remain:
    `grep -rn "use_llm_classification" src/`
    Must return zero results.
  </action>
  <verify>
    <automated>cd /home/ollie/Development/Tools/vibe_coding/corpus-analyzer && grep -rn "use_llm_classification" src/ && echo "FOUND — fix needed" || echo "CLEAN"</automated>
    <manual>grep returns zero matches; `uv run mypy src/` passes; `uv run ruff check .` passes</manual>
  </verify>
  <done>
    `grep -rn use_llm_classification src/` returns zero results.
    `uv run mypy src/` exits 0.
    `uv run ruff check .` exits 0.
  </done>
</task>

<task type="auto">
  <name>Task 3: Update tests and verify no regressions</name>
  <files>
    tests/ingest/test_indexer.py
    tests/config/test_schema.py
  </files>
  <action>
    **1. `tests/ingest/test_indexer.py`**

    Find the `SourceConfig(...)` constructor call that passes `use_llm_classification=False` (around line 388). Remove that keyword argument. Keep all other arguments and all behaviour assertions intact.

    **2. `tests/config/test_schema.py`**

    Delete the entire `test_source_config_use_llm_classification_defaults_false` test method (lines 73–80 approximately). This test exists only to verify the field being removed — it must be deleted, not retained.

    After edits, run the full test suite and type/lint checks:
    ```
    uv run pytest -v
    uv run mypy src/
    uv run ruff check .
    ```

    Final confirmation: `grep -r use_llm_classification .` (from repo root) must return zero results in any `.py` file.
  </action>
  <verify>
    <automated>cd /home/ollie/Development/Tools/vibe_coding/corpus-analyzer && uv run pytest -v --tb=short 2>&1 | tail -10</automated>
    <manual>
      1. All tests pass with same count as baseline (minus the one deleted test)
      2. grep -r use_llm_classification . returns no .py file matches
    </manual>
  </verify>
  <done>
    All tests pass.
    `grep -r use_llm_classification . | grep "\.py"` returns zero results.
    `uv run mypy src/` exits 0.
    `uv run ruff check .` exits 0.
  </done>
</task>

</tasks>

<verification>
Final checks after all tasks complete:

```bash
cd /home/ollie/Development/Tools/vibe_coding/corpus-analyzer

# 1. No trace of the removed parameter in any Python file
grep -r "use_llm_classification" . --include="*.py"
# Expected: zero output

# 2. Full test suite green
uv run pytest -v
# Expected: all pass, count equals baseline minus 1 (deleted test)

# 3. Type check clean
uv run mypy src/
# Expected: exit 0

# 4. Lint clean
uv run ruff check .
# Expected: exit 0
```
</verification>

<success_criteria>
1. `grep -r use_llm_classification . --include="*.py"` returns zero results
2. `uv run pytest -v` passes with zero failures
3. `uv run mypy src/` exits 0
4. `uv run ruff check .` exits 0
5. `classify_file` in `indexer.py` is called with `use_llm=False` (rule-based classification preserved)
</success_criteria>

<output>
After completion, create `.planning/phases/08-cleanup/08-01-SUMMARY.md`
</output>
