Skip to content

End a delegated letter's raise once the child takes up a later request - #861

Merged
yansfil merged 1 commit into
mainfrom
fix/escalation-undelivered-clear
Oct 9, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/escalation-undelivered-clear

Conversation

@yansfil

@yansfil yansfil commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

위임된 자식이 부모에게 보낸 request/block 편지가 undelivered(또는 부모 쪽 hold)가 되면 자식이 Needs You로 올라간다.
지금까지는 자식이 답 없이 일을 이어가도 working인 동안만 가려지고, 멈추면 같은 편지 때문에 다시 올라왔다.
docs/status-model.md는 "Working activity ... clears any cause"라고 적어 코드와 어긋났다.
이제 편지보다 늦게 쓰인 요청(운영자 입력이나 다른 편지)을 자식 세션이 받아 새 턴을 시작하면, 그 편지에서 생긴 승격(Undelivered, ParentBlocked, Draft, BellExhausted)은 영구히 풀린다.
ChildBlocked와 watch 승격(ObserverUnconfirmed)은 그대로다.

실제 사례(2026-10-09): letter-3078(block, 02:27 작성, 03:27 undelivered) 뒤에 자식 세션은 다른 편지로 여러 번 깨어나 PR #818을 머지했고, 05:49에 멈춘 뒤 Needs You에 남아 있었다.
이 세션의 마지막 요청 기록(other_request.at_unix_ms)은 편지보다 약 2.5시간 늦으므로, 이 변경 뒤에는 이 자식이 올라가지 않는다.

Review

  • 판단해 주세요: "새 활동 에피소드"를 Herdr의 working 전이가 아니라 세션 기록에 남은 새 요청으로 판정했다. 멈춘 에이전트는 새 입력이 있어야 다시 일하므로 같은 사실이다. 재시작 뒤에도 영속되는 기록(labels.json, 디바이스는 helper가 transcript를 다시 읽음)에서 나오고, 새 상태나 시계를 만들지 않는다.
  • 판단해 주세요: 편지를 쓴 그 턴 안에서 자식이 멈추지 않고 계속 일한 경우(새 요청 없음)에는 승격이 그대로 남는다. 세션을 읽지 못하는 에이전트도 기존처럼 수신, 답장, 취소, 만료 전까지 승격이 남는다.
  • 조심해서 볼 파일: herdr-core/src/agent_state/escalation.rs - of()는 runtime mutex 안에서 프로젝션마다 돈다. 추가 작업은 편지마다 행의 요청 시각 두 개를 비교하는 것뿐이다.
  • 질문: 디바이스 자식은 transcript 시각(디바이스 시계)을 Mac이 찍은 편지 시각과 비교한다. 편지를 쓴 턴이 시작된 지 몇 초 안에 편지를 보내고 시계가 그보다 더 어긋나면 잘못 풀릴 수 있다. 감수할 만한가?

Evidence

  • 확인한 것: escalation::tests에 새 테스트 하나를 더했다. 네 원인 각각에 대해, 그리고 운영자 요청과 다른 에이전트 요청 각각에 대해 다음을 단언한다. 편지 이전이나 같은 시각의 요청으로는 승격이 남는다. 이후 요청이 생기면 working 중에 사라지고, 다시 멈춰도 돌아오지 않는다. 메뉴 blocked는 여전히 ChildBlocked로 올라간다.
  • 확인한 것: 결함을 일부러 심어 확인했다. 새 조건을 지우면 "does not come back when the child stops again"에서 실패하고, >를 >=로 바꾸면 "no later than the letter"에서 실패한다.
  • 확인한 것: scripts/verify-cargo.sh nextest --profile ci -p herdr-core에서 1814개가 통과하고 0개가 실패했다. scripts/verify-cargo.sh lint(fmt, clippy)와 policy lane의 구조 검사 7개도 통과했다.
  • 확인하지 못한 것: 실행 중인 앱에서 해당 자식 행이 Needs You에서 빠지는지는 확인하지 않았다. 설치된 앱은 운영자의 것이라 교체하지 않았다. 사례 판정은 로컬 ledger와 labels.json의 실제 값으로만 대조했다.
  • 확인하지 못한 것: 워크스페이스 전체 verify-cargo.sh test는 로컬에서 돌리지 않았다. 바뀐 크레이트는 herdr-core 하나뿐이고, 나머지는 CI rust lane에 맡긴다.

A child whose request or block letter went undelivered, or was held for
its parent, stayed in Needs You after it carried on without the answer
and stopped again: working activity only hid the raise. The letter now
stops raising once the child's session records a request written after
it, read from the session facts the label store keeps across restarts.
@yansfil
yansfil merged commit 9e97eac into main Oct 9, 2026
20 checks passed
@yansfil
yansfil deleted the fix/escalation-undelivered-clear branch October 9, 2026 05:20
yansfil added a commit that referenced this pull request Oct 9, 2026
Related: PRD `agents/prd/agent-hierarchy-screens/prd.md` · 같은 영역의 직전 작업
#861, #862, #869 · 막힘 상태 #890 위에 합침

