Skip to content

feat: run a mission's pull-request worker on another connected device - #2015

Merged
yansfil merged 9 commits into
mainfrom
feat/mission-worker-device
Nov 2, 2026
Merged

yansfil merged 9 commits into
mainfrom
feat/mission-worker-device

Conversation

@yansfil

@yansfil yansfil commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

미션 worker는 지금까지 미션 프로젝트가 있는 기기에서만 시작할 수 있었습니다.
이제 Conductor가 --machine으로 다른 연결된 기기에 worker나 checker를 띄울 수 있습니다. 조건은 두 가지입니다. 그 기기에 미션과 같은 GitHub 저장소의 프로젝트가 있어야 하고(GitHub repository id로 비교), 노드가 delivery: pr인 change 노드여야 합니다.
direct 노드는 결과 브랜치가 그 기기에 남으므로 거절합니다. research와 verify 노드도 미션 기기에서만 돕니다.
그 기기 worker의 check 줄은 그 기기 checkout에서 기록됩니다. 그 기기가 연결되어 있는 동안에만 그 checkout의 head로 유지 여부를 판단하고, 연결이 끊기면 열린 상태로 보입니다.

거절은 원인별로 나뉩니다. spawn과, 다른 기기 에이전트를 노드에 새로 붙이는 hide mission node --agent-id|--reviewer|--verifier가 같은 규칙 함수(admit_elsewhere) 하나를 씁니다.

mission_machine_node_refused   (노드 key)  pr change가 아닌 노드: direct, research, verify
mission_machine_unavailable               연결되지 않은 기기
mission_projects_loading                  그 기기의 프로젝트 목록을 아직 읽는 중
mission_machine_no_repository             같은 GitHub 저장소의 프로젝트가 그 기기에 없음(GitHub 읽기 대기 포함)

화면은 바꾸지 않았습니다(web/ 변경 없음).

Review

  • 판단해 주세요: 노드가 이미 붙들고 있는 다른 기기 에이전트는 다시 판단하지 않습니다. 그래서 기기가 잠시 끊겨도 같은 바인딩이나 무관한 replan은 막히지 않습니다. replan은 그 노드를 pr change가 아니게 바꿀 때만 거절합니다.
  • 판단해 주세요: 미션 프로젝트 자신의 repository id를 GitHub가 아직 답하지 않았으면 mission_machine_no_repository로 거절하고, 안내문이 GitHub 읽기를 기다리라고 말합니다.
  • 조심해서 볼 파일: herdr-core/src/missions.rs - 저장 형식. 미션 기기의 check는 지금처럼 folder에 저장합니다. 다른 기기의 check는 이전 빌드가 모르는 remote_folder(기기와 경로 한 쌍)에만 저장하고 folder는 비웁니다. 그래서 이전 빌드는 그 check를 열린 상태로 읽고, 그 빌드가 한 번 저장한 뒤에도 열린 상태로 남습니다. schema 버전은 그대로입니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/missions.rs - admit_elsewhere, 그리고 plan/node 명령의 판단. 모두 runtime lock 아래에서 메모리 속 기록만 읽으며, 하위 프로세스나 I/O는 없습니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/projects.rs - 기기별 GitHub 답 조회 github_on 하나를 두고, 단건 조회(github_project_on)와 전체 조회(github_projects_on)가 둘 다 이것을 씁니다. worktree 목록 조회와 projects_loading도 같은 곳에 있습니다.

