Skip to content

feat: hand plan steps to child agents with checked finish conditions - #1900

Merged
yansfil merged 14 commits into
mainfrom
feat/plan-step-delegation-core
Oct 30, 2026
Merged

yansfil merged 14 commits into
mainfrom
feat/plan-step-delegation-core

Conversation

@yansfil

@yansfil yansfil commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 에이전트가 자기 계획의 결과물 단계를 다른 Hide 에이전트에게 맡길 수 있습니다: hide agent spawn --parent here --plan-node <key>.
  • 단계 상태를 바꾸는 모든 길(plan node, plan set)이 한 검사를 거칩니다: 앞 단계 순서, 결과물 증거(--pr/--file), 맡긴 단계는 자식의 보고.
  • 자식의 보고 옴/막힘/닫힘은 단계에 저장되어 스냅샷으로 나가고, 한 메인의 계획 자식은 동시에 3개까지입니다.
  • hide plan help, 세션 시작 안내 표, hide guide, 소유 문서를 같은 PR에서 고쳤습니다. 화면은 이 위에 쌓일 web PR이 맡습니다.

스크린샷 없음: core only, screens are the stacked web PR

Review

  • 판단해 주세요: 맡긴 file 단계는 자식 보고만으로 done이 됩니다(파일은 메인이 가져오기 전까지 자식 브랜치에 있음).
  • 판단해 주세요: 계약에 없던 거절 코드 2개를 더했습니다: plan_node_finished(끝난 단계를 맡김), plan_file_unconfirmed(파일을 지금 읽지 못함).
  • 판단해 주세요: delegation.agent_id는 자식이 등록되기 전까지 null입니다.
  • 조심해서 볼 파일:
    • herdr-core/src/plans.rs (judge, PlanProof::run) - failure path: PR과 파일 확인은 잠금 밖, 답을 가지고 다시 판정
    • hided/src/core.rs plan() - runtime mutex: 증거 읽기는 request thread에서, 최대 3회
    • herdr-core/src/runtime/plans.rs fold_delegations - high-frequency path: publish_delivery마다 돎
    • herdr-core/src/coordination/mod.rs reserve - 상한 3을 ledger 잠금 안에서 셈
    • herdr-core/src/plans.rs StepView, contracts/snapshot-wire-enums.json, web/src/snapshot.ts - snapshot wire
  • 비용 검토: fold는 계획에 묶인 spawn이 없으면 바로 끝나고, 있으면 단계마다 마지막으로 읽은 편지 뒤의 편지만 봅니다.
  • 비용 검토: refresh_plans 캐시 키에 자식의 pane과 세션을 더해, 자식이 움직일 때만 뷰를 다시 만듭니다.
  • 판단해 주세요: PR이 세션 것인지는 체크아웃의 현재 브랜치, 그 밖의 로컬 브랜치(노드의 HasLocalBranch), 자식 브랜치로 봅니다. 기존 명령이라 helper 프로토콜은 그대로입니다.
  • 질문: 잠든 자식을 깨우는 편지의 상한 검사는 prepare_delivery에서 합니다. 같은 순간에 spawn이 겹치면 자식 하나가 끝날 때까지 잠깐 4개가 될 수 있는데, 받아들여도 될까요?

Evidence

  • 확인한 것: 새 테스트 20개(core 판정, runtime 위임 흐름, 상한, B6 깨우기와 끝나는 중인 자식, CLI 파싱, help 예시가 set을 통과함).
  • 확인한 것: cb4a25074에서 verify-cargo.sh test-scoped(테스트 바이너리 45개)와 verify-web.sh(web 2309, desktop 302) 통과, verify-cargo.sh lint 통과.
  • 확인한 것: 끝나는 중인 자식을 세는 테스트는 고치기 전 규칙에서 실패하는 것을 확인했습니다.
  • 확인한 것: hided CLI/contract 테스트 21개, hide-agent-hooks와 hide-kit 611개(1개는 부하 중 시간 초과였고 단독 재실행에서 통과).
  • 확인한 것: check-capability-readers-off-lock, check-core-touches-no-machine, check-no-attribution, check-no-workstation-identity 통과.
  • 확인하지 못한 것: 이 컴퓨터의 셸은 pnpm 12를 먼저 잡아 verify-web.sh 설치가 거부되므로, pnpm 10을 PATH 앞에 두고 돌렸습니다(CI와 같은 버전).
  • 확인하지 못한 것: 격리된 후보 앱으로 한 네이티브 QA는 하지 않았습니다. 기기 helper 경로(B24)는 가짜 NodeLink 단위 테스트로만, 실제 gh 호출은 가짜로만 확인했습니다.
  • 확인하지 못한 것: Windows와 Linux는 CI lane이 확인합니다.
  • web 변경은 wire 타입 때문에 바뀐 snapshot.ts와 테스트·갤러리 fixture 6개뿐입니다. hided-ws.schema.json에는 plans 섹션이 없어 그대로 둡니다.
