Repository navigation
feat: add hide pane commands and forced letters through the engine boundary - #1912
Merged
Merged
Conversation
# Conflicts: # hided/src/cli.rs
yansfil
added a commit
that referenced
this pull request
Oct 31, 2026
… through hide (#1913) Related: #1907 (Desk 화면 부품, 머지됨). 이 PR이 그 부품을 앱에 연결한다. ## Summary Desk 방이다(PRD Desk 1차 B1-B24, B36-B40). 사이드바 맨 위 `◆ Desk` 줄을 누르면 가운데에 Desk 채팅이 열린다. 운영자가 고른 에이전트(Claude 또는 Pi)와 ACP로 대화한다. 그 에이전트는 hide 명령으로 세션을 띄우고 따라가며, 승인 카드는 hided가 결정한다. Desk가 띄운 세션은 운영자 소유 탭으로 체크아웃의 `◆ Desk` 그룹에 들어간다. 상한 8과 대기열, 일 카드 상태, `hide agent archive`, Settings › Desk가 함께 들어 있다. Codex는 운영자 설정이 섞이고 샌드박스가 hide를 막아서 아직 고를 수 없게 두었다(공백, 아래 Review). lane(Threads, 결과물, ⌘J)은 lane 노드가 붙인다.   ## Review - **판단해 주세요**: 화면 연결에서 정한 것. - lane이 붙기 전에는 카드, 세션 칩, 편지 줄을 누르면 그 세션의 탭이 열린다. lane 노드가 스레드 칸으로 바꾼다. - 알림의 `다시 시도`는 운영자의 마지막 말을 그대로 다시 보낸다. 코어에 재시도 이벤트가 없어서다. - 대화가 64장 넘게 전의 카드를 가리키면 그 카드 줄은 그리지 않는다. `desk_jobs`는 최신 64장만 보내기 때문이다. - 📎(첨부)는 `desk_send`가 첨부를 받지 않아서 보이지 않게 했다. - 보낸 말은 대화에 나타난 뒤에 입력창에서 지운다. 코어가 거절하면 말이 입력창에 남는다. - **판단해 주세요**: Claude의 plan 모드를 Desk에서 막았다(리뷰 7). - 실제 어댑터에서 EnterPlanMode는 권한을 묻지 않고 바로 plan 모드로 바꿨다. - 그러면 Desk는 ask 모드를 벗어났다고 세션을 끝내고 Claude를 `묻기 모드 없음`으로 표시했다. hided를 다시 켤 때까지 Claude를 고를 수 없게 된다. - 세션 설정에 `deny: ["EnterPlanMode"]`를 넣었다. 다시 확인하니 도구 목록에서 빠졌고 세션은 ask 모드에 남았다(7381e90). - 벗어난 세션을 끝내는 안전장치는 그대로 둔다. - **화면 연결, 재리뷰, verify에서 찾아 고친 결함 일곱**: - Desk가 부르는 spawn과 request가 모두 `reserved_name`으로 거절되고 있었다. Desk의 이름 `hide:desk`가 Factory 이름 막기에 걸렸기 때문이다. Hide가 만든 신원은 제 이름을 쓸 수 있게 했다(a503ded). - 코어 테스트는 Desk의 접수 함수를 직접 불렀고, c2 확인은 가짜 hide를 썼다. 그래서 둘 다 이 경로를 지나지 않았다. 이제 `prepare_delivery`를 Desk 호출자로 지나는 테스트가 있다. - 카드만 바뀌는 이벤트(취소, 다시 맡기기, 읽음)에도 대화 구획 `desk`를 다시 보내고 있었다. 이제 `desk_jobs`만 간다(a503ded). - `@` 메뉴의 프로젝트가 등록 id로 가고 있었다. Desk의 에이전트는 `@project(<경로> <이름>)`를 `--repo`로 넘기고, 화면은 그 경로로 체크아웃을 찾는다. 그래서 프로젝트를 고른 말은 엉뚱한 `--repo`가 되고 프로젝트 칩은 눌러도 열리지 않았다. 이제 기본 체크아웃의 경로를 보낸다(기본 체크아웃이 없는 폴더 프로젝트는 그 폴더의 경로, 2333ae0). - Desk가 일을 하나도 띄우지 못했다(verify). 모든 spawn이 `parent_unavailable`로 거절되었다. 부모 없는 spawn은 부르는 쪽의 기록을 origin으로 쓰는데, 실제 경로에서는 아무도 `hide:desk`의 기록을 만들지 않았다. Desk 테스트들은 그 기록을 손으로 만들고 시작했고, 화면 확인은 없는 기기로 보내 실패 카드만 봤기 때문에 둘 다 놓쳤다. - 이제 Hide의 신원(`hide:<role>`)이 부모 없이 처음 spawn할 때 executor가 그 기록을 등록하고 origin으로 쓴다. Hide AI가 spawn마다 손으로 부르던 등록은 지웠다(e21bf35). - 새 테스트는 손 등록 없이 Desk 프로세스가 묻는 그대로(`DESK_CALLER`, `prepare_delivery`, 전달 worker) 가짜 기기 Herdr에 spawn한다. 일이 시작되고, 카드가 Working이고, 상한 1에서 다음 spawn이 대기 1번이 된다. 고침을 빼면 이 테스트는 실패한다. - 턴 요약이 실패한 시작도 `세션 n개 시작`으로 셌다(verify). 이제 시작은 spawn이 성공으로 답한 것만 센다(bded951). - 대기 카드가 약 24초 늦게 떴다(verify 2차). spawn은 바로 `queued`로 답했지만 카드 구획은 다음 갱신 때 만들어졌고, 그 변화를 화면에 알리는 일도 없었다. 이제 대기열에 넣는 그 자리에서 카드를 만들고, 잠금을 놓은 뒤 화면에 알린다(5a9bad1). - 탭이 열린 뒤 실패한 시작(에이전트가 제때 brief를 받지 못함)은 탭이 살아 있는데 ◆ Desk 그룹 밖에 있었고 카드는 Failed였다(verify 2차). 그룹에 넣는 일이 child 기록이 묶인 spawn만 보았기 때문이다. 이제 spawn이 만든 pane으로 그룹에 넣는다. 카드는 그 pane의 에이전트가 일하거나 물으면 그 상태를 따르고, 쉬고 있으면 Failed로 남아 그 pane을 연다(4f58ee9). - **판단해 주세요**: 쉬는 에이전트를 `완료`로 보이지 않게 했다. brief를 받지 못했으니 일을 하지 않은 것이고, `다시 시도`가 같은 pane에 brief를 넘긴다. - **판단해 주세요**: Codex는 흐리게만 보이고 고를 수 없다(`not_offered`). - 실제 어댑터로 확인하니 운영자의 `~/.codex/AGENTS.md`, 스킬, MCP를 읽었고 read-only 샌드박스가 루프백을 막아 `hide`가 실패했다. - 닫으려면 Hide 소유 `CODEX_HOME`과 Desk 전용 `codex login`이 필요하다. 로그인이 하나 더 생기는 일이라 운영자 결정을 기다린다(with-hide/hide-private#388). - Codex 어댑터 실행 코드와 권한 분류는 #388에서 쓰므로 지우지 않았다. - **판단해 주세요**: 다른 기기에서 띄운 일의 탭은 `◆ Desk` 그룹 밖, 그 기기가 만든 자리에 둔다(받아들인 공백, `docs/UI_BEHAVIOR.md` Desk's jobs). - **판단해 주세요**: Desk가 카드 없이 실행하는 hide 명령은 코어가 Desk에게 받아 주는 것만 남겼다. - 남긴 것: agent, request, inbox, watch, ps, device list, 그리고 CLI 도움말(guide, contract, status, version). - `hide agent spawn ... -- <인자>`는 카드로 묻고, `--parent`를 단 spawn은 `invalid_request`로 거절한다. - **리뷰가 남긴 '화면 연결 때 볼 점'의 결과**: - WebSearch와 WebFetch: Claude에서 둘 다 `기타` 카드가 떴다(제목과 입력 전문). 거절하니 실행되지 않았다. - plan 모드(7): 위의 판단 항목대로 막았다. - bare hide(10): 운영자의 실제 HOME과 rc로 Claude Bash에서 `which -a hide`를 돌리니 Desk가 준 hide가 첫째, `~/.local/bin/hide`가 둘째였다. rc가 PATH를 다시 만들어도 Desk의 hide가 앞선다. - 일 8개의 전송량: 카드 8장의 `desk_jobs`는 4.4 KB였다. 고친 뒤 카드 하나를 다시 시도하면 그 구획만 간다(4.6 KB 프레임). 대화 구획은 가지 않는다. - 대기열 재시작: 실패 카드 8장과 대화는 hided를 두 번 다시 켜도 그대로였다. 대기 중 카드는 화면에서 만들지 못했다. 자리를 잡으려면 진짜 에이전트를 띄워야 해서다. 대기열 유지는 코어 테스트가 보인다. - **커밋 순서**: - 백엔드: d014181, f37e8df, af1c09f, 057da08, 2ebaf31, 5d0babc, 5f6afb6, 009e47e, ba83093, 04b2af0. - main merge: 9e97b40, 0423cfb, 2df1b56(#1907). - 화면 연결: 345cda0. 확인에서 나온 고침: 7381e90(plan 모드), a503ded(spawn과 구획), 115b825(단수 문구), 9740cad(rustfmt), 266c61a(Settings e2e 목록에 Desk). - main merge: f3e73fd(#1910, #1912). 그 뒤 51bc0d8(갤러리 칩 타입). - 재리뷰: 2333ae0(`@project` 경로), d968b35(DeskScreen 컴포넌트 테스트: 보낸 말 보관, 다시 시도, 예시 줄, 프로젝트 칩). - verify: e21bf35(Desk 기록 등록), bded951(턴 요약의 시작 수), b5cb652(lint). - verify 2차: 5a9bad1(대기 카드 바로), 4f58ee9(실패한 시작의 탭과 카드). - main merge: 7664293(#1900). `hide-cli.json`은 다시 만들었고(main의 `--plan-node` 위에 `hide agent archive`), `docs/delivery.md`와 `agent_cli.rs` 사용법 줄은 둘을 합쳤다. 0045aff1a는 main이 `Command::Spawn`에 더한 `plan`, `plan_node`를 Desk 테스트 fixture에 넣었다. 프로토콜, 스냅샷, 스킬 번호는 이 브랜치가 바꾸지 않았다. - 입력창: #1910이 Enter 전송을 `DeskComposer` 안으로 옮겼다. Desk는 `held`로 보낼 수 없음을 넘기고 `@` 메뉴 키만 처리한다. 메뉴가 막은 키는 보내지 않는다. - 전달: #1912의 `--force` 경로(`forced_through`)와 Desk의 `then`, `answered`를 한 `Prepared`에 함께 두었다. - **조심해서 볼 파일**: - `herdr-core/src/runtime/delivery.rs`: 이름 막기의 예외. Hide가 만든 신원(`code_owned`)만 예외이고, pane은 그런 신원을 주장할 수 없다. - `herdr-core/src/runtime/desk/worker.rs`: runtime mutex 밖의 단일 소유 스레드다. 보고는 짧은 잠금 아래에서 적용된다. - `hide-desk/src/permission.rs`: failure path. 읽지 못한 요청은 실행되지 않고, allow_always는 고르지 않는다. - `herdr-core/src/runtime/desk/jobs.rs`: high-frequency path. `refresh_desk_jobs`가 rest가 바뀐 publish마다 돈다. - `web/src/MarkdownText.tsx`: 답 속 세션 칩을 CodeMirror 위젯으로 그린다. 칩마다 React 루트가 하나이고, 편집기가 놓은 뒤에 내린다. - `web/src/DeskScreen.tsx`: 화면이 가진 것은 쓰는 중인 말과 `@` 메뉴 위치뿐이다. 나머지는 모두 코어의 구획이다. - **비용 검토**: - publish마다 하는 일: 보관 기록, 행, 기기, plan, mission, 열린 View를 한 번 색인하고 카드를 한 번 만든다(최대 64장). - 카드, `@` 메뉴, 답 스트림은 각자 제 구획으로 간다. 대화(`desk`, 최대 2 MiB)는 대화나 방이 바뀔 때만 간다. - 화면은 보이는 카드만 읽음으로 보내고, 카드의 변화마다 한 번만 보낸다. - Desk 프로세스는 하나다. 워커가 소유하고, hided 종료, 새 대화, 다시 시작, 자손 48개나 RSS 4 GiB 상한에서 끝난다. ## Evidence - **확인한 것**: - 격리 후보(사설 HOME, XDG, Hide 상태, Herdr 소켓, 이 브랜치의 debug hided와 웹 셸, Aside 브라우저): Claude 어댑터 자리에 가짜 ACP 에이전트를 두었다. 진짜 에이전트는 띄우지 않았다. - `◆ Desk` 줄로 방이 열렸고, 에이전트 메뉴에서 Codex는 `아직 고를 수 없음`으로 흐렸다. - 메시지를 보내자 `touch note.txt` 승인 카드가 명령, 이유, 두 답과 함께 떴다(위 첫 스크린샷). 거절하니 한 줄로 접혔고 `note.txt`는 생기지 않았다. - hided를 다시 켜자 대화가 남았고, 가짜 에이전트가 이어가기를 못 해 '새로 시작' 줄이 보였다(B11). - 가짜 에이전트가 없는 기기로 spawn 8번을 부르자 카드 8장이 실패와 이유, `다시 시도`로 떴다(위 둘째 스크린샷). 고치기 전에는 8번 모두 `reserved_name`으로 막혀 카드가 없었다. 이 확인은 성공하는 spawn을 보지 않았고, 그 빈틈을 verify가 찾았다(위 결함 넷째). - 끝난 뒤 후보의 hided, Herdr, 가짜 에이전트 프로세스가 남지 않았다(ps). - 실제 어댑터 확인(운영자 HOME, 임시 작업 폴더, 기록만 하는 가짜 hide, 일회용 실행 파일은 지움): WebSearch, WebFetch, plan 모드, `which -a hide`. 끝난 뒤 남은 프로세스가 없었고 전역 설정 파일 해시가 그대로였다. - 이전 c2 확인: Claude와 Pi에서 hide 명령과 파일 읽기는 카드 없이, 편집과 셸 명령은 카드로 물었고 거절하면 실행되지 않았다. - 게이트(0045aff, main cb4a85e merge 뒤): fmt와 clippy, hakari, cargo test 6672개 통과(실패 0), verify-web(웹 2375개, 데스크톱 302개), scripts 단위 테스트 741개, 정적 검사 8개, design contract가 모두 통과했다. CI는 4f58ee9af에서 모두 초록이었다. - verify 2차(b5cb652, 격리 후보 앱): ◆ Desk 그룹 탭, 상한 1의 대기 카드와 취소, 다시 맡기기, 재시작 뒤 순서, 자리가 나면 다음 일이 스스로 시작, 턴 요약, archive 확인 요구가 통과했다. CI도 b5cb652b7에서 모두 초록이었다(Windows 포함). - 새 테스트: `a_spawn_desk_asks_for_starts_with_no_record_made_beforehand_and_takes_its_place`(고침을 빼면 실패함을 확인), `a_turn_tells_the_sessions_it_started_and_not_a_start_that_was_refused`, `a_project_in_the_at_menu_is_named_by_its_primary_checkout_s_path`, `a_queued_spawn_s_card_is_drawn_with_its_answer_and_the_screen_is_told`, `a_start_that_failed_after_its_tab_opened_joins_the_group_and_its_card_follows_the_pane`, `DeskScreen.test.tsx` 4개. - CI(9740cad)의 windows check 실패는 connect_stop 세 테스트가 hided 시작에서 10초를 넘긴 것이다. 같은 시작 코드가 2df1b562d에서 Windows를 통과했고, 차가운 러너의 알려진 flake(with-hide/hide-private#326)로 본다. - **확인하지 못한 것**: - 마지막 두 고침(5a9bad1, 4f58ee9)의 앱 화면 확인. 코어 테스트로 보였고, 그 앞의 b5cb652b7은 verify가 후보 앱에서 통과시켰다(◆ Desk 그룹 탭, 대기 카드와 취소, 다시 맡기기, 재시작 뒤 순서, 턴 요약). - plan 모드 막기의 앱 화면 확인. 실제 어댑터 확인에서 EnterPlanMode가 도구 목록에서 빠지고 세션이 ask 모드에 남는 것은 봤다. 후보 앱 화면에서 Claude에게 계획 모드를 시켜 보는 것은 하지 않았다. - 데스크톱 앱(Electron) 창. 같은 웹 셸을 격리 hided에 붙여 Aside 브라우저로 봤다. - Windows와 Linux에서 진짜 어댑터 실행. 코드는 플랫폼에 중립적이고 CI 레인에서 돈다. - Codex. 고를 수 없게 막아 두었다. - 다른 기기 일의 그룹 배치. 받아들인 공백이다. <details><summary>Verification record</summary> - head 0045aff (main cb4a85e merged in 7664293) - verify-cargo lint 0, hakari 0, test 0 (6672 passed, 0 failed), verify-web 0 (web 2375, desktop 302), scripts unittest 0 (741 ran, 21 skipped), static checks 8 PASS, design contract PASS - isolated candidate: private HOME, XDG_CONFIG_HOME, HIDE state and HERDR_SOCKET_PATH under /tmp; debug hided and web/dist of this branch; fake ACP agent at the Claude adapter path; candidate processes stopped by exact pid, none left - real adapter probe: scratch working folder and adapters, fake hide that records its arguments, global config hashes unchanged, no adapter process left </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agents in a Hide pane were taught to drive panes with Herdr's own CLI (
herdr agent prompt,herdr workspace report-metadata,HERDR_BIN_PATH), which goes around Hide and leaves no letter, reply or retry.This adds the Hide commands that replace them, running through the core's engine boundary, and removes Herdr from everything Hide teaches an agent.
hide pane read <pane>andhide agent read <agent>print a pane's last 120 lines, unwrapped (--lines, at most 2,000).hide pane send <pane> <text>types text and presses Enter only with--enter(at most 16 KiB).hide pane open --beside [--focus] -- <command>runs a command in a new pane beside the caller and prints its id; focus stays unless--focus. Several words after--stay one argument each, quoted for the machine's shell (POSIX, PowerShell on Windows); one word is typed as written.hide workspace purpose <text>sets the checkout's one-line purpose (at most 40 characters).hide request send … --forceputs a letter into the recipient's input now, even while it works, and records it like any letter; while someone's text is in that input it is refused withcomposer_not_emptyand nothing is typed or recorded.스크린샷 없음: 화면을 바꾸지 않음 (CLI 명령과 에이전트 안내 문구만 바뀜)
Review
--forcechecks the input twice, once at send (refuses, records nothing) and again right before typing; if someone started typing in between, the letter is not typed and stays as an ordinary--nowletter (delivery.forced_deferredin the log). Is staying as a letter the right outcome there?tool_lettersinhide_agent_adapter) gets a forced letter at its next tool call, as--nowalready does; only kinds without that hook have it typed into their input mid-turn.herdr-core/src/delivery/doorbell.rs- forced letters skip the working wait, unread turn and draft hold, but still wait on an operator approval or a blocked pane; the composer re-read runs in the pass, off the lock.herdr-core/src/runtime/pane_command.rs- what is read underMutex<Runtime>: caller proof, target pane or agent, engine handle; every Herdr call runs after the lock inherdr-core/src/pane_command.rsPrepared::run.hide-agent-hooks/src/install.rsQuoting::command_line- which characters stay bare and the&PowerShell needs before a quoted program; tested for both shells on every system.hided/src/server.rs- the newpanescoped request type is exempt from the 16 KiB frame limit because a send carries up to 16 KiB of text plus its envelope.hide-agent-hooks/src/runtime.rs,hided/assets/guide.md- the guidance text agents read at session start; the guide skill stub moves to version 4 so installed stubs are rewritten.pane openpolls the new shell at 100 ms for at most 10 s off the lock before typing the command.Evidence
scripts/verify-cargo.sh lint && scripts/verify-cargo.sh teston 4bf7815: 6,555 tests passed, 0 failed (45 binaries); rerun on the final commit is recorded on the mission.--forcewhile it worked: the bell line was typed at once, the letter went to delivered with the hook's receipt, and the agent kept working.--forceafter typing "half typed words" into its input: refusedcomposer_not_empty, exit 2; the draft stayed and the refused text never appeared.pane readandagent readreturned the agent's screen;agent readnames panew1:p1.pane open --beside -- sh -c 'echo X spaced'ran in a new pane of the same tab with its script as one argument (printedX spaced), and focus did not move.pane sendwithout--entertyped but did not run the line; with--enterit ran.workspace purposeset the workspace'spurposetoken.checkout_not_registered.draftfor text andcomposer_unconfirmedfor an unread screen.target_ambiguousfor two of one name,remote:<device>:pane:<id>on that device's engine, the purpose's engine workspace orpurpose_no_workspace, andcaller_context_changed/pane_required.scripts/check-engine-boundary.pypasses with its allow-list unchanged; tests pin that the session-start note,hide guideandhide mission helpname no Herdr, and that every command they teach is incontracts/hide-cli.json.remote:<device>:pane:<id>) were not run live.Verification record
contracts/hide-cli.json,docs/agent-hooks.md,hide-agent-hooks/src/runtime.rsandhided/src/cli.rs; merge-order says stay, merge main once after each lands.