## Summary

- 하위 어디서 막히든 그 계보의 루트 한 줄이 사이드바와 Sessions의 Needs You에 오르고, 막힌 자손은 따로 오르지
않는다.
- 승격 줄과 pane header band는 원인별 동사(승인 · 답변 · 확인 · 초안), 무엇을, 누가 순서로 쓰고,
Open은 손댈 pane으로 간다.
- 자식은 사이드바, Home, Sessions 어디서나 같은 트리로 보인다. 손자까지 레일로 들여쓰고, 접힌 행은 자손
표시(`! N`, `● N`)를, 행마다 PR 아이콘 하나를 단다.
- 트리 팝오버가 증손 이하와 `외 N건`을 열고, 끝나고 읽은 자식은 `끝난 자식 N` 아래로 접힌다.
- Sessions는 사이드바와 같은 이름의 그룹(Needs You · Working · Done · Idle · Resolved
24h)으로 바뀌고, Factory 카드도 같은 자손 표시를 쓴다.
- #890의 막힘(▲), 멈춤(◐), 대기를 트리에 합쳤다. 막힘은 동사 대신 원인 문장을 두 번째 줄에 남기고, 읽은 막힘은
새로 올라온 ask에 자리를 내준다.

![사이드바 트리: 루트 아래 자식과 손자가 레일로 이어지고, 행마다 PR 아이콘과 접힌 자손 표시가 붙는다 (gallery,
Light)](https://github.com/yansfil/pr-assets/blob/main/hide/agent-hierarchy-screens/41c2939/sidebar-tree-more-open-light.png?raw=true)

## Review

- **판단해 주세요**: 열린 checkout 행의 목적 줄이 사라졌다(B35). 트리가 그 자리를 쓰기 때문인데, 접힌
checkout에서만 목적을 보는 것으로 충분한지.
- **판단해 주세요**: 트리 행은 한 줄이라(B14), 읽은 AI 질문의 요청 줄과 #890의 "대기 · …", "멈춤 ·
…" 줄은 트리에 남지 않는다. 막힘의 원인 줄만 남긴다(#890 B2).
- **판단해 주세요**: 접힌 부모의 자손 표시는 올라온 ask와 일하는 자손만 센다(D-40). #890이 배지에 세던 막힌
자식 수는 트리를 펼쳐야 보인다.
- **조심해서 볼 파일**: `herdr-core/src/agent_state/escalation.rs` - snapshot
wire(`RaisedAsk.raised_pane_id`)와 승격 판단이 바뀐다. 원인별 동사와 미수신 문구가 여기서 정해진다.
- **조심해서 볼 파일**: `herdr-core/src/agent_state/turn.rs` - `demand_verb`가
읽은 AI 질문과 읽은 막힘을 루트의 할 일에서 뺀다. #890과 합친 자리라 행 표시, 마크 색, Needs You 판단이
여기서 갈린다.
- **조심해서 볼 파일**: `herdr-core/src/agent_state/tally/scope.rs` - runtime
mutex 안에서 checkout마다 사이드바 트리를 만든다. 한 번만 만들도록 중복 호출을 지웠다.
- **조심해서 볼 파일**: `web/src/components/agent-tree-popover.tsx`,
`web/src/PaneHeaderBand.tsx` - 묻는 행을 `raised_pane_id`로 찾고, 연결 안 된 기기의
Open을 막는다.
- **비용 검토**: 승격 lift는 행마다 조상을 다시 걷는다(계보 깊이에 비례). 고빈도 경로의 입력당 작업은 늘지 않고,
publish는 상태 전이 때만 일어난다.

## Evidence

- **확인한 것**: 결정적 verify(`verify-cargo.sh test`, `lint`)가 #890을 합친 head에서
PASS. herdr-core 1884개, hided 포함 2299개 통과.
- **확인한 것**: `verify-web.sh` 웹 1326개(1 skip), desktop unit 162개 통과.
`check-design-contract.mjs` 통과.
- **확인한 것**: #890을 합친 뒤 blocked-state, sidebar-status, session-panel,
projects-sidebar, overview, session-readers, lineage-session e2e 통과.
- **확인한 것**: web e2e 전체 249개 중 246개가 #890을 합치기 전 head에서 통과했고, 실패 3개는 고친
뒤 재실행에서 통과. 합친 뒤 전체 실행은 CI가 맡는다.
- **확인한 것**: desktop e2e 전체 67개 중 58개 통과, 8개 skip, 1개(session-labels)는
B14에 맞춰 옮긴 뒤 단독 재실행 통과.
- **확인한 것**: design review가 pane-header, session-panel,
projects-sidebar에서 Pen r2 대비 Light/Dark 모두 PASS(합친 뒤 다시 실행).
- **확인한 것**: 승인된 디자인 후속(Dark 팝오버 레일 토큰 강화, Light PR 아이콘에서 빨강과 주황 구분)이 실제
화면 캡처로 확인됨.
- **확인하지 못한 것**: 설치된 앱(`/Applications/hide.app`)에서의 실제 계보 확인은 하지 않았다.
지시상 설치와 실행을 하지 않았고, 확인은 gallery, e2e fixture, 격리된 Herdr로 했다.
- **확인하지 못한 것**: 로컬 cargo test 중
`bell_intake::the_bell_turn_receives_the_letter_bodies_and_confirms_them`(이
PR이 손대지 않은 crate)이 부하 중 한 번 실패했다. 단독 8회는 모두 통과.
- **확인하지 못한 것**: 이 Mac의 전역 commit 서명 때문에 hide-host git 테스트와
`cmdk.spec:215`가 로컬에서만 실패하고, 서명을 끄면 통과한다. CI는 영향 없다.
- **생성물**: `design/hide-screens.pen`은 main의 파일에서 합친 생성기로 다시 만들었다. 한쪽만 바꾼
시트는 그쪽과 같다. gallery fixture(`agentScopes.json`, `agentStates.json`)도
diff가 크다.

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

![Sessions: 승인된 Pen r2(왼쪽), 현재 Pen, 실제 화면(오른쪽). Needs You · Working ·
Done · Idle 그룹
(Light)](https://github.com/yansfil/pr-assets/blob/main/hide/agent-hierarchy-screens/41c2939/sfu-panel-l.png?raw=true)

![Pane header: 원인별 band와 조상 경로, Pen r2 대비 실제
(Dark)](https://github.com/yansfil/pr-assets/blob/main/hide/agent-hierarchy-screens/41c2939/sfu-ph-board-d.png?raw=true)

후속으로 남긴 것:
- 다시 뿌리를 옮긴 트리 팝오버에 원래 부모로 돌아가는 길이 없다.
- 세 단계보다 깊은 곳에서 올라온 ask는 팝오버에서 손자의 자손 표시로만 보인다(트리는 2단계, D-12).
- 여러 PR 목록 hover는 포인터로만 고를 수 있고, 키보드로는 닿지 않는다.
- band hover 문구("경로 다음 checkout · N분째 동사 대기")를 단위 테스트가 확인하지 않는다.
- 분 단위 문구는 snapshot 사이에 멈춰 있고, `agentScopes.json`에는 옛 sessions/work 모양이
남아 있다.
- `lift`는 행마다 조상을 다시 계산한다(`lineage_path_pane_ids`로 줄일 수 있음). 트리 레일의
`border-l-2`는 토큰이 아닌 폭이다.
- 자동 Resolve가 `wait`(백그라운드 작업, 답장 대기)를 보지 않는다. 막힘 band의 `+N`은 팝오버를 열지
못한다. 요청 집계(`scope.rs` VERBS)에 `blocked`가 없다(main과 같음).

</details>

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

- PRD: `agents/prd/agent-hierarchy-screens/prd.md` (sha256
68f370e815271d2cb5a8c6fe4f549a64fd3088a3ac45a7f44129f7981769361f)
- Base ec61754 → head 36feb61, verified 2026-10-09T18:49:50.900Z: PASS
- Verification report:
`agents/runs/agent-hierarchy-screens/verification-report.json` and
`agents/runs/agent-hierarchy-screens/verification-report.md`; source
fingerprint
9fe3702577bf19b095ae8c67820fbe23cb686760563c2158181227bea553b678
- Suites:
  - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0)
  - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0)
- Reviews:
- Fidelity + Code (first, head 5195edd): Fix now were the e2e selectors
to port, Draft asks keyed by the named pane, Home trees, the band's Open
while disconnected, the hover path repeat, read-question demand, the B18
finished fold, the multi-PR hover list, the native-question verb,
grandchild ArrowRight, the duplicate sidebar tree build and broad store
reads. All fixed in e51ba10..ee42827.
- Fidelity + Code (follow-up, head ee42827): all 13 prior items fixed
(B18 partial). Fix now: a child's own native question claimed its parent
had not received it; fixed in 0890706 with a test. Also fixed: the
finished fold hiding a raised descendant, a draft's Open checking the
wrong device, a vacuous e2e assertion. Follow-ups are listed above.
- Merge resolution review (head 5d0b1f2, merge of main with #890):
nothing from #890 dropped. Fix now: a read block hid a newer raised ask,
and a waiting raised root drew its ask in working blue; both fixed in
36feb61 with a test. Also fixed: a read block's cause in Sessions, ja
Idle group word, stale band and Resolved docs.
- Evidence: none registered separately.
- Changed paths: 95 (see Files changed)
- Delivery: mode pr, branch `gen-prd/agent-hierarchy-screens`, base
`main`

</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