Metadata-Version: 2.4
Name: frankenreview
Version: 12.0.0
Summary: A multi-layered, agentic, context-aware, zero-cost code reviewer
Author: SNiPERxDD
License-Expression: MIT
Project-URL: Homepage, https://github.com/SNiPERxDD/Frankenreview
Project-URL: Repository, https://github.com/SNiPERxDD/Frankenreview
Project-URL: Documentation, https://github.com/SNiPERxDD/Frankenreview#readme
Keywords: code-review,ai,automation,gemini,llm,developer-tools
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: playwright>=1.40.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: nbformat>=5.9.0
Requires-Dist: nbconvert>=7.0.0
Requires-Dist: tiktoken>=0.5.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: ruamel.yaml>=0.17.0
Requires-Dist: pathspec>=0.12.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Provides-Extra: all
Requires-Dist: frankenreview[dev]; extra == "all"
Dynamic: license-file

# Frankenreview v12.0.0

<p align="center">
  <img src="https://img.shields.io/badge/version-12.0.0-blue.svg" alt="Version">
  <img src="https://img.shields.io/badge/python-3.10+-green.svg" alt="Python">
  <img src="https://img.shields.io/badge/cost-$0.00-success.svg" alt="Cost">
  <img src="https://img.shields.io/badge/model-Gemini-purple.svg" alt="Gemini">
  <img src="https://img.shields.io/badge/status-production-brightgreen.svg" alt="Status">
</p>

> Lean, stateless, zero-cost code reviewer and research agent powered by Gemini via browser automation.

**Architecture:** Pull Model | **Cost:** $0.00 | **Runtime:** Playwright + Chrome

> [!CAUTION]
> **Data Privacy Notice**: Google AI Studio may use submitted code for model training. Do NOT submit proprietary, confidential, or sensitive code.

---

## Overview

Frankenreview packs a repository into structured XML context and submits it to Gemini via browser automation (no API key required).

Current browser flow:
- Starts or attaches to a Chrome debug session.
- Opens AI Studio on the requested model and verifies the active UI model.
- Enables temporary chat for one-shot reviews when available, avoiding delete cleanup.
- Sets AI Studio Thinking Level to High by default when the model exposes that control.
- Uploads repository context as a file-backed prompt, then triggers Run via native DOM click with mouse fallback.
- Extracts responses with AI Studio's native `Copy as markdown` action first, then falls back to DOM scraping.

| Layer | Module | Function |
|---|---|---|
| **Dumper** | `engine/repo_dumper.py` | Repository to XML context |
| **Browser** | `engine/browser/client.py` | AI Studio automation |
| **CLI** | `cli.py` | Stateless command interface |
| **Research** | `agents/research.py` | Deep research agent |

---

## Installation

```bash
pip install frankenreview && playwright install chromium
```

Run Frankenreview from the project directory or pass `--path` explicitly. Filesystem roots such as `/`, `C:\`, and UNC share roots are rejected before any workspace files are created or scanned.

---

## Usage

```bash
frankenreview --start-chrome              # Start Chrome debugger
frankenreview -r                          # Review current directory
frankenreview -r --path "C:\path\to\repo" # Windows: review an explicit project
frankenreview -r -m gemini-3-pro         # Use specific model
frankenreview -r -m lite                 # Alias: gemini-flash-lite-latest
frankenreview -r --thinking-level high    # Set AI Studio thinking effort if available
frankenreview -r --json                   # JSON output for CI
frankenreview --research --prompt q.md    # Deep research
frankenreview -t                          # Token eaters + token tree

# Model Discovery
frankenreview --available-models           # Cached model list (instant)
frankenreview --fetch-models               # Live fetch from Google AI docs

# Security Gates
frankenreview --secrets                    # Count exposed secrets in repo
frankenreview --secrets-gate               # Toggle git-push secret scan
frankenreview --key-gate                   # Toggle shell key-exfiltration guard

# Session Management
frankenreview --open-chat                 # Open chat for manual use
frankenreview -r --continue               # Continue previous session
frankenreview -r --continue --prompt "Summarize next steps"
frankenreview --delete-chat               # Delete saved session
```

---

## CLI Reference

| Flag | Description |
|---|---|
| `-r`, `--review` | Run code review |
| `--research` | Deep research mode |
| `--start-chrome` | Launch Chrome debugger |
| `--stop-chrome` | Stop Chrome instance |
| `--path PATH` | Target project |
| `-m`, `--model ID` | Gemini model ID; aliases: `pro`, `flash`, `lite` |
| `-t` | Run token-eaters and token-tree analysis |
| `--thinking-level LEVEL` | AI Studio Thinking Level: minimal, low, medium, high |
| `-i`, `--init` | Initialize project-local `.frankenreview/` config and skill |
| `-gi`, `--gitignore` | Generate or merge clean, curated `.gitignore` |
| `-ds`, `--discover-selectors` | Verify live AI Studio selectors and update config |
| `--attach FILE` | Extra context files |
| `--json` | JSON output |
| `--continue` | Resume previous session |
| `--open-chat` | Open chat without review |
| `--delete-chat` | Delete saved session |
| `--available-models` | Display cached model compatibility list |
| `--fetch-models` | Actively fetch models from Google AI docs and update cache |
| `--secrets` | Scan repository for exposed secrets |
| `--secrets-gate` | Toggle git-push secret scan in zsh |
| `--key-gate` | Toggle shell guard for accidental key exfiltration |

---

## Security Gates

Frankenreview masks secrets before XML dump writes when `mask_secrets: true`.

Manual checks:

```bash
frankenreview --secrets
```

Optional shell gates:

```bash
frankenreview --secrets-gate   # Wraps git push with a pre-upload secret scan
frankenreview --key-gate       # Guards common shell output paths for key-like data
```

Both gate toggles edit the current user's shell config and are reversible by running the same command again.

---

## Configuration

Edit `config.yaml`:

```yaml
chat_url: "https://aistudio.google.com/prompts/new_chat?model=gemini-flash-latest"
delete_after_review: true
use_temporary_chat: true
prune_dirs: [.git, node_modules, __pycache__]
model_failover: [gemini-3-flash-preview, gemini-2.5-pro, gemini-2.0-flash]
thinking_mode: true
thinking_level: high
mask_secrets: true
```

`thinking_level` is best-effort. If a model does not expose the AI Studio control, Frankenreview logs the miss and continues.

Model aliases:

| Alias | Resolves to |
|---|---|
| `pro` / `pro-latest` | `gemini-pro-latest` |
| `flash` / `flash-latest` | `gemini-flash-latest` |
| `lite` / `flash-lite` / `flash-lite-latest` | `gemini-flash-lite-latest` |

Run selector discovery when AI Studio changes:

```bash
frankenreview -ds --port 9222                  # Selector + deterministic generation check
```

Selector discovery exercises the temporary-chat toggle at the start and ends
in a saved chat so the production delete flow can be checked. Temporary chats
do not expose **Delete Prompt**. Discovery submits exactly one probe and does
not rerun failed turns or switch models; normal reviews may still use
`use_temporary_chat: true` for one-shot cleanup.

---

## Documentation

- [CONTEXT_v11.md](docs/archive/CONTEXT_v11.md) - Archived v11 architecture reference
- [FR_FEATURE_CATALOG_v11.md](docs/archive/FR_FEATURE_CATALOG_v11.md) - Archived v11 feature reference
- [MODEL_COMPATIBILITY_2026.md](docs/MODEL_COMPATIBILITY_2026.md) - Models

---

## License

MIT - See [LICENSE](LICENSE)
