Metadata-Version: 2.5
Name: revigil
Version: 0.2.0
Summary: Keep watch over your peer reviews: review mail, Web of Science credit, data-integrity and reference checks, and AI that runs on your own computer by default (cloud AI only with explicit, per-article consent).
Project-URL: Homepage, https://github.com/AlsammanAlsamman/revigil
Project-URL: Issues, https://github.com/AlsammanAlsamman/revigil/issues
Author: Alsamman Alsamman
License-Expression: MIT
License-File: LICENSE
Keywords: GRIM,Web of Science,chatgpt,claude,data fabrication,deepseek,local AI,ollama,peer review,research integrity,reviewer,statcheck
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Environment :: Win32 (MS Windows)
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Communications :: Email
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Requires-Dist: keyring>=24
Requires-Dist: numpy>=1.26
Requires-Dist: openpyxl>=3.1
Requires-Dist: pillow>=10.0
Requires-Dist: platformdirs>=4
Requires-Dist: pymupdf>=1.24
Requires-Dist: python-docx>=1.1
Requires-Dist: python-pptx>=0.6
Requires-Dist: requests>=2.31
Requires-Dist: scipy>=1.11
Provides-Extra: all
Requires-Dist: anthropic>=1.0; extra == 'all'
Requires-Dist: openai>=1.40; extra == 'all'
Requires-Dist: opencv-python-headless>=4.8; extra == 'all'
Requires-Dist: pystray>=0.19; extra == 'all'
Provides-Extra: cloud
Requires-Dist: anthropic>=1.0; extra == 'cloud'
Requires-Dist: openai>=1.40; extra == 'cloud'
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pyinstaller>=6; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: images
Requires-Dist: opencv-python-headless>=4.8; extra == 'images'
Provides-Extra: tray
Requires-Dist: pystray>=0.19; extra == 'tray'
Description-Content-Type: text/markdown

<div align="center">

<img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/src/revigil/assets/icon-256.png" width="132" alt="Revigil logo">

# Revigil

### Keep watch over your peer reviews.

**Organised. In control. Confidential.**<br>
A reviewer's workbench for the age of AI-written manuscripts: every review e-mail in one place,<br>
mechanical checks for errors and fabricated data, and AI that runs **on your own computer** by default.

