feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller - #38
Conversation
Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle
|
Warning Review limit reached
More reviews will be available in 10 minutes and 24 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔎 Lint report:
|
|
auto-review: changes requested. Matrix checks (U1–U5, C1–C5)
C2 finding — new type: ignore annotationsTwo new
|
C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass.
|
auto-review: approved (second pass). Matrix checks (U1–U5, C1–C5)
Awaiting human merge + kanban_approve. |
|
auto-review: approved (2nd pass — unchanged, re-confirming). Matrix checks (U1–U5, C1–C5)
Awaiting Sahil's merge + kanban_approve. |
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
…ler (#38) * feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller Adds gateway/hermes_home_puller.py — a background daemon thread that checks once per hour whether ~/.hermes is on main, clean, and behind origin/main, and if so fast-forwards it. This stops the recurring pattern where the live config checkout drifts N commits behind main because PRs merge but no one pulls. Design: - Fast-forward only (git pull --ff-only origin main). - Skips on dirty working tree (uncommitted live edits are preserved). - Skips on non-main branches (e.g. a worker's kanban/task-id branch). - 10-second warm-up at gateway start, then once per hour. - Safe non-fatal: all git failures log and skip; timeout also skipped. - Opt-out via HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false in config.yaml. - No-op when ~/.hermes has no .git directory. Changes: - gateway/hermes_home_puller.py: new module (HermesHomePuller class + start_hermes_home_puller() factory + helper functions) - gateway/run.py: start_hermes_home_puller() called alongside the code_watcher; stopped cleanly on shutdown - tests/gateway/test_hermes_home_puller.py: 30 tests covering env/config disable, branch/clean/behind checks, pull success/failure, lifecycle * fix(review): remove type: ignore annotations in hermes_home_puller C2 fix 1: use subprocess.CompletedProcess[str] directly (text=True guarantees str) gateway/hermes_home_puller.py:73: removed # type: ignore[type-arg] C2 fix 2: type _run as Callable[[], None] in __init__ so test monkey-patching is valid - Renamed _run method to _run_impl to avoid redeclaration - Added self._run: Callable[[], None] = self._run_impl in __init__ - Removed # type: ignore[method-assign] from test line 312 tests/gateway/test_hermes_home_puller.py:312: removed # type: ignore[method-assign] 30/30 tests still pass. --------- Co-authored-by: Sahil (AI) <266772320+sahilm-ai@users.noreply.github.com>
Adds gateway/hermes_home_puller.py — background daemon thread that periodically fast-forwards ~/.hermes to origin/main.
Why
~/.hermes drifts behind origin/main after PRs merge. This PR closes the symmetric gap to code_watcher.py (PR #31) for the config repo.
Design
Changes
Screenshot omissions
N/A — no UI-emitting paths changed.