Skip to content

Scope every check script's build directory to its own checkout - #43

Merged
yansfil merged 1 commit into
mainfrom
chore/scoped-build-scratch
Sep 10, 2026
Merged

yansfil merged 1 commit into
mainfrom
chore/scoped-build-scratch

Conversation

@yansfil

@yansfil yansfil commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What changed, in one paragraph a new contributor can follow

The build-output rule that landed in #40 and the scripts in this repository disagreed, and both halves of the disagreement were wrong in a different direction. AGENTS.md said not to redirect a build anywhere shared, while five local check scripts sent theirs to one unkeyed /tmp/herdr-ide-verify - exactly the shared directory the rule describes. Read the other way, "never redirect" would have deleted a reason the rule did not mean to touch: a check that judges the working tree must not dirty it by building into target/, which is why scripts/rust-test.sh already keys its own test build by checkout. Both properties hold at once, so scripts/build-scratch.sh now owns that one decision - a scratch path keyed by checkout, isolated from the tree and from every other tree - and the five scripts source it instead of writing a path. The release archive is the single exception and never leaves the worktree, which also removes the target symlink hack check-typed-live-remote.sh needed to compensate for exporting CARGO_TARGET_DIR globally.

Review boundary

  • Runtime mutex: nothing. No Rust or Swift source changes; this is five shell scripts, one new sourceable shell script, and two documents.
  • Snapshot wire: no field added or moved.
  • Ownership: neither. Nothing here reaches Herdr or the core.
  • Herdr contract: no method, parameter or field touched. contracts/herdr-api.schema.json is unchanged and check-herdr-contract.sh --schema-only passes against the pinned binary.
  • Failure path: build-scratch.sh derives its path from git rev-parse --show-toplevel; outside a checkout that command fails and set -euo pipefail in every caller stops the run with git's own message rather than silently building into a default. There is no fallback path, because a wrong default here is what this change exists to remove.

Evidence

  • Verified by: scripts/check-typed-contract.sh generated run end to end - wire::tests 12 passed, the test binaries executed out of $TMPDIR/hide-verify-herdr-ide/cargo/debug/deps/, the worktree's target/debug/deps stayed empty, and target/release/libherdr_core.a was untouched. That is the whole claim of this change in one run. The repository-invariant lane passes locally: the ten structural scripts, the script suite (9 tests), check-herdr-pin-single-source.sh, check-herdr-contract.sh --schema-only, check-design-contract.mjs, and check-no-attribution.py. Every edited script parses under the shell in its own shebang (bash -n, zsh -n).
  • Not verified (and why): the four scripts other than check-typed-contract.sh were not run to completion. check-hide-full.sh and check-runtime-gates.sh need a full release build plus the Swift suite, and check-typed-live-remote.sh probe/e2e and check-hide-copy.sh need a live Herdr server, an authorized remote fixture, or a base commit. Their edits are the same mechanical substitution the run above proves, plus the two deliberate changes called out below. None of these is a CI gate.
  • High-frequency path impact: N/A. Nothing here runs in the app.

Two changes that are not mechanical, and what a reviewer should judge

  1. check-typed-live-remote.sh no longer exports CARGO_TARGET_DIR/SWIFTPM_BUILD_DIR for the whole script. That export sent cargo build --release -p herdr-core out of the worktree, and its own comment admitted it needed a worktree target symlink to give SwiftPM the relative library path back. The release build now lands where build_dev_app.sh reads it. Please confirm no local workflow still depends on that symlink existing.
  2. check-runtime-gates.sh keeps its release build in the tree. Its next line already says "Swift links the library built for the dev bundle by build_dev_app.sh", so the comment and the command now agree; before this they did not.

Also worth a reviewer's judgment: the remaining /tmp/herdr-ide-verify/ paths in scripts/ are fixture roots and a compiled accessibility probe, not Cargo or SwiftPM build directories, so this change leaves them alone. If the intent is that every generated path be checkout-scoped, that is a second change and should be argued on its own.

Screenshots

N/A - no visual surface changed.

AI tooling

