Skip to content

feat: let a Conductor run a mission of agents with a map, a cap and pull request wakes - #1524

Merged
yansfil merged 20 commits into
mainfrom
gen-prd/software-factory-conductor
Oct 22, 2026
Merged

yansfil merged 20 commits into
mainfrom
gen-prd/software-factory-conductor

Conversation

@yansfil

@yansfil yansfil commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

여러 이슈를 한 에이전트(Conductor)에게 맡기면, 그 에이전트가 계획을 세우고 작업자 에이전트를 나눠 띄우고 PR까지 끌고 가는 기능입니다.
Hide는 그 진행을 "미션"으로 기록하고, 오른쪽 보기 칸에 미션 지도를 그리며, 동시에 도는 작업자 수를 상한으로 막고, PR이 바뀌면 Conductor를 깨웁니다.

  • Conductor는 hide-conductor 스킬과 hide mission help 안내를 따르고, hide mission 명령으로 계획, 노드 상태, 결정할 일, 보고를 기록합니다.
  • 첫 계획이 들어오면 지도가 한 번 열리고, 사이드바의 Conductor 줄과 Overview 기록에 미션 0/4 칩이 붙어 다시 열 수 있습니다.
  • Settings › Conductor에서 동시 작업자 상한, 기본 범위, 작업자 후보(에이전트, 모델, effort, 용도)를 정합니다.
  • 상한을 넘는 작업자, 계획 승인 전의 작업자, 다른 기계를 겨냥한 작업자는 이유를 붙여 거절합니다.

격리 후보에서 실제 gittest PR 두 개로 돌린 미션 지도와 노드 상세

Review

  • 판단해 주세요: 작업자 수 상한은 Conductor가 띄우는 작업자에만 걸립니다. 작업자가 다시 띄우는 에이전트는 안내문으로만 막습니다(운영자의 "하네스는 가볍게" 결정을 따름).
  • 판단해 주세요: 닫히거나 취소된 미션의 Conductor는 이후 일반 에이전트처럼 상한 없이 띄울 수 있습니다. 한 Conductor가 여는 미션은 한 번에 하나뿐이라, 다른 미션을 하는 중에 끝난 미션의 PR이 바뀌면 소식만 받고 그 미션은 끝난 채로 둡니다. 끝난 미션의 PR이 머지되면 아무도 깨우지 않습니다.
  • 판단해 주세요: 미션 기록 파일을 읽지 못하면 아무것도 작업자를 세지 못합니다. 모든 띄우기를 막는 대신, 안내문이 Conductor에게 멈추고 운영자에게 알리라고 합니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/missions.rs - 모든 명령이 runtime mutex 안에서 한 번에 적용되고, PR 깨우기는 잠금 밖 스레드에서 보냅니다. 작업자 후보 밖의 띄우기(mission_candidate_refused)와 스택이 모두 머지된 merge_wait 미션의 자동 종료도 여기서 정합니다.
  • 조심해서 볼 파일: herdr-core/src/coordination/mod.rs - 상한 검사가 ledger 예약과 같은 잠금 안에 있습니다. 10분 동안 진행이 없고 작업자도 없는 예약은 세지 않고, 그 예약을 다시 부르면 상한 안에서 자리를 다시 잡거나 거절합니다. 이어받기(take)는 미션의 작업자, 그 시작 기록, 감시를 새 Conductor에게 옮기며(AdoptMissionWorkers), take가 답하기 전에 delivery 큐에 넣어 새 Conductor의 다음 명령보다 먼저 들어갑니다.
  • 조심해서 볼 파일: herdr-core/src/node_migration.rs, reown.rs - core를 다른 기계로 옮길 때 missions.json도 함께 옮기고 기계, 프로젝트, pane id를 바꿉니다.
  • 조심해서 볼 파일: herdr-core/src/persistence.rs - Settings › Conductor를 값으로 저장해서, 이 빌드가 못 읽는 값이 나머지 UI 상태를 지우지 않습니다.
  • 비용 검토: 새 상시 작업은 없습니다. 깨우기는 이미 있는 GitHub 읽기 결과를 비교할 뿐이고, 보내지 못한 깨우기는 미션당 32개까지 기록에 남습니다. 저장 크기는 시작 때 다시 읽을 수 있는 7 MiB 안으로 제한합니다.
  • 비용 검토: snapshot을 읽을 때마다 lock 안에서 도는 미션 갱신은, 미션이 없으면 아무것도 하지 않고, 있으면 숫자 두 개, ledger 포인터 하나, 미션당 두 비트만 비교합니다. 미션 기록, PR 답, ledger, Conductor 유무, 기기 연결 중 하나가 바뀌었거나 만드는 중인 작업자가 상한에서 빠질 때만 지도를 다시 만들고, 닫힌 미션은 기록이나 PR이 바뀔 때만 다시 만듭니다.

