Skip to content

feat(gateway): auto-pull ~/.hermes from origin/main via HermesHomePuller - #38

Merged
sahilm-ai merged 2 commits into
mainfrom
kanban/t_cbe1a497
May 29, 2026
Merged

sahilm-ai merged 2 commits into
mainfrom
kanban/t_cbe1a497

Conversation

@sahilm-ai

Copy link
Copy Markdown
Collaborator

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

  • fast-forward only; skips dirty trees; skips non-main branches
  • once per hour (10s warm-up at start)
  • non-fatal: all git failures log and return
  • opt-out: HERMES_GATEWAY_NO_AUTO_PULL=1 or gateway.hermes_home_auto_pull: false

Changes

  • gateway/hermes_home_puller.py: new module
  • gateway/run.py: start_hermes_home_puller() called alongside start_code_watcher()
  • tests/gateway/test_hermes_home_puller.py: 30 tests, all pass

Screenshot omissions

N/A — no UI-emitting paths changed.

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
@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@sahilm-ti, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac958091-7242-4abb-ba7e-8d8cbaf12af9

📥 Commits

Reviewing files that changed from the base of the PR and between c49a782 and acd2188.

📒 Files selected for processing (3)
  • gateway/hermes_home_puller.py
  • gateway/run.py
  • tests/gateway/test_hermes_home_puller.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kanban/t_cbe1a497

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 28, 2026 •

Copy link
Copy Markdown

🔎 Lint report: kanban/t_cbe1a497 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9591 on HEAD, 9591 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5049 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@sahilm-ti

Copy link
Copy Markdown
Owner

auto-review: changes requested.

Matrix checks (U1–U5, C1–C5)

  • U1 in-scope-files: PASS — gateway/hermes_home_puller.py, gateway/run.py, tests/gateway/test_hermes_home_puller.py — all AC-scoped
  • U2 out-of-scope-deletions: PASS — additions + minor modification to run.py
  • U3 no-secrets: PASS — no secret-shaped strings
  • U4 AC-coverage: PASS — auto-pull behavior, skip-dirty, skip-off-main, opt-out flag all implemented
  • U5 mergeable: PASS — mergeStateStatus UNSTABLE (test(5) is a non-required check, see C1 note)
  • C1 CI-green: NOTE — test(5) failed at tests/hermes_cli/test_web_server.py::TestPtyWebSocket::test_pub_broadcasts_to_events_subscribers. This test is unrelated to the PR (not in diff). Error: "broadcast not received within 10s" — timing-based WebSocket flake. mergeStateStatus=UNSTABLE confirms this is non-required. Treated as pass per U5 UNSTABLE rule.
  • C2 type-discipline: FAIL — see below
  • C3 lint-clean: PASS — ruff enforcement (blocking) and ruff + ty diff both PASS
  • C4 tests-touched: PASS — 320-line test file added
  • C5 worker-identity: PASS — all commits 266772320+sahilm-ai@users.noreply.github.com

C2 finding — new type: ignore annotations

Two new type: ignore annotations introduced in this PR:

  1. gateway/hermes_home_puller.py:73:

    def _run_git(hermes_home: Path, *args: str) -> subprocess.CompletedProcess:  # type: ignore[type-arg]

    Fix: use the parametrized form subprocess.CompletedProcess[str] — no ignore needed since capture_output=True with text=True means stdout/stderr are always str.

  2. tests/gateway/test_hermes_home_puller.py:312:

    puller._run = quick_run  # type: ignore[method-assign]

    Fix: either type the _run attribute explicitly as Callable[[], None] in the class definition so mypy accepts reassignment, or extract to a subclass for testing instead of monkey-patching the private attribute.

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.
@sahilm-ti

Copy link
Copy Markdown
Owner

auto-review: approved (second pass).

Matrix checks (U1–U5, C1–C5)

  • U1 in-scope: PASS — 3 files match AC scope (auto-pull feature)
  • U2 no deletions: PASS
  • U3 no secrets: PASS
  • U4 AC coverage: PASS — dispatcher auto-pull (AC item 3), opt-out, skip-dirty/skip-non-main logic
  • U5 mergeable: PASS — CLEAN (all tests green)
  • U6 UI screenshot: PASS — N/A, no emitter paths changed
  • C1 CI green: PASS — all 17 checks pass (test 1-6 all pass, nix ubuntu+macos, ruff, e2e)
  • C2 type discipline: PASS — no type:ignore annotations; _run: Callable[[], None] typed in init; CompletedProcess[str] explicit
  • C3 lint: PASS — ruff enforcement (blocking) and Windows footguns checks green
  • C4 tests touched: PASS — tests/gateway/test_hermes_home_puller.py added (30 tests, 320 lines)
  • C5 worker identity: PASS — all commits authored by 266772320+sahilm-ai@users.noreply.github.com

Awaiting human merge + kanban_approve.

@sahilm-ti

Copy link
Copy Markdown
Owner

auto-review: approved (2nd pass — unchanged, re-confirming).

Matrix checks (U1–U5, C1–C5)

Rule Status Evidence
U1 in-scope-files PASS 3 files: gateway/hermes_home_puller.py, gateway/run.py, tests/gateway/test_hermes_home_puller.py
U2 out-of-scope-deletions PASS No deletions
U3 no-secrets PASS No secret-shaped strings
U4 ac-coverage PASS Auto-pull on dispatcher, skips dirty/off-main, logs clearly
U5 pr-mergeable PASS mergeStateStatus=CLEAN, all CI green
U6 ui-no-verification N/A No UI-emitter paths touched
C1 ci-green PASS 20/20 checks pass/skip; all 6 test shards + nix (ubuntu+macos) + ruff/ty + e2e green
C2 type-discipline PASS Zero new type:ignore / ty:ignore / cast() in diff (previously fixed)
C3 lint-clean PASS ruff enforcement (blocking) + ruff+ty diff both green
C4 tests-touched PASS 320-line test file covering all new functionality
C5 worker-identity PASS Both commits authored+committed by 266772320+sahilm-ai

Awaiting Sahil's merge + kanban_approve.

@sahilm-ai
sahilm-ai merged this pull request into main May 29, 2026
21 checks passed
@sahilm-ai
sahilm-ai deleted the kanban/t_cbe1a497 branch May 29, 2026 08:31
sahilm-ti pushed a commit that referenced this pull request May 29, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jun 3, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jun 5, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jun 15, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jun 17, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jun 22, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 3, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 9, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 10, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 11, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 13, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 15, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 17, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 21, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 23, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Jul 28, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Aug 24, 2026
…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>
sahilm-ti pushed a commit that referenced this pull request Sep 2, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants