refactor: remove the main room concept

No room has room_settings.is_main = 1, so every main-only path was dead,
and admin work is done from the host shell. Each room's agent may now
only act on its own room:

- IPC: messages/inbound injection only to the source room; schedule,
  update, pause, resume and cancel only for the source room's tasks;
  drop the assign_room and refresh_groups IPC tasks and the deps they
  needed (assignRoom/syncGroups/getAvailableGroups/writeGroupsSnapshot)
- DB/host evidence is always scoped to the source group folder
- runner MCP server: drop the assign_room tool, the target_group_jid
  parameters and the isMain flag; list_tasks shows only the room's tasks
- drop EJCLAW_IS_MAIN, RunnerInput.isMain and AgentInput.isMain; the
  global CLAUDE.md memory is now included for every room
- drop the available_groups.json snapshot (available-groups.ts), the
  inferred restart announcement that only went to the main room, and
  the unused Channel.syncGroups hook
- setup register: drop --is-main; deregister-room: drop the main-room
  refusal and --force, and fix its unknown[] binding type error
- remove the groups/main/ template

The room_settings.is_main column and migrations are untouched; new rows
get the column default (0) and nothing reads it anymore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-10-01 19:37:29 +09:00
parent ce4547daa6
commit f127ac7a2b
62 changed files with 136 additions and 1412 deletions

View File

@@ -53,6 +53,11 @@ Discord ──► SQLite (WAL) ──► GroupQueue ──┬──► Owner (ho
paired_turn_outputs Discord display
```
## 방 격리와 작업 중단
- 모든 방은 동등합니다. main(관리) 방 개념은 없으며, 각 방의 에이전트가 IPC로 할 수 있는 일(메시지 전송·inbound 주입, 예약 작업 생성/수정/일시정지/취소, DB·호스트 증거 조회)은 자기 방(같은 group folder)으로만 제한됩니다. 방 등록/변경은 호스트 셸(`setup --step register`, `scripts/deregister-room.ts`)에서 합니다.
- 사람이 "그만"·"멈춰"·"stop" 같은 중단 의도만 담긴 짧은 메시지를 보내면 메시지 루프(`src/message-runtime-dispatch.ts` → `src/room-stop.ts`)가 가로채, 커서를 그 메시지까지 넘기고 열린 paired task를 `user_stopped`로 닫은 뒤 `GroupQueue.closeStdin`(사유 `user-stop`) + `killProcess`로 실행 중인 에이전트를 끝냅니다. 판정 규칙은 `src/stop-intent.ts`에 있습니다.
## Tribunal 역할 분리
| 역할 | 기본 선택 | 설명 |
@@ -101,6 +106,7 @@ Discord ──► SQLite (WAL) ──► GroupQueue ──┬──► Owner (ho
| --- | --- |
| `src/index.ts` | 전체 오케스트레이션 진입점 |
| `src/message-runtime.ts` | 메시지 루프, paired flow 연결 |
| `src/room-stop.ts`, `src/stop-intent.ts` | 자연어 작업 중단 |
| `src/message-turn-controller.ts` | progress / final delivery 제어 |
| `src/paired-execution-context.ts` | owner / reviewer / arbiter 실행 준비 |
| `src/paired-workspace-manager.ts` | owner / reviewer workspace 관리 |