Skip to content

refactor(tui): extract _SlashWorker client + session db into tui_gateway modules (server.py god-file slice R1) - #79259

Open
andrexibiza wants to merge 2 commits into
NousResearch:mainfrom
andrexibiza:fix/tui-slash-worker-extract
Open

refactor(tui): extract _SlashWorker client + session db into tui_gateway modules (server.py god-file slice R1)#79259
andrexibiza wants to merge 2 commits into
NousResearch:mainfrom
andrexibiza:fix/tui-slash-worker-extract

Conversation

@andrexibiza

@andrexibiza andrexibiza commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

tui_gateway/server.py god-file slice R1: extract the _SlashWorker subprocess client + session-db cluster from tui_gateway/server.py (13,908 lines) into tui_gateway/slash_worker_client.py and tui_gateway/session_db.py. Part of the repo-wide large-file decomposition (tracker #78647).

What changed and why

  • _SlashWorker + _SLASH_WORKER_TIMEOUT_S (window 158–162 + 326–459, golden sha e71683bf…) → tui_gateway/slash_worker_client.py — zero forward deps, git_probe.py extraction is the in-tree precedent
  • Session DB cluster (window 1301–1508, golden sha cea6186d…, 12 members) → tui_gateway/session_db.py — 9/12 members have zero outside refs; the 2 global state lines stay on server.py (test-pinned)
  • server.py re-exports all moved names identity-preserving (seam: server.X is module.X)
  • Double-blind: 2 blind region analysts (pass A + pass B) → consensus adjudication (R1-CONSENSUS.md) → implementer → 2 blind re-reviewers (both APPROVED)

Testing

  • 63 tests pass (5 dedicated slash-worker files + 2 new extraction tests) + 523 tui server/ws tests
  • Full tests/tui_gateway/: 391 passed, 4 failed — identical 4 proven at the pristine pin (timing flakes + Windows SIGPIPE)
  • Seam identity 14/14 re-export names verified is-identical
  • Golden shas verified against the consensus contract
  • ruff clean · git diff --check clean · LF-only · DCO signed · Windows-tested

Coordination / interlock

Part of #78647
Part of #78630

…way modules (server.py god-file slice R1)

Signed-off-by: andrexibiza <84248988+andrexibiza@users.noreply.github.com>
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 5, 2026
@andrexibiza

Copy link
Copy Markdown
Contributor Author

🔒 This shard is part of the tui_gateway/server.py KILL LOCK — the permanent record of the 13,908-line whole, the mess it caused (#60654 WS-frame stalls/frozen desktop, #60800 cold-start stalls, #33503 shell injection, #76285 board-slug validation, #76701 SessionDB abandonment, FIPS crashes), every shard in the wave, and every open fixer PR still fighting the surface (#72370 #76366 #67628 #58339 #77391 #66874 #77745 #72231 #62598 #33503 #74408 #74350 #65192 #77860 #76298 #78036 #74701 #72295 #73800 #76131 #68468 #51596 #53373 #76701 #70226).

Lock: posted on #78630 · Indexed by the Kill All Gods meta-issue #78647.

@andrexibiza

Copy link
Copy Markdown
Contributor Author

Pushed 52470ebc54: the extraction contract no longer uses hardcoded C:/tmp, which does not exist on Linux and therefore made _configured_cwd_from_cfg correctly return None. The test now creates a real tmp_path directory. Verification: session-db extraction, slash-worker extraction, and /undo suites pass 54/54 on Windows and 54/54 under Ubuntu/WSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants