MinerU
Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Cited knowledge graphs from local documents, extracted by small Ollama models on idle machines.
作者による原文
この種の作業を AI に教える Skill。これと一緒に使えます
Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Agent skills for Obsidian. Teach your agent to use Obsidian CLI and open formats including Markdown, Bases, JSON Canvas.
一覧は利用スコア(100 点満点)で並びます。内訳は次のとおり
| 人気 | 4/80 | GitHub スターか週間ダウンロード数。大きい方を 60、小さい方を 20 で数えます |
|---|---|---|
| 新しさ | 12/12 | 30 日以内のリリースかコード更新で満点 |
| 応答中 | 0/8 | 前回の確認でクラウドのエンドポイントが応答 |
| 利用スコア | 16/100 |
品質: 基本チェック 3/3 項目に合格(表示のみ、並び順には不使用) · 勢い: データなし (「急上昇」タブでのみ使用)
使っているAIアプリを選んで、設定をコピーしてください。
ひとことで AI にインストールしてもらう
Nightshift Grid をインストールして。https://mcp.popnx.com/i/redd34-nightshift-grid.md に従い、コマンドを見せて、私が OK するまで実行しないで。パソコンで作業できる AI(Claude Code や Cursor など)に貼り付けます。手順を読み、コマンドを見せて、あなたの OK を待ちます。キー不要・登録不要。 · AI が読む全文を見る
チェック 3/3 合格 · あなたのパソコンで動きます · ✓ コマンド確認済み 2026年11月15日
まず:どの AI を使っていますか?
使っているアプリを選ぶと、下に手順が表示されます。
Claude につなげますが、先に準備が必要です
先にパソコンへ Python (uv) を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません
このメッセージを Claude のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。
このパソコンの Claude に MCP server Nightshift Grid を入れてください。順番に:1) uv --version で uv があるか確認。なければ https://docs.astral.sh/uv/getting-started/installation/ から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "nightshift-grid": { "command": "uvx", "args": [ "nightshift-grid" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Nightshift Grid のツールが本当に表示されるか確認する。このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。
もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter
uv --versionMac:⌘ + Space を押し、Terminal と入力して Enter
Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」
まだ入っていない場合: uv にはクリック式のインストーラーがありません。uv 公式ページからお使いの OS(macOS か Windows)用の 1 行コマンドをコピーしてターミナルに貼り付けます · Python を別に入れる必要はなく、必要なときに uv が自動で取得します
入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: uv --version
一度入れれば、uv を使うすべてのツールで使えます
SettingsDeveloperEdit Config
{
"mcpServers": {
"nightshift-grid": {
"command": "uvx",
"args": [
"nightshift-grid"
]
}
}
}Nightshift Grid を使って、私に何ができるか教えて、1 つやってみせて✓ Claude が Nightshift Grid を使っていると言うか、回答に Nightshift Grid のツール名が出れば接続成功です
上のコマンドはこれらがなくても動きます。変えたいときだけ作者の説明に沿って追加してください。
NIGHTSHIFT_URL Coordinator の URL。未設定の場合は、このマシンで nightshift up により起動されたグリッドを使用します。 NIGHTSHIFT_TOKEN_FILE coordinator クライアントトークンを保存するファイル(NIGHTSHIFT_URL を使用する場合のみ必要)。 NIGHTSHIFT_MCP_ROOTS サーバーがドキュメントを読み取れるフォルダ(デフォルト: 現在のディレクトリ)。 説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。
メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります
ChatGPT はまだ Nightshift Grid につなげません
Nightshift Grid はパソコンに入れて使うものですが、ChatGPT は Web 上で動くサーバーにしかつなげません
A · Nightshift Grid につなげるアプリを使う
Claude Code につなげますが、先に準備が必要です
先にパソコンへ Python (uv) を入れてください(1 回だけ)
このメッセージを Claude Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。
このパソコンの Claude Code に MCP server Nightshift Grid を入れてください。順番に:1) uv --version で uv があるか確認。なければ https://docs.astral.sh/uv/getting-started/installation/ から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):claude mcp add --scope user nightshift-grid -- uvx nightshift-grid 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Nightshift Grid のツールが本当に表示されるか確認する。このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。
もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter
uv --versionMac:⌘ + Space を押し、Terminal と入力して Enter
Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」
まだ入っていない場合: uv にはクリック式のインストーラーがありません。uv 公式ページからお使いの OS(macOS か Windows)用の 1 行コマンドをコピーしてターミナルに貼り付けます · Python を別に入れる必要はなく、必要なときに uv が自動で取得します
入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: uv --version
一度入れれば、uv を使うすべてのツールで使えます
Mac:Command+スペースで Terminal と入力 · Windows:PowerShell を開く
claude mcp add --scope user nightshift-grid -- uvx nightshift-gridNightshift Grid が一覧にあり、接続済みと表示されれば OK です
Nightshift Grid を使って、私に何ができるか教えて、1 つやってみせて✓ Claude Code が Nightshift Grid を使っていると言うか、回答に Nightshift Grid のツール名が出れば接続成功です
上のコマンドはこれらがなくても動きます。変えたいときだけ作者の説明に沿って追加してください。
NIGHTSHIFT_URL Coordinator の URL。未設定の場合は、このマシンで nightshift up により起動されたグリッドを使用します。 NIGHTSHIFT_TOKEN_FILE coordinator クライアントトークンを保存するファイル(NIGHTSHIFT_URL を使用する場合のみ必要)。 NIGHTSHIFT_MCP_ROOTS サーバーがドキュメントを読み取れるフォルダ(デフォルト: 現在のディレクトリ)。 説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。
メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります
Cursor につなげますが、先に準備が必要です
先にパソコンへ Python (uv) を入れてください(1 回だけ)
このメッセージを Cursor のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。
このパソコンの Cursor に MCP server Nightshift Grid を入れてください。順番に:1) uv --version で uv があるか確認。なければ https://docs.astral.sh/uv/getting-started/installation/ から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "nightshift-grid": { "command": "uvx", "args": [ "nightshift-grid" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Nightshift Grid のツールが本当に表示されるか確認する。このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。
もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter
uv --versionMac:⌘ + Space を押し、Terminal と入力して Enter
Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」
まだ入っていない場合: uv にはクリック式のインストーラーがありません。uv 公式ページからお使いの OS(macOS か Windows)用の 1 行コマンドをコピーしてターミナルに貼り付けます · Python を別に入れる必要はなく、必要なときに uv が自動で取得します
入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: uv --version
一度入れれば、uv を使うすべてのツールで使えます
Nightshift Grid を使って、私に何ができるか教えて、1 つやってみせて✓ Cursor が Nightshift Grid を使っていると言うか、回答に Nightshift Grid のツール名が出れば接続成功です
上のコマンドはこれらがなくても動きます。変えたいときだけ作者の説明に沿って追加してください。
NIGHTSHIFT_URL Coordinator の URL。未設定の場合は、このマシンで nightshift up により起動されたグリッドを使用します。 NIGHTSHIFT_TOKEN_FILE coordinator クライアントトークンを保存するファイル(NIGHTSHIFT_URL を使用する場合のみ必要)。 NIGHTSHIFT_MCP_ROOTS サーバーがドキュメントを読み取れるフォルダ(デフォルト: 現在のディレクトリ)。 説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。
メニュー名は 2026年11月11日 に Cursor のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります
VS Code につなげますが、先に準備が必要です
先にパソコンへ Python (uv) を入れてください(1 回だけ)
このメッセージを VS Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。
このパソコンの VS Code に MCP server Nightshift Grid を入れてください。順番に:1) uv --version で uv があるか確認。なければ https://docs.astral.sh/uv/getting-started/installation/ から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "servers": { "nightshift-grid": { "type": "stdio", "command": "uvx", "args": [ "nightshift-grid" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、Nightshift Grid のツールが本当に表示されるか確認する。このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。
もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter
uv --versionMac:⌘ + Space を押し、Terminal と入力して Enter
Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」
まだ入っていない場合: uv にはクリック式のインストーラーがありません。uv 公式ページからお使いの OS(macOS か Windows)用の 1 行コマンドをコピーしてターミナルに貼り付けます · Python を別に入れる必要はなく、必要なときに uv が自動で取得します
入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: uv --version
一度入れれば、uv を使うすべてのツールで使えます
Nightshift Grid を使って、私に何ができるか教えて、1 つやってみせて✓ VS Code が Nightshift Grid を使っていると言うか、回答に Nightshift Grid のツール名が出れば接続成功です
上のコマンドはこれらがなくても動きます。変えたいときだけ作者の説明に沿って追加してください。
NIGHTSHIFT_URL Coordinator の URL。未設定の場合は、このマシンで nightshift up により起動されたグリッドを使用します。 NIGHTSHIFT_TOKEN_FILE coordinator クライアントトークンを保存するファイル(NIGHTSHIFT_URL を使用する場合のみ必要)。 NIGHTSHIFT_MCP_ROOTS サーバーがドキュメントを読み取れるフォルダ(デフォルト: 現在のディレクトリ)。 説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。
メニュー名は 2026年11月11日 に VS Code のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります
Claude Code
claude mcp add --scope user nightshift-grid -- uvx nightshift-gridClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"nightshift-grid": {
"command": "uvx",
"args": [
"nightshift-grid"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"nightshift-grid": {
"command": "uvx",
"args": [
"nightshift-grid"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"nightshift-grid": {
"type": "stdio",
"command": "uvx",
"args": [
"nightshift-grid"
]
}
}
}NIGHTSHIFT_URL envNIGHTSHIFT_TOKEN_FILE envNIGHTSHIFT_MCP_ROOTS env説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。
この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。
pypi: nightshift-gridこのサーバーのつなぎ方と、各アプリの公式ドキュメントに基づきます。2026年11月10日に確認。
パソコン上で動かせるアプリ
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。
誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月20日にチェック
レジストリ名は、リポジトリを所有するGitHubアカウント redd34 で確認済みです
コードの最終更新:5 日前
Apache-2.0を使用
これはパソコンで動くため、インターネット上のエンドポイントはありません
パソコンで動き、代わりにローカルの設定を使います
パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです
OSV.dev に nightshift-grid@0.1.3 の登録はありません
このバージョンのパッケージ本体のみ確認。すべての依存関係ではありません · 確認日 2026年11月15日
作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。
[](https://mcp.popnx.com/en/servers/redd34-nightshift-grid)質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。
まだレビューはありません
レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。
当てはまる基本チェック3項目のうち3項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。
レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。
あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。
GitHubリポジトリの最終更新は5 日前、最新バージョン(0.1.3)がレジストリに届いたのは5 日前です。
Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにPython (uv)も必要です。
同じカテゴリには:Puter MCP, XcodeBuildMCP, Vexa, Atlassian Rovo MCP Server, Anki MCP Server
同じカテゴリでほかの作者のもの。コマンドは確認済み。公式を先に、次にスター順。
カードの見方:↓ 週あたりのダウンロードi★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i
Puter MCP enables AI tools to interact with Puter: manage files, websites, workers, and more
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Meeting bot and transcripts for Google Meet, Teams and Zoom. Live or after, speakers labelled.
Connect to Atlassian Jira, Confluence, Loom, and more to search, create, and manage your work.
MCP server for Anki flashcards: adaptive review, notes, media, and deck management via AnkiConnect.
| これ Nightshift Grid | Puter MCP | XcodeBuildMCP | Vexa | Atlassian Rovo MCP Server | Anki MCP Server | |
|---|---|---|---|---|---|---|
| 動く場所 | パソコンにインストールが必要 | クラウドで動き、インストール不要 | パソコンにインストールが必要 | クラウドで動き、インストール不要 | クラウドで動き、インストール不要 | パソコンにインストールが必要 |
| キーが必要 | いいえ | いいえ | いいえ | はい | いいえ | いいえ |
| Claude で + から追加 | いいえ | いいえ | いいえ | いいえ | はい | いいえ |
| 基本チェック | 3/3 | 4/4 | 3/3 | 2/4 | 4/4 | 3/3 |
| ライセンス | Apache-2.0 | AGPL-3.0 | MIT | Apache-2.0 | Apache-2.0 | MIT |
| 料金 | 登録情報に費用の記載なし | 登録情報に費用の記載なし | 登録情報に費用の記載なし | 登録情報に費用の記載なし | 登録情報に費用の記載なし | 登録情報に費用の記載なし |
作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。
Turn idle laptops, office PCs and legacy mini-PCs into a zero-CapEx, fault-tolerant local AI batch and GraphRAG cluster.
pipx install nightshift-grid # or: uv tool install nightshift-grid
nightshift up --mock --workers 3 # coordinator + 3 workers + live dashboard
A real (mock-inference) run recorded with scripts/record_demo.py. Benchmarks so far are from a single Mac; see Known limitations.
Nightshift Grid is a lightweight distributed compute engine ("SETI@home meets local enterprise MapReduce"). It harvests idle cycles across mixed local machines without slowing down the people using them.
It doesn't slice one giant model across slow LAN links, where Wi-Fi jitter destroys token throughput and one closed laptop lid kills the forward pass. Instead, every machine is a preemptible, fenced micro-worker running its own quantized small model (qwen3:4b, qwen2.5:3b, phi4-mini) via Ollama. A central coordinator hands out leased chunks. When a human touches the machine, the node yields immediately and its chunk moves to another node.
submit 24 chunks output_graph.jsonl
client ──────────────────────▶ Coordinator ───────────────────────▶ (1 record / chunk) │ ▲ lease(task_id, lease_id) / heartbeat 3s / complete / preempt ┌───────────────┼──┼────────────────┐ ▼ ▼ │ ▼ node-office-pc node-legacy-laptop node-mac-studio each: worker_daemon.py (Tier 2) (Tier 1) (Tier 3) + local Ollama
Most teams have gigabytes to terabytes of unstructured PDFs, logs and tickets that can't go to cloud APIs for cost or privacy reasons. Meanwhile the office PCs, laptops and mini-PCs that could process them sit mostly idle all day and fully idle overnight.
The common ways to pool local machines leave a gap for batch pipelines:
| Approach | Typical failure mode for batch work | Nightshift Grid |
|---|---|---|
| Tensor/layer splitting (one big model sharded across machines) | Bound by LAN serialization. One node dropping mid-pass stalls the whole request. | Each node runs a whole small model on independent chunks. A dropped node costs one chunk retry. |
| Stateless request routing (load-balance chat requests across nodes) | No durable job state, so a node dying mid-request fails that request. | Stateful MapReduce queue with fenced leases. Every chunk completes or is explicitly dead-lettered. |
| Dedicated inference pools | Machines must be handed over to the cluster. | Good-citizen harvesting: the human always wins and the grid backs off in milliseconds. |
Capability tiers decide what each node gets: Tier 1 (<8GB free) does embeddings and chunking, Tier 2 (8–24GB) does 3B–8B INT4 entity/relationship extraction, and Tier 3 (>24GB, or Apple Silicon with ≥16GB free) does heavy verification and synthesis.
A common trap when wrapping Ollama or llama.cpp in Python is breaking out of the token loop without closing the underlying socket. The server keeps generating, and the GPU stays pegged until the response finishes. A second trap is checking for user activity only when a token arrives. That leaves a blind spot while the model is loading weights or evaluating a long prompt.
Nightshift runs inference in its own asyncio task. An out-of-band activity watcher polls the chaos trigger file every 100ms and OS HID idle time every 500ms: IOKit HIDIdleTime read in-process on macOS (ioreg -c IOHIDSystem as a fallback), GetLastInputInfo on Windows, D-Bus or xprintidle on Linux. On activity it calls task.cancel(), which unwinds async with client.stream(...) and closes the connection, so Ollama stops generating.
Measured with qwen3:4b on Apple Silicon (GPU utilisation from IOKit, 250ms samples):
| Worker cancellation method | GPU utilisation afterwards |
|---|---|
| Stop the read loop, leave the response open | 84–94% until the model finishes |
Error raised inside async with client.stream | 0% by the first sample; next request ready in 0.04s |
Out-of-band task.cancel() (also covers model load and prompt eval) | 0% by the first sample |
Three workers (qwen3:4b, about 130 tok/s decode) processed a 24-chunk industrial-maintenance GraphRAG extraction job per phase, with auth enabled (python nightshift.py chaos-test --model qwen3:4b). All three workers ran on one Mac sharing one Ollama instance. Multi-machine runs are still to do.
| Chaos scenario / metric | Measured result |
|---|---|
Live human preemption (user returns mid-job on node-legacy-laptop) | 24/24 chunks in 47.3s, 0 failures |
| Activity → coordinator reclaims the lease (trigger file, 100ms poll) | 0.01–0.10s across runs (0.011s in the final run) |
| Lease reclaimed → re-assigned to another node | 0.8s |
| Activity → preempted chunk finished on the backup node | 5.2s |
| Work sent to the paused node while the human is active | 0 chunks |
Worker crash (SIGKILL node-office-pc mid-chunk) | 24/24 chunks in 45.8s |
SIGKILL → lease expiry (12s TTL) → re-assigned → done | 11.9s → +1.1s → 16.8s total |
Coordinator crash (SIGKILL coordinator mid-job, 3s outage, restart on same SQLite file) | 24/24 chunks in 46.4s, 24 attempts for 24 chunks (0 wasted) |
| Restart → ready; in-flight leases finished by their original holders | 0.23s; 2/2 |
Host CPU spike (busy-loop on all 16 cores mid-job, --max-host-cpu-pct 65) | 24/24 chunks in 54.4s; all 3 workers yielded (cpu_busy) in 1.9–2.7s, 0 leases while loaded, all resumed 2.1s after the load stopped |
| Unintended preemptions from the grid's own Ollama load (phases 1–3) | 0 |
| Auth (anonymous submit / worker token on client API / forged completion) | 401 / 401 / 401 |
| Output integrity (4 jobs) | 96/96 records, 0 missing, 0 duplicates, 434 triples |
With --native-idle-seconds, detection latency is bounded by the 500ms HID poll rather than the 100ms file poll. The HID path is covered by unit tests and live IOKit and ioreg reads. An end-to-end benchmark with real keyboard input is still to do, because synthesising HID events needs macOS Accessibility permission.
| Guarantee | Mechanism |
|---|---|
| No chunk lost | Every lease has a 12s TTL, extended by 3s heartbeats, and a reaper re-queues expired leases. Preemption and graceful SIGTERM hand leases back immediately. A worker can hold only one lease at a time. |
| Fenced leases (no split-brain) | Each assignment carries a unique lease_id. A partitioned or stalled worker can't heartbeat or complete a lease that was re-issued. The heartbeat reply (lease_valid: false) tells it to abort the zombie compute. |
| Race-free pull and pause | If a human returns while a pull is in flight, the new lease goes straight back. Preempt messages name their lease, so a late one can't revoke a newer lease. A paused node gets no work until it reports idle. |
| Dead-letter protection | Errors and lease expiries count toward MAX_FAILURES=3, after which the chunk is parked as FAILED. Human preemptions don't count as failures. |
| Clean graph output | Ollama structured outputs (a JSON schema) constrain decoding. normalize_extraction() coerces the output to [subject, RELATION, object] and canonicalises relation names (exceeded during → EXCEEDED_DURING) so edges merge across chunks. Reasoning tokens are disabled on thinking models (qwen3). Invalid output is a retryable failure. |
| Idempotent sink | output_graph.jsonl is fsynced per record and deduplicated by task_id, including across a coordinator restart or a failed fsync. Retried completions are no-ops. |
| Capability-aware scheduling | A worker serves the highest tier it's capable of first, so Tier 3 nodes aren't spent on Tier 1 work while Tier 3 work waits. Recovered chunks go to the front of the queue. |
| Survives coordinator crashes | Every state transition is journaled to SQLite (WAL) in one transaction. On restart, queue order, results and dead letters are recovered, and in-flight leases get a fresh TTL so workers that kept computing can still complete them. Workers retry completions for 30s to ride out the restart. About 11k durable transitions/s; a 50k-task job recovers in 0.3s. |
| Least-privilege auth | Separate bearer tokens for workers (/worker/*) and clients (/v1/*), so a compromised laptop can lease work but can't submit jobs or read results. Each worker registration gets a session secret (X-Nightshift-Session), so a live worker's id can't be hijacked. Constant-time comparison. Tokens come from files or env, never argv. Reused token files must be regular, owned by you and 0600 (no symlinks). The coordinator binds loopback by default and refuses a LAN bind without tokens. Browser Origin requests are refused, and in no-auth loopback mode untrusted Host headers are refused too (DNS-rebinding protection). |
| Good citizen beyond the keyboard | Workers also pause on battery power (--allow-battery to opt out) and under thermal throttling (macOS pmset, Linux sensors). They pause when *other* processes push host CPU over --max-host-cpu-pct (default 65; Ollama and co-located workers are excluded; sustain and hysteresis prevent flapping; the full process table is walked only every 30s, with new processes picked up on every 1s poll). They pause when free RAM drops under --min-free-ram-gb (default 2.0), evicting the model with keep_alive: 0; the resume threshold includes the model's size, so unloading can't cause a pause/reload loop. |
| Fail-closed idle sensing | With --native-idle-seconds, a worker that can't read HID idle time refuses to start (--allow-no-idle-sensor overrides). Sensors: macOS IOKit HIDIdleTime in-process (falling back to ioreg), Windows GetLastInputInfo, GNOME/Wayland Mutter and freedesktop ScreenSaver over D-Bus, X11 xprintidle. If a sensor dies at runtime, the worker pauses (idle_sensor_lost) rather than guessing. |
| Zero-config LAN discovery | worker_daemon.py --discover finds the coordinator over UDP broadcast. The reply carries an HMAC proof keyed by the worker token, so a rogue host can't impersonate the coordinator and harvest tokens. Replays fail (fresh nonce), two valid coordinators are an error, and responses are size-capped and rate-limited (not an amplifier). |
| Live vector index (optional) | --qdrant-url adds a Qdrant sink alongside the always-on JSONL. Writes are queued off the event loop, batched, embedded (nomic-embed-text, or a deterministic hash embedder) and upserted idempotently into nightshift_graph. Failures spool to disk and replay, and never fail a completion. One embedder per collection is enforced. |
| Preemption without lost work (Baton relay, opt-in) | With coordinator.py --relay