Written with AI tooling. Checked by hand: that the release archive path is the only one the build scripts read from a fixed location; that rust-test.sh's existing keying and the new helper agree on their reason; and that the substitution left no /tmp/herdr-ide-verify/{cargo,swift} behind (rg reports none).

The build-output rule and the scripts disagreed. AGENTS.md said not to
redirect a build anywhere shared, while five local checks sent theirs to
one unkeyed `/tmp/herdr-ide-verify`, which is the shared directory the
rule describes: Cargo names a workspace member's artifacts by its path
relative to the workspace root, so two checkouts pointed at it read each
other's build as fresh, and its exclusive lock serializes the parallel
builds the worktree layout exists to allow.

Reading the rule as "never redirect" would also have deleted a reason it
did not mean to touch. A check that judges the working tree must not
dirty it by building into `target/`, which is why `scripts/rust-test.sh`
already sends its own test build to a path keyed by checkout. Both
properties hold at once, so `scripts/build-scratch.sh` now owns that
decision and the five scripts source it.

The release archive is the one thing that never leaves. SwiftPM links
`target/release/libherdr_core.a` from a fixed path under the worktree,
and the dev bundle and app builds read it there. `check-typed-live-remote.sh`
exported `CARGO_TARGET_DIR` globally, which sent the release build out of
the tree and needed a worktree `target` symlink to compensate; that export
and the hack it required are gone, and `check-runtime-gates.sh` keeps its
release build in the tree its own comment already assumed.

Verified: `check-typed-contract.sh generated` runs `wire::tests` (12
passed) out of the scoped scratch directory with `target/debug/` empty
and the release archive untouched; the script suite passes; every edited
script parses under its own shell.
@yansfil
yansfil merged commit 2b5ed99 into main Sep 10, 2026
5 checks passed
@yansfil
yansfil deleted the chore/scoped-build-scratch branch September 10, 2026 08:35
yansfil added a commit that referenced this pull request Oct 4, 2026
Related: Closes #360. Sasu 변경: yansfil/sasu#16

## Summary

- hided가 계보 토큰과 register/list/show/end/spawn을 소유하고 기존 읽기 계약을 유지한다.
- 보고의 전달 확정이 감시를 끝내며 원격 수신자도 reverse forward로 같은 장부를 사용한다.
- kit은 열린 항목을 사전 점검한 뒤 한 릴리스 동안 옛 설치물을 정리하고 장부 폴더 이름만 바꾼다.
- 기존 조정 플러그인·패키징·현행 문서를 제거하고 별도 Sasu 변경과 함께 전환한다.

