Skip to content

feat(collab): per-session server-side editor + renderer fan-out (#2424)#2435

Open
jsmestad wants to merge 1 commit into
mainfrom
collab/2424-per-session-editor
Open

feat(collab): per-session server-side editor + renderer fan-out (#2424)#2435
jsmestad wants to merge 1 commit into
mainfrom
collab/2424-per-session-editor

Conversation

@jsmestad

Copy link
Copy Markdown
Owner

Summary

Lets one Minga node host N independent server-side editor sessions, each with its own Frontend.Manager + Renderer.Server + MingaEditor, all sharing the node-local Buffer.Registry. Default single-session behavior is preserved. This is the foundation for shared-workspace multi-human collaboration (epic #1100).

What changed

  • New MingaEditor.Collab namespace: Names (per-session via-tuples; the default session falls back to the historical bare module names so existing global lookups keep resolving), SessionSupervisor (per-session triad), SessionManager (DynamicSupervisor + attach/detach lifecycle), Cleanup, and Collab (attach/detach orchestration with rollback).
  • Runtime.Supervisor hoists Parser.Manager to node-shared and replaces the static MingaEditor.Supervisor with SessionManager + a default SessionSupervisor.
  • New Runtime.HeadlessSupervisor starts the session-hosting DynamicSupervisor on the headless daemon.
  • Editor resolves its renderer per-session; renderer writeback resolves pid/atom/via through GenServer.whereis.
  • Editor now monitors Parser.Manager and re-subscribes on restart (capped backoff) — preserving syntax highlighting after a parser crash, now that the parser is no longer in the editor's rest_for_one cascade.
  • Collision-free editor_session_id.

Testing

  • mix compile --warnings-as-errors, mix format --check-formatted, mix credo --strict: clean.
  • New tests: collab/names_test, collab/session_manager_test (incl. two-clients-share-one-buffer acceptance), collab_test (attach/detach), parser_resubscribe_test, runtime/headless_supervisor_test, and editor_session_id tests.
  • Went through a dedicated bug-hunt review pass; the parser-restart recovery regression plus three other findings were addressed.

Known limitation (MVP)

The Sidebar/SemanticUI render-trigger registries remain node-shared (documented in Collab.Cleanup); per-session windows, cursor, mode, and feature-state are fully isolated.

Closes #2424. Part of #2422 (tracking) / epic #1100.

🤖 Generated with Claude Code

Host N independent server-side editor sessions on one node, each with its own Frontend.Manager + Renderer.Server + MingaEditor triad sharing the node-local Buffer.Registry. Default single-session behavior preserved.

- New MingaEditor.Collab.{Names,SessionManager,SessionSupervisor,Cleanup} + Collab orchestration
- DynamicSupervisor of per-session triads; Parser.Manager hoisted to node-shared
- Per-session naming via Registry via-tuples; editor monitors parser and re-subscribes on restart (capped backoff)
- Headless daemon hosts sessions via Runtime.HeadlessSupervisor
- Collision-free editor_session_id; renderer writeback resolves pid/atom/via via GenServer.whereis

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collab MVP: per-session server-side editor + renderer fan-out on the headless daemon

1 participant