Skip to content

Name the core's own machine by its node id and convert stored state once - #664

Merged
yansfil merged 24 commits into
mainfrom
prd/core-host-node
Oct 7, 2026
Merged

yansfil merged 24 commits into
mainfrom
prd/core-host-node

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: core-host-node 1/5 (항상 켜진 노드에서 core 돌리기). origin/main 2c15edb 위로 rebase했습니다. #661과 #669는 main에 들어가서 이 PR에서 빠졌습니다. 저장소의 attribution 검사에 걸린 커밋 문구 두 개(제품 이름)만 고쳐 head가 b5ddca5e로 바뀌었고, tree는 030b1867과 같습니다.

Summary

core는 자기 기계를 local이라는 문자열로 불렀습니다. 그래서 기기 행, 등록, 폴더 owner mark, 라벨 키, 편지, 프로젝트 id에 모두 local이 박혀 있었고, core를 다른 기계로 옮기면 어느 기계의 것인지 가릴 수 없었습니다.
이제 core는 자기 기계를 node id(그 기계 machine_id의 소문자)로 부릅니다. device를 적지 않은 이벤트는 여전히 core 자신의 node를 뜻하고, local을 명시하면 모르는 기기로 보고 거절합니다.
local로 쓰인 상태 폴더는 hided가 core를 띄우기 전에 한 번 변환합니다.

Can't connect to hided
hided could not start because of this file, which was left unchanged.
<state folder>/node.json
[Retry]

화면 캡처에는 워크스테이션의 사용자 이름과 경로가 보여서 올리지 않았습니다. 캡처는 로컬 run 기록에 있습니다.

Review

  • 정해진 것(운영자 결정): node.json은 "이 폴더에서 qualify되지 않은 키를 가진 node"를 뜻하고, 다른 node 이름이 적힌 폴더(새 Mac, Migration Assistant로 옮긴 폴더)는 layer 5의 옮기기와 되돌리기가 다룹니다. 그때까지는 그 파일을 보여 주며 시작을 거절하는 지금 동작을 유지합니다. 형식은 layer 5에서 바뀌지 않습니다(D-23).
  • 판단해 주세요: 세션 검색 인덱스(운영 기계에서 170 MB)는 백업하지 않습니다. 새 키에 이미 행이 있으면 새 행을 남기고 옛 행을 지운 뒤 개수를 기록합니다. 옛 Copied history 설정도 이 규칙을 따릅니다.
  • 판단해 주세요: 프로젝트 id가 node id를 해시에 넣으므로, 변환 전에 transcript에 찍힌 Memory receipt는 더 이상 검증되지 않습니다.
  • 조심해서 볼 파일: herdr-core/src/node_migration.rs (failure path)
    • 저장소 하나라도 변환에 실패하면 시작을 멈춥니다.
    • 재시도하면 수렴합니다. pair는 지금의 Memory와 등록에서 다시 얻고, 백업은 같은 폴더에 한 번만 남깁니다.
    • 변환된 인덱스는 읽기만 합니다.
  • 조심해서 볼 파일: hided/src/cli.rs wait_healthy. hide connect는 자기가 띄운 daemon이 먼저 끝나면 10초를 기다리지 않습니다. 대신 Logs에서 그 pid가 spawn 이후에 쓴 거절 기록을 읽어 state_refused로 답합니다.
  • 조심해서 볼 파일: herdr-core/src/checkout_owner.rs (Herdr contract). owner mark가 node id로 바뀌고, 기존 local mark도 이 node의 것으로 읽습니다.
  • 조심해서 볼 파일: rebase 뒤 main이 더한 코드에서 이 기계를 "local"로 부르던 곳(adea3d9, 문구를 고치기 전 e3f0688). herdr-core/src/runtime/kit.rs(Codex CLI shared server 끄기와 에이전트 연결 읽기), herdr-core/src/runtime/agents.rs, web/src/PaneConnection.tsx, web/src/settings/{AgentsTab,DevicesTab,HideAiTab,agentRows}.ts*가 이제 node id 또는 기기 행의 kind로 이 기계를 찾습니다. main의 동작은 바꾸지 않았습니다.
  • 조심해서 볼 파일: desktop/src/main/browser.ts. node id를 받기 전에는 loopback 페이지를 원격 파티션에 두고, id가 오면 파티션이 바뀐 페이지를 다시 만듭니다.
  • 질문: 기계 id가 바뀐 Mac(새 Mac 설정, 재설치)은 자기 옛 폴더를 다른 node의 것으로 보고 거절합니다. 지금은 창에 파일을 보여 주고 문서로 "새 state 폴더로 시작"을 안내합니다. 이 경우는 layer 5의 move/restore가 맡는 것으로 보면 될까요?
  • 질문: daemon frame에 node_id를 더하지 않았습니다(웹은 자기 기기 행에서 읽습니다). layer 4에서 화면의 node와 core의 node가 갈라질 때 더하려고 합니다.
  • 질문: snapshot wire의 pane과 checkout id qualify는 layer 4의 요구사항으로 남깁니다.

Evidence

  • 확인한 것: sasu implement verify PASS on bce1a82(S1 Rust 전체 suite, S2 lint). 지금 head f422844b는 main Hold the first verify run at a FIFO so the one-run-at-a-time check sees it running #722, Require a pane-bound caller for delivery and agent commands #725 위로 rebase만 한 것입니다. range-diff로 본 차이: #725가 없앤 checkout caller의 pane hint 코드에 있던 node 고정이 함께 빠졌고, 배달 권한 목록은 #725의 pane 조건과 node id 확인을 함께 둡니다. #725가 더한 테스트 5곳은 TEST_NODE로 고정했습니다. 그 head에서 herdr-core와 hided 테스트 1982/1982, workspace lint 통과.
  • 확인한 것: main이 더한 테스트의 fixture 경쟁을 고쳤습니다(bce1a82, 제품 동작 변경 아님, issue 641 영역). 가짜 Codex CLI app-server의 hang 모드가 hooks/list를 받은 뒤에야 자식을 띄워서, load 65에서 요청 한도가 먼저 끝나면 시간 초과 테스트가 자식을 찾지 못했습니다. 자식을 시작 때 띄우게 했고, 요청 한도 50 ms에서 옛 fixture는 실패, 새 fixture는 통과합니다.
  • 확인한 것: rebase한 head에서 clippy 통과, Rust workspace nextest 2804/2805. 남은 1건 hided opener_lifecycle::acceptance_timeout_ends_cli_spawned_before_watcher는 load 24에서 실패했고, 단독 5회 반복(load 24에서 34)에서 4/5 통과, 1회는 20초 pid 대기 deadline에서 실패했습니다. 이 PR은 hided의 spawn과 opener를 바꾸지 않습니다.
  • 확인한 것: web(129 files, 1164)과 desktop(16 files, 158) typecheck, lint, unit, build 통과(rebase 뒤).
  • 확인한 것: 변환 계약 테스트
    • KEYS의 모든 키에 fixture 값이 있습니다.
    • 다시 쓴 키에서는 local이 사라지고, node 소유 키는 그대로입니다.
    • KEYS와 UNBOUND 어디에도 없는 파일이 있으면 실패합니다.
    • 재시도 수렴, 충돌 시 rollback, 백업 1부, 변환된 폴더를 다른 writer가 잡고 있어도 시작되는 경우를 다룹니다.
  • 확인한 것: 69693b51의 debug hided로 운영자 ~/.hide/state의 새 복사본을 변환했습니다(HOME 격리, Herdr 없음, 상태 폴더 0700).
    • core-state, ledger, labels, workspace-views의 "local" 13/481/1/225가 0이 되었고, Memory 2개 프로젝트와 세션 검색 20,925행의 키를 다시 붙였습니다(버린 행 0).
    • 변환 후 ledger를 읽었고, 두 번째 시작은 아무것도 변환하지 않았으며 백업 폴더도 1개 그대로였습니다.
    • 운영자 원본 ledger, workspace-views, Memory의 mtime과 sha256은 그대로였습니다. 운영자 폴더에는 node.json도 백업도 생기지 않았습니다.
  • 확인한 것: 네이티브 QA. 설치된 빌드(b520d6e)가 격리 Herdr에서 쓴 폴더를 candidate 앱이 열었습니다.
    • This Mac 아래에 두 프로젝트가 보였습니다.
    • 같은 Herdr workspace id와 두 번째 탭이 유지되었습니다.
    • 다른 node 폴더는 0.3초 만에 파일을 보여 주었습니다.
  • 확인한 것: rebase 전 web e2e 186/187. rebase 뒤 main이 더한 agents-tab, devices-settings spec 6건 중 5건 통과, desktop e2e(focus 제외) 55 통과 7 skip 1 실패(아래 dense hover). home-layout 통과, local-kit은 패키지된 앱이 필요해 로컬에서 skip. Herdr schema contract(0.9.1), Herdr pin single source, design contract, workstation identity, harness anchor, capability readers, worktree removal boundary 통과.
  • 확인하지 못한 것: 이 diff 밖에 있고 main에서도 재현되는 실패들입니다. 고치지 않았습니다.
  • 확인하지 못한 것: 운영자의 실제 링크 기록 레이아웃. 설치된 앱이 PR과 세션의 연결을 기록해 PR 옆 패널, Issue 패널, Sessions 칩, ⌘K, hide links에서 보여 줍니다 #638 이전 빌드라 links.sqlite3가 없어서 fixture 계약 테스트로만 확인했습니다.
  • 확인하지 못한 것: check-herdr-contract.sh의 실행 중 서버 확인. 이 PR은 Herdr 호출을 바꾸지 않습니다.
