Commit Graph

3662 Commits

Author SHA1 Message Date
Teknium b1b171c0fe Merge branch 'simp/r2-gw-rest' into simp/integration2 2026-09-02 17:27:35 -07:00
Teknium e93960b47c Merge branch 'simp/r2-gw-rest-rooms' into simp/r2-gw-rest 2026-09-02 17:26:37 -07:00
Teknium 696662997b Revert "refactor(gateway/hosted_rooms): reflow multi-line SQL constants (whitespace-only, parity-verified)"
This reverts commit fa827f596e.
2026-09-02 17:18:13 -07:00
Teknium 921362cbfa Merge branches 'simp/r2-rooms-v1', 'simp/r2-rooms-v2' and 'simp/r2-rooms-v3' into simp/r2-gw-rest-rooms 2026-09-02 17:17:31 -07:00
Teknium 598065384d refactor(gateway/hosted_rooms): driver generation-transition spec table + run-fence transition helper; replicas ingest_page row-state/store extraction 2026-09-02 17:14:41 -07:00
Teknium 6a7e7aaa03 refactor(gateway/hosted_rooms): structural dedupe — _reload, _read_one, _non_negative, _remote_run_schema_current; split _append_authority_claim/_disband_replay; table-driven _migrate_legacy_columns; fold _event_storage_bytes/_assert_event_capacity into _prepare_event 2026-09-02 17:14:28 -07:00
Teknium 86a548935e refactor(gateway/hosted_rooms): extract checkpoint _settled_message, table-drive discussion event/actor checks, partial-ize peer _exact_fields (structural only, parity-neutral) 2026-09-02 17:12:48 -07:00
Teknium 6360d3d9c4 Merge branch 'simp/r2-gw-rest' into simp/integration2
# Conflicts:
#	tests/gateway/test_48031_model_switch_after_auto_reset.py
2026-09-02 17:06:54 -07:00
Teknium 02fb8fb5bf Merge branch 'simp/r2-gw-rest-stream' into simp/integration2 2026-09-02 17:05:22 -07:00
Teknium d48a0e604f Merge branch 'simp/r2-gw-rest-config' into simp/integration2 2026-09-02 17:05:22 -07:00
Teknium c92f5a3685 Merge branch 'simp/r2-gw-rest-sess' into simp/integration2 2026-09-02 17:05:19 -07:00
Teknium 33928b0a80 Merge branch 'simp/r2-rooms-v1' into simp/integration2 2026-09-02 17:05:13 -07:00
Teknium 686b6824ef Merge branch 'simp/r2-gw-rest-sess' into simp/r2-gw-rest 2026-09-02 16:55:02 -07:00
Teknium 182724d09f Merge branch 'simp/r2-gw-rest-stream' into simp/r2-gw-rest 2026-09-02 16:55:01 -07:00
Teknium ba7599c953 Merge branch 'simp/r2-gw-rest-config' into simp/r2-gw-rest 2026-09-02 16:55:01 -07:00
Teknium 5820d0b0d5 refactor(gateway/config): extract the config.yaml phase to gateway/config_loader.py; table-driven from_dict; defensive collapse
- load_gateway_config (536 LOC) is now a thin orchestrator: legacy gateway.json
  -> config_loader.load_yaml_layer -> GatewayConfig.from_dict -> env overrides
  -> validation. The yaml phase lives in gateway/config_loader.py as small
  functions driven by tables: _TOPLEVEL_BRIDGE (23 top-level/nested
  gateway.<key> bridges with 5 fallback modes), _SHARED_KEYS (28 per-platform
  keys copied into extra, with per-platform restrictions and transforms) and
  _PORT_BRIDGE_KEYS. Logger name kept as "gateway.config".
- GatewayConfig.from_dict: shared pick()/key_label() helpers replace the
  repeated "top-level key present else nested gateway.<key>" blocks; warning
  order preserved.
- _normalize_unauthorized_dm_behavior / _normalize_notice_delivery unified into
  _normalize_choice; _ensure_platform_extra_dict -> _dict_slot (also used by
  persist_home_channel); _getenv_int removed (dead since the env pass moved to
  config_env, which has its own _int_or).
