Commit Graph

9 Commits

Author SHA1 Message Date
Teknium eeb7671e69 simplify(compat): hermes_cli small facades — drop 7 re-exports/aliases (+relay_runtime alias module), repoint 12 callers/tests 2026-09-03 13:05:57 -07:00
Teknium e83816a4d1 review-fix(comments): restore lost #NNNN rationale comments across non-test source (mechanical sweep, condensed, code unchanged)
For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.
2026-09-03 09:44:26 -07:00
Teknium e7e287cdd8 refactor(tui_gateway): tighten W5 modules (host_supervisor, agent_callbacks, model_switch, change_watcher, compute_host_bridge, browser, hosted-room adapters, git_probe, method_ctx, bot_relay) 3037->2680 LOC, zero behavior change 2026-09-03 02:28:12 -07:00
Teknium b279e45d7c refactor(tui_gateway): entry discovery spawn helper, row/kwargs table tightening
- entry: _spawn_discovery + logged _mcp_startup_call replace the two duplicated
  start_background_mcp_discovery try/except blocks (same log levels + messages);
  docstrings/comments compacted keeping every signal/thread WHY.
- methods_projects/agent_callbacks: _project_tree_row and preview kwargs tightened.
Goldens identical; WIRE-PARITY-OK.
2026-09-03 00:05:29 -07:00
Teknium de227bdc34 refactor(tui_gateway): final compaction pass on r3-36 group G
- mcp_oauth_sessions: lift the probe+rollback block out of _worker (_probe_with_rollback).
- project_tree: lane group built from a field table; stamp_profile/_lane_key/_disambiguate
  flattening. methods_projects: policy loader + scan loop tightened. agent_callbacks:
  preview-history filter via _PREVIEW_HISTORY_ROLES. Blank-line squeeze after in-body
  lazy imports (AST-identical). All goldens identical; WIRE-PARITY-OK.
2026-09-02 23:54:51 -07:00
Teknium aef127ad46 refactor(tui_gateway): projects mutator table, mcp_startup call helper, kwargs table in agent_callbacks
- methods_projects: update/add_folder/remove_folder/set_primary handlers registered from a
  _PROJECT_MUTATORS table (same @method names, same 5062/5063/5061 mapping); _pick() for
  params->kwargs; old-vs-new RPC golden (27 calls incl. error paths) identical.
- entry: _mcp_startup_call() replaces 5 lazy import+try/except ladders on hermes_cli.mcp_startup
  (tests monkeypatch mcp_startup module attrs — still resolved at call time).
- agent_callbacks: _background_agent_kwargs built from key tables; drop unused _registry.
- docstring compaction (module docstrings <= 8 lines, WHYs kept).
WIRE-PARITY-OK.
2026-09-02 23:44:18 -07:00
Teknium 79d0d3b600 refactor(tui_gateway): compact project_tree/methods_projects/agent_callbacks/entry/mcp_oauth_sessions (-16%)
- project_tree: split build_tree (207 LOC) into _auto_buckets/_home_project phase helpers;
  _field() replaces 9 '(x.get(k) or "").strip()' ladders; _project_node takes wire-shaped
  **flags; drop unused placement 'repo_path' and _strip_trailing_sep; _FolderIndex/
  _project_for_session collapsed. Old-vs-new golden (67 synthetic build_tree runs) identical.
- methods_projects: _project_ok/_path_param unify 4 handler tails; _project_tree_row via
  dict comprehensions; discovered-cache read via contextlib.nullcontext; policy loader
  helpers. Golden over rows/policy/junk predicates identical.
- agent_callbacks: subagent mirror dispatch on a delta table; drop _render_personality_prompt
  (single caller); getattr shorthand in _background_agent_kwargs.
- entry: _write_or_exit unifies 3 write-fail exits; suppress(); heartbeat/sweep start loop.
- mcp_oauth_sessions: suppress(), gc/listener/redirect compaction, docstrings.
WIRE-PARITY-OK; tests green.
2026-09-02 23:24:24 -07:00
Teknium 99433742dc refactor(tui): extract the prompt turn into prompt_turn.py; compact methods_*/session_*/agent_callbacks; split _start_agent_build into scope/wiring helpers
- server.py 7663 -> 5319: _run_prompt_submit and its goal/loop/voice/scope
  phases move to tui_gateway/prompt_turn.py (bound via method_ctx.bind_module);
  _start_agent_build split into _bind/_release_build_profile_scopes,
  _deferred_build_agent_kwargs, _wire_session_agent, _start_session_services;
  _load_enabled_toolsets split (_enabled_mcp_server_names, _resolve_explicit_toolsets).
- methods_slash: _LIVE_SLASH_OUTPUT dispatch table; methods_tools: _SLASH_BUILTINS,
  _guarded; tool_progress: _PROGRESS_HANDLERS; methods_config_set:
  _REASONING_DISPLAY_WORDS; methods_voice: _VOICE_TOGGLE_ACTIONS.
- Unified: _denied_source (methods_session) replaces _WORKER_SOURCES in
  methods_profiles; _compress_live_with_feedback / _compute_host_slash shared by
  the slash mirror and /compress; _end_voice_chat shared by stop-phrase paths;
  _watcher_mtime_ns; _reaper_session_is_detached_idle; _notif_* helpers.
- Dead: _profile_dir_or_err, _resume_info, _slash_builtin_table (refs.py: 0 hits).
- acp_adapter/server.py: docstring compaction only (AST-identical).
- Every file semantically reviewed hunk-by-hunk for wire/log/lock/order parity.
2026-09-02 14:09:13 -07:00
Teknium 1134e5171d refactor(tui): split auto-continue, session history shaping and agent-callback wiring out of server.py 2026-09-02 14:09:08 -07:00