[![PyPI](https://img.shields.io/pypi/v/revigil?color=1f6f5c&label=PyPI&logo=pypi&logoColor=white)](https://pypi.org/project/revigil/)
[![Python](https://img.shields.io/pypi/pyversions/revigil?color=1f6f5c&logo=python&logoColor=white)](https://pypi.org/project/revigil/)
[![License: MIT](https://img.shields.io/badge/license-MIT-1f6f5c)](https://github.com/AlsammanAlsamman/revigil/blob/main/LICENSE)
[![Platforms](https://img.shields.io/badge/Windows%20%C2%B7%20macOS%20%C2%B7%20Linux-1f6f5c)](#install)
[![Local AI](https://img.shields.io/badge/AI-local%20by%20default-2e8b57)](#-local-ai-that-never-leaves-your-computer)
[![Cloud AI](https://img.shields.io/badge/Claude%20%C2%B7%20ChatGPT%20%C2%B7%20DeepSeek-opt--in%20only-b26a00)](#cloud-ai)
[![Manuscripts](https://img.shields.io/badge/manuscripts-stay%20on%20your%20computer-2e8b57)](#-the-reviewer-agreement)

[Why](#why-revigil) · [Features](#what-revigil-does-for-you) · [Install](#install) · [Local AI](#-local-ai-that-never-leaves-your-computer) · [Cloud AI](#cloud-ai) · [Privacy](#what-stays-on-your-computer) · [FAQ](#questions-reviewers-ask)

<br>

<img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/overview.png" alt="Revigil dashboard: reviews, rounds, points raised, recommendations, journals and deadlines" width="900">

</div>

---

## Why Revigil

> *I am the son of reviewers who worked with a pen. They read every table, recomputed what looked odd, looked up the references they did not know, and wrote in the margins. Checking everything yourself is still the heart of peer review. What has changed is the volume and the tricks.*

Generative AI has made manuscripts cheap to produce. Journals receive more submissions than ever. Some are careless, some are padded, and some report data that were never measured. Reviewers get more invitations, shorter deadlines and more reminders.

The easy answer is to paste the manuscript into a chatbot and let it write the report. That breaks the confidentiality the authors trusted us with, and most journals forbid it. Worse, it gives away the one thing that makes review worth anything: a person who understands the work and stands behind the judgement. **If we turn our backs on review and hand it to AI, we will lose the ability to tell good science from bad, and no one will be left to fix it.**

Revigil takes the other road. It keeps you **organised**, does the **mechanical checking** in seconds, and uses AI only as a **magnifying glass on your own computer**. It points at places to look, and you do the judging. The goal is a reviewer community that is better prepared, not one that has been replaced.

<table>
<tr>
<td width="33%" valign="top">

### 🗂️ Organised
Invitations, reminders, receipts and decisions from all your mailboxes, gathered into **one row per manuscript**: deadlines, rounds, what you still owe. Finished reviews are credited to **Web of Science** automatically.

</td>
<td width="33%" valign="top">

### 🔍 In control
P values recomputed, confidence intervals and percentages checked, **GRIM** and digit tests, **duplicated or cloned images**, every reference looked up for **existence and retraction**. Signals, never verdicts.

</td>
<td width="33%" valign="top">

### 🔒 Confidential
The AI is an **open model running locally**. It compares the abstract with the results, tests each claim against the data, and flags citations that do not fit. **The manuscript never leaves your machine**, unless you deliberately choose a cloud AI for a journal that allows it.

</td>
</tr>
</table>

---

## What Revigil does for you

### 🧪 Check a manuscript in minutes, not hours

Open an article and run the checks a meticulous reviewer would do by hand:

- **Data-integrity screen:**
  - Recomputes P from t, F, χ², r and z (statcheck-style), and P from OR/HR with their 95% CI.
  - Checks CI symmetry on the log scale, `a/b (c%)` percentages and GRIM.
  - Tests last-digit uniformity and looks for repeated values and duplicated table rows.
  - Finds duplicated, rotated, cropped or cloned images.
- **Reference check:** every reference is looked up in Crossref. Does it exist, do year, author and DOI agree, is it retracted or under an expression of concern, and where in the text is it cited?
- **Author background:** OpenAlex profiles, retractions, the self-citation share, and papers co-authored with you (conflict of interest).

<p align="center"><img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/article-checks.png" alt="Article page: rounds, data-integrity screen, reference check and author background" width="900"></p>

### 🤖 A second pair of eyes that stays on your desk

The **local AI reading** goes through the manuscript the way a careful co-reviewer would:

- 📑 **Abstract vs. results:** numbers or statements in the abstract that the body contradicts. A changed P value, follow-up time or sample size is a classic sign of careless or fabricated data.
- ⚖️ **Claims vs. evidence:** is each main claim backed by data, only weakly (a subgroup, an association sold as a cause), contradicted, or not supported at all?
- 🔗 **Citations vs. sentences:** does the cited paper plausibly support the sentence that cites it?

Below is the real output of the default model on an invented test manuscript. It found all four planted inconsistencies.

<p align="center"><img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/ai-reading.png" alt="Local AI reading: four mismatches between abstract and results found by a local model" width="900"></p>

> [!NOTE]
> Like every check in Revigil, the AI gives **signals to verify, not findings**. Small models make mistakes. Read the passage, judge it yourself, and write your own review.

### 📬 Never miss an invitation, a deadline or your credit

Revigil watches your mailboxes (read only), recognises invitations, reminders, receipts, decisions and cancellations, and links them to your articles. **To review now** lists what is waiting, oldest first, with the days since the journal asked. When the editor's final decision arrives, the journal's "thank you" e-mail is **forwarded to Web of Science** so the review counts on your profile, after a click or automatically.

<p align="center"><img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/mail.png" alt="Mail and Web of Science: invitations, reminders, receipts and decisions grouped by manuscript" width="900"></p>

### 📈 See yourself grow as a reviewer

Articles reviewed, rounds, points raised per section, your recommendations, journals, **how many of your earlier comments the authors actually followed**, and a timeline of how your reviewing checklist improved.

---

## 🔒 Local AI that never leaves your computer

Revigil runs open models through [Ollama](https://ollama.com) on your own computer. On first start it offers to install Ollama and download the recommended model. You can switch models at any time in **Settings → Local AI**.

<p align="center"><img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/local-ai.png" alt="Settings: local models with benchmark scores, sizes, speeds and licences" width="900"></p>

**How the default was chosen.** We did not use generic leaderboards. Seven open models under 8 GB were tested on Revigil's own tasks, using invented manuscripts:

- **Manuscript A** has planted problems:
  - a P value, a follow-up time and a subgroup result that differ between abstract and results
  - an overclaimed dose-response
  - a causal claim from observational data
  - a trap that looks like an error but isn't
- **Manuscript B** is clean, to catch models that cry wolf.
- **Eight sentence/reference pairs** with known answers test the citation check.

<p align="center">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/benchmark-dark.svg">
  <img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/benchmark-light.svg" alt="Benchmark of seven local models on Revigil's reviewer tasks: Qwen 3.5 4B scores 100, Qwen 3.5 9B and Gemma 4 E4B 91, Gemma 3 4B 67, Granite 4 3B 63, Llama 3.2 3B 59, Phi-4 mini 46" width="900">
</picture>
</p>

<details>
<summary><b>📊 Exact numbers per task</b></summary>
<br>

| | Model | Score | Errors found | False alarms | Claims | Citations | Download | Speed | License |
|:-:|---|:-:|:-:|:-:|:-:|:-:|:-:|:-:|---|
| 🥇 | **Qwen 3.5 4B** ⭐ default<br><sub>`qwen3.5:4b` · Alibaba Qwen</sub> | **100** | ✅ 4/4 | ✅ 0 | 100% | 100% | 3.3 GB | 86 tok/s | Apache-2.0 |
| 🥈 | **Qwen 3.5 9B**<br><sub>`qwen3.5:9b` · Alibaba Qwen</sub> | **91.2** | ✅ 4/4 | ⚠️ 2 | 100% | 100% | 6.6 GB | 53 tok/s | Apache-2.0 |
| 🥉 | **Gemma 4 E4B**<br><sub>`gemma4:e4b` · Google DeepMind</sub> | **91.2** | ✅ 4/4 | ⚠️ 3 | 100% | 100% | 6.6 GB | 171 tok/s | Gemma terms of use |
| 4 | **Gemma 3 4B**<br><sub>`gemma3:4b` · Google DeepMind</sub> | **66.7** | ⚠️ 3/4 | ⚠️ 3 | 40% | 100% | 3.4 GB | 97 tok/s | Gemma terms of use |
| 5 | **Granite 4 3B**<br><sub>`granite4:3b` · IBM</sub> | **62.7** | ⚠️ 3/4 | ⚠️ 2 | 60% | 50% | 2.1 GB | 118 tok/s | Apache-2.0 |
| 6 | **Llama 3.2 3B**<br><sub>`llama3.2:3b` · Meta</sub> | **59.2** | ✅ 4/4 | ❌ 7 | 60% | 0% | 2 GB | 130 tok/s | Llama 3.2 community license |
| 7 | **Phi-4 mini 3.8B**<br><sub>`phi4-mini` · Microsoft</sub> | **45.5** | ❌ 0/4 | ❌ 4 | 60% | 62% | 2.5 GB | 105 tok/s | MIT |

<sub>**Errors found:** of the 4 mismatches planted between abstract and results. **False alarms:** mismatches reported on a clean manuscript that has none. **Claims:** 5 claims judged as supported / weak / contradicted as expected. **Citations:** 8 sentence–reference pairs judged correctly.</sub>

</details>

Run on one NVIDIA RTX 4000 Ada (20 GB). A laptop without a GPU is several times slower, but the 3.3 GB default fits in 8 GB of memory. A perfect score means this small benchmark can no longer tell the best models apart. It shows a model can do Revigil's tasks; it does not prove it will catch everything in a real manuscript. Reproduce it with `python benchmarks/run.py` ([details](https://github.com/AlsammanAlsamman/revigil/blob/main/benchmarks/README.md)).

---

<a id="cloud-ai"></a>

## ☁️ Cloud AI: optional, at your own responsibility

Some journals allow reviewers to use AI services, and some reviewers want a larger model for a hard manuscript. For those cases Revigil can also read a manuscript with **Claude** (Anthropic), **ChatGPT** (OpenAI) or **DeepSeek**, using **your own API key**. All three are **off by default**, and Revigil makes the risk impossible to miss:

| | Where the manuscript goes | What the company does with it | Risk |
|---|---|---|:-:|
| **Claude** · Anthropic | Anthropic's servers (mainly US) | API inputs not used for training by default; kept for a limited period for safety monitoring | ⚠️ high |
| **ChatGPT** · OpenAI | OpenAI's servers (mainly US) | API data not used for training by default; kept up to 30 days for abuse monitoring. *The ChatGPT app is different: chats can be used for training unless you opt out.* | ⚠️ high |
| **DeepSeek** | Servers in the **People's Republic of China** | Its privacy policy: stored in mainland China, kept as long as necessary, may be used to improve its services. Many institutions forbid it for confidential material. **Revigil strongly advises against it.** | ⛔ very high |

<sub>Summaries of each company's published terms in December 2026. Policies change: read them yourself before relying on this.</sub>

<table>
<tr>
<td width="55%" valign="top">

**1. Set up a provider, once** (Settings → Cloud AI → *Set up…*)

- Read the provider's own warning: where the data goes, how long it is kept, whether it may be used for training.
- Follow the step-by-step guide to create an API key with that company. API use is paid per use, separately from any chat subscription.
- Tick every statement and type <code>I ACCEPT THE RISK</code>. DeepSeek adds one more statement about storage in China.
- The key goes into your operating system's credential store, never into a file.

**2. Confirm it for every article**

- On the article page, pick the provider next to **Run** in the *AI reading* card. 🔒 Local AI stays the default.
- Confirm that this journal's reviewer guidelines allow it, accept responsibility, and **type the journal's name**.
- Revigil records each use (time, provider, model, what you typed) with the article (`checks/cloud_consent.jsonl`) and in `cloud_ai_log.jsonl`. You can always account for it.

**3. Under the hood**

- A cloud call without that per-article confirmation is refused in the code, not just hidden in the page.
- Claude runs through Anthropic's official SDK with structured outputs, ChatGPT and DeepSeek through OpenAI's SDK.
- Install the connectors with `pip install "revigil[cloud]"`; they are included in `[all]`.

</td>
<td width="45%" valign="top">

<img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/cloud-setup.png" alt="Setting up DeepSeek: warning, data location, how to get an API key, agreement statements and typed acceptance" width="100%">

<img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/cloud-confirm.png" alt="Per-article confirmation before a manuscript is sent to ChatGPT: the journal's name must be typed" width="100%">

</td>
</tr>
</table>

<p align="center"><img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/cloud-providers.png" alt="Settings: the three cloud providers, off by default, with where the manuscript goes and the risk level" width="900"></p>

The **Process** step can also hand an article to **Claude Code**. It uses the same Claude agreement and the same per-article confirmation.

---

## 📜 The reviewer agreement

Nothing runs until you accept it, the first time Revigil starts.

<table>
<tr>
<td width="52%" valign="top">

1. **A manuscript under review is confidential.**
2. **Most journals and funders forbid uploading it, or any part of it, to cloud AI** such as ChatGPT, Claude, Gemini or Copilot. Examples: Elsevier, the ICMJE recommendations, the US NIH (NOT-OD-23-149) and the *Science* journals. Some forbid any AI help at all.
3. **You, the reviewer, are responsible** for following each journal's policy. Revigil cannot know it.
4. **Local AI is the default.** Cloud AI is off. It can be switched on only with a separate confirmation, and Revigil then asks again **for every article**.
5. **Signals, not verdicts.** The review is yours.

[Read the full agreement →](https://github.com/AlsammanAlsamman/revigil/blob/main/src/revigil/data/AGREEMENT.md)

</td>
<td width="48%" valign="top">

<img src="https://raw.githubusercontent.com/AlsammanAlsamman/revigil/main/docs/screenshots/agreement.png" alt="The reviewer agreement shown on first start" width="100%">

</td>
</tr>
</table>

---

## Install

<table>
<tr>
<td width="50%" valign="top">

### 🐍 pip (Windows, macOS, Linux)

Revigil is on [**PyPI**](https://pypi.org/project/revigil/). With Python 3.10 or newer:

```bash
pip install "revigil[all]"
revigil
```

A green **R** appears next to the clock and the dashboard opens at `http://127.0.0.1:4310`. `[all]` adds the tray icon and the crop/clone image checks. A plain `pip install revigil` opens the dashboard in your browser instead.

On Windows, add Start menu, Desktop and sign-in shortcuts once:

```bash
revigil install-shortcuts
```

Update later with `pip install -U "revigil[all]"`.

</td>
<td width="50%" valign="top">

### 🪟 Windows program (no Python needed)

A ready-to-run `Revigil.exe` will be attached to each [**GitHub release**](https://github.com/AlsammanAlsamman/revigil/releases), starting with the first one:

1. Download `Revigil-<version>-windows.zip` and unzip it anywhere.
2. Run **`Revigil.exe`**.
3. Optional: run `revigil-cli install-shortcuts` in that folder.

Until then, use pip, or build it yourself with `pyinstaller packaging/revigil.spec` (see *Development* below).

</td>
</tr>
</table>

**Local AI** needs [Ollama](https://ollama.com/download). On Windows, Revigil installs it for you when you agree. On macOS and Linux, install it first, and Revigil downloads the model.

**First steps:**
1. Accept the agreement.
2. Let Revigil fetch the local model.
3. Add your review mailbox in **Settings**. Gmail needs an app password.
4. Click **Process now** on an invitation, drop the manuscript files into the folder that opens, and run the checks.

---

## What stays on your computer

| | Where it goes |
|---|---|
| 📄 **Manuscripts, reviews, check results** | Your workspace (`Documents/Revigil` by default). **Never uploaded**, unless you turn cloud AI on *and* confirm it for that article. Keep it out of any public repository. |
| 🤖 **AI reading** | A local model through Ollama on `127.0.0.1` |
| 🔑 **Mailbox passwords** | Your operating system's credential store (Windows Credential Manager, macOS Keychain), never a file |
| 📚 **Reference text and author names** | Crossref and OpenAlex (public bibliographic databases), only when you run those checks |
| ✉️ **E-mail** | Read only. Revigil sends mail only to forward a receipt to Web of Science or to alert addresses you added. |
| ⚙️ **Settings, mail log, cache** | `%LOCALAPPDATA%\Revigil` · `~/Library/Application Support/Revigil` · `~/.local/share/Revigil` |

The dashboard listens on `127.0.0.1` only, checks the Host header, and requires a per-session token for every action, so other websites cannot drive it.

---

## Questions reviewers ask

<details>
<summary><b>Is using Revigil allowed by my journal?</b></summary>

Revigil's organising, mail and mechanical checks never share the manuscript. The local AI keeps it on your computer, which most policies aim to protect. Some journals, however, forbid **any** AI assistance, even local. Read the reviewer guidelines of each journal, and disclose AI use if they ask. You can switch the local AI off in Settings.
</details>

<details>
<summary><b>Does Revigil write my review?</b></summary>

No, on purpose. It points at places to look: a recomputed P value that disagrees, an abstract that contradicts the results, a retracted reference. You read, you judge, you write.
</details>

<details>
<summary><b>Do I need a powerful computer?</b></summary>

No. The default model is a 3.3 GB download and runs in 8 GB of memory, faster with a GPU but fine without one. The mechanical checks run on any computer.
</details>

<details>
<summary><b>Which mailboxes work?</b></summary>

Any IMAP mailbox: Gmail and Google Workspace (with an app password), Outlook.com, Yahoo, iCloud, Zoho and most university servers. Revigil detects the servers from your address. Many Microsoft 365 work accounts block password logins; the in-app help shows the work-arounds.
</details>

<details>
<summary><b>How does the Web of Science credit work?</b></summary>

Web of Science Reviewer Recognition adds a review to your profile when the journal's "thank you for your review" e-mail is forwarded to `reviews@webofscience.com` from an address on your profile. Revigil waits for the editor's final decision, then forwards that e-mail, after your click or automatically.
</details>

<details>
<summary><b>Can I use Claude, ChatGPT or DeepSeek instead of the local model?</b></summary>

Yes, if the journal allows it, and only after reading the warnings. See [Cloud AI](#cloud-ai). You need your own API key with that company: a ChatGPT Plus or Claude Pro subscription does not include API use. Revigil asks you to confirm for every article and records each use. For most journals, the local model is the only option that keeps you within the rules.
</details>

<details>
<summary><b>Can I try it without my own data?</b></summary>

Yes: `revigil demo my-demo` writes invented articles, checks and e-mails, and `revigil --workspace my-demo serve --no-watch` shows them. The screenshots on this page were made that way.
</details>

---

<details>
<summary><b>⌨️ Command line</b></summary>

```text
revigil                          tray icon + dashboard (http://127.0.0.1:4310)
revigil serve [--port N]         dashboard server and mail watcher, no tray
revigil prepare <id> [--round N] move downloaded files into the round folder and extract them
revigil check <id> [integrity|references|authors|ai|all]
revigil ai status | models | pull [MODEL] | install
revigil demo <folder>            invented data to try Revigil
revigil install-shortcuts        Windows Start menu, Desktop and sign-in shortcuts
```
Global option: `--workspace FOLDER` (or `REVIGIL_WORKSPACE`).
</details>

<details>
<summary><b>🛠️ Development and releases</b></summary>

```bash
git clone https://github.com/AlsammanAlsamman/revigil
cd revigil
pip install -e ".[all,dev]"
pytest
python benchmarks/run.py           # local model benchmark (needs Ollama and the models)
python packaging/make_icons.py     # icons from packaging/icon-source.jpg
pyinstaller packaging/revigil.spec # dist/Revigil/Revigil.exe and revigil-cli.exe
```

A release is a tag `v<version>`. GitHub Actions tests on Windows, macOS and Linux, publishes the wheel to PyPI (trusted publishing), and attaches the Windows program to the release.

Revigil grew out of ReviewerManager, a folder layout with reviewing skills that improve after every article. Point the workspace at such a folder and the **Skill growth** tab shows how the checklist (`.claude/skills/peer-review/lessons.md`) evolved.
</details>

---

<div align="center">

**Made for reviewers who still read every table.**

MIT licensed · Model licences are their makers' (Apache-2.0, MIT, Gemma terms, Llama community license) · Revigil downloads a model only when you choose it

</div>