- Platform._missing_: one _add_pseudo_member helper for both branches.
- Single warning sites in _coerce_optional_positive_int and
  coerce_systemd_watchdog_seconds; _validate_gateway_config placeholder pass
  flattened; small to_dict/getter collapses. Ruff F401/SIM102 clean.
- tests/hermes_cli/test_config_read_guard.py: allowlist gateway/config_loader.py
  (same owner as gateway/config.py — the extracted load_gateway_config phase).

gateway/config.py 2684 -> 1319 LOC (-50.9%); largest function now
GatewayConfig.from_dict at 119 LOC. Resolved-config parity: 160 cells
(16 yaml fixtures x 10 env sets) byte-identical to the integration base,
including captured log records and stderr.
2026-09-02 16:48:36 -07:00
Teknium fa827f596e refactor(gateway/hosted_rooms): reflow multi-line SQL constants (whitespace-only, parity-verified) 2026-09-02 16:46:00 -07:00
Teknium 2e9a5e9f32 refactor(gateway/slash): collapse /whoami, /platform, /stop, /footer, /verbose duplication; extract /compress preview; module docstrings 2026-09-02 16:41:41 -07:00
Teknium 59acca1850 refactor(gateway/slash): unify context-breakdown transcript load; tidy module headers and import order 2026-09-02 16:30:01 -07:00
Teknium 73d56a1290 Merge branch 'simp/r2-rooms-w2' into simp/r2-gw-rest-rooms 2026-09-02 16:27:20 -07:00
Teknium 5ab334c6e7 refactor(gateway/slash): extract autonomy-loop commands into gateway/slash_commands_goals.py (GatewayGoalCommandsMixin) 2026-09-02 16:27:13 -07:00
Teknium 2b7d975b9b refactor(gateway/hosted_rooms): rewrap driver DDL/prune SQL, tighten _transition docstring 2026-09-02 16:26:29 -07:00
Teknium 4ad1c6c1be refactor(gateway): drop dead GatewayRunner._has_setup_skill (no production caller; tests only stub it) 2026-09-02 16:26:11 -07:00
Teknium 6bbb13d625 refactor(gateway/slash): extract introspection commands into gateway/slash_commands_status.py (GatewayStatusCommandsMixin) 2026-09-02 16:25:35 -07:00
Teknium c4bc0ada79 refactor(gateway/hosted_rooms): inline replica clock helper, collapse driver literal 2026-09-02 16:23:44 -07:00
Teknium 44e37bc7e3 refactor(gateway/hosted_rooms): table-driven task transitions in hosted_room_driver; fold replica schema init, share leaf helpers (-40% LOC, parity-neutral) 2026-09-02 16:19:39 -07:00
Teknium 1b3f37b3eb Merge branch 'simp/r2-rooms-w4' into simp/r2-gw-rest-rooms 2026-09-02 16:18:42 -07:00
Teknium 0686f3fdae Merge branch 'simp/r2-rooms-w3' into simp/r2-gw-rest-rooms 2026-09-02 16:18:40 -07:00
Teknium 865d77a166 refactor(gateway/status): drop dead is_gateway_running/clear_planned_stop_marker, unify PID-record liveness, marker-write, JSON-parse and stale-lock helpers, table-drive runtime-status field writes 2026-09-02 16:16:59 -07:00
Teknium d7bdf2788d refactor(gateway/session): split SessionStore into persistence/recovery/lifecycle/transcript mixins by call-graph cohesion; compact wire helpers 2026-09-02 16:15:42 -07:00
Teknium 66366d3dab refactor(gateway): split GatewayRunner into 13 run_* mixins + TurnRunner module (run.py 31332 -> 6957)
AST-driven, body-identical move of 359 GatewayRunner methods into cohesive
mixin modules (gateway/run_{voice,adapters,topics,turn,shutdown,busy,
config_loaders,startup,watchers,notifications,inbound,goals,agent_cache}.py)
plus TurnRunner -> gateway/run_turn_runner.py. run.py-internal symbols are
imported lazily inside method bodies so patch('gateway.run.X') keeps
intercepting; neutral deps are top-level; logger name stays 'gateway.run'.
_UNSET moved to leaf gateway/run_common.py (def-time default-arg sentinel).
Whole-module inspect.getsource(gateway_run) AST-walker tests repointed to
the module that now holds the walked code.
2026-09-02 16:11:50 -07:00
Teknium c4920cc8be refactor(gateway/hosted_rooms): dispatch-table event validation and terminal effects in discussion; split checkpoint sync and compact SQL 2026-09-02 16:05:18 -07:00
Teknium ad301948df refactor(gateway/hosted_rooms): dedupe SQL/validation via hosted_rooms_common, table-drive schema, split create_room/probes (2270->1648 LOC) 2026-09-02 16:03:46 -07:00
Teknium 04fc5ea9ee refactor(gateway/slash): extract session-transcript commands into gateway/slash_commands_session.py (GatewaySessionCommandsMixin) 2026-09-02 16:03:07 -07:00
Teknium 7e046408a7 refactor(gateway/hosted_rooms): peer grant token split/fsync helpers, frozen grant field sets 2026-09-02 16:01:31 -07:00
Teknium 8ba0350b31 refactor(gateway/slash): extract model-route commands into gateway/slash_commands_model.py (GatewayModelCommandsMixin) 2026-09-02 15:59:06 -07:00
Teknium 2a5e7764ad refactor(gateway/hosted_rooms): compact peer/links/execution_policy onto common validators, extract catalog endpoint/link-mode parsers 2026-09-02 15:58:57 -07:00
Teknium b3759fa8d6 Merge branch 'simp/r2-gwrun-hmwa' into simp/r2-gwrun 2026-09-02 15:57:24 -07:00
Teknium 94af71400d Merge branch 'simp/r2-gwrun-rai' into simp/r2-gwrun 2026-09-02 15:57:23 -07:00
Teknium 6e4e1674e4 Merge branch 'simp/r2-gwrun-runsync' into simp/r2-gwrun 2026-09-02 15:57:22 -07:00
Teknium 0b3f9ae7b3 Merge branch 'simp/r2-gwrun-hm' into simp/r2-gwrun 2026-09-02 15:57:20 -07:00
Teknium 95801ab139 Merge branch 'simp/r2-gwrun-busyprep' into simp/r2-gwrun 2026-09-02 15:57:19 -07:00
Teknium 4e8daa54f9 Merge branch 'simp/r2-gwrun-startgw' into simp/r2-gwrun 2026-09-02 15:57:18 -07:00
Teknium fd2bfa1893 refactor(gateway/kanban): lift notifier delivery into _KanbanNotification + event-formatter table, dispatcher into _DispatcherSettings/_KanbanDispatcher; unify board enumeration/tick sleep 2026-09-02 15:57:11 -07:00
Teknium f8d7733640 refactor(gateway/slash): dedupe /reset hook payloads + tool-state clears, /branch row copy 2026-09-02 15:55:22 -07:00
Teknium d3b4d1cbe3 refactor(gateway/slash): unify diff rendering, nested-config writes, background task tracking; extract restart payload and detached update spawn 2026-09-02 15:52:37 -07:00
Teknium a47a35f44b refactor(gateway/stream): split GatewayStreamConsumer into transport/fallback/think mixins + fences leaf; drop dead _MEDIA_RE 2026-09-02 15:51:05 -07:00
Teknium 98a528a65a refactor(gateway): split _handle_message_with_agent into _hmwa_* helpers (2365 -> 242 LOC, max helper 249) 2026-09-02 15:50:25 -07:00
Teknium f92267f6f6 refactor(gateway): split TurnRunner.send_progress_messages into state carrier + 8 helpers (333 -> 168 LOC) 2026-09-02 15:49:24 -07:00
Teknium 83dc167c1c refactor(gateway/slash): extract /model picker send, kanban auto-subscribe, shared refine/review and approve/deny preludes 2026-09-02 15:49:22 -07:00