Commit Graph

5793 Commits

Author SHA1 Message Date
Teknium 73ca3efea4 refactor(update): lift divergence reconcile and syntax-guard rollback out of _pull_updates (153 -> 47 LOC) 2026-09-02 17:02:23 -07:00
Teknium 2d7fcf636e refactor(update): compact re-export import blocks (AST-identical, -117 lines) 2026-09-02 17:00:07 -07:00
Teknium 231ee6bf69 refactor(update): lift profile syncs and post-summary notices out of _run_post_update_maintenance (174 -> 67 LOC) 2026-09-02 16:59:18 -07:00
Teknium 832f77939a refactor(update): lift snapshot safety nets out of _check_and_apply_config_migration (192 -> 130 LOC) 2026-09-02 16:57:00 -07:00
Teknium ce45e216e7 refactor(update): promote nested _restart_one_systemd_gateway_unit closure to a module-level function (184 -> 70 LOC orchestrator) 2026-09-02 16:55:53 -07:00
Teknium 60041b787a refactor(update): join short multi-line statements onto one line (AST-identical, -416 lines) 2026-09-02 16:52:38 -07:00
Teknium 15651bd877 refactor(update): lift cold-start plan and SCM service pause out of _pause_windows_gateways_for_update (261 -> 163 LOC) 2026-09-02 16:50:01 -07:00
Teknium 0bfcf42133 refactor(update): unify venv-prefix and backend-argv helpers in update_cmd_windows (3+2 call sites) 2026-09-02 16:48:45 -07:00
Teknium 1aa9285312 refactor(update): hand-compact comments/docstrings in update_cmd.py, update_cmd_fleet.py, update_cmd_zip.py (AST-identical); rewrite stale module docstring 2026-09-02 16:45:44 -07:00
Teknium d46eb1f964 refactor(update): collapse 90 try/except-pass and try/except-logger.debug blocks into suppress()/_best_effort() (new leaf update_cmd_common.py) 2026-09-02 16:34:55 -07:00
Teknium ebf2875049 refactor(update): lift already-up-to-date finish out of _cmd_update_impl (290 -> 257 LOC) 2026-09-02 16:31:17 -07:00
Teknium bff23bea2c refactor(update): lift option resolution, receipt/plan, git prep, HEAD verification and CalledProcessError handling out of _cmd_update_impl (521 -> 290 LOC) 2026-09-02 16:29:04 -07:00
Teknium dc4de83c62 refactor(update): lift ZIP download/swap and deps reinstall out of _update_via_zip (327 -> 137 LOC) 2026-09-02 16:25:31 -07:00
Teknium e118abc61a refactor(update): lift manual-gateway restart, stuck-PID sweep and phase-abort recovery out of _restart_gateway_fleet_after_update (362 -> 154 LOC) 2026-09-02 16:23:31 -07:00
Teknium a59680217f refactor(update): hand-compact comments/docstrings in split modules (AST-identical); re-export get_hermes_home/shutil; repoint source-inspection tests 2026-09-02 16:11:02 -07:00
Teknium 4674f8b254 refactor(update): split zip/stash/config/deps/git/maint clusters out of update_cmd.py 2026-09-02 16:00:26 -07:00
Teknium 096826bf7d refactor(update): split gateway fleet restart/verify into update_cmd_fleet.py 2026-09-02 15:55:50 -07:00
Teknium 5206a504ca refactor(update): split Windows gateway lifecycle into update_cmd_windows.py 2026-09-02 15:40:14 -07:00
Teknium e2d7a6f8b8 refactor(update): drop dead _gateway_restart_recovery_profiles; write sibling-snapshot cache via module attribute 2026-09-02 15:27:33 -07:00
Teknium 88b74d6ef0 Merge branch 'simp/hclib' into simp/integration 2026-09-02 15:05:48 -07:00
Teknium cfa327e5dc refactor(hclib): remaining hermes_cli library modules — dead code, unified helpers, flattened branches 2026-09-02 15:03:42 -07:00
Teknium ae70536485 Merge branch 'simp/web' into simp/integration 2026-09-02 15:01:45 -07:00
Teknium 24b9d18448 Merge branch 'simp/cli-models' into simp/integration
Conflict in hermes_cli/model_setup_flows.py: took simp/cli-models's
simplified version and re-applied simp/cli-main's 2-line change (import
_current_reasoning_effort/_set_reasoning_effort from hermes_cli.setup
instead of hermes_cli.main, since cli-main removed the main.py copies).
simp/cli-models had dropped those two helpers from hermes_cli.setup.py as
dead (their only base caller was main.py's own copy); restored them there
so the cli-main import path resolves.
2026-09-02 15:01:11 -07:00
Teknium 78335adfec refactor(hclib): shared roots — hermes_constants, hermes_logging, utils, _subprocess_compat compaction and dedupe 2026-09-02 14:47:26 -07:00
Teknium 2c7f5d12b5 refactor(hclib): cron/update/install lifecycle — cron status, update_* receipts and recovery, install repair, service manager 2026-09-02 14:45:25 -07:00
Teknium 3ffd44acd3 refactor(hclib): models/runtime — models, inventory, runtime_provider, provider catalog, local_runtime, banner 2026-09-02 14:44:48 -07:00
Teknium 5d4b97939e refactor(hclib): config — config/config_migrations/tools_config/toolset_* dispatch tables and dedupe 2026-09-02 14:42:18 -07:00
Teknium 3371814034 refactor(hclib): auth — Nous/Copilot/portal auth, credential lifecycle, keepalive simplified 2026-09-02 14:42:18 -07:00
Teknium 0330faffcb Merge branch 'simp/state' into simp/integration 2026-09-02 14:19:40 -07:00
Teknium 1593bee0c3 Merge branch 'simp/cron' into simp/integration 2026-09-02 14:19:40 -07:00
Teknium 81ddc99705 Merge branch 'simp/cli-update' into simp/integration 2026-09-02 14:19:37 -07:00
Teknium 50be642e52 Merge branch 'simp/cli-misc' into simp/integration 2026-09-02 14:19:37 -07:00
Teknium db0515f120 Merge branch 'simp/cli-mixins' into simp/integration 2026-09-02 14:19:37 -07:00
Teknium beb56b6a00 refactor(web): re-export list_credential_pool from web_server for off-loop tests 2026-09-02 13:49:24 -07:00
Teknium 7c0d8f2c6f refactor(web): second-pass compaction of local_models/profiles/web_git (helpers, dict literals, docstrings) 2026-09-02 13:35:48 -07:00
Teknium 15aaa359bf refactor(web): strip web_models provenance banners, compact field comments (schema byte-identical) 2026-09-02 13:35:24 -07:00
Teknium bdf1d8b0cf refactor(web): dedupe web_git subprocess/ref-list plumbing, drop dead _MAX_BUFFER 2026-09-02 13:35:24 -07:00
Teknium de626c5a36 refactor(web): unify profiles router error mapping, target enumeration and row tagging 2026-09-02 13:34:56 -07:00
Teknium 8c5af5733a refactor(web): collapse local_models job/download/server boilerplate into shared helpers 2026-09-02 13:33:24 -07:00
Teknium 7d28a33bd9 refactor(web): simplify dashboard_procs/dashboard_register (dedupe home/profile helpers, drop _HEX16 alias, compact docs) 2026-09-02 13:33:23 -07:00
Teknium 5c7096e7cf refactor(web): delete dead web_server helpers (_demo, _ws_request_reason, _TERMINAL_BACKEND_NAMES, _mcp_oauth_callback_url_from_base) 2026-09-02 13:33:23 -07:00
Teknium 4fd970c62f refactor(web): absorb single-router web_server helpers into their routers (75 defs); drop dead imports 2026-09-02 13:33:22 -07:00
Teknium c90af45f57 refactor(web): unify the three post-config gateway auto-restart helpers 2026-09-02 13:32:52 -07:00
Teknium f2c506845b refactor(web): unify device-code poller lifecycle into _oauth_poller decorator 2026-09-02 13:32:49 -07:00
Teknium ba4f4b8161 refactor(web): collapse try/except-HTTPException/log/raise boilerplate into _common.http_failure; trim unused fastapi imports 2026-09-02 13:32:46 -07:00
Teknium 8ac12223bb refactor(web): late() proxies replace per-handler lazy web_server imports in extracted routers 2026-09-02 13:32:45 -07:00
Teknium ba91166b1c refactor(web): hoist stdlib imports in extracted routers; drop unused web_server imports 2026-09-02 13:32:28 -07:00
Teknium ff660354f3 refactor(kanban): CLI micro-helpers, action dispatch tables, shared triage helpers; active_sessions dedupe
hermes_cli/kanban.py 3,565 -> 2,912; kanban_diagnostics 1,216 -> 996;
kanban_decompose 468 -> 393; kanban_transfer 478 -> 443; kanban_specify
264 -> 229; kanban_swarm 390 -> 378; active_sessions 871 -> 775. `hermes kanban
[sub] --help` byte-identical for all 55 parsers.

- kanban.py: _err / _print_json / _json_out / _fmt_counts / _bulk_apply /
  _obj_dict field tuples replace repeated print/JSON/exit-code blocks; action
  and board subcommand routing via dict dispatch; shared run-state and
  triage-sweep argparse blocks; argparse declarations re-packed (AST-identical).
- specify/decompose: one _run_triage_sweep driver, shared _extract_json_blob /
  _truncate / _profile_author / _title_body / _resolve_profile_from_cfg.
- diagnostics: rule helpers (_first_field / _latest_event_ts / _log_hint_action
  / _error_snippet), _rows_by_task fleet fetch; unreferenced DIAGNOSTIC_KINDS dropped.
- swarm: graph nodes share one create_task kwarg set.
- active_sessions: one _flock per platform, _pid_alive via _pid_liveness,
  shared _read_live_entries / _without_lease / _clean_metadata, table-driven
  strict registry validation.
- Docstrings/comments hand-compacted (AST-identical), invariants kept.
2026-09-02 13:32:14 -07:00
Teknium 841c975d43 refactor(kanban): unify kanban_db SQL/row/JSON/env/git boilerplate; table-drive migrations
hermes_cli/kanban_db.py 12,153 -> 11,157 LOC, behavior-neutral.

- _row_get / _json_or / _json_dict / _env_int / _git_out applied at every
  duplicate site; Event/Comment/Attachment.from_row row mapping.
- Scalar-read helpers (_task_status, _latest_event, _scratch_workspace,
  _has_spawnable, _current_run_id, _parents_satisfied) replace repeated
  conn.execute(...).fetchone() blocks.
- _migrate_add_optional_columns and add_notify_sub column refreshes are
  table-driven (same statements, same order).
- _dispatch_lane_task unifies the ready/review lane tails; _claim_and_open_run
  and _reclaim_dangling_run shared by claim paths; block_task's three UPDATE
  branches and complete_task's UPDATEs collapsed to one statement each.
- connect() PRAGMA/WAL setup shared via _open_configured; _probe_integrity
  shared by the health guard and repair; _try_lock_nb/_unlock shared by the
  init and dispatch file locks; _insert_comment for in-transaction audit rows.
- Dead: parent_results (zero refs).
- Long docstrings hand-compacted, every invariant kept. Schema SQL untouched.
2026-09-02 13:32:14 -07:00
Teknium e4d8a78967 refactor(web): move /api/logs into web_routers/status.py (logs_router) 2026-09-02 13:32:08 -07:00