Verification record

yansfil added a commit that referenced this pull request Oct 30, 2026
…undary (#1912)

## 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>` and `hide 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 … --force` puts 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 with `composer_not_empty`
and nothing is typed or recorded.
- A refusal is one JSON line with the reason and the next step, and a
non-zero exit.

스크린샷 없음: 화면을 바꾸지 않음 (CLI 명령과 에이전트 안내 문구만 바뀜)

```
$ hide request send w1:p1 --intent … --kind report --body "…" --force   # agent working, input empty
{"ok":true,"result":{"id":"letter-1","forced":true,…}}
$ hide request send w1:p1 … --force                                       # "half typed words" in the input
{"ok":false,"reason":"composer_not_empty","next_action":"Someone is typing in the recipient's input, so nothing was typed or recorded; send it again without --force, and it is delivered once they submit"}
$ hide pane read w1:p1 --lines 2001
{"ok":false,"error":{"code":"lines_out_of_range","message":"Pass --lines from 1 to 2000"}}
```

## Review

- **판단해 주세요**: `--force` checks 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
`--now` letter (`delivery.forced_deferred` in the log). Is staying as a
letter the right outcome there?
- **결정됨 (PRD D-14)**: an agent kind whose hook takes letters at tool
calls (five kinds, `tool_letters` in `hide_agent_adapter`) gets a forced
letter at its next tool call, as `--now` already 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
under `Mutex<Runtime>`: caller proof, target pane or agent, engine
handle; every Herdr call runs after the lock in
`herdr-core/src/pane_command.rs` `Prepared::run`.
- **조심해서 볼 파일**: `hide-agent-hooks/src/install.rs`
`Quoting::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 new `pane` scoped 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.
- **비용 검토**: no resident work. Each command is one request; `pane open`
polls 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
test` on 4bf7815: 6,555 tests passed, 0 failed (45 binaries); rerun on
the final commit is recorded on the mission.
- **확인한 것**: one live run per command on an isolated Herdr 0.9.5 with
this branch's hided (0c56889) and one agent of a kind without
tool-call letters, busy on a sleep job:
- `--force` while it worked: the bell line was typed at once, the letter
went to delivered with the hook's receipt, and the agent kept working.
- `--force` after typing "half typed words" into its input: refused
`composer_not_empty`, exit 2; the draft stayed and the refused text
never appeared.
- `pane read` and `agent read` returned the agent's screen; `agent read`
names pane `w1:p1`.
- `pane open --beside -- sh -c 'echo X spaced'` ran in a new pane of the
same tab with its script as one argument (printed `X spaced`), and focus
did not move.
- `pane send` without `--enter` typed but did not run the line; with
`--enter` it ran.
  - `workspace purpose` set the workspace's `purpose` token.
- Refused with exit 2, reason and next step: 2,001 lines, an unknown
pane, an unknown agent, a 41-character purpose, a 16 KiB + 1 send;
without a pane credential it was refused `checkout_not_registered`.
- The run cleaned up its processes, socket and probe; the config guard
restored nothing and reported no change of its own.
- **확인한 것**: the input race is pinned by runtime tests: typed into a
working agent over an empty input; text in the input at typing time
keeps it as a letter; text at send time refuses and records nothing; a
deferred letter is held as `draft` for text and `composer_unconfirmed`
for an unread screen.
- **확인한 것**: runtime tests pin how a command finds its target: an agent
by name, registration id or pane, `target_ambiguous` for two of one
name, `remote:<device>:pane:<id>` on that device's engine, the purpose's
engine workspace or `purpose_no_workspace`, and `caller_context_changed`
/ `pane_required`.
- **확인한 것**: `scripts/check-engine-boundary.py` passes with its
allow-list unchanged; tests pin that the session-start note, `hide
guide` and `hide mission help` name no Herdr, and that every command
they teach is in `contracts/hide-cli.json`.
- **확인하지 못한 것**: the second input check (someone starts typing between
the send and the typing) was not reproduced live; only the runtime test
covers it.
- **확인하지 못한 것**: forced letters were run live into one agent kind only,
and the commands only on macOS; Linux and Windows run them in this PR's
CI lanes.
- **확인하지 못한 것**: commands against a connected device's pane
(`remote:<device>:pane:<id>`) were not run live.

<details><summary>Verification record</summary>

- Base: origin/main 83ac3ea; head: see the PR.
- Overlap: #1900 and #1899 touch `contracts/hide-cli.json`,
`docs/agent-hooks.md`, `hide-agent-hooks/src/runtime.rs` and
`hided/src/cli.rs`; merge-order says stay, merge main once after each
lands.

</details>
@yansfil
yansfil merged commit cb4a85e into main Oct 30, 2026
42 checks passed
@yansfil
yansfil deleted the feat/plan-step-delegation-core branch October 30, 2026 23:01
yansfil added a commit that referenced this pull request Oct 30, 2026
…map (#1909)

Related: #1900 (core, this PR stacks on it)

## Summary

Hide plan step delegation, the screen half: the pane head plan chip's
popover and the 보기 slot's plan map now show who does each step and what
each finished step left.
A handed step names its child agent and the child's current step, and
pressing the name goes to the child's pane.
보고 옴, 맡길 예정, 막힘 and 닫힘 are short words where the step's tail goes; every
map card has two lines of one height (누가 · 지금 뭐).
A handed card opens on the child's own checklist with 터미널로 이동, and a
finished plan's popover lists every step instead of folding them.

![팝오버와 보기 칸 지도: 맡긴 단계 줄, 두 줄 카드, 맡긴 카드 상세의 자식 계획
목록](https://github.com/yansfil/pr-assets/blob/main/hide/feat-plan-step-delegation-web/8fb1f3b/plan-delegate-web-ko-detail-v2.png?raw=true)

## Review

- **판단해 주세요**: 목업의 `일하는 중`은 용어집이 은퇴시킨 말이라 상세의 상태는 `작업 중`(용어집 단어)으로 씁니다.
- **판단해 주세요**: 맡긴 카드 상세의 이동 버튼은 이름 뒤 조사 문제를 피해 기존 문구 `터미널로 이동 ›`을 그대로
씁니다(이름은 바로 위 "맡은 에이전트"에 있음).
- **판단해 주세요**: 맡긴 단계가 증거 없이(output none) 끝나면 꼬리에 `보고`를 씁니다(목업의 리뷰 줄). 맡길
예정 카드는 아직 에이전트가 없어 이름표 없이 `맡길 예정 · <단계> 기다림`만 씁니다.
- **조심해서 볼 파일**: `web/src/plans.ts` - 맡김 낱말, 증거, 자식 계획
찾기(`delegation.session`)를 한 곳에서 정합니다; 화면 세 곳이 이 값을 읽습니다.
- **조심해서 볼 파일**: `web/src/PanePlanChip.tsx` - `맡긴 일 N`은 단계에 붙은
자식(`delegation.pane_id`)을 뺀 직접 자식만 셉니다. 새 wire 필드는 없습니다.

## Evidence

- **확인한 것**: vitest `PanePlanChip.test.tsx` 10개 통과. 새 셋은 맡긴 줄(자식 지금
단계·이름표·보고 옴/막힘/닫힘, 이름 누르면 `focus_pane` c1), 두 줄 카드와 상세의 자식 체크리스트·터미널로
이동, 계획 없는 자식과 시작 중 자식(n/m·이동 없음)을 봅니다.
- **확인한 것**: 끝난 계획 팝오버가 모든 단계를 증거(`delegate-spec.md`, `#1879`), 옛 단계의
종류, 맡았던 이름과 함께 보이고 머리가 `… · took 2h`인 것.
- **확인한 것**: 갤러리 `scene=plan&state=delegated|delegated-finished`를
한국어·영어, 팝오버 폭(360)·카드 폭(224)에서 캡처; 긴 단계 이름은 팝오버에서 줄바꿈, 카드에서 말줄임으로 겹치지
않음.
- **확인한 것**: `node scripts/check-design-contract.mjs` 통과(토큰, 대비, 로고, UI
부품 수).
- **확인하지 못한 것**: 실제 core가 보낸 맡김 스냅샷으로 격리 후보 앱을 띄운 화면은 찍지 않았습니다. 캡처는 같은
컴포넌트를 쓰는 갤러리입니다. 중국어·일본어 화면은 문구만 넣고 캡처하지 않았습니다. Light 테마 미확인.

<details><summary>추가 증거</summary>

![끝난 계획: 팝오버가 모든 단계를 증거와 맡았던 에이전트와 함께
보임](https://github.com/yansfil/pr-assets/blob/main/hide/feat-plan-step-delegation-web/f03b26c/plan-delegate-web-pr-plan-delegated-finished-ko.png?raw=true)

![English: 맡길 예정 카드와 그
상세](https://github.com/yansfil/pr-assets/blob/main/hide/feat-plan-step-delegation-web/f03b26c/plan-delegate-web-pr-plan-delegated-en.png?raw=true)

</details>

<details><summary>Verification record</summary>

</details>
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 노드가 붙인다.

![Desk room in the isolated candidate: a fake Claude adapter asks to run
touch note.txt and the approval card
waits](https://github.com/yansfil/pr-assets/blob/main/hide/feat-desk-host/115b825/desk-approval.png?raw=true)

![Eight Desk starts on a device that does not exist: each card failed
with its reason and Try
again](https://github.com/yansfil/pr-assets/blob/main/hide/feat-desk-host/115b825/desk-jobs-after.png?raw=true)

## 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>
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.

1 participant