Skip to content

fix: open a file a node pane prints from the node's own checkout - #1320

Merged
yansfil merged 8 commits into
mainfrom
fix/node-checkout-paths
Oct 17, 2026
Merged

yansfil merged 8 commits into
mainfrom
fix/node-checkout-paths

Conversation

@yansfil

@yansfil yansfil commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

core를 Mac mini로 옮긴 뒤 MacBook 창에서, MacBook pane이 찍은 자기 checkout의 파일 경로를 눌러도 아무것도 열리지 않았습니다.
core가 그 checkout을 자기 기계 목록(navigator)에서만 찾아서, node 세션에 있는 MacBook의 checkout을 "등록되지 않음"으로 버렸기 때문입니다.
이제 core는 node와 기기의 checkout도 catalog에서 찾고, 창은 그 경로가 node의 것임을 이벤트에 적어 보냅니다.
Overview에서 누른 경로처럼 그 checkout이 node에서 앞에 있지 않으면, node의 Herdr에 그 checkout을 앞으로 가져오게 하고 도착하면 파일을 엽니다. 이 기계의 checkout을 눌렀을 때와 같은 결과입니다.
그 기다림은 요청이 살아 있는 동안만 이어집니다. node가 거절하거나 답을 잃거나, 다른 선택이 오거나, 기기가 빠지거나, node의 앞 checkout이 다른 곳으로 가거나, 답이 5초 안에 오지 않거나, 수락 뒤 15초 안에 도착하지 않으면 버립니다. 그래서 나중에 운영자가 직접 그 checkout을 열어도 예전 클릭의 파일이 열리지 않습니다.
같은 기다림에 실리는 Memory 이동도 이제 같은 규칙으로 만료됩니다. 의도한 변경입니다: 전에는 수락된 Memory 이동이 기한 없이 기다려, 한참 뒤 운영자가 그 checkout을 열면 Memory가 열렸습니다.
같은 실수가 있던 곳도 고쳤습니다: node 프로젝트 PR 카드의 연결 기록, node PR의 1분 시계와 CI 재확인.
docs/status-model.md의 "기기 행은 PR을 잇지 않는다" 문장은 실제 동작(기기 행은 CI를 기다리지 않고, node PR은 연결 기록과 PR 카드로만 이어짐)에 맞게 고쳐 썼습니다. 동작은 바뀌지 않았습니다.

스크린샷 없음: 바뀐 화면 모양이 없습니다. 웹 변경은 terminal link 클릭이 보내는 이벤트에 device_id를 더하는 것뿐이고, 결과(파일이 열림)는 core 테스트가 확인합니다.