Evidence

  • 확인한 것: 격리된 desktop 후보(dev 빌드, 고정 Herdr 0.9.5, 운영자 앱과 서버는 건드리지 않음)를 띄우고, 실제 yansfil/gittest에 쌓인 PR 두 개로 미션 하나를 끝까지 돌렸습니다(마지막 코드 d5b2140b4에서 Keep build output in its worktree and stop the incremental cache #40, Make the recent-panel chord span every project #41). 끝난 뒤 PR은 닫고 브랜치는 지웠습니다.
  • 확인한 것: 그 실행에서 첫 계획이 지도를 열었고, 시작 전 작업자는 mission_not_started, 상한 2에서 세 번째는 mission_cap_reached, 다른 기계는 mission_machine_refused로 거절됐습니다.
  • 확인한 것: 아래 PR에 push하자 hide:conductor가 보낸 깨우기 편지 한 통(mission:mission-1:api:40:new_head:<head 12자>:1:<Conductor>)이 Conductor 받은편지함에 들어왔습니다.
  • 확인한 것: 같은 실행에서 결정 배너, Settings › Conductor, Conductor가 끝난 뒤의 이어받기 배너, 노드 상세, 사이드바 칩을 화면으로 봤습니다.
  • 확인한 것: 마지막 코드 e99c204a2로 다시 돌린 격리 실행(gittest Route background AI requests through an owned provider boundary #42, Scope every check script's build directory to its own checkout #43)에서 실제로 이어받기를 했습니다. 첫 Conductor 프로세스를 끝내자 Conductor 없음 배너가 떴고, 새 pane이 hide mission take로 이어받자 배너가 사라졌습니다. 새 Conductor가 같은 노드 intent(mission-1:api)로 다시 띄우자 새 작업자가 아니라 기존 작업자(agent-3)가 돌아왔고, 그 작업자는 새 Conductor의 자식이 됐습니다. 작업자가 보낸 report 편지는 새 Conductor 받은편지함에 들어왔습니다.
  • 확인한 것: 같은 실행에서 이어받은 뒤 쌓인 PR #43에 push하고 draft로 바꾸자, 지도의 PR 표시가 mergeable에서 draft로 바뀌었고 새 Conductor가 PR #43 has a new commit 깨우기를 받았습니다(지도 갱신 조건이 GitHub 답을 놓치지 않음). 끝난 뒤 PR은 닫고 브랜치는 지웠습니다.
  • 확인한 것: web e2e mission-map.spec.ts가 실제 hide mission 명령으로 지도 열림, 다시 안 열림, 칩으로 다시 열기, 노드 상세, Settings 상한 저장을 확인합니다.
  • 확인한 것: 코드 리뷰가 찾은 13건과 후속 리뷰의 1건(core 이동 뒤 기록을 못 읽는 문제)을 고쳤고, 그중 깨우기 유실, 설정 손상, 세션 누락은 고치기 전에 실패하는 테스트로 확인했습니다.
  • 확인하지 못한 것: 후보 창이 비활성이라 macOS 창 캡처가 "could not create image from window"로 실패해, 화면은 renderer 캡처로 남겼습니다.
  • 확인하지 못한 것: 기기 연결이 끊긴 지도(B20 흐림)는 gallery 장면으로만 봤고, 실제 기기 연결을 끊어 보지는 않았습니다.
  • 확인하지 못한 것: Windows는 실행해 보지 않았습니다(docs/INSTALL.md 표에 이유와 닫을 방법을 적었습니다). Linux는 CI로만 확인합니다.
  • 확인하지 못한 것: 저장 크기 초과로 되돌린 명령은 책만 되돌리고, 그 명령이 먼저 연 보기 칸과 보낸 깨우기는 되돌리지 않습니다(7 MiB 근처에서만 생김).
  • 확인하지 못한 것: 작업자 후보 두 개를 아주 빠르게 연달아 고치면 뒤의 편집이 앞의 것을 덮을 수 있습니다(후보 목록은 통째로 보냄).
  • 확인하지 못한 것: 미션 단위의 "뒤에서 열기" 확인(B7)은 없습니다. 후보 거절(B8), 스택 머지 후 자동 종료(B41), 원격 카탈로그의 이유 표시(B10), 늦게 돌아온 예약의 상한, 한 Conductor당 열린 미션 하나는 core 테스트로만 확인했고 live 실행에는 없습니다.
추가 증거

사이드바의 Conductor 줄에 붙은 미션 칩

Conductor가 끝난 뒤의 이어받기 배너

새 pane이 이어받은 뒤의 미션 지도

이어받은 뒤 PR #43 push와 draft 전환을 지도가 따라감

Settings › Conductor

결정할 일이 있는 지도, 밝은 테마 gallery

Verification record
  • PRD: software-factory-conductor (local contract; D-01..D-56, B1..B55)
  • Base 242aed346ac9, head e99c204a2 (verify report head)
  • sasu implement verify: PASS on e99c204: scripts/verify-cargo.sh test and lint green
  • Also run on the final code: verify-web.sh web typecheck/lint/test (1944 passed, 1 skipped), web e2e mission-map.spec.ts (1 passed), web e2e settings-general.spec.ts (3 passed), verify-cargo.sh cli, hide CLI contract tests, hakari, live isolated desktop spec on yansfil/gittest, rerun on d5b2140 (1 passed, 2.9 min), rerun with a real takeover on e99c204 (1 passed, 3.7 min)
  • Reviews: Fidelity and Code on f7981c2 (13 code findings, all fixed); follow-up Fidelity and Code on fb3785a (Fix now: null workspace_id after a core move, fixed in cc05c9a); short Code re-review of cc05c9a: nothing to fix; Observer-requested contract gaps (B8 candidates, B10 test, B41 self-close, resumed reservation cap, wake recipient) in 1d846b9, review found 2 Fix now (candidates per mission, already-merged stack) fixed in d5b2140, re-review: nothing to fix; independent review of a7fba00 (6 items: one open mission per Conductor, takeover handover, snapshot hot path, merge_wait settle, replan guard, wake kind) fixed in d33972c; follow-up review found 3 Fix now in the handover (unregistered heir, worker without parent, swallowed enqueue failure) fixed in e99c204; re-review: nothing to fix
  • Follow-up (not fixed): revert after mission_full keeps the opened slot and sent wakes; candidate edits send the whole list; a re-ask of a stuck start every <10 min keeps its slot; a self-closing mission still gets its last merged wake; no per-mission worker override (B3); an unknown kind is refused as a candidate before agent_unknown; the 200-newest PR window; skill re-write after one skill is deleted; reown key skip narrowing; mission chip found by pane id; a former Conductor's in-flight spawn racing a take can move workers back; a closed mission's node pane follows only on the next book or PR change; no runtime test of a take whose handover enqueue fails
  • Registered evidence (12): live run logs (fb3785a, d5b2140, e99c204 with takeover), 6 live renderer captures (node detail, decision, settings, takeover banner, taken over, after push and draft), mission-map e2e log, gallery stale capture, web lanes log

A mission record (plan, nodes, cap, scope, status) is owned by the core,
saved off the lock, and changed only by its Conductor's pane through
hide mission. A Conductor's spawns are refused before the plan is
approved or on another machine and capped in the ledger; a mission's
pull request changes wake its Conductor; the first plan opens the map
in the detail slot once; hide agent catalog lists each machine's agents,
models and efforts.
The kit writes a list of skill stubs into every skill folder (Claude
Code, ~/.agents/skills, agy). A folder an older kit wrote with the
browser stub alone reads outdated and gets the conductor stub on the
next pass; an edited or foreign stub stays the operator's.
…uctor

The mission map opens in the detail slot: one card per node with its PR
state band and four-step bar, the stack edges dashed, a decision or a gone
Conductor named in one banner, and a takeover that starts a new Conductor
on the mission. A Conductor's task row carries the mission chip, and
Settings › Conductor keeps the cap, the default scope and the worker
candidates. The gallery shows each map state in both themes.
…e still loading

A Conductor's session record in the Overview carries the mission chip, so a
mission whose Conductor has closed is still found there. A mission asked
for before the machine's projects are first read is refused as still
loading rather than as an unknown project. An end-to-end test drives the
real hide mission commands from an agent pane against an isolated hided.
…the skill

The owning guides now say what a mission records and refuses, how its map
and chip behave, that a mission adds no attention state, which skill stubs
the kit writes, where each system stands, and how the record is stored.
…and does not name them

The node command sent every field it was not given as null, which the core
reads as clear, so setting a status wiped the worker, the agent and the
pull request. Unset fields are now left out of the patch.
The detail read the worker's session through a store selector that built a
new object on every read, so with a live worker the map looped until it
was thrown away. The session is now derived outside the selector, the
detail keeps the keyboard where it was, and the card's own press alone
toggles it.
…e's gaps

A cancelled mission's chip says so instead of counting, and the map before
the first plan is one line. The guide says the check command stands in for
a missing CI, how to read the account's permissions, and that the
Conductor starts reviewers and verifiers itself so the cap counts them.
A pull request change is recorded on the mission and leaves only once its
letter is in the Conductor's inbox, and two asks on one head are two letters.
A spawn reservation that never produced its worker stops holding a cap place,
a change that would outgrow what a start reads back is refused, a stored
Settings > Conductor this build cannot read loads the defaults without losing
the rest of the UI state, and each settings edit sends only what it changes.
The mission keeps its Conductor's session even when the pane's row lags,
overlaps compare one machine's paths, merge_order names each node once,
decide and delay require their line, and a takeover prompt names the mission
by id only.
missions.json is one of the stores a core move copies, and the move maps
each mission's machine, project id and Conductor pane as it maps the ledger,
so a moved core keeps its missions instead of starting with an empty book.
…ory-conductor

# Conflicts:
#	contracts/hide-cli.json
A core move that finds a mission's project registration gone writes null,
which now reads as no registration instead of making the whole book
unreadable. A cancelled mission drops its unsent wakes, a panicking send
clears the sending flag, a change that shrinks an over-budget book is kept,
read-only mission commands skip the size check, and a mission's own words
are not read as machine keys by a move.
…stack

A mission's worker that is none of the operator's candidates is refused
mission_candidate_refused, a start that stopped holding its cap place takes
one again or waits when it is asked for later, a merge_wait mission closes
itself once every pull request of its stack is merged, and a wake names the
Conductor it is for so a takeover is not answered with its predecessor's
letter. A device's catalog is tested to say why it lists no models.
…n already merged stack

A Settings edit now applies from the next mission, so a running mission's
retries are never refused by a later edit; a close as merge_wait of a stack
already merged is done at once and a read with nothing new still closes a
merged stack; the expired-reservation check compares the mission, and a
wake's intent carries a short head.
…onductor, and build mission views only when their inputs move

A take moves the mission's worker starts, child records and watches to the new Conductor's registration. A done mission no longer reopens beside its Conductor's open one, and its merge wakes no one. merge_wait settles on merged or closed pull requests of nodes still in the stack. A replan refuses to drop a planned node that names its worker, pull request or branch. Wake letters are progress letters. The snapshot read skips the mission views when the book, pull request answers, ledger, presence and device answers did not move.
… and refuse a take whose handover fails

A Conductor that took a mission over with no registration gets the workers when it registers to start one, in the same reserve. A worker started without a parent has its origin moved too, so the ledger stays valid. A take whose handover cannot be queued is undone and can be asked again, after the record-size check. A posted effect that fails is logged.
@yansfil
yansfil merged commit 6352c9c into main Oct 22, 2026
67 checks passed
@yansfil
yansfil deleted the gen-prd/software-factory-conductor branch October 22, 2026 01:16
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