LOCKDOWN FOR WINDOWS - BETA 0.9
================================

A study lockdown for Windows 10 and 11. One session, one goal, one clock.

WHAT IT DOES
------------
- Blocks around one hundred site names (YouTube, TikTok, Instagram, Reddit,
  Discord, Twitch, Netflix, Roblox, Steam and more) in every browser by
  writing a marked section into the Windows hosts file.
- Closes a list of distraction processes every two seconds, including
  Discord, Roblox, Spotify, Steam, Epic, Telegram and the common game
  launchers.
- Asks for one specific session goal and keeps it on screen for the whole
  session.
- Runs a focus coach every 30, 45 or 60 seconds using the foreground window
  title and app name. It can use a free Gemini API key or a local Ollama
  model.
- Ending early requires the sentence you set, typed exactly, after the pause
  you set. The default is:

  i am choosing to abandon my study session and i will regret it tomorrow

  Change both in Settings > Escape gate. The rule freezes when a session
  starts.
- Restores the hosts file automatically when the timer ends or when you
  finish the sentence. A backup is kept next to the hosts file.

REQUIREMENTS
------------
- Windows 10 or 11, 64-bit.
- Administrator rights. Start Lockdown.cmd asks for them.
- PowerShell 5.1, which ships with Windows.
- Optional: a free Google AI Studio key for the cloud coach.
- Optional: Ollama from ollama.com for a fully local coach.

START
-----
1. Unzip this folder anywhere permanent, for example Documents\Lockdown.
2. Double-click "Start Lockdown.cmd".
3. Click Yes on the Windows administrator prompt.
4. Type a specific goal, pick a duration and press Start lockdown.

Windows SmartScreen may warn about an unsigned script. Choose "More info"
then "Run anyway". The full source is Lockdown.ps1 - read it first if you
prefer.

FREE GEMINI KEY
---------------
1. Open https://aistudio.google.com/app/apikey in any browser.
2. Sign in with a Google account.
3. Choose "Get API key" and create a key. No card is required.
4. In Lockdown, open Settings, paste the key and press Save settings.
The key is encrypted with Windows DPAPI for your user account and stored in
%LOCALAPPDATA%\Lockdown\gemini.key. It never goes to a Lockdown server.

OLLAMA (LOCAL AI, NO KEY)
-------------------------
1. Install Ollama from https://ollama.com.
2. Run: ollama pull llama3.2
3. In Lockdown Settings choose "Ollama - local", set the model to llama3.2
   and save. Ollama listens on 127.0.0.1:11434.

IF SOMETHING GOES WRONG
-----------------------
Run "Unblock Internet.cmd" as administrator. It removes the Lockdown section
from the hosts file and clears the saved session. You can also open
C:\Windows\System32\drivers\etc\hosts in Notepad as administrator and delete
everything between:

  # >>> LOCKDOWN BLOCKLIST >>>
  # <<< LOCKDOWN BLOCKLIST <<<

If Lockdown is still open, close it from the notification area first.

FILES
-----
%LOCALAPPDATA%\Lockdown\config.json       settings, sentence and pause
%LOCALAPPDATA%\Lockdown\blocklist.txt     sites to block, one per line
%LOCALAPPDATA%\Lockdown\blocked-apps.txt  process names, without .exe
%LOCALAPPDATA%\Lockdown\session.json      active session, for crash recovery
%LOCALAPPDATA%\Lockdown\gemini.key        DPAPI-encrypted API key

LIMITS OF THE BETA
------------------
- This build blocks by hostname, not by page. A YouTube video embedded on
  another site may still play.
- Chrome and Edge "secure DNS" can bypass the hosts file. Turn secure DNS
  off in the browser for a strict session.
- The coach reads window titles and process names, not screen pixels. It is
  easier to fool than the macOS build, which can read visible text on-device.
- The app is unsigned. It does not install a service; it must stay running
  for process blocking and the timer. The hosts block survives a crash until
  you run Unblock Internet.cmd.
- No telemetry. No account. No Lockdown server.