Review

  • 판단해 주세요: node에서 앞에 있지 않은 checkout의 경로는 focus_device: true인 FocusWorkspace 요청으로 node를 앞으로 가져오고, 기다리는 Workspace 선택(PendingChoice::reveal)에 reveal을 실어 두었다가 sync가 도착을 보면 엽니다. View 영역이 없는 runtime(제품 hided는 늘 있음)에서만 예전처럼 reveal.not_in_front로 거절합니다.
  • 판단해 주세요: 기다리는 Workspace 선택(PendingChoice)에 수명을 줬습니다. FocusWorkspace는 추적되는 remote operation이 아니라 expire_remote_operations가 보지 못하므로, 선택이 스스로 기한을 가집니다: 답에 CLOSE_STAGE_TIMEOUT_MS(5초, PRD D-08의 단계 기한과 같음), node가 수락하면 도착에 CHOICE_LANDING_TIMEOUT_MS(15초). 도착은 node Herdr의 포커스 변경과 node 세션의 publish를 기다리고, 느린 tailnet에서는 5초를 넘을 수 있어 넓혔습니다. 요청 때 node의 앞 checkout을 기억해 두고, 그것도 요청한 checkout도 아닌 곳으로 앞이 옮겨 가면 버립니다. 이 규칙은 reveal, Memory 이동, D-11의 "고른 Workspace" 기억에 모두 적용됩니다. 수락 뒤 15초 넘게 늦게 도착한 앞은 운영자의 선택으로 기억되지 않고 실린 것도 돌지 않습니다.
  • 판단해 주세요: 만료는 로그에만 남습니다(workspace.choice_expired, 앞 이동은 workspace.choice_dropped). 운영자가 할 수 있는 일이 없는 실패라 화면에 올리지 않습니다(설계 원칙 Move live and remote Herdr parsing to the typed boundary #13). 그 결과 15초를 넘긴 클릭은 화면에서 조용히 아무 일도 하지 않습니다.
  • 판단해 주세요: node 프로젝트의 PR이 CI를 돌리는 동안, Sessions가 보이면 1분마다 node의 GitHub 읽기를 다시 요청합니다(이 기계 프로젝트와 같은 규칙). 전에는 5분 주기 읽기에만 기댔습니다.
  • 기기 범위 답: links.rs의 link_projects_print, link_projects, 부모 표(~318/354/454)는 main에서도 이미 기기 세션을 훑었고(link_lineage_workspaces), 이 PR은 같은 일을 하는 catalog_workspaces로 이름만 바꿨습니다. 기기 프로젝트의 PR은 device_github에서만 오고, 그 표는 스스로 사실을 보고하는 node만 채웁니다(projects.rs, LinkOrigin::reports_own_facts). 그래서 새로 열린 동작(open_links, 1분 시계, 재확인)은 실제로 node에만 닿고, SSH 기기 프로젝트에는 PR이 없습니다. lay_checks는 이 기계 pane만 놓으니 기기 행은 계속 CI를 기다리지 않습니다.
  • 비용: 1분 tick(tick_work_clock)은 node 프로젝트에만 PR이 있어도 이제 refresh_agent_scopes_at을 1분에 한 번 돌립니다. 이 함수는 이미 이벤트 처리 47곳에서 부르는 lock 안의 행 순회(I/O 없음)이고, scope cache가 결과를 비교해 바뀐 것이 없으면 publish하지 않습니다. 더해지는 것은 1분에 순회 한 번입니다. 재확인은 CI가 도는 node 프로젝트 수만큼, 이 기계 프로젝트와 같은 상한입니다.
  • 조심해서 볼 파일:
    • herdr-core/src/runtime/session.rs - reveal이 catalog에서 checkout을 찾고, 기기 세션의 checkout이면 core 포커스를 옮기지 않으며, 뒤에 있으면 기기의 Herdr에 맡깁니다(reveal_when_in_front, Herdr/core ownership).
    • herdr-core/src/runtime/workspace_view.rs - PendingChoice가 reveal을 들고, 도착한 sync에서 메모리 표시 다음에 reveal을 돌립니다. 기한, 앞 checkout 기준, 버리는 규칙도 여기 있습니다(runtime mutex 안, I/O 없음; 선택이 기다리는 동안 sync마다 그 기기 세션의 checkout을 한 번 훑습니다).
    • herdr-core/src/runtime/agents.rs, operations.rs - 수락 답이 도착 단계 기한을 새로 걸고(acknowledge_choice, 전 acknowledge_memory_navigation), tick이 기한을 봅니다(failure path).
    • herdr-core/src/runtime/request_view.rs - 1분 tick 경로(high-frequency path): 판단 대상이 catalog 전체로 넓어졌습니다.
    • web/src/actions.ts - node checkout의 file_open/reveal_path가 device_id를 실어 hided가 core 기계의 root로 경로를 판단하지 않게 합니다(failure path).
  • 질문: node 행도 node PR의 CI를 기다리게 할까요? 이 PR은 그 계약을 바꾸지 않았습니다.

Evidence

  • 확인한 것: 새 core 테스트 5개 중 4개는 main 코드에서 실패하고(reveal은 버그 보고와 같은 reveal.unknown_checkout), 수정 뒤 통과합니다.
  • 확인한 것: 뒤에 있는 node checkout 테스트는 이전 head(a96db77)에서 reveal.not_in_front로 실패하고, 지금 통과합니다. 클릭 직후에는 아무것도 읽지 않고 기기의 Herdr에 FocusWorkspace가 기록되며, node의 front가 바뀐 sync 뒤에 파일이 node 채널로 읽힙니다.
  • 확인한 것: node reveal 테스트 둘 다 읽기가 node 기기의 채널(Call::OpenDocument)로 갔는지 확인합니다.
  • 확인한 것: a_reveal_waiting_on_a_node_dies_with_the_request가 일곱 경우(거절, 연결과 함께 잃은 답, 다른 선택, 기기 이탈, 앞이 다른 checkout으로 감, 답 없이 5초 지남, 수락 뒤 5초가 지나도 기다리고 15초 지나면 버림)마다 나중에 운영자가 같은 checkout을 열어도 아무것도 읽지 않고 열지 않음을 확인합니다. 기한 검사를 빼거나 앞 이동 규칙을 빼면 해당 경우가 "the old click opened"로 실패하고, 도착 단계를 5초로 되돌리면 "an accepted request waits for its front"로 실패합니다.
  • 확인한 것: a_remote_memory_visit_whose_front_never_landed_in_time_opens_nothing_later: 수락된 Memory 이동이 기한 안에 도착하지 않으면 나중 방문에 Memory를 열지 않고 기기를 앞으로 가져오지 않습니다. 기한 검사를 빼면 실패합니다.
  • 확인한 것: node 프로젝트 PR 카드 테스트는 실패 경로와 함께 성공 경로(node의 GitHub 답으로 panel.pr의 연결 기록이 열림)도 확인합니다.
  • 확인한 것: scripts/verify-cargo.sh test-scoped -p herdr-core: 2633 passed, 0 failed, 9 ignored.
  • 확인한 것: scripts/verify-cargo.sh lint(fmt, workspace clippy -D warnings) 통과.
  • 확인한 것: scripts/verify-web.sh web typecheck|lint|test 통과(199 files, 1753 passed, 1 skipped). 새 웹 테스트는 수정 전 코드에서 node 창의 reveal_path에 device_id가 없어 실패합니다. 리뷰 수정에는 웹 변경이 없습니다.
  • 확인하지 못한 것: 실제 두 기계 사이 이동 뒤의 앱 화면 클릭. 운영자의 앱과 Herdr를 건드리지 않는 조건이라 core와 웹 단위 테스트로만 봤습니다.
  • 확인하지 못한 것: hided, desktop lane, e2e는 디스크 여유가 작아 CI에 맡깁니다.
navigator만 읽는 core 조회 점검
  • 고침: session.rs reveal_path (보고된 버그). 뒤에 있는 node checkout은 node를 앞으로 가져온 뒤 엽니다.
  • 고침: links.rs open_links - node 프로젝트 PR 카드의 연결 기록 패널이 열리지 않았습니다.
  • main에서 이미 고쳐짐: links.rs links_scope(fix: find new files and links from a device pane #1308). 합치면서 지운 중복 함수 대신 catalog_workspaces를 부르게 했습니다.
  • 고침: request_view.rs tick_work_clock - node 프로젝트에만 PR이 있으면 1분 판단이 돌지 않았습니다.
  • 고침: request_view.rs reread_pending_checks의 Work 목록 부분 - node PR의 CI가 1분마다 다시 읽히지 않았습니다.
  • 정리: links.rs의 link_lineage_workspaces는 catalog_workspaces와 같은 일이라 지우고, link_github_project를 catalog_github_project로 이름 바꿔 함께 씁니다.
  • 의도대로 둠: request_view.rs lay_local_requests와 checks_wait.rs lay_checks의 장소 표 - 이 기계 행의 PR만 잇습니다. 기기 행은 lay_remote_requests가 PR 없이 놓고, docs/status-model.md가 기기 행은 CI를 기다리지 않는다고 정합니다.
  • 의도대로 둠: reread_pending_checks의 행 PR과 checks 대기 부분 - 위와 같은 계약으로 이 기계 행만 있습니다.
  • 의도대로 둠: focus_checkout, CreateTab, FocusTab, local_tab_host - 기기 checkout의 포커스와 탭은 그 기기의 Herdr가 remote_control로 다룹니다.
Verification record
  • base 9acf24362d19 (origin/main at the last merge), head ac69637e8.
  • scripts/verify-cargo.sh lint: pass at head.
  • scripts/verify-cargo.sh test-scoped -p herdr-core: 2633 passed, 0 failed, 9 ignored at head.
  • Mutations: without expire_pending_choice in the tick, the reveal test fails on "no answer in time: the old click opened" and the Memory test fails; without the front-moved drop, it fails on "the device's front moved elsewhere: the old click opened"; with the landing stage back at 5 s, it fails on "an accepted request waits for its front".
  • scripts/verify-cargo.sh nextest -p herdr-core with the new tests on the code before the fix: failed; after: passed. The behind-checkout reveal test failed on a96db77d6 with reveal.not_in_front.
  • scripts/verify-web.sh web typecheck, lint, test: pass (199 files, 1753 passed, 1 skipped); the new actions.test.ts case failed before the fix.
  • scripts/check-no-workstation-identity.sh, scripts/check-core-touches-no-machine.py, scripts/check-no-attribution.py --range origin/main..HEAD: pass.
  • Not run locally: hided, desktop, web and desktop e2e, Windows and Linux lanes.
  • Changed paths: docs/{ARCHITECTURE,UI_BEHAVIOR,status-model}.md, herdr-core/src/runtime/{agents,documents,events,links,operations,request_view,session,workspace_view}.rs, herdr-core/src/runtime/tests/{agent_scopes,documents,labels,links,project_settings,workspace_view}.rs, web/src/actions.ts, web/src/actions.test.ts.

A window on a node resolves a terminal link against its own machine's
checkouts, which the core lists in the node's session. The core looked
for the checkout in its navigator alone and refused the reveal as not
registered, so the click opened nothing.

The reveal now finds the checkout in the catalog, and a checkout of a
device's session is revealed only while it is in front there, moving no
focus of the core's. The window names the node in the event so hided
leaves the path to that node instead of the core machine's roots.
…st them

The link record, the PRs list and the Work list already carry a node's
projects, but four lookups read only this machine's navigator: the PR
card's link panel, the project hide links scopes to, the minute clock
that judges the PRs list, and the minute re-read of running checks.
They now read the catalog, and the re-read asks for a node's repository
through the node's read. The duplicate catalog walk in links.rs goes.
# Conflicts:
#	docs/ARCHITECTURE.md
#	herdr-core/src/runtime/links.rs
@yansfil
yansfil merged commit e8d6245 into main Oct 17, 2026
25 checks passed
@yansfil
yansfil deleted the fix/node-checkout-paths branch October 17, 2026 18:55
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