Evidence

  • 확인한 것: 규칙마다 core 시험을 하나씩 두었습니다.
    • spawn: 거절 4종과, 같은 저장소일 때 허용(checker intent 포함). 다른 저장소(R_2)와 미션 저장소 id를 모를 때는 거절됩니다.
    • 바인딩: 미션 밖 다른 기기 에이전트도 spawn과 같은 규칙으로 거절됩니다. 이미 붙은 에이전트는 기기가 끊겨도 유지되고, direct로 바꾸는 replan은 거절됩니다.
    • check 유지: 그 기기 checkout의 head를 따라갑니다. 미션 기기의 같은 경로 checkout의 head가 바뀌어도 영향이 없습니다. 끊기면 open, 같은 head로 재연결되면 pass, 새 head면 open입니다.
    • 저장 호환: 이전 빌드 모양으로 읽고 저장한 뒤 다시 읽으면, 원격 check는 open이고 미션 기기 check는 pass가 유지됩니다.
  • 확인한 것: 결함을 심어 시험이 잡는지 봤습니다. 심은 결함은 4가지입니다: 원격 경로를 folder에 씀, 끊긴 기기의 head를 씀, 바인딩 규칙 무시, replan 검사 제거. 결함마다 해당 시험이 실패했고, 나머지 미션 시험은 통과했습니다.
  • 확인한 것: 9f99195e9에서 미션 check 명령을 돌렸고 lint는 통과했습니다. 시험은 memory_analysis::a_forked_session_counts_only_what_the_operator_said_after_the_fork 하나만 실패했습니다(with-hide/hide-private#436). 이 시험은 시험만 바꾼 다른 브랜치에서도 2026-11-02 10:47Z부터 같은 값 [3, 1]로 실패하고, 이 diff는 그 모듈을 건드리지 않습니다. 그 시험 하나만 빼고 같은 명령을 다시 돌리면 7315개 통과, 실패 0개입니다.
  • 확인한 것: 제품 코드 diff(시험, 문서, contract 제외)는 +241 / −56입니다. 시험은 +457입니다.
  • 확인하지 못한 것: 실제 연결된 Mac/Linux 기기에서 미션 worker를 끝까지 돌려 보지 않았습니다. hided의 연결 노드 시험도 쓰지 않았습니다. 같은 저장소 판단이 GitHub repository id 읽기에 기대기 때문입니다. 원격 기기를 흉내 낸 core 시험으로 대신했고, docs/INSTALL.md에 "실제 미션 한 번으로 닫힘"이라고 남겼습니다.
  • 확인하지 못한 것: Windows는 기기 노드가 없어 지원하지 않습니다(docs/INSTALL.md 지원표 줄).
Verification record
  • base: 9305a846b
  • head: 9f99195e9
  • 미션 check 명령: lint 통과. test는 Run fake gh, tailscale and usage provider as Node scripts on Windows #436 한 개 실패. 그 하나를 빼면 7315 passed / 0 failed
  • 문서: docs/delivery.md(Missions의 spawn과 바인딩 규칙, Finish lines의 check 폴더), hided/assets/mission/help.md, docs/INSTALL.md(What each system supports에 한 줄)

A Conductor can start a worker or checker with --machine on a connected
device that holds a project of the mission's GitHub repository (compared by
repository id), for a change node delivered by pull request only. A direct,
research or verify node stays on the project's machine. Each refusal has its
own reason: mission_machine_node_refused, mission_machine_unavailable,
mission_projects_loading and mission_machine_no_repository; binding an agent
from another machine and a replan follow the node rule too.

The node's check folder now remembers its machine (folder_device), so a check
recorded in the worker's checkout on that device is held against that
device's catalog; a folder written without a machine reads as the mission's
machine.
…s as spawns

A check recorded on another machine is now written only in remote_folder,
which builds from before devices do not know, so they read the check as open
instead of the device's path as a checkout on the mission's machine; the
folder_device field is gone. A device that does not answer shows no head, so
its check reads open until it answers again. Binding an agent from another
machine asks the same admission as a spawn there (connection, project list,
repository and node kind); an agent the node already holds and a replan are
judged by the node's kind alone. One per-device GitHub lookup serves the
single and the many project reads.
…lder change small

Binding a new agent from another machine calls admit_elsewhere directly and a
replan checks runs_elsewhere alone, with no helper of their own; the remote
folder is a (machine, path) pair rather than a new type, and the tests keep
one per rule.
@yansfil
yansfil merged commit b1b25cd into main Nov 2, 2026
69 of 71 checks passed
@yansfil
yansfil deleted the feat/mission-worker-device branch November 2, 2026 13:43
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