# Fly Lint
Fly Lint reviews TypeScript and JavaScript pull requests with hosted Jev and a local neural network built from measured fruit-fly connections.
The browser follows the review with a fly that moves between changed code and supporting evidence. Open any step to see Jev's questions, the local decision and the resulting candidates.

Recorded playback of [VS Code React Native #2898](https://github.com/microsoft/vscode-react-native/pull/2898), before the fix.
See the fly up close

Recorded playback of [NestJS #17400](https://github.com/nestjs/nest/pull/17400), before the fix.
## Run the demo
Requires Bun 1.4+ and Git.
```sh
git clone https://github.com/timbrinded/fly-lint.git
cd fly-lint
bun install
bun start
```
Open **http://localhost:3210**. Select **Real PR examples**, choose **Before fix** or **PR head**, then **Start review**. The bundled examples include captured Jev responses, ready for playback.
For a fresh review, add `TYPESAFE_API_KEY=...` to `.env`, restart the server and select **Live Jev**. Choose a bundled example, a local Git repository or a GitHub PR. GitHub PRs use your authenticated `gh` session.
## How it works
1. **Extract the change.** The TypeScript compiler identifies changed symbols, local calls and related tests.
2. **Measure the code.** Jev answers small questions in parallel. With the bundled trained model, target assessments combine 40 contract questions with 20 lint questions; focused lint checks use a further 20-question batch.
3. **Choose the next inspection.** A hand-designed controller follows related source. A trained output layer selects and scores focused checks for four lint patterns.
4. **Keep the evidence.** The report links candidates and unresolved questions to the source excerpts and measurements behind them.
The local network uses **1,000 FlyWire neurons and 24,492 measured connections**. Training fits the lint output layer while keeping those connections fixed. Bun and TypeScript run the review and serve the browser interface.
Review flow

## Guides
- [Usage](docs/usage.md): CLI commands, review behaviour, exports and resource limits.
- [Real PR examples](docs/pr-examples.md): pinned source, captured results and coverage.
- [Training](docs/training.md): verified fixes, fitted models and baseline comparisons.
- [Experiments](docs/experiments.md): hosted runs and connectome comparisons.
## Attribution and licences
Built with [fly-connectome-template](https://github.com/cobanov/fly-connectome-template) by [Mert Cobanov](https://github.com/cobanov). Fly Lint is a modified derivative adapted for code review under the template's [attribution licence](licenses/fly-connectome-template.txt).
Original application code is [MIT licensed](LICENSE). FlyWire data uses **CC BY-NC 4.0** terms. Source excerpts and visual assets retain their [upstream licences](THIRD_PARTY_NOTICES.md).