리뷰와 처리

rebase 뒤 리뷰(adea3d9, 문구를 고치기 전 e3f0688): 충돌 해결이 main과 layer 1의 동작을 모두 지켰는지, main이 더한 코드의 local이 모두 node id로 바뀌었는지, 명시한 local이 어디서도 통과하지 않는지 봤고 Fix now는 없었습니다. 따라온 두 가지는 030b1867에서 고쳤습니다: 이 Mac을 local로 적던 기기 id 주석, 그리고 활성 Memory 항목의 검색 행까지 옮기는 변환 테스트.

Fidelity, Code, Security 리뷰를 두 라운드 돌렸습니다(62b777c, e071177). Fix now 항목은 모두 이 PR에서 고쳤고, 고친 diff를 본 세 번째 라운드(4c287ce)는 Fix now가 없었습니다.

  • 재시도 수렴, 조용한 UPDATE OR IGNORE, FTS 고아 행: 2c3f5c7, 4c287ce.
  • KEYS 누락 필드와 UNBOUND 분류: 2c3f5c7.
  • B2 창 표시: d63dd60.
  • 매 시작마다 잡던 검색 인덱스 쓰기 잠금, 재시도마다 늘던 백업, pid만으로 맞추던 거절 기록: 4c287ce.

CI windows check가 4c287cec부터 실패했습니다. Windows 전용 hook 테스트가 Project를 아직 local로 만들고 있었기 때문이고, 06b2425f에서 node id로 바꿨습니다.

코드 리뷰 1라운드(4c287ce) 처리는 69693b51입니다.

  • 두 이름으로 쓰인 device_expanded_paths 목록은 합칩니다(전에는 옛 목록을 버렸습니다).
  • 더 긴 node id 때문에 ledger가 loader 한도(16 MiB)를 넘게 되면 시작을 멈추고 파일을 알려 줍니다.
  • 밀려난 #[cfg(unix)]를 브라우저 alias 테스트에 되돌렸고, hide connect 거절 테스트를 unix 전용으로 했습니다.
  • 4라운드(f93ef22 네이티브 리뷰) 처리는 6605c78c입니다. ledger 크기 확인을 어떤 파일도 쓰기 전에 하므로, 거절되면 모든 파일이 제자리에 그대로 남습니다. 이미 한도를 넘은 ledger는 loader에 맡기고, 거절 문구에 해결 방법을 적었습니다. 목록 합치기와 중복 제거는 선형이고, node 경계 테스트는 다시 모든 OS에서 돕니다.
  • 2라운드(69693b5) 처리는 c85aeef4입니다. expanded_inactive_project_device_ids가 이미 node를 담고 있으면 변환 뒤에도 한 번만 남깁니다.
  • 2라운드에서 바꾸지 않은 것: core-state 8 MiB 한도(그 한도는 제거된 native 앱의 상태 파일에만 적용되고 core-state에는 loader 한도가 없음), 이전 앱이 다시 쓴 local 행과의 Memory/링크 충돌(아래 후속), 10초 health 창 안의 큰 변환(아래 후속), 등록도 Memory도 없는 프로젝트의 Sessions mode(기본값으로 돌아가고 인덱스는 다시 만듦), hide-kit search_path(이 diff 밖), 브라우저 partition(위 Review 파일).
  • 바꾸지 않은 것: hook이 실행마다 기계 id를 읽는 비용(ioreg 0.01초, hook은 hide-kit에 의존할 수 없음), node.json 해석과 desktop/web 동시 배포(위 Review 질문).

후속으로 남긴 것:

  • 일반 daemon.start_failed 기록.
  • try_wait 오류 처리.
  • 큰 변환이 10초를 넘을 때의 Retry 안내.
  • 롤백한 빌드가 다시 쓴 local 행의 Memory와 링크 충돌. 지금은 시작을 멈추고 파일을 알려 줍니다(layer 5).
  • 등록도 Memory도 없는 프로젝트의 Sessions mode 키.
  • 실패한 백업 복사의 .partial 정리와 rename 전 fsync.
  • 검색 FTS 고아 행을 직접 세는 테스트.
  • node.json이 있는 폴더에서 실패를 재시도할 때 백업 폴더 재사용.
테스트 고정값 변경 (PRD changes the wire id, D-21)

