Skip to content

feat: keep each session's own plan and put it up for review - #1568

Merged
yansfil merged 18 commits into
mainfrom
gen-prd/hide-plan
Oct 22, 2026
Merged

yansfil merged 18 commits into
mainfrom
gen-prd/hide-plan

Conversation

@yansfil

@yansfil yansfil commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

에이전트가 자기 일의 계획을 hide plan으로 올리면, Hide가 그 단계를 pane 옆 지도로 그리고 매 프롬프트에 지금 단계를 알려 줍니다.
--ask로 올린 계획은 운영자의 검토를 기다리는 질문이 되어 pane 띠, 사이드바 둘째 줄, 벨, 폰에 같은 길로 뜨고(core는 문구 없이 ask_subject {cause: plan_review, steps}만 보내고 각 화면이 자기 언어로 씁니다), 에이전트가 hide plan approve할 때까지 파일 쓰기와 git commit/git push가 막힙니다.
pane 머리의 옛 작업 칩 자리에 계획 칩(n/m, 검토 중이면 Review)이 생기고, 팝오버는 작은 지도, 크게 ›는 보기 칸의 큰 지도입니다.
계획은 세션 기록과 같은 저장소에 남아 재시작 뒤에도 읽히고, 세션이 지워지면 함께 지워집니다.

English UI: chip Review, band and sidebar say Plan review · 5 steps
검토로 올린 계획(영어 UI): 칩 Review, pane 띠와 사이드바 둘째 줄이 Plan review · 5 steps로 묻습니다. 한국어 UI에서는 계획 검토 · 5단계입니다.

