# Smart Reviewer Verification

This document outlines the verification steps and test suites for the Context-Aware Smart Reviewer.

## 1. Automated Tests

The feature is covered by a standard `pytest` suite located in `tests/review/`.

### Running Tests
```bash
python3 -m pytest tests/review/
```

### Test Coverage
- **Graph Analysis**: `test_graph.py` verifies that dependency queries return correct nodes and respect truncation limits.
- **Context Fetching**: `test_context.py` ensures token budgets are respected and binary files are skipped.
- **LLM Reasoning**: `test_llm.py` mocks the OpenAI API to verify risk assessment logic and error handling.

## 2. Manual Verification Walkthrough

To verify the tool end-to-end:

1.  **Ensure Environment is Ready**:
    - `clew-engine` services (API, Neo4j, Qdrant) must be running (`docker-compose up`).
    - `OPENAI_API_KEY` must be exported.

2.  **Stage a Change**:
    Modify a file in the repo.
    ```bash
    echo "# Comment" >> src/clew/cli.py
    git add src/clew/cli.py
    ```

3.  **Run Review**:
    ```bash
    clew review --staged
    ```

4.  **Expected Output**:
    - A Markdown report showing the file `src/clew/cli.py`.
    - Risk Level: **SAFE** (for a comment) or **HIGH/MEDIUM** (for breaking changes).
    - Impact Count: Number of downstream files found.

## 3. Known Issues & Limitations

- **API 500 Errors**: Ensure Neo4j credentials (`NEO4J_USER`/`NEO4J_PASSWORD`) are correctly set in `docker-compose.yml`.
- **Redirects**: The API may return 307 redirects for trailing slashes; the client is configured to follow them automatically.