아래 파일에서는 local 고정값만 node id로 바꿨습니다. Rust는 crate::node::TEST_NODE, e2e는 daemon의 node.json, web 단위 테스트는 helper의 node 인자를 씁니다. assertion은 바꾸지 않았습니다.

  • Rust: herdr-core/src/runtime/tests.rs, herdr-core/src/runtime/tests/*(26 files), herdr-core/src/labels/tests.rs, herdr-core/src/session_sync/tests.rs, hided/tests/mobile.rs, hide-agent-hooks/tests/windows_hook_command.rs(Windows 전용이라 macOS 검색에서 빠졌고, 06b2425f에서 고침). inline test module도 바꿨습니다: workspace.rs, runtime/delivery.rs, coordination/executor.rs, delivery/worker.rs, live.rs, files.rs, labels/import.rs, changes.rs, runtime/attachments.rs.
  • web: web/e2e/{device-rail,home,mobile,s3,s7,start-panel}.spec.ts, web/e2e/hided-fixture.ts, web/src/{RequestView,addProject,areaCycle,buffers,linkPanel,numbering,revealExternal,store,viewLayout,workspaceManage}.test.*.
  • desktop: desktop/e2e/{add-project,agent-spawn,browser,device-home,home-layout,local-kit,remote-workspace,workspace-columns}.spec.ts, desktop/src/main/{browser,browserSync}.test.ts.
  • 두 번째 rebase 뒤 main이 더한 Factory 코드와 테스트: herdr-core/src/runtime/delivery.rs, herdr-core/src/runtime/factory.rs, herdr-core/src/delivery/watch.rs, herdr-core/src/coordination/mod.rs의 테스트, web/e2e/agents-tab.spec.ts의 session 수 단계. 운영 코드에서는 Factory의 수신자(Actor::factory)가 core의 node id를 받고, hide factory 명령의 기기 확인이 "local" 대신 core의 node id와 비교합니다(5d343e0).
  • rebase 뒤 main이 더한 테스트: herdr-core/src/runtime/tests/{agent_connection,agents_settings_remote,lineage,ui_state_focus}.rs, web/e2e/{agents-tab,devices-settings}.spec.ts, desktop/e2e/{home-layout,local-kit}.spec.ts의 Connection details 단계.

새 테스트만 더한 파일입니다: hided/tests/node_owner.rs, hide-session/tests/search.rs, desktop/e2e/desktop.spec.ts, desktop/src/main/cli.test.ts.

Verification record

Breaking change

  • 상태 폴더(~/.hide/state, ~/Library/Application Support/hide의 Project Memory)는 첫 시작에 한 번 변환됩니다. 이전 앱으로 돌아가면 이 Mac의 프로젝트가 다른 기기의 것으로 보입니다. 되돌리려면 node-migration-backup/<ms>/의 파일을 제자리에 복사합니다(docs/INSTALL.md).
  • daemon wire나 hide 명령에서 device_id: "local"을 명시하면 이제 모르는 기기로 거절됩니다. device를 적지 않으면 지금처럼 이 기계를 뜻합니다.

yansfil added 19 commits October 7, 2026 17:26
The core used the literal "local" for its own machine everywhere: device
rows, registrations, owner marks, label keys, letters and project ids. It
now carries a NodeId (the machine's own id) and compares against it, an
event that names no device still means the core's own node, and an
explicit "local" is an unknown device.

hided converts a state folder written under "local" before the core
starts: every machine-bound key is rewritten to the node id, Memory and
session-search project ids are re-keyed in one transaction each, the
originals are kept under node-migration-backup/, and node.json records
the node that owns the folder's unqualified keys. A folder owned by
another node is refused with its reason.
…sktop host

The shell compared device ids with the literal "local" to tell this
machine's checkouts, receipts, drafts and Explorer state from a device's.
It now reads the node id from the navigator's own device row
(localDeviceId); before the snapshot names it the id is empty, which an
event carries as no device_id, the core's own node.

Drafts this host stored under "local" move to the node id once, keeping
their contents and time. The desktop host learns the node id from the
shell's browser sync and keys the shared loopback partition and direct
loads on it.
…lone

A daemon that hide connect starts has its stderr discarded, so a state
folder the conversion refused left no reason anywhere. The refusal is now
written at once to the folder's Logs file (diagnostics::record_now), and a
daemon test starts hided on a folder another node owns and reads it there.

A JSON store whose version this build does not read is left byte for byte
for its own loader, which keeps an unknown Views file aside as it is.

Clippy: the coordination context is a named struct, and Memory analysis
takes its progress callback rather than the worker context.
The fixtures read the node id from the state folder's node.json, and every
assertion that named this machine "local" names that id. A seeded Views
file of a version the build does not read, another host's draft and an S6
Views file still name "local", as the builds that wrote them did; a new s3
test seeds a draft this host stored under "local" and sees it restored.
…rch index without locking it, and match a refusal to the start that spawned it
…in the node conversion

A device_expanded_paths list written under both names keeps the paths of both instead of dropping the legacy one.
A delivery ledger the longer node id would push past the loader's 16 MiB limit stops the start and names the file, rather than converting into a ledger every later start refuses.
The browser root-alias test keeps its unix gate, and the hide connect refusal test runs on unix only, as its PATH does.
A list that already named the node next to local would otherwise hold the node twice once local is rewritten.
The hook resolves Projects by the node id since the conversion, so the Windows-only test that seeded its Project under local never saw a Memory receipt. The test is compiled only on Windows, which is why the macOS sweep of local pins missed it.
A ledger the longer node id would push past 16 MiB now stops the start before any store is rewritten, so every file stays as it was, and the refusal says how to get past it; a ledger already over the limit is left to its loader as before. The list union and the device-list dedupe are linear, the node boundary test runs on every system again, and the Unix-only hide connect test says why it is Unix-only.
Main gained the Codex CLI shared server switch, the Settings tabs and the agent
connection reads, which named this machine "local". They now name it by
the node id, as the rest of layer 1 does: the kit's checks compare with
the runtime's node, the shell finds this machine's row by its kind, and
the tests and e2e specs main added pin the daemon's node id (D-21).
…converted Project keeps its search row

Comments on the kit, Codex CLI shared server and file index device ids still
said `local` names this Mac; it is the core's own node id now. A Memory
conversion test now moves a Project holding an active item, so its
search row is converted and checked, not only the Project row.
A turn-off for the core's own node no longer needs a connected helper, and
the turn-off tests address the test runtime's node.
Under load a check could time out before hooks/list reached the stand-in,
so it never started the child the timeout test expects to be stopped.
@yansfil
yansfil force-pushed the prd/core-host-node branch from bce1a82 to f422844 Compare October 7, 2026 08:31
@yansfil
yansfil merged commit ed64668 into main Oct 7, 2026
22 checks passed
@yansfil
yansfil deleted the prd/core-host-node branch October 7, 2026 08:56
@yansfil yansfil mentioned this pull request Oct 7, 2026
yansfil added a commit that referenced this pull request Oct 7, 2026
…#692)

Related: core-host-node 2a/5 (항상 켜진 노드에서 core 돌리기).
#664(병합됨, ed64668) 다음 layer입니다. base는 main입니다.

## Summary

core(`herdr-core`)는 결정과 상태만 갖고, 기계를 직접 만지지 않게 했습니다.
파일, 프로세스, Herdr 소켓, 세션 파일은 node의 일이고, core는 계약 하나(`NodeLink`, 새 crate
`hide-node-link`)로 node id를 지정해 묻습니다.
이 PR에서는 core 자신의 node(`hide_node::Local`, hided 프로세스 안)가 모든 호출에 답합니다.
화면과 동작은 바뀌지 않습니다.
- core가 하던 git, `gh`, hide-ai, 포트, agent sleep, kit, 세션 읽기, clone,
worktree, 문서 저장, 첨부, Herdr 연결이 `Call::*`로 node에 갑니다.
- 카탈로그는 경로를 직접 읽지 않고, 재빌드 전에 lock 밖에서 node에 한 번 묻습니다(`Call::PathFacts`).
새 프로젝트도 node가 만듭니다(`Call::ProjectCreate`).
- 링크 기록의 세션 파일 상태(있음/없음)도 node에 묻습니다(`Call::RealPaths`). node가 답하지 못하면
"알 수 없음"으로 둡니다.
- hided의 파일 열기(opener)와 pane 자격 증명의 커널 증거, bootstrap 소켓은 `hide-node`로
옮겼습니다.
- 탐색기 감시는 이 Mac과 device를 하나의 감시자로 합쳤습니다. 둘 다 node id로 그 node에
`Call::Stamps`를 묻습니다.
- `scripts/check-core-touches-no-machine.py`가 core의 운영 코드에서 기계 접근을 막습니다.
예외 파일마다 허용 개수를 적어 두어, 예외 파일 안에 새로 생긴 접근도 실패시킵니다. policy lane에서 돕니다.

```text
core(결정, 상태, 자기 저장소) --NodeLink(node id)--> node(파일, 프로세스, Herdr, 세션)
  이 PR: core 자신의 node만, 같은 프로세스 안에서 답함
  2b: SSH 위의 같은 계약, device helper가 hided node 역할로 합쳐짐
```

## Review

- **판단해 주세요**: 탐색기 감시를 "옮기기" 대신 "합치기"로 했습니다. 이 Mac의 핸들 polling을 지우고
device와 같은 stamp 비교로 바꿨습니다. 200 ms poll과 200 ms 묶음 창은 그대로입니다. 이 Mac의
root는 boundary가 등록 때 확인한 identity로 고정합니다(목록 읽기와 같은 identity). 그래서 같은
경로에서 바꿔치기된 root는 목록과 감시 모두 거절합니다. device root는 helper가 바꿔치기를 알리면 다시 열고
감시 폴더를 모두 한 번 알립니다.
- **판단해 주세요**: 카탈로그 행의 경로가 node의 비교 형태(실제 경로)입니다. 예전에는 pane에서만 보인 행이 이름
그대로(`/var/...`)였고, 등록 행만 실제 경로였습니다. 이제 둘 다 `/private/var/...`처럼 실제
경로입니다.
- **조심해서 볼 파일**: `herdr-core/src/session_sync/coordinator.rs`,
`runtime/session.rs` (high-frequency path, runtime mutex). 재빌드 전에 lock
밖에서 `PathFacts`를 묻고, 같은 경로 집합이면 30초 refresh까지 재사용합니다. coordinator가 카탈로그를
한 번 넘긴 runtime은 그 뒤 카탈로그 없이 들어온 session(닫기 상태 읽기 등)에서도 lock 안에서 node를
부르지 않고 마지막 답을 씁니다. coordinator가 없는 runtime(fixture, 첫 Herdr 응답 전)만 lock
안에서 자기 node에 묻습니다.
- **조심해서 볼 파일**: `herdr-core/src/live.rs` 프로젝트 생성 (failure path). 폴더와
`git init`은 node가 하고 실제 경로를 답합니다. 등록은 그 경로로 합니다.
- **조심해서 볼 파일**: `hide-project/src/lib.rs` (failure path). 저장소 안의 HEAD,
ref, 포인터 파일, config를 regular file로만, 링크를 따라가지 않고, pipe에서 막히지 않게 열고 크기
상한(포인터 64 KiB, config 1 MiB)을 둡니다. pane 안의 프로세스가 `.git/config`를 pipe로
바꿔도 카탈로그가 멈추지 않습니다.
- **조심해서 볼 파일**: `hided/src/watch.rs` (high-frequency path). 이 Mac 감시는
200 ms마다 in-process `Call::Stamps` 한 번(폴더 최대 64), device는 2초마다 한 번, 실패한
poll은 어느 쪽이든 2초 뒤에 다시 묻습니다. 답한 link는 poll 사이에 재사용해서 매 poll마다 core owner
thread를 거치지 않습니다.
- **조심해서 볼 파일**: `hided/src/env.rs` (failure path). 상대 경로
`HERDR_SOCKET_PATH`는 시작 때 `HERDR_SOCKET_PATH: invalid`로 거절합니다. 예전에는 연결은
됐지만 pane 증명이 조용히 checkout binding으로 내려갔습니다.
- **비용 검토**: 카탈로그 재빌드 1회당 node 호출 1회(경로 4,096개 단위), 경로 집합이 그대로면 30초에 1회.
lock 안에서는 node를 부르지 않습니다(테스트가 호출 수 0을 확인). 감시는 대기열 없이 직전 답을 기다린 뒤 다음
poll을 합니다.
- **조심해서 볼 파일**: `herdr-core/src/worktrees.rs` Git watch (high-frequency
path, failure path). 감시 대상이 바뀌면 새 감시를 시작하되, 새 감시가 `Watching`을 알릴 때까지 옛
감시를 유지해 두 집합에 모두 있는 저장소는 감시가 끊기지 않습니다(main은 저장소마다 watch/unwatch해서 틈이
없었습니다). 감시가 끝나거나 시작하지 못하면 30초 뒤 다시 시작하고, 다시 감시가 시작되면 모든 프로젝트를 한 번 다시
읽습니다. 시작 실패는 매번 다시 묻지 않고 30초 간격으로 다시 시도합니다.
- **조심해서 볼 파일**: `hide-node-link/src/protocol.rs` (snapshot wire 아님,
node 프로토콜). 2a가 node 호출 38개를 더해서 `PROTOCOL_VERSION`을 22로 올렸습니다(main의
#656이 공유 서버 끄기로 21을 먼저 썼습니다). 이 빌드의 helper를 아직 받지 않은 device는 Hello에서
거절되고, 새 payload의 digest가 달라서 다음 연결에서 새로 설치됩니다.
- **B1 예외로 적은 테스트 수정**: 이미 있던 테스트
`a_commit_in_one_project_does_not_rerun_status_in_another`,
`moved_remote_ref_refreshes_one_project_once_after_a_burst`,
`idle_and_working_tree_edits_do_not_reread_but_manual_refresh_does`와
helper `changes_before_sentinel`을 고쳤습니다. 저장소를 만들 때의 Git
쓰기(`symbolic-ref`)와 sentinel 자신의 늦은 쓰기가 감시 시작 뒤에 도착해 측정에 섞였기 때문입니다.
단언(프로젝트별 `git status` 횟수 1과 0, `behind_upstream`)은 그대로이고, 측정 전에
sentinel로 정리하고 이미 시작된 읽기를 기다립니다. main의 고치지 않은 테스트에도 같은 경쟁이 있는지는 돌려보지
않았습니다(같은 `Repository::new` 구조라서 있을 것으로 추정).
- **질문**: hided에 남긴 것은 자격 증명 registry(`pane_auth.rs`, 증명은 이 프로세스에서
`hide_node::pane_proof`로 읽음)와 감시자 스케줄러(`watch.rs`)입니다. registry는 layer
4에서 node 역할 hided가 link로 보내는 증명을 받도록 바꾸려 합니다. 괜찮을까요?
- **질문**: 파일 열기의 안전 규칙(`server.rs::openable`, 실행 파일과 handler가 실행하는 파일
거절)은 hided의 open handler 곁에 남았습니다. 그 handler는 main에서 이미 연결되지 않은
코드(`#[allow(dead_code)]`)라서, 연결하는 변경이 규칙을 launcher 곁으로 옮기도록 문서에 적었습니다.
- **질문**: core에 남은 기계 접근은 check에 이유와 개수로 적었습니다. SSH 전송(`remote.rs`,
`remote/`, `ssh_hosts.rs`)은 2b, terminal attach child(`live.rs`)와 첨부는
layer 3, label generator lock은 layer 4입니다. AI 선택
파일(`hide_ai::settings`)은 core 저장소로 두었습니다.
- **알려진 예외**: main이 이 PRD 뒤에 넣은 Software Factory 엔진은 이 PR 뒤에도 core의 기계에서
직접 일합니다. runner(`hide_factory::exec`, 경계 check가 이름으로 금지)가 git,
`gh`(issue와 pull request 만들기, merge, rerun, `gh::allowed`가 덮지 않는 호출), 확인
명령(`/bin/sh -c`)을 돌리고, 버리는 Task의 worktree는 node의 확인된 삭제 대신
`hide_host::worktrees::remove_worktree`로 강제 삭제하고 `branch -D`합니다. 남은 디스크와
자기 실행 파일 위치도 직접 읽고, `hide-factory` crate는 프로젝트 파일(guide, `package.json`,
`Makefile`)을 스스로 읽습니다(check가 보는 폴더 밖). 모두 main의 동작 그대로이고, `factory.rs`를
LATER_LAYERS에 2b 항목(15)으로 적었습니다. 2b가 이것을 모두 core 자신의 node로 옮기고 항목을
지웁니다(Observer 결정). `docs/ARCHITECTURE.md`에도 적었습니다. 이 PR에서 node로 가는 것은
Factory의 AI 판단(`factory_router`)과 worker pane 닫기입니다.
- **main과 달라진 동작**: Factory의 판단 thread는 core가 사라지면(`Weak` upgrade 실패)
끝납니다. main은 홈의 AI 선택을 읽어 판단을 계속했지만, 답을 받을 core가 없고 node도 core가 줍니다.

## Evidence

- **확인한 것**: `sasu implement verify` PASS on 98b6440(지금 head). S1 Rust
전체 suite, S2 lint, 격리 HOME과 긴 TMPDIR.
- **확인한 것**: CI 전 lane 통과 on 5edb1b8(98b64402는 진행 중)(rust workspace,
windows check, os contract 3종, web e2e linux 4/4, windows e2e, desktop
e2e, package linux/windows).
- **확인한 것**: 로컬 web e2e 205/206(새로 빌드한 hided, load 20 아래). 남은 1건
`agents-tab.spec.ts:46`은 이 Mac에 Homebrew로 설치된 OpenCode가 login shell
PATH로 보여 "Installed 5"가 된 환경 차이입니다. 이 PR은 agent
탐지(`hide-kit/src/agents.rs`, `hide_platform::programs`)를 바꾸지 않았고 CI에서는
통과합니다.
- **확인한 것**: Rust workspace nextest 2832/2833(load 15에서 19). 남은 1건
`opener_lifecycle acceptance_timeout`은 테스트 안의 경쟁(2초 수락 창과 가짜 helper의 pid
기록)으로, 단독 5/5 통과, 코드는 그대로 옮겼고 #664 tree에서도 같은 실패를 봤습니다.
- **확인한 것**: Git watch 테스트의 간헐 실패 2종은 flake로 두지 않고 테스트를 고쳤습니다. sentinel
자신의 늦은 쓰기가 기준선에 섞인 것(d3eb073), 저장소 준비 때의 ref 쓰기(`symbolic-ref`)가 감시 시작
뒤에 도착해 다른 프로젝트 읽기를 먼저 깨운 것(5edb1b8, 측정 전에 sentinel로 정리). 고친 뒤 worktree
behavior 테스트 전체 stress 30/30, Git watch 3건 40/40(고치기 전 1/24 실패). main의
`codex_trust` 시간 초과 1건(load 34에서 41)은 이 PR이 바꾸지 않은 테스트입니다.
- **확인한 것**: lock 안에서 node를 부르지 않음.
`reconciling_with_a_precomputed_catalog_runs_no_git`가 세는
node(`CountingNode`)로, 카탈로그를 받은 뒤 카탈로그 없는 session까지 호출 0을 확인합니다.
- **확인한 것**: 링크로 들어간 checkout 아래 중첩 worktree를 구분하는 테스트는 예전 동작으로 되돌리면
실패하고 지금 통과합니다. 바꿔치기된 root 거절(boundary identity), 상대 socket 거절, pipe와 큰
config 거절, 세션 파일 상태(있음, 없음, 알 수 없음)를 단위 테스트합니다.
- **확인한 것**: 경계 check가 심어 둔 위반, 예외 파일 안의 새 접근을 잡고, 이유가 사라진 항목을
실패시킵니다(`scripts/tests/test_core_touches_no_machine.py` 7건). clippy `-D
warnings`, fmt, design contract 통과.
- **확인한 것**: `PathFacts` 비용: 실제 worktree 경로 24개(저장소 1개)에 p50 2.8 ms, p90
3.1 ms, 최대 9.1 ms(debug 빌드, load 21에서 24).
- **확인한 것**: 저장소의 `HEAD`와 config가 링크여도 main처럼 따라가 읽습니다(regular file,
비차단, 크기 상한은 유지). `a_linked_head_and_config_are_read_through_the_link`.
- **확인한 것**: Git watch 인계와 끊긴 뒤 다시 읽기를 가짜 node로 단위
테스트합니다(`a_git_watch_restarted_after_it_ended_rereads_every_project`,
`a_change_while_the_watched_set_changes_is_kept`).
- **확인하지 못한 것**: 유휴/구동 측정은 2b에서 옮긴 reader와 함께 냅니다.
`moved_remote_ref_refreshes_one_project_once_after_a_burst`가 다른 세션이 빌드하던
중 섞어 돌린 stress에서 1/20 한 번 15초 hang guard에 걸렸습니다. 어느 대기였는지는 남기지 못했고, 그 뒤
섞어서 40/40, 단독 30/30입니다.
- **후속(2b)**: `RealPaths`의 상대 경로 하나가 묶음 전체를 실패시키는 것, `LinkAnswer` Debug의
비밀 가리기, stdio serve의 역할별 호출 허용 목록, gh argv 정확 일치, git 인자 검증,
`Local::call` timeout, SSH link의 `call_with_progress`(진행과 취소가 있는 호출을
device에 보내기 전), 세션 읽기 호출의 경로 제한과 비차단 열기(main과 같은 동작), `PathFacts` 답 전체
크기 상한, Windows의 root identity 일치 테스트.
- **후속(나중)**: 경계 check가 signature 안의 `;`(예: `[u8; 4]`)에서 test 항목을 일찍 끝내는
것(실패가 크게 나므로 숨지 않음), `test_ci_plan.py`의 `EVERY_PACKAGE` 하드코딩.

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

- base: f422844 (#664 head, on origin/main 411f34a; `git merge-tree`
against origin/main f5a9fe8 clean), head: 0b7a250
- sasu verify: PASS on 0b7a250(S1 Rust 전체 suite 344.9s, S2 lint; round
5 고침이 동작을 바꿔서 전체 verify). 그 전 PASS: 98b6440. 0b7a2506에서 workspace lint
통과, Git watch와 reader 테스트 45/45, kit, protocol, Factory 테스트 92/92, 경계
check 테스트 8/8.
- sasu verify: PASS on 98b6440 (test 296.9s, lint 34.8s); earlier PASS
on 5edb1b8
- CI on 5edb1b8: all success (package macos skipped on PRs)
- local web e2e on 5edb1b8: 205 passed, 1 failed (environment: Homebrew
OpenCode on PATH), 38.4m
- reviews round 1 (e11296d4): Fidelity, Code, Security. Fix now 12건 처리:
watcher를 boundary identity로 고정하고 실패 시 2초로 물러남(11ea411), Windows unix
gate 2건(0c6ce78), 중첩 worktree를 최신 index로 읽고 lock 안 node 호출
제거(fc97795), 상대 socket 거절(6b193d2), Git 파일 읽기 상한과 비차단(4ce9d8b), 링크 파일
상태를 node에 묻고 check에 허용 개수(e497247, 2b3d36a), 문서 정정(58c3cce). 2b로 넘긴
것: stdio serve의 역할별 호출 허용 목록, gh argv 정확 일치, git 인자 검증, `Local::call`
timeout.
- reviews round 2 (6c7e832): Security 새 발견 없음. Fidelity: CI와 e2e 증거 요청,
이번 head에서 채움. Code: policy lane `test_ci_plan`(2b898fe), hide-host gh
테스트 unix gate(586528b), 쓰지 않는 `folder_stamps` 삭제(9664628), boundary
identity 테스트가 바꾸기 전에 stamp(df6fbc4), ARCHITECTURE의 저장소 파일 읽기
규칙(ea84dd1), Git watch 테스트 2건(d3eb073, 5edb1b8).

- reviews round 3 (5edb1b8): Security Fix now 없음. Fidelity Fix now 1:
고친 기존 테스트를 B1 예외로 기록(Review 절). Code Fix now 1: 측정 전 진행 중 읽기를
기다림(589e937). 받은 follow-up: 링크 HEAD/config(1e0a905), 대기 상한(589e937),
중복 gate 삭제(78356a5).
- /code-review 1회차 (5edb1b8), 8건: protocol 21(96b411a), Git watch 인계와
끊긴 뒤 다시 읽기(4508968), 시작 실패 재시도 간격(4508968), doc 위치(78356a5) 고침. 받지
않음: 탐색기 200 ms poll(main도 200 ms poll), SSH 취소(2a에서는 device로 안 보냄, 2b),
경계 check `;`(이전 회차와 같음), 세션 경로 제한(main과 같음, 2b).
- reviews round 4 (98b6440): Fix now 3건 처리. Git watch가 어느 감시에서 끊기든 다시
읽기를 한 번 빚지는 하나의 `owes_reread`(3aad696), Git watch 테스트는 읽기와 대기가 모두 끝난
뒤에만 정리(159706c), discovery가 regular HEAD만 받는다는 문서와 그 뒤 링크 읽기
테스트(41c4289).
- reviews round 5 (d278df4, round 4 고침과 main #656, #682, #724, #725 위로의
rebase): Fidelity Fix now 1, Code Fix now 3, Security Fix now 1 처리. 옛
Git watch의 overflow도 다시 읽기를 빚게 함(6e39a90, 고치기 전 실패하는 테스트),
`join_pending` doc 위치(7b1c446), 판단 thread의 동작 변화를 Review에 적음, Factory가
아직 직접 하는 일을 Review와 ARCHITECTURE에 적음(25e3e24). 받은 follow-up: 이름을 바꾼
runner 호출도 check가 잡음(fd1e21f), 이 기계의 공유 서버 끄기가 자기 node로 가는
테스트(94ce4d9, 막는 결함을 심으면 실패). 2b로: `hide-factory` crate 전체의 기계 접근과 store
개수 분리, Factory `gh` 쓰기와 느슨한 allowlist 정확 일치, search allowlist 테스트 위치,
Git watch `collect`의 한 pass 안 경쟁, 발견 뒤 링크가 된 HEAD 테스트.

</details>
yansfil added a commit that referenced this pull request Oct 7, 2026
…ent start (#730)

Closes #726

## Summary

Windows에서 fixture는 `pane process-info`로 "shell이 혼자"인지 보고 agent를 시작했습니다.
하지만 고정된 Herdr(v0.9.1)의 Windows `agent.start`는 다른 조건을 씁니다: 프로세스 표에서 shell
pid를 부모로 적은 프로세스가 하나도 없어야 합니다(시작 시각 비교 없이 pid만, 후손까지).
#726 run에서 pane의 `cmd.exe`(7964)는 세션을 만들고 끝난 `smss.exe`의 pid를 다시 받았고,
`csrss.exe`·`winlogon.exe`가 아직 그 pid를 부모로 적고 있었습니다. process-info는 shell
혼자로 보였지만 Herdr는 그 pane을 끝까지 busy로 거절했습니다(재시도는 다른 pid를 받은 새 pane이라 통과).

- "Herdr가 이 shell을 available로 보는가"를 함수 하나(`shellAvailability`)로 두고,
`startHerdr`의 setup 대기와 `startAgentAtShell`이 둘 다 부릅니다. Windows에서는 Herdr의
조건 그대로(`hide-children.exe`로 shell을 부모로 적은 프로세스를 읽음), macOS·Linux는 전과 같이
foreground group입니다.
- shell보다 먼저 시작한 프로세스가 shell pid를 적고 있으면 기다려도 오지 않는 상태라 바로 그 프로세스를 적고
실패합니다.
- c323729d가 `startHerdr`의 두 shell에만 하던 교체를 helper
하나(`unclaimedWorkspace`)로 합쳐, spec이 `fixture.run`으로 보내는 `workspace
create`(`spawnAgent` 포함)도 같은 코드를 씁니다.
- `docs/TESTING.md`와 `docs/ARCHITECTURE.md`(Starting an agent)에 Windows
조건을 적었습니다.

## Review

- **판단해 주세요**: 교체는 "shell보다 먼저 시작한 프로세스가 shell pid를 부모로 적음"을 본 뒤 한 번만
합니다. 교체본도 그러면 각 프로세스의 pid·시작 시각·이름을 적고 실패합니다. timeout·재시도·sleep은 늘리지
않았습니다.
- **판단해 주세요**: 제품 영향: 실제 Windows 사용자도 이런 pid를 받은 pane에서는 agent를 영원히 시작하지
못합니다(`agent_start::start_at_shell`은 30초 뒤 실패). Herdr의 결함이라 upstream
issue 초안을 운영자 승인 대기로 남겼습니다(제안: 후손 판정에 시작 시각 비교).
- **조심해서 볼 파일**: `web/e2e/herdr-fixture.ts` `run` - 모든 spec의 `workspace
create`가 지나갑니다. Windows가 아니면 그대로 반환하고, Windows에서는 만든 직후 pane마다
`hide-children.exe`를 한 번 돌립니다.
- **조심해서 볼 파일**: `startHerdr` - 교체 검사가 prompt 대기 뒤에서 앞(만든 직후)으로 옮겨졌습니다.
Herdr는 create에 답하기 전에 shell pid를 저장하므로(`src/pane.rs` spawn) 대기가 필요 없습니다.
- **범위 밖**: `tab create`·`pane split`로 만든 pane은 교체하지 않습니다(그런 pane에서
Windows agent를 시작하는 spec은 지금 없음). 그런 pane의 agent start는 프로세스를 적고 바로
실패합니다. `desktop/e2e/agent-spawn-fixture.ts`의 `waitForSpawnShell`도 같은
판정이지만 `agent-spawn.spec.ts`가 `@platform`이 아니라 Windows에서 돌지 않아 손대지 않았습니다.

## Evidence

- **확인한 것**:
- 원인: 실패 job log(112680845736)의 자식 목록 `7976 ... older csrss.exe, 8024
... older winlogon.exe`. issue 본문은 600자에서 잘려 이 부분이 빠져 있었습니다.
- Herdr 조건: v0.9.1 소스 `src/app/agents.rs`(`available_shell_name`이
`platform::available_pane_shell` 호출, 없으면 `agent_pane_busy`),
`src/platform/windows.rs`(`available_pane_shell` → `descendant_entries`,
`th32ParentProcessID`만 비교). upstream #3485에서 maintainer가 "Windows
process-info는 shell만 보여도 agent start는 후손이 있으면 거절"이라고 확인.
- #664 무관: #664는 `web/e2e/herdr-fixture.ts`·`checkout-pr.spec.ts`를 바꾸지
않았고, 실패는 spec이 hided를 시작하기 전 `workspaceAt` 안이었습니다.
- 로컬: web lint(eslint e2e 포함), desktop typecheck(`desktop/e2e`가 이
fixture를 import, `tsc -p e2e`), policy 검사 5개, design-contract, script
tests 168개 통과.
- **확인하지 못한 것**:
- Windows에서 로컬로 돌리지 못했습니다(이 Mac뿐). 새 Windows 조건은 이 PR의 `windows e2e`
lane에서 agent start마다 돕니다.
- 교체 경로 자체는 pid 재사용이 우연히 일어나야 돌아서 CI에서 일부러 재현할 수 없습니다. 로직은 c323729d에서 이미
돌던 것을 helper로 옮긴 것입니다.
yansfil added a commit that referenced this pull request Oct 7, 2026
Related: 1단계 #682 (머지됨, 707ef2c) 위의 2단계 · PRD
`agents/prd/software-factory-ui/prd.md`

## Summary

1단계(#682)로 Factory 엔진, 저장소, `hide factory` CLI가 들어왔지만 운영자는 터미널로만 볼 수
있었습니다.
이 PR은 그 위에 Factory 화면을 얹습니다: 내 차례, 보드, 그래프, Task 페이지, 만들기 시트, 설정, 비서 패널.
코어 스냅샷에 `factory`와 `factory_task` 섹션이 생기고, 엔진 스레드가 비교해 달라졌을 때만 내보냅니다.
화면의 모든 행동은 `factory_action` 이벤트 하나로 1단계 `Command`를 그대로 실어 보냅니다.
사이드바 배지, 요청 뷰의 Factory 줄, ⇧⌘F 단축키가 Factory로 이어집니다.

리뷰 전에 함께 넣은 것 (마지막 push ceae33e 이후):

- 코드 리뷰 3회차의 결함 7개를 고침 (설정 검사 추가 중복, 받지 못하는 숫자 복원, Task 페이지 폼별 요청, i32
우선순위 상한, 받아들여진 답 뒤 보내기 비활성 등), 각각 jsdom 테스트와 함께.
- 흐름 막대의 완료 오늘을 이 기기의 현지 날짜로 셉니다. 전에는 UTC 날짜라 서울 오전 9시 전에 끝난 Task가
빠졌습니다. 엔진 요약을 바꾸는 유일한 변경이며 운영자가 이 PR에 넣도록 허락했습니다
(`hide-platform/src/time.rs`, `hide-factory` Clock 포트에 `utc_offset_ms`).
- 검증 n/3 수에 "검증 실패" 이름을 붙이고, 완료된 Task의 기준은 충족 체크로 그립니다.
- '{{answer}}(으)로 보내기' 대신 조사 없는 '보내기: {{answer}}'; Factory 문구 전체에서 한국어
조사 대체 표기를 없앴고 `labels.test.ts`가 지킵니다.
- 엔진이 줄인 글의 `[cut N bytes]` 표시를 결정, 시도 로그, 목표 어디에 있든 "… (줄임)"으로 보여 줍니다.
- 의존 그래프(Issues Dependencies와 Factory 그래프가 함께 쓰는 D-08 배치)의 배치와 선 경로만
elkjs layered로 바꿨습니다. 카드와 토큰은 그대로이고, 전이 축약은 Factory 그래프에만 남깁니다. elkjs는
그래프를 열 때 동적 import로 불러 Web Worker에서 돌리고, 3초나 카드 400장을 넘으면 열 배치로 남기며 진단
로그를 남깁니다.
- main(#664, node id) 병합 뒤 만들기 시트가 `"local"` 대신 이 기기의 node id로 프로젝트를
고릅니다.
- main(#692 node link, 그 뒤 #738 Herdr 0.9.3과 #733)을 병합했습니다; Factory 화면
포트는 Factory host 시작 직후 그대로 설치되고, 완료 오늘의 시간대 읽기는 2b가 노드로 옮길 기기 일로 경계 검사에
적었습니다.

라이선스: elkjs 0.12.0은 EPL-2.0 (또는 GPL-3.0-or-later)이고, hide(MIT)는 이를 수정하지
않은 번들 의존성으로 EPL-2.0에 따라 씁니다. 패키지된 앱은 `elk-worker.min.js`를 그대로 담습니다.

![내 차례 (ko, Light): 완료 오늘 9, 보내기:
ok](https://github.com/yansfil/pr-assets/blob/main/hide/software-factory-ui/9ed33d7/ko-light-turn.png?raw=true)

## Review

- **판단해 주세요**: 그래프 배치가 elkjs layered로 바뀌어 긴 선이 카드 사이로 돌아갑니다; Issues
Dependencies 화면에도 같은 배치가 적용됩니다 (아래 그래프 이미지).
- **판단해 주세요**: 내 차례 맨 위 항목이 펼쳐진 채 답 후보가 바로 보이는 밀도가 적당한지 (위 이미지).
- **판단해 주세요**: 엔진이 쓴 영어 문장(GitHub 읽기/쓰기, `gh` 로그아웃 다음 행동)과 공지 접두사는 모든
언어에서 그대로 보입니다.
- **판단해 주세요**: 새 번들 의존성 elkjs (EPL-2.0); 저장소에 제3자 고지 파일이 없어 고지 문구를 넣을
자리가 없습니다.
- **조심해서 볼 파일**: `herdr-core/src/factory/screen.rs` - 엔진 스레드의 비교와 발행,
high-frequency path.
- **조심해서 볼 파일**: `herdr-core/src/factory.rs` - 명령과 틱마다 `touched()`, 엔진
루프 안의 추가 일, `SystemClock`의 현지 시차.
- **조심해서 볼 파일**: `herdr-core/src/runtime/factory.rs` - runtime mutex 안에서
보내는 이벤트와 거절 경로.
- **조심해서 볼 파일**: `snapshot_delta.rs`,
`contracts/snapshot-wire-enums.json` - snapshot wire에 새 섹션 둘.
- **조심해서 볼 파일**: `persistence.rs` - core
`ui_state.factory_secretary_pane`, 목록에 나온 pane만 기억.
- **조심해서 볼 파일**: `hide-platform/src/time.rs` - Unix
`localtime_r`/`tm_gmtoff`, Windows `GetTimeZoneInformation`; 읽지 못하면 한 번
로그하고 UTC로 셉니다.
- **조심해서 볼 파일**: `hide-factory/src/summary.rs`, `adapters.rs` - 엔진 요약의
날짜 경계 (Clock 포트에 메서드 하나).
- **조심해서 볼 파일**: `web/src/dependencyLayout.ts`, `web/src/TaskBoards.tsx`
- 공유 그래프 배치, worker 수명, 시간 제한, 구조별 배치 기억.
- **비용 검토**: 유휴 시 2분마다 바깥 읽기 시각이 바뀌어 22 KB `factory` 프레임 하나; hided CPU
60초당 0.23-0.25초.
- **비용 검토**: 열린 Task 페이지는 명령과 틱마다 다시 읽지만 같으면 버립니다; 우선순위 변경 20번에 프레임 20개.
- **비용 검토**: 그래프 배치는 같은 노드와 선이면 다시 묻지 않고, 거절된 구조는 한 번만 묻고 한 번만 로그합니다.
- **질문**: 아래 "PRD가 말하지 않은 곳의 가정" 중 바꿔야 할 것이 있는지.

<details><summary>PRD가 말하지 않은 곳의 가정</summary>

- One generic `factory_action` event carries the stage-1 `Command`
(strict decode, whitelisted verbs, one event per action), read as the
PRD's "typed UI 이벤트 하나씩".
- The 내 차례 tab count and the sidebar badge always show the global
`my_turn`, also while the project filter is set.
- With several Factories the board shows Factory after Factory in the
engine's order; the screen re-sorts nothing.
- The flow bar sums the shown Factories' flows; its read time is the
oldest GitHub read among them, stale when any is stale.
- Done today counts by this machine's local day, the day the operator
reads it on; a machine whose offset cannot be read counts in UTC and
logs once.
- The Factory screen is kept out of Recent Panels.
- 카드 고치기 (edit) opens the secretary, because the PRD has no edit form
and the engine's edit is a card re-add.
- The secretary row shows only while an open Factory exists; its pane is
remembered in core `ui_state.factory_secretary_pane`; it starts with the
Factory config's `default_runtime`; its first prompt is English.
- The create sheet asks the engine for a new preview on each project or
verification change and preselects the first detected candidate; it
lists this machine's projects only, because the engine reads local
folders.
- Settings can add a check (the `check` verb is in the screen whitelist)
but not remove one: the engine has no removal verb.
- The Overview's yellow count keeps its aria name '내 차례', which now
overlaps the Factory's 내 차례 (PRD Risks).
- ⇧⌘F was free and is now Open Factory; the shortcut test and the docs
table gained that row.
- The init preview's GitHub reads and writes are English sentences with
no codes; the sheet shows them as given in every language.
- Refusal reasons have no engine enum; the screen labels all 50, held
complete by `labels.test.ts` reading every `refuse`/`Refusal::new`
reason in `hide-factory/src` and `herdr-core/src`; an unlisted reason
shows its code.
- A stop's free-text detail (`stop_detail` in the engine's item text) is
not shown in 내 차례; only the coded reason is.
- The graph's placement and edge routes come from elkjs's layered
algorithm for both Issues Dependencies and the Factory graph (D-08 still
shares one layout); only the Factory graph drops transitive edges. Over
400 cards or 3 seconds the columns layout stays and a diagnostic is
logged.
- An engine notice's text is shown as the engine wrote it, so the
stage-1 prefix `무관한 발견:` stays Korean in every interface language.
- The Task page's chain lists the stored dependencies, including those
the graph leaves out as redundant (L-1 lists L-5, which also waits on
L-2 and L-4).
- B9 puts the time left on the line under the open item; the approved
picture puts the time cue at the item's right, where every item has it,
and the screen follows the picture.
- A failed project check is `init_failed` with a stage; the engine tells
a logged-out `gh` apart only in its English next action, so the sheet
shows that sentence as written in every language. A code for that signal
in stage 1 would let the screen label it.
- With no required checks a GitHub repository still lists CI first; the
sheet's own first pick moves to the detected commands when the engine
refuses CI with `ci_checks_required`.
- Text the engine shortened shows a muted "… (줄임)" where each `[cut N
bytes]` mark was, in decisions, attempt logs and the goal.
</details>

## Evidence

- **확인한 것**: 푸시한 머리 a9370ae(main #738 병합)에서 sasu verify PASS (S1, S2),
CI 통과, build, 집중 테스트 865개, 코어 경계 검사, verify-web, Factory와 Overview e2e
9/9 (Herdr 0.9.3), 그 전 머리 563c1a59에서도 sasu verify PASS (S1
`verify-cargo.sh test`, S2 lint), `verify-cargo.sh build --workspace`,
코어 경계 검사, herdr-core/hide-factory/hide-platform 집중 테스트 865개, verify-web,
design contract, Factory와 Overview e2e 9/9.
- **확인한 것**: 9ed33d70에서 web e2e 19/19: `factory.spec.ts` (그래프가
`layered`로 열림, 만들기 시트에서 `fixture` 프로젝트 선택), `overview.spec.ts`,
`s2.spec.ts`.
- **확인한 것**: 새 테스트: 서울 오전 9시 전에 끝난 Task가 그날의 완료로 세어짐 (Rust); 긴 L-1>L-5
선의 경로가 어떤 카드 상자와도 겹치지 않음, 카드 수 상한, 시간 제한 뒤 worker 종료, 같은 구조 재구성 때 배치 유지,
거절된 구조 한 번만 묻기 (vitest); 조사 대체 표기 없음, 줄임 표시, 충족 기준, 검증 실패 이름, 열 배치 대체
(jsdom).
- **확인한 것**: 격리된 후보 앱 네이티브 QA (9ed33d7, #692 병합 전, 1단계 Factory 사본,
ko/en x Light/Dark): 완료 오늘 9, 보내기: ok, 그래프 layered 선 10개, T-3 줄임 표시, 만들기
시트 프로젝트 calc와 fixture; #664 이전에 쓴 상태 폴더도 그대로 열림.
- **확인한 것**: B25 그래프 열기: 탭 클릭부터 layered 배치까지 23-302 ms (302 ms는 worker를
처음 불러오는 첫 열기), 네 번 모두 main thread long task 0개; 1.6 MB worker 파일은 한 번만
불러옴.
- **확인한 것**: 이전 B25, 50-Task Factory: 입력 echo p50 2.1 대 2.2 ms, p95 9.8
대 11.5 ms, 탭 전환 잡음 범위.
- **확인하지 못한 것**: B25는 debug 빌드, 통제되지 않은 부하; release, 스크롤, 실행 중 Task,
400장 넘는 그래프나 worker 시간 초과의 네이티브 확인 (단위 테스트만).
- **확인하지 못한 것**: GitHub를 쓰는 만들기 시트 전체 흐름 (실제 저장소에 Factory를 돌리지 않음), CI
대체 선택의 테스트, 비서 시작 hook의 단위 테스트, Pen 프레임 렌더.
- **확인하지 못한 것**: 부하 30-60에서 S1이 이 PR 밖 테스트로 실패했다가 단독 또는 재실행에서 PASS:
`github` gh 시간 초과, `codex_trust` 자식 pid (두 번), `ssh_hosts` 주소 None,
`worktrees` stale; 563c1a59의 첫 실행은 디스크가 가득 찬 순간 fixture의 git commit이
실패하고 (e2e 3개) 테스트 바이너리 하나가 실행 중 사라져 (S1) 실패, 다시 돌려 PASS.
- **생성물**: `design/hide-screens.pen`의 Factory 화면은
`scripts/pen-screens-factory.mjs`가 씁니다.

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

![그래프 (ko, Light): elkjs layered 배치, 긴 선이 카드 사이로
지나감](https://github.com/yansfil/pr-assets/blob/main/hide/software-factory-ui/9ed33d7/ko-light-graph.png?raw=true)

![Graph (en, Dark): layered
layout](https://github.com/yansfil/pr-assets/blob/main/hide/software-factory-ui/9ed33d7/en-dark-graph.png?raw=true)

![Task T-3 (ko, Light): 줄임 표시, 검증 실패 0/3, 완료 기준
체크](https://github.com/yansfil/pr-assets/blob/main/hide/software-factory-ui/9ed33d7/ko-light-task-T-3.png?raw=true)

![Create sheet (en, Dark): this machine's projects by node
id](https://github.com/yansfil/pr-assets/blob/main/hide/software-factory-ui/9ed33d7/en-dark-create-projects.png?raw=true)

후속 개선:

- 바깥 읽기 시각을 작은 별도 필드나 섹션으로 내보내, 시각 하나 때문에 요약 전체를 다시 보내지 않기; 엔진이 깨어날 때마다
요약을 다시 만드는 일도 함께.
- 행동 답이 그 행동이 바꾼 요약보다 먼저 옴 (화면마다 보정 중); 요약을 먼저 내보내기, 답은 별도 섹션으로.
- 큐가 가득 차 버려진 `factory_task_open`은 다시 묻지 않아 Task 페이지가 로딩에 머묾.
- 열린 Task 페이지는 프로세스에 하나이고 클라이언트가 떠나도 남음; 클라이언트별 소유로.
- 공유 그래프 worker: 한 그래프의 시간 초과가 대기 중인 다른 배치까지 끝냄 (각자 기한에 열 배치로 남음); 배치마다
시작 시각부터 재는 순차 큐로.
- `summary::build`에 0이 아닌 시차를 넣는 Rust 테스트 (지금은 `local_day`만 고정).
- 제목과 문장 속에 끼워 넣은 질문 글의 `[cut N bytes]`도 줄임 표시로.
- elkjs EPL-2.0 고지를 담을 제3자 고지 파일 체계.
- 그래프 확대/이동과 미니맵.
- CI 대체 선택 때 경고가 잠깐 보임; 무응답 뒤 다시 시도 버튼이 켜져 있음.
- 비서 시작 hook에 테스트 추가; 비서 pane id는 목록에 있는지만 확인하므로 Herdr가 재시작 뒤 id를 다시 쓴다면
신원 확인 추가.
- 1단계가 `gh` 로그아웃을 코드로 알리면 화면이 그 다음 행동을 번역할 수 있음.
- 설정 거절이 모든 칸의 입력을 되돌림; 거절된 칸만 되돌리기.
- 대기 중 add가 루프 끝 발행을 건너뜀 (이 PR 전부터).

</details>

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

- PRD: `agents/prd/software-factory-ui/prd.md` (sha256
4102547e0dfc5f17ab8554209dd17eab92e83036646f14b414ed2369f19dd73b)
- Base e515726 → head a9370ae, verified 2026-10-07T11:00:50.045Z: PASS
- a9370ae is the merge of main fffb3c0 (#738 Herdr 0.9.3, #733) on
563c1a5; sasu implement verify passed on both heads (the first run on
a9370ae was stopped by the disk floor and rerun).
- Verification report:
`agents/runs/software-factory-ui/verification-report.json` and
`agents/runs/software-factory-ui/verification-report.md`; source
fingerprint
bdf303ba6f2a0342e79a3de079ccceb9fff0e4f17a70ea7f4ec6dbe67e91359b
- Suites:
  - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0)
  - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0)
- Reviews:
- Fidelity (b6084f0): B5 init_failed 다음 행동, B22 Close 조건, B13 범위, B25
증거 범위 지적; 앞의 셋은 35f02bef에서 고침, B25는 아래 확인하지 못한 것에 남김
- Code (b6084f0): Medium 5건(secretary 기억 재시도, config 무응답 deadline,
factory_busy 라벨, 늦은 답 유실, Task 페이지 재읽기) 모두 f3fc7d0, 35f02be,
0847812a에서 고침
  - 병합 뒤 후속 리뷰 (0847812, 5d5eb89): Fix now 없음; Follow-up은 아래 목록
- 두 번째 main 병합 뒤 후속 리뷰 (4bdaa80): Fix now 없음; Factory task 상태 `landed`와
`CheckoutSnapshot.landed`가 이름만 겹침 (Follow-up)
- PR 코드 리뷰 1회차 (4bdaa80): 10건; 5건을 0c9a4a1c에서 고침 (자세히 위 Enter, 한글 조합 중
Enter, 거절된 설정값 복원과 중복 전송, 설정 위 ⇧⌘F, 보관만 남은 보드); 나머지 5건은 Follow-up 또는 변경
없음
- 고친 커밋 후속 리뷰 (0c9a4a1): Fix now 없음; 다시 입력한 값 재전송과 문서 문구를 7d87084f에서 반영
- PR 코드 리뷰 2회차 (7d87084): 8건; 6건을 ceae33e1에서 고침 (check/close 답에 config가
없어 설정 화면이 깨짐, 만들기 시트가 이전 프로젝트 답을 다시 읽음, 비운 숫자가 0으로 감, 폼 입력 유실, 받아들여진 답
재전송, 사라진 Factory의 Task 로딩); 2건 Follow-up
- PR 코드 리뷰 3회차 (ceae33e): 10건; 7건을 edd3e432에서 고침, init probe는 변경 없음, 2건
Follow-up
- 977/986 수정 후속 리뷰 (11b2af7): Fix now 2건 (스냅샷마다 그래프 배치가 열 배치로 돌아감, 거절된
배치를 스냅샷마다 다시 물음) 모두 a1965fc, 6c8f90fb에서 테스트와 함께 고침; Follow-up 4건은 위 목록
- main(#664) 병합 뒤 후속 리뷰 (9ed33d7): 병합에서 찾은 만들기 시트의 `"local"` 필터를
9ed33d70에서 고침; 그 밖의 결함 없음
- main(#692, node link) 병합 뒤 후속 리뷰 (7e018cc, 563c1a5, 마지막): 결함 없음;
Factory 시계의 시간대 읽기를 2b가 옮길 기기 일로 경계 검사와 ARCHITECTURE에 적음 (563c1a5)
- Evidence: 41 registered (11 file, 22 screenshot, 8 log); paths are
local to the run directory
  - agents/runs/software-factory-ui/qa/native/RECORD.md
  - agents/runs/software-factory-ui/qa/native/ko-light-graph.png
  - agents/runs/software-factory-ui/qa/native/ko-light-graph-right.png
  - agents/runs/software-factory-ui/qa/native/ko-dark-board.png
  - agents/runs/software-factory-ui/qa/native/en-light-turn.png
  - agents/runs/software-factory-ui/qa/native/en-dark-settings.png
  - agents/runs/software-factory-ui/qa/native/ko-dark-settings.png
  - agents/runs/software-factory-ui/qa/native/ko-light-task-T-9.png
  - agents/runs/software-factory-ui/qa/native/en-dark-task-T-1.png
  - agents/runs/software-factory-ui/qa/native/status.json
  - agents/runs/software-factory-ui/qa/native/facts.json
-
agents/runs/software-factory-ui/qa/design-review/states/light-1440-long-x1.png
-
agents/runs/software-factory-ui/qa/design-review/states/dark-1440-long-x1.png
  - agents/runs/software-factory-ui/qa/design-review/report.md
  - agents/runs/software-factory-ui/qa/native/CORRECTION.md
  - agents/runs/software-factory-ui/qa/b25/RECORD.md
  - agents/runs/software-factory-ui/qa/b25/b25-matched.json
  - agents/runs/software-factory-ui/qa/b25/run1.json
  - agents/runs/software-factory-ui/qa/b25/b25-idle.json
  - agents/runs/software-factory-ui/qa/b25/idle-frames.json
  - agents/runs/software-factory-ui/qa/b25/zz-b25-matched.spec.ts.txt
  - agents/runs/software-factory-ui/qa/b25/zz-b25-idle.spec.ts.txt
  - agents/runs/software-factory-ui/qa/native2/RECORD.md
  - agents/runs/software-factory-ui/qa/native2/CORRECTION.md
  - agents/runs/software-factory-ui/qa/native2/facts.json
  - agents/runs/software-factory-ui/qa/native2/ko-light-graph.png
  - agents/runs/software-factory-ui/qa/native2/en-dark-graph.png
  - agents/runs/software-factory-ui/qa/native2/ko-light-graph-right.png
  - agents/runs/software-factory-ui/qa/native2/ko-light-task-T-3.png
  - agents/runs/software-factory-ui/qa/native2/ko-light-task-T-1.png
  - agents/runs/software-factory-ui/qa/native2/ko-light-turn.png
  - agents/runs/software-factory-ui/qa/native2/en-light-graph.png
  - agents/runs/software-factory-ui/qa/native2/ko-dark-graph.png
  - agents/runs/software-factory-ui/qa/review/merge-664-review.md
  - agents/runs/software-factory-ui/qa/native3/RECORD.md
  - agents/runs/software-factory-ui/qa/native3/facts.json
  - agents/runs/software-factory-ui/qa/native3/ko-light-graph.png
  - agents/runs/software-factory-ui/qa/native3/en-dark-graph.png
  - agents/runs/software-factory-ui/qa/native3/ko-light-turn.png
- agents/runs/software-factory-ui/qa/native3/en-dark-create-projects.png
  - agents/runs/software-factory-ui/qa/review/merge-692-review.md
- Changed paths: 634 (see Files changed)

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