![격리 후보의 위임
chip](https://github.com/yansfil/pr-assets/blob/main/hide/hcoord-retire/c1de92a/agent-spawn-delegation-public.png?raw=true)
![격리 후보의 은퇴 완료
상태](https://github.com/yansfil/pr-assets/blob/main/hide/hcoord-retire/c1de92a/coordination-retirement-public.png?raw=true)

## Review

머지와 설치가 전환이며, 활성 sasu 런·열린 request·활성 감시가 없을 때 운영자가 시점을 고른다

- 리드 결정, 운영자 확인 필요: 확정 기록 없는 과거 ack는 닫힌 상태를 유지하고 전달 확정 증거로 쓰지 않는다(D-37).
- 결정: plan은 일반 request와 Observer 확인 reply로 닫고 구현자는 기다리지 않는다(D-34).
- 결정: 옛 Sasu index와 revision은 전환 점검 뒤 운영자가 수동 보관한다(D-35).
- 비용 판단: B39의 비용 불변은 미입증이며 일부 값이 증가했다. 최종 HEAD의 성능 측정은 하지 않았다.
- 화면 판단: 대표 이미지의 위임 chip과 은퇴 상태 문구를 검토한다.
- 전환 판단: 롤백 없이 실패 단계부터 재개하며 소유 불명 테스트 서버는 운영자가 직접 확인한다.
- 파일:
`hide-kit/src/coordination_retirement.rs`·`herdr-core/src/remote/retirement.rs`의
사전 점검·소유권 경계.
- 파일:
`herdr-core/src/coordination/lineage.rs`·`herdr-core/src/delivery/worker.rs`의
갱신·변경 시 알림·전달 확정 경계.
- 비용: 키 입력에 새 작업이 없고 기존 1초 갱신의 안정 경로는 완료 배출·등록 수 검사, 변화 시 락 밖 계획·쓰기다.
- 소유·상한: 서버별 worker 1개, 실행·대기 batch 각 1개, patch 2,048개·완료 4,096개이며 종료 시
락 밖에서 합류한다.

## Evidence

- main merge 뒤 사설 Herdr·HOME의 macOS Chromium에서 sidebar/new-tab 3개와
GitHub core 15개·lint가 통과했다.
- 이전 새 탭 Linux 실패는 로컬에서 재현되지 않았다. 원인은 미확정이며 merge 뒤 Linux CI 결과를 기다린다.
- CI 수정은 전체 Rust 2,208개와 최종 kit·platform 250개·lint로 확인했다. 기존 assertion과
기한은 유지했다.
- 실제 사설 SSH 전달 1개와 macOS CI의 원격 전달 준비 단계가 통과했다. 이후 전달 코드는 바꾸지 않았다.
- 최초 전달 후보는 Rust 2,205개·web 946개·desktop 99개 및 구조 검사 9종이 통과했다.
- Rust의 기존 ignored 17개와 desktop의 기존 플랫폼 skip 3개는 별도 실제 실행 증거와 구분한다.
- 격리 후보의 native 흐름 4개가 통과했다. 서명한 package의 CLI·daemon·kit을 확인했으며 packaged
GUI 실행은 미확인이다.
- 실제 SSH 단절·재연결·같은 ID 보고 확정이 통과했다. 이전 후보 실행과 최종 소스의 동일 범위를 구분했다.
- 비용 불변은 미입증이다. 유휴 CPU·다중 pane CLI p95 증가와 frame 기준 실패, 내부 tick·lock·쓰기
횟수 미관측이 남는다.
- 기존 process 기한·worktree watcher의 간헐 실패는 보존했다. 현재 통과가 원인 해결을 증명하지 않는다.
- Pen 문구는 생성 스크립트로 반영했다. 실제 전환·물리 키보드·IME·타 OS는 미실행이다.
- Linux·Windows package 재검증은 CI 대기 중이며, smoke state를 사설 HOME 아래로 옮겨 소유권
검사를 유지했다.

## Breaking change

기존 조정 명령과 백엔드를 제거하며 장부나 활성 런을 자동 이전하지 않는다.
새 Hide 설치 뒤 Sasu 변경을 적용하고 이름만 바뀐 옛 장부는 운영자가 정리한다.
은퇴 코드는 모든 기기 전환 뒤 운영자가 정한 다음 릴리스에서 제거한다.

<details><summary>Approved decisions</summary>

- D-01·D-03: 전체 전환의 3·4단계이며 Hide 구현 뒤 별도 Sasu 변경을 적용한다.
- D-09·D-18: 계보의 네 토큰과 읽는 코드는 유지하고 기존 1초 갱신에서 차이가 있는 등록 pane만 락 밖에서 쓴다.
- D-10·D-19: Hide가 register/list/show/end/spawn과 watch assign을 제공하며
Sasu는 직접 native dispatch 뒤 등록한다.
- D-14·D-25: 같은 intent의 보고는 한 통이며 hook 출력 뒤 전달 확정 순간 감시가 끝난다.
- D-11·D-26~D-29: 사람 알림은 첫 경고 미확인 60분과 미전달 60분의 두 원인뿐이며 원인별 중복과 상한을
유지한다.
- D-15: 기기는 기존 reverse forward로 같은 장부에 닿고 단절 중 hook은 2초 안에 끝나며 별도 spool은
없다.
- D-12·D-13: Sasu는 Hide만 사용하며 새 상태만 지원하고 옛 장부나 활성 런의 자동 이전은 없다.
- D-17·D-24·D-30: 한 릴리스 동안 활성 런·열린 편지·감시를 사전 점검하여 발견하면 무변경으로 멈춘다.
- D-17·D-24: 점검 뒤 중지, LaunchAgent 제거, 소유한 링크·kit 정리, 옛 폴더 이름 변경 순서로 멱등하게
이어가며 롤백은 없다.
- D-31·D-32: 옛 메시지 헤더 해석은 제거하고 소유를 증명하지 못한 테스트 서버는 자동 정리를 거부한다.
- D-33: 새 Observer가 명시적 승인과 실제 native 신원·감시 세대로 인계하고 성공 뒤 Sasu 상태를 바꾼다.
- D-34: plan은 일반 request와 Observer 확인 reply로 닫고 구현자는 기다리지 않는 운영자 확정
흐름이다.
- D-36: 이미 출력한 보고는 미전달·취소 전환 뒤에도 실제 확정을 기록하여 감시를 끝내고 재확정은 새 감시를 보존한다.
- D-37: 확정 기록 없는 과거 ack는 닫힌 상태와 재주입 제외를 유지한다. 리드 결정이며 운영자 확인이 필요하다.
- D-13·D-16: 활성 작업이 없는 머지·설치 시점은 운영자가 고르며 앱 실행 전 감시 공백을 허용한다.
- D-23: 범위 밖 후속 항목은 #357에서 재검토했다. 실제 기기 UI·역방향 계보의 미확인 범위는 #212에 남는다.
- D-35: 옛 런 종료와 Hide 전환 점검 후 운영자가 index·revision 파일을 백업 폴더로 수동 보관하며 자동
이전은 없다.

</details>

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

- 계약: 로컬 전용 PRD B D01-D37/B1-B45, SHA256
`0a39e8daff38be147644addd1a4874667beeb1551468ec75366e376e01266c5c`. 핵심
결정은 Approved decisions에 요약했다.
- 최초 전달 HEAD `c1de92a513e0e4b594c2afe1c19a1592533aabc7`, 실제 PR base
`16e4f7ce41de324b17528b660234b27e2517d622`.
- 최초 전달 검증 PASS, 생성 `2026-10-04T19:29:37.277Z`, report SHA256
`699d6967c7714e47cb44d4baba6e68de038dd89e5544f401b8b9ca45da5e81a1`.
- source fingerprint
`e33ec4635800b5f7d7b85b1799caf4277093765e3fcf26e6e193897d61a5f72b`,
input fingerprint
`cd894b2b63b9639ec5c7d989887cd122285e6894b8aa569cc17c2b1bb657098e`.
- S1 `bash scripts/verify-cargo.sh test`: exit0, 139.640s, log SHA256
`007de7b285d042990b524692661aeebf7765298ba91ff836fc40210758cd91ea`.
- S2 `bash scripts/verify-web.sh`: exit0, 33.826s, log SHA256
`d1e736e4d44533730bb64bc334ad5ccd2db3a3d29928d784aa1dfd125fd319a4`.
- S3 `bash scripts/verify-cargo.sh lint`: exit0, 2.888s, log SHA256
`cdd574e981093f1846d4a9c9d6a5e6c94745f49ed1607adbcb706f1786bb0e24`.
- 등록 증거 79개, 실제 PR 변경 177경로.
- Rust 2205 PASS / 17 existing ignored, web946 PASS, desktop99 PASS
/3existing platform skips.
- 검증 장부 초기 base `7f914c70f2ed9fe48f2d7f3cdb7e26d833e3479b`와 통합 main/PR
base는 다르다.
- 필수 검사는 지원 locale en_US.UTF-8 및 RUST_TEST_THREADS=4에서 전체 실행했다. 테스트 내부
경쟁·assertion·기한·재시도·skip은 그대로다.
- 앞선 c1de 전체 실행의 FAIL3회는 보존했다: 미지원 C.UTF-8 Perl setup2개, 기존 process1.85s
Deadline1개, 기존 worktree observations_current1개. 소스가 같은 focused32/1 PASS는
원인 해결 증거가 아니다.
- 최초 ERROR/FAIL, 이전70b 긴 socket setup8FAIL, Python3.9 importERROR를 보존했다.
짧은 owned fixture 교정 후 같은74byte TMP 조건65PASS, 정상Python3.12
scripts108PASS.
- 구조 검사9종 PASS: scripts108, nightly/design/ignore anchor/asset
boundary/capability lock/privacy/removal boundary/pin source.
- 현재 서명 package proof SHA256
`0caf8c5da06b1f3607dbd75fd3b38f531698cdba98e22f274321998468bda0eb`,
native proof SHA256
`ee963bed27745b292c10f8c55b36c0a58dd2f2af41af8ec37a71045fc3784ac3`.
- 현재 실제 격리 native/session4흐름 PASS, package CLI/daemon/kit 실제 확인,
packaged GUI launch UNOBSERVED. Synthetic provider 조건이다.
- wire token 영역 SHA256
`12168c46a9ae50434dc73df4d43318bb73cc8349f1d265b7344a6e4409e8ba13`,
sidebar production code 기준 byte-exact, 실제 PR reader diff0. 전체 reader 파일의
상속 변경은 구분했다.
- 상속 #407의 GitHub store1thread/1pending 및 UI-attached
coordinator64project 비교는 비용 수용 증거로 대체하지 않았다.
- 실제 authenticated SSH 후보926e, 단절/reconnect/같은ID/확정과 owned cleanup PASS,
hook405/38/196ms. 이후 transport source 동일 범위만 재사용하며 runtime-negative
ancestry는 미실행이다.
- 최종 Sasu88d actual caller1PASS0skip19.553s, nearest40PASS0skip. Caller
proof SHA256
`02a11b9b8b083166865f0872f090cbeaaadc034f63a00792706cd1003eb25549`.
- 사설 fixture EISDIR의 원래 orphan을 재현하고 PID-before-write IPC/실제
reaping/nonzero로 수정했다. 실제 owner EOF0survivors117.599ms, cap2/15s/5s기한
유지; ENOSPC/EACCES 개별 주입은 미실행이다.
- 코드·보안·계약 최종 후속 리뷰는 모두 Hidec1de/Sasu88d를 검사하고 V2/S5/F7을 해소했다. 기존 전체 계약
리뷰를 유지하며, 리뷰 cutoff의 PENDING/NOT_RUN은 위 실제 최종 검사와 구분한다.
- 후속 개선: native occupant read→token-write race, handover digest fast
path, 사설 runtime-negative ancestry/기기 UI #212. D37 확인과 B39 미입증은 Review에
공개했다.
- 비용 측정은 candidate43e/baseline59c만 해당한다. 4구성 CLI600회/trusted600회,
frame4×120s, 자원 idle80/driven80창.
- CLI p95 single0.852051→0.757568ms, multi0.424805→0.559082ms. Trusted
marker p95는 두 구성0.10ms 감소. Raw 음수 표본은 지우지 않았다.
- frame>16.7ms single26.440772→26.482433%, multi26.829607→27.440633%;
baseline/candidate4창의 절대1% 기준은 모두FAIL.
- 갱신3쌍/12창/240표본: hided idleCPU0.08321149→0.10019573%,
driven0.16680784→0.14966253%; RSS idle+844/driven+735KiB.
- StrictB39 UNPROVEN. 최종c1de 비용 재측정/내부tick·lock·쓰기 횟수/2,048cap지연은 미관측,
CPU10ms 양자화와 통합 build차이를 구분했다.
- root agents index0, 상속 #385의103삭제 경로는 색인에서만 삭제하고 로컬 원본을 보존했다.
PRD/로그/native원본/profile은 공개하지 않는다.
- CI 수정 HEAD `a494bc3bd912186e811e5a09bc4debd838bfa18a`: offline
registry 확인과 pinned Herdr의 실제 offline uninstall, portable long HOME,
배포본처럼 stripped fixture, HOME 아래 package state를 반영했다.
- 771482a 후보 전체 Rust2208 PASS/17existing ignored, 실제 사설 SSH1
PASS/0ignored, smoke script syntax PASS. f5d9c1b는 fixture/doc만 바꿨으며 외부
XDG config를 명시한 kit68 PASS/0ignored로 확인했다. 최종 a494bc3는 플랫폼 공통 config 함수를
사용하며 kit/platform250 PASS/1existing ignored와 workspace lint PASS로 확인했다.
- 771482a macOS CI의 Remote mailbox over private SSH 단계 SUCCESS. 같은 후보
Linux CI의 새 fixture2 FAIL을 상속 XDG config로 재현한 뒤, 원래 assertion을 유지하고
owned child의 config 환경을 격리하여 고쳤다.
- 기존 코드의 offline fixture assertion FAIL을 보존하고 수정 후 동일 assertion PASS를
확인했다. 실제 pinned Herdr fixture에서 대상만 제거되고 foreign entry와 local source는
보존됐다.
- 읽기 전용 운영 환경 점검: 옛 command·kit·home은 남아 있고 전역 Herdr registry에는 대상 등록이
없어, Herdr가 꺼져도 재개 가능한 경우를 확인했다. 운영 환경에는 쓰지 않았다.
- 심볼 제거 전송 fixture의 원본 빌드 산출물·제품 코드와 package fixture의 소유권 검사, 모든 기존
assertion·기한·재시도·skip은 유지했다.
- Windows APPDATA/USERPROFILE 기본 경로와 XDG 우선순위는 기존 platform resolver를
재사용하고 uninstall child에도 같은 config root를 명시한다. 기존 namespace/ownership 검사는
그대로다.
- Linux/Windows package와 macOS CI는 새 head에서 대기 중이며 리드가 확인한다.
merge/install은 실행하지 않는다.

- main 동기화 HEAD `456ee8c56a4133e8fd2c6331623b63a78bed9ee4`:
`origin/main`의 `8fda555ecd9ca5c09c408b5c737469876ca64b5c`를 merge하여 #410을
포함했다. rebase나 force push 없이 일반 push했다.
- main 기준 [verify
실행](https://github.com/modakbul-gongbang/hide/actions/runs/37231596984)은
SUCCESS다. 이번 로컬 통과만으로 이전 새 탭 Linux 실패를 기존 flake로 분류하지 않았다.
- merge 뒤 `bash scripts/verify-cargo.sh cli`와 `bash
scripts/verify-web.sh web build`를 다시 실행했다. macOS의 pinned Herdr 사설
서버·HOME과 Chromium에서 `sidebar-pr-start.spec.ts`, `new-tab.spec.ts`를 실행하여
3 PASS/0 FAIL/0 SKIP, 27.6s를 확인했다.
- merge 뒤 `bash scripts/verify-cargo.sh lint` PASS와 `test-scoped -p
herdr-core github_reads`의 15 PASS/0 FAIL/0 ignored를 확인했다. root agents
index0, 작업 트리 clean을 확인했다.
- 이전 Linux job111526037117은 merged PR #43 글리프 없음, job111526037087은 Agent
영역의 탭 expected2/received1로 실패했다. 기존 assertion·기한·재시도·skip은 유지했으며 새 head의
Linux CI는 대기 중이다.

</details>
yansfil added a commit that referenced this pull request Oct 5, 2026
…estart flow (#489)

Related: #417

## Summary

`sidebar-pr-start` 가 Linux CI에서 같은 SHA의 통과와 실패를 오갔고, 실패 자리는 매번 병합된
PR(#43)의 glyph였다.
spec이 Inactive 접힘 행을 클릭해 연 뒤 glyph를 찾았는데, 실패 시점의 화면은 접힘 행이 닫힌 채였다.
이 spec이 증명하는 것은 "화면이 묻지 않아도 사이드바가 PR을 그린다"이지 접힘 토글이 아니므로, 클릭을 없애고 첫 재시작이
읽는 core-state에 펼침 상태를 미리 넣는다.
`@flaky` 태그와 issue annotation을 지운다.
클릭 연결은 `web/src/inactiveFold.test.tsx`(클릭이 프로젝트 경로를 담은
`inactive_checkouts_toggle` 한 건을 보내고, 접힘 행이 core가 돌려준 `expanded`를 그린다)가
지킨다.
#417은 main 연속 2회 녹색 뒤에 닫는다(원인 미확인).

## Review

- **판단해 주세요**: 원인을 찾지 못한 채 상호작용을 설정으로 바꿨다. TESTING.md는 "클릭 수를 바꿔서 통과시키지
않는다"고 하므로, 이것을 "준비 단계의 클릭을 상태 준비로 옮긴 것"으로 볼지 판단이 필요하다.
- **조심해서 볼 파일**: `web/e2e/sidebar-pr-start.spec.ts` - 시드 키는 core가
`workspace.path`와 정확히 비교하므로 `toPage`를 거친다.

## Evidence

- **확인한 것**: 같은 spec을 retry 0으로 로컬 macOS에서 반복 실행했다. 이 PR의 변경: 30/30
통과(CPU `yes` 4개 + workers 4, 머신 load average 10-13). 비교로 현재 main spec
54/54, 실패 당시 SHA(33b7342)의 옛 spec 30/30, 느린 git 래퍼(0.7초) 8/8.
- **확인한 것**: 접힘 행 생성 시점을 page에서 10ms 간격으로 관찰했다. 재시작 직후 charlie 행은 먼저 일반
행으로 보이고, worktree reader의 git 답이 온 시점(git 지연에 비례해 1초-6초 뒤)에 Inactive
접힘으로 옮겨진다. 접힘 행이 나타난 같은 프레임에 클릭해도 12/12 즉시 펼쳐졌다.
- **확인하지 못한 것**: CI 실패의 원인. 로컬에서 실패가 재현되지 않았고, CI artifact에는 wire trace가
없어서 토글이 core에서 거부됐는지(`inactive_checkouts.unavailable`) 확인하지 못했다. 이 수정이
Linux CI에서 실제로 막는지는 CI 반복 실행으로만 알 수 있다.
- **확인한 것**: 새 단위 테스트는 `actions.ts`의 payload 키를 바꾸면 실패한다(변이 확인). web
lint와 typecheck 통과.
- **확인하지 못한 것**: Linux와 Windows에서는 실행하지 않았다.

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

실패 시점 aria snapshot: `charlie` 프로젝트 안에 `main, now`와 `Inactive 1`(접힘)만 있고
alpha/bravo는 `Open pull request #41/#42`가 그려져 있다. hided 로그에는 세 저장소의
`pull_requests.ok`가 모두 있다.

</details>
yansfil added a commit that referenced this pull request Oct 22, 2026
…ull request wakes (#1524)

## Summary

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

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

![격리 후보에서 실제 gittest PR 두 개로 돌린 미션 지도와 노드
상세](https://github.com/yansfil/pr-assets/blob/main/hide/gen-prd-software-factory-conductor/f7981c2/pr-map-detail.png?raw=true)

## 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에서 #40, #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 #42, #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 실행에는 없습니다.

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

![사이드바의 Conductor 줄에 붙은 미션
칩](https://github.com/yansfil/pr-assets/blob/main/hide/gen-prd-software-factory-conductor/f7981c2/pr-sidebar-chip.png?raw=true)

![Conductor가 끝난 뒤의 이어받기
배너](https://github.com/yansfil/pr-assets/blob/main/hide/gen-prd-software-factory-conductor/f7981c2/pr-map-takeover.png?raw=true)

![새 pane이 이어받은 뒤의 미션
지도](https://github.com/yansfil/pr-assets/blob/main/hide/software-factory-conductor/e99c204/07-taken-over-renderer.png?raw=true)

![이어받은 뒤 PR #43 push와 draft 전환을 지도가
따라감](https://github.com/yansfil/pr-assets/blob/main/hide/software-factory-conductor/e99c204/08-after-push-draft-renderer.png?raw=true)

![Settings ›
Conductor](https://github.com/yansfil/pr-assets/blob/main/hide/gen-prd-software-factory-conductor/f7981c2/pr-settings.png?raw=true)

![결정할 일이 있는 지도, 밝은 테마
gallery](https://github.com/yansfil/pr-assets/blob/main/hide/gen-prd-software-factory-conductor/f7981c2/pr-gallery-decision-light.png?raw=true)

</details>

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

- 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

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