[claude] Bannerlord M1 — GABS Observer Mode (Passive Lord) (#1093) #1124

Merged
claude merged 1 commits from claude/issue-1093 into main 2026-03-23 18:23:53 +00:00
Collaborator

Fixes #1093

What this does

Implements M1 of Project Bannerlord (#1091): Passive Lord — Observer Mode via GABS.

Timmy can now read full Bannerlord game state via the GABS TCP JSON-RPC bridge and journal it to memory/bannerlord/journal.md.

Changes

File Purpose
src/config.py GABS settings: gabs_host, gabs_port, gabs_timeout, gabs_poll_interval, gabs_journal_path. Off by default (gabs_enabled=False).
src/integrations/bannerlord/gabs_client.py GabsClient — synchronous TCP JSON-RPC 2.0 client. Exposes get_game_state(), get_player(), get_player_party(), list_kingdoms(). Raises GabsError on any failure.
src/integrations/bannerlord/observer.py BannerlordObserver — async observe(days=N) loop. Polls GABS every gabs_poll_interval seconds, formats game state into Markdown journal entries, and stops after N unique in-game days. Degrades gracefully when GABS is unreachable.
tests/integrations/test_gabs_observer.py 21 unit tests (all offline, sockets mocked). Covers TCP failure, RPC errors, partial snapshots, journal creation, and the observe(days=N) stop condition.

Usage

from integrations.bannerlord.observer import BannerlordObserver

observer = BannerlordObserver(host="10.0.0.50")
await observer.observe(days=7)  # journal 7 in-game days then stop

Tests

21 passed in 0.49s
3268 passed, 1 skipped (full suite)

Next steps (M2)

  • Action loop: move party, recruit troops, initiate trade
  • Requires VM + GABS mod to be running (not needed for this offline implementation)
Fixes #1093 ## What this does Implements M1 of Project Bannerlord (#1091): **Passive Lord — Observer Mode via GABS**. Timmy can now read full Bannerlord game state via the GABS TCP JSON-RPC bridge and journal it to `memory/bannerlord/journal.md`. ## Changes | File | Purpose | |------|---------| | `src/config.py` | GABS settings: `gabs_host`, `gabs_port`, `gabs_timeout`, `gabs_poll_interval`, `gabs_journal_path`. Off by default (`gabs_enabled=False`). | | `src/integrations/bannerlord/gabs_client.py` | `GabsClient` — synchronous TCP JSON-RPC 2.0 client. Exposes `get_game_state()`, `get_player()`, `get_player_party()`, `list_kingdoms()`. Raises `GabsError` on any failure. | | `src/integrations/bannerlord/observer.py` | `BannerlordObserver` — async `observe(days=N)` loop. Polls GABS every `gabs_poll_interval` seconds, formats game state into Markdown journal entries, and stops after N unique in-game days. Degrades gracefully when GABS is unreachable. | | `tests/integrations/test_gabs_observer.py` | 21 unit tests (all offline, sockets mocked). Covers TCP failure, RPC errors, partial snapshots, journal creation, and the `observe(days=N)` stop condition. | ## Usage ```python from integrations.bannerlord.observer import BannerlordObserver observer = BannerlordObserver(host="10.0.0.50") await observer.observe(days=7) # journal 7 in-game days then stop ``` ## Tests ``` 21 passed in 0.49s 3268 passed, 1 skipped (full suite) ``` ## Next steps (M2) - Action loop: move party, recruit troops, initiate trade - Requires VM + GABS mod to be running (not needed for this offline implementation)
claude added 1 commit 2026-03-23 18:23:19 +00:00
feat: Bannerlord M1 — GABS Observer Mode (Passive Lord)
Some checks failed
Tests / lint (pull_request) Failing after 14s
Tests / test (pull_request) Has been skipped
8de1a4225b
Implements issue #1093: Timmy reads Bannerlord game state via the GABS
TCP JSON-RPC bridge and journals it to memory/bannerlord/journal.md.

Changes:
- src/config.py: add GABS settings (host, port, timeout, poll_interval,
  journal_path) — all off by default (gabs_enabled=False)
- src/integrations/bannerlord/gabs_client.py: GabsClient — synchronous
  TCP JSON-RPC 2.0 client with graceful GabsError handling; exposes
  get_game_state(), get_player(), get_player_party(), list_kingdoms()
- src/integrations/bannerlord/observer.py: BannerlordObserver — async
  observe() loop that polls GABS every poll_interval seconds and formats
  game state into structured Markdown journal entries; degrades gracefully
  when GABS is unreachable (logs warning, no crash)
- tests/integrations/test_gabs_observer.py: 21 unit tests (all offline,
  sockets mocked) covering TCP failure, RPC errors, partial snapshots,
  journal creation, and the observe(days=N) stop condition

Fixes #1093

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude merged commit 276bbcd112 into main 2026-03-23 18:23:53 +00:00
claude deleted branch claude/issue-1093 2026-03-23 18:23:53 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1124