Your tests broke at night.
NightShift works while you sleep.
It finds the cause, tries a fix and runs the tests to check it. If the checks fail, it stops and tells you why. A human decides what gets merged.
New here? Three steps
Pick a bug
The bug library has small example programs. Each one has a test that fails.
Watch the agent
See each step: what it read, what it changed and what the safety rules blocked.
Read the receipt
The Morning Receipt says what happened and what you should do next.
In short
The AI model suggests. Program code checks. A human decides. The model chooses what to read and change. NightShift gives it seven limited tools, runs the tests, checks the result, records the steps and can be stopped.
Agent console
Practice runs scripted, not real AI
No API key needed. The model's choices are written in advance. Tests, safety rules, STOP and the log are real.
Activity feed
🧾 Morning Receipt
Written by program code from the audit log, not by the AI.
The code change (red = removed, green = added)
Every step (newest first, click for details)
Bug library
Demo data: small example programs, each broken in a different way. They are examples, not proof that every bug of a type can be fixed.
Test results
Real AI model, Docker sandbox. "Hidden tests" are extra tests the agent never saw.
| Situation | Ended as expected | Hidden tests passed |
|---|
Read this too: these are small projects with one bug each, so the numbers do not predict results on large code. The two "flaky test" misses came from a badly designed case: the agent stopped without a fix, but not with the expected label. We still count them as misses.
How it works
Trigger
The watch command notices a new commit.
Reproduce
Tests run twice. If the result changes, it is flaky and no code is touched.
Plan and act
The AI model reads files and makes a small edit. It has seven tools.
Check
Program code, not the AI, decides: tests must run and pass, within patch limits.
Report
A local pull request, or an explanation of why it stopped.
Words explained
- Agent
- A program where an AI model chooses steps and uses tools to finish a job.
- Test
- Small code that checks other code gives the right answer.
- Guardrail
- A rule enforced by code. The AI cannot talk its way past it.
- Sandbox
- A closed box for running code. Real runs use Docker with no network. Practice runs use no sandbox, only the sample code.
- Pull request
- A proposed code change that waits for a human to review it. NightShift saves it locally.
- Audit log
- A record of each step. The check finds changed, removed or reordered lines. It cannot detect someone rewriting both the whole log and the saved result.
Why you can walk away
The design assumes the AI model can be fooled, so the important rules are in program code.
Guardrails in code
No shell, push, merge or delete tool. Tests and secret files are protected. Common cheating edits are blocked.
Live monitor
The agent console shows the current step, tool calls, stated reasons and tokens used.
Kill switch
One button cancels the model request, kills running tests and stops the watcher.
Audit trail
Each step is saved in a linked log that can be replayed and checked for changes.
Limits: passing tests do not prove a fix is right, pattern blocks can be bypassed, and prompt injection is not solved. Read the patch before merging. Full list: SAFETY.md.
Run it on your computer
This computer
Checking model settings...
Checking Docker...
1. You need Python 3.11 or newer and Git. Get the code:
git clone https://github.com/RAHUL0408-B/nightshift.git
2. Open the app (no API key needed to look around):
python nightshift.py dashboard
3. For real AI: copy .env.example to .env, add your model key, start Docker, then run:
docker pull python:3.13-slim
4. Press Run with real AI in the bug library. Real runs send the example code and test output to your model provider and use your API allowance.