Review

  • 판단해 주세요: B20의 "같은 자리에서 끈다"를 Settings › Agents의 에이전트 스위치로 읽었습니다. 스킬 줄은 읽기 전용이고 스킬마다 끄는 스위치는 없습니다(kit에 그 상태가 없음). 스킬별 스위치가 필요하면 후속으로 나눕니다.
  • 판단해 주세요: 재계획에서 빠진 done 단계는 done인 채 "바뀜"으로 남깁니다(빠진 나머지는 dropped). n/m이 뒤로 가지 않게 하려는 선택입니다.
  • 판단해 주세요: 새 토큰 --size-plan-node-compact: 144(팝오버 작은 지도의 카드 폭).
  • 조심해서 볼 파일: herdr-core/src/runtime/plans.rs - runtime mutex 안의 일. refresh_plan_reviews가 snapshot 경로에서 계획 책이 바뀐 때만 보이는 행에 검토 질문을 다시 얹고, 얹었던 것만 걷어 냅니다.
  • 조심해서 볼 파일: herdr-core/src/agent_state/turn.rs, header.rs, tally.rs - snapshot wire. 행의 ask_subject가 state.line.subject, state.ask.subject, 띠 subject, 벨과 폰 알림의 subject로 그대로 갑니다(ask_subject_cause를 snapshot-wire-enums.json에 등록). 이 행은 detail이 비고 상태 단어만 남습니다.
  • 조심해서 볼 파일: web/public/m/sw.js, web/src/mobile/push.ts - 폰이 닫혀 있어도 알림을 쓰도록 페이지가 {{count}}를 남긴 문구를 서비스 워커에 넘기고, 워커가 단계 수를 채웁니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/snapshot_delta.rs - snapshot wire. 위 호출이 refresh_missions 앞에 들어갑니다.
  • 조심해서 볼 파일: herdr-core/src/links/ - 링크 worker가 유일한 SQLite writer, 스키마 9에 ledger_plans 표(#1565의 8 다음).
  • 조심해서 볼 파일: hide-agent-hooks/src/plan_record.rs, hide-agent-hooks/src/delivery.rs - failure path. PreToolUse는 core를 부르지 않고 pane 기록 파일만 읽습니다. 읽지 못한 계획 요약은 요약만 버리고 편지는 그대로 전합니다.
  • 조심해서 볼 파일: herdr-core/src/dag.rs - 미션 그래프 코드를 옮긴 것(동작 그대로, 미션 테스트 77개 통과).
  • 비용 검토: 고빈도 경로 추가는 snapshot마다 plans.edit 비교 한 번입니다. 계획이 바뀐 publish에서만 행 복사, lineage, 읽음 축을 다시 돕니다. 계획은 128개(PLAN_LIMIT), 단계는 64개(plan_too_large)로 막히고, laid는 보이는 pane으로 잘립니다.

Evidence

  • 확인한 것: 격리된 Herdr와 hided 위의 Playwright e2e web/e2e/plan-review.spec.ts. --ask → 칩 Review, 띠와 사이드바 Plan review · 4 steps(영어 UI), approve → 띠와 사이드바가 비고 1/4, 일하는 단계가 둘째 줄, 순서 거절 plan_order_refused, 2/4, 팝오버 4단계, 크게 › → 보기 칸 큰 지도(아래로 흐름), drop → 칩 사라짐.
  • 확인한 것: 격리된 후보 Electron 창(Playwright renderer capture, 사설 HOME/state/Herdr)에서 아래 화면 네 장. 운영자 앱과 서버는 쓰지 않았습니다.
  • 확인한 것: 핵심 회귀 - 다른 Herdr 이벤트 없이 approve만 해도 검토 질문이 행에서 걷힘(첫 캡처에서 남아 있던 것을 고침, core 테스트로 고정).
  • 확인한 것: core plan/mission 테스트, delivery-envelope 계약 테스트(계획 요약과 힌트 예시), hide-agent-hooks 전체(훅이 hide를 부르지 않고 거절), hided CLI 계약, hide-kit, web 전체(scripts/verify-web.sh), design contract, cargo lint(clippy, fmt).
  • 확인하지 못한 것: OpenCode와 Pi 플러그인 helper의 계획 거절 경로는 테스트가 없습니다(Claude Code CLI 경로만 픽스처로 증명).
  • 확인하지 못한 것: 연결된 기기의 pane(B22), 폰 줄(B24)은 실행해 보지 않았습니다. 같은 질문 행을 읽는다는 것은 코드로만 확인했습니다.
  • 확인하지 못한 것: 실제 macOS 창 크롬과 네이티브 입력(renderer capture만 했습니다).
  • 확인하지 못한 것: 한 번 OpenCode plugin2 테스트 "a terminal that misses an answer…"가 부하 중 실패했고 재실행에서 통과했습니다. 이 변경과 무관해 보입니다.
추가 증거

approve 뒤 묻기가 사라지고 칩 1/5, pane 둘째 줄이 지금 단계와 line
approve 뒤: 묻기가 사라지고 칩 1/5, pane 둘째 줄이 core 이벤트 · 이벤트 쓰는 중.

칩 팝오버: 작은 지도
칩 팝오버: 끝난 단계 채움, 지금 단계 진행색과 Now, 기다리는 단계 점선, PR 꼬리.

크게 ›가 보기 칸에 큰 지도를 연다
크게 ›가 보기 칸에 큰 지도를 엽니다.

Verification record
  • PRD: hide-plan (D-01..D-30, B1..B24), head e52d7f7b7 (main merged four times: 02f9043c0, d55a5218e with feat: keep checkout Git state current with a background fetch and one merge judgment #1564, 68e6fcba4 with feat: let pull request facts and flow changes settle stale session record states #1565, 8a6ca61af with feat: replace the Memory and PRs tools with the Project tool and a sidebar PR list #1567; the last keeps both sides' 보기 items, Plan beside Worktrees and Cost, and 55 shortcut rows).
  • Review band wording moved out of the core (e6e898dc3): the row carries ask_subject, and web, bell and phone word it with plan.askReview; core test compares the wire structure, web tests cover en/ko line, bell and service worker; e2e plan-review.spec.ts passes with the English text; isolated capture replaced.
  • Reviews of e6e898dc3: Code review found a raised ask (a blocked delegated child carrying the subject) would word the label line on its root; 22e41901a carries subject on RaisedAsk to the root's ask, band, turn card and tree popover, with a core test. A plain laid review does not raise on its own (ChildBlocked needs the child's own block), so this was a latent path. Fidelity review: the same popover sites, fixed by the same commit; no other Fix now. Follow-ups: overviewTasks.cardLine reads only ask.what (its one consumer falls back to the subject).
  • sasu implement verify: PASS on e52d7f7b7 (and on 22e41901a, 8a6ca61af); CI verify green on e52d7f7b7 (run 39855795741). The phone's cached words now include the plan review template (mobile.spec.ts expectation, e52d7f7b7). Code review of the 8a6ca61af merge: no Fix now.
  • Earlier: sasu implement verify PASS on 68e6fcba4 (S1 verify-cargo.sh test, S2 verify-cargo.sh lint), and earlier on 02f9043c0 and 7582bce1e.
  • Before the merge, two runs on 3c96a8381 each failed one unrelated timing test under machine load (load average 20 to 28): memory_analysis::...a_linked_node_s_closed_session... and memory_hook::...short_continuations... (Deadline for Empty). Each passed alone, neither file is in this diff.
  • Link store schema: feat: let pull request facts and flow changes settle stale session record states #1565 merged first and took version 8 (closed_result); ledger_plans is version 9, applied after it in the same migration. Code review of the move: no Fix now (a store a pre-merge build of this branch stamped 8 would miss closed_result; only throwaway candidate stores).
  • Fidelity review on 6195d35af: 6 Fix now, 5 fixed (done steps on replan, --json revise route, record 지금 line, waypoints icon, plan_not_yours test), 1 left to the reviewer (B20 per-skill off). Follow-up on 3c96a8381: no Fix now.
  • Code review on 6195d35af: 4 Fix now, all fixed (plan_too_large and --json errors as JSON, review question lifted from shown rows, --json revise route, unreadable plan summary keeps the letters). Follow-up on 3c96a8381: no Fix now.
  • After the merge, Fidelity found that a deleted session's plan item closed the viewing column instead of showing the documents (main's lane-two-columns B13); drop_detail_items fixes it for plans and missions (2b4b5ad79). Both reviews of 02f9043c0..7582bce1e: no Fix now.
  • CI web e2e linux 5/6 (s2.spec.ts shortcut count 53 vs 54 with Show plan) fixed in 7582bce1e.
  • Follow-ups carried: plan context before the restore finishes, skip the row copy when no plan is proposed, remote rows' read mark after a re-lay, bell on a review laid at pull time, ghost steps toward the 64 cap, session precedence after /clear, device clock skew, pane record cleanup, eviction note, OpenCode and Pi helper test, git rebase --continue, a documents-return assertion on the plan delete path, re-reading a record under a dropped plan.
  • Evidence: 5 isolated renderer captures registered (B5, B7, B11, B12, B14); e2e web/e2e/plan-review.spec.ts.

The mission's unknown-key, cycle and upstream walk move to herdr-core/src/dag.rs
so a session's plan can share them. The mission tests pass unchanged
(38 passed: runtime::tests::missions, missions::tests, dag::tests).
Adds hide plan set/node/approve/drop/show, answered by the core over the pane capability. Plans are saved beside the session record in the link store (schema 8) and deleted with the session. A plan put up with --ask lays a question on the agent's row, so the band, the second line and the bell show 계획 검토 · N단계. The prompt hook keeps the core's small plan summary in the pane's record and adds its line to the context. The pre-tool hook reads only that record to refuse writes, commits and pushes under review, a merge by a PR-scope mission worker, and force pushes or rebases in any Hide pane. The plan_context shape is fixed in contracts/delivery-envelope.json and checked from both the core and the hook.
A short stub that sends the agent to hide plan help; the kit writes, observes and removes it with the other two.
…ecord

Adds the plan detail item, prunes it with the session, pins the plan enums and the detail item kinds in the wire contract, and gives the session record the plan as its map draws it.
…ission nodes

The plan chip takes the old task chip's place and ⇧⌘U, its popover is the small map, Larger and the pane menu's Plan open the map in the 보기 slot, the second line shows the current step, mission cards read the worker's plan, the record gains a Plan section, and Settings › Agents lists the three Hide skills.
# Conflicts:
#	contracts/hide-cli.json
#	hided/src/cli_contract.rs
#	web/src/shortcuts.test.ts
# Conflicts:
#	herdr-core/src/model.rs
#	herdr-core/src/runtime/detail.rs
#	web/e2e/s2.spec.ts
#	web/src/DetailPanel.tsx
#	web/src/shortcuts.test.ts
#	web/src/snapshot.ts
@yansfil
yansfil merged commit f0e93d2 into main Oct 22, 2026
54 checks passed
@yansfil
yansfil deleted the gen-prd/hide-plan branch October 22, 2026 21:58
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