Skip to content

PR과 세션의 연결을 기록해 PR 옆 패널, Issue 패널, Sessions 칩, ⌘K, hide links에서 보여 줍니다 - #638

Merged
yansfil merged 15 commits into
mainfrom
prd/link-graph
Oct 6, 2026
Merged

yansfil merged 15 commits into
mainfrom
prd/link-graph

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: PRD agents/prd/link-graph/prd.md (로컬 계약; 검토할 동작은 아래 Summary와 docs/UI_BEHAVIOR.md PRs 절)

Summary

  • pane이 닫히고 worktree가 정리된 PR에서 "어떤 세션이 이걸 만들었지?"를 찾을 수 없었습니다(예: PR 317).
  • 이제 Hide가 세션, PR, 브랜치, worktree, 이슈 사이의 확실한 연결만 출처와 시작·끝 시각과 함께 별도 SQLite 파일(links.sqlite3)에 기록합니다.
  • PRs 탭의 한 줄 행을 누르면 옆 패널이 열리고 연결(이슈와 출처, worktree)과 세션 N(만든 세션, 일한 세션, 대화 보기, 이어서 하기)을 보여 줍니다.
  • 같은 기록을 Issue 패널의 세션 절, Sessions 탭의 PR 칩, ⌘K 상세의 세션 N, 읽기 전용 hide links pr|issue|branch|session CLI가 읽습니다.
  • 기록은 hide-links worker 하나가 Mutex<Runtime> 밖에서 씁니다: 처음 한 번 최근 90일을 채우고, 이후 바뀐 세션 파일만 읽습니다. 연결된 기기는 helper protocol 18의 link_files/link_read로 연결 사실만 넘깁니다.

PR #352 패널 (Light): pane과 worktree가 사라진 머지된 PR에서 PR을 만든 세션과 그 요청이 보입니다

같은 패널 (Dark)

Review

  • 판단해 주세요: D-41(다른 기기 세션의 대화 보기는 꺼진 채 툴팁으로 이유 표시)과 D-42(OpenCode 이어서 하기 꺼짐)는 위임 아래 좁힌 범위입니다. 이대로 둘지 정해 주세요.
  • 판단해 주세요: 열린 PR/Issue 동안 최대 1년 보관하는 예외는 열린 PR에만 적용됩니다. 열린 Issue만 걸린 세션은 Copied history 기간을 따릅니다.
  • 판단해 주세요: D-22의 "세션 파일을 같은 파서로 한 번 읽어 두 용도를 뽑기"는 이번에 하지 않았습니다. 같은 파서를 쓰지만 검색 색인과 연결 기록은 파일을 각자 읽습니다.
  • 판단해 주세요: 가정으로 정한 것들. 쉬고 있는 live pane 줄은 pane으로 가기를 보이고, 확인 배지는 빼고, B23의 ▷ 맡기기는 세션 절 빈 상태에 두고, D-45 요약은 link_summaries 별도 delta 절로 보냅니다.
  • 판단해 주세요: design/hide-screens.pen의 PRs 탭 Screen sheet(패널 분할, 한 줄 행)는 이 PR에서 고치지 않았습니다. 후속으로 Pen을 맞춰야 합니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/links.rs - runtime mutex 안에서는 사실 fingerprint와 owned 값 전달만 합니다. 파일 읽기나 SQLite가 lock 안으로 들어가면 안 됩니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/snapshot*, web/src/store.ts - snapshot wire에 link_panel, link_summaries 두 절이 각자 revision으로 붙습니다.
  • 조심해서 볼 파일: hide-host/src/protocol.rs, serve.rs - helper protocol 18. link_read는 agent transcript root 밖 경로를 거절하고 대화 본문을 넘기지 않습니다.
  • 조심해서 볼 파일: herdr-core/src/links/store.rs, worker.rs - 새 SQLite 저장소. 64 MiB 상한, secure_delete, 손상 시 한 번 옆에 두고 재생성, 더 새 스키마는 거절합니다.
  • 비용 검토: worker 하나, 대기 시 Condvar. 15초마다(패널이 열려 있으면 3초) 세션 폴더 목록만 훑고, 바뀐 파일만 20 ms 읽고 30 ms 쉽니다. 목록 한 페이지 2,000개, 방문 100,000개, 1회 읽기 1 MiB, 기기 호출 분당 1회와 10초 상한, 요약 2초에 한 번. docs/PERFORMANCE_TESTING.md "Link record worker" 행에 상한과 종료(Drop for Core에서 join)를 적었습니다.
  • 질문: hide links는 창이 한 번 붙어 GitHub PR 목록을 읽기 전에는 not_found를 답합니다(PR 목록 읽기가 창 연결 뒤 시작). CLI가 그 전에 목록을 읽게 해야 할까요?

Evidence

  • 확인한 것: 실제 PR 352(이 Mac에서 만들어졌고 pane이 닫혔고 worktree가 정리됨)를 격리된 Herdr, HOME, 상태 폴더의 후보 hided로 열었습니다. 패널에 PR을 만든 Claude Code 세션 한 줄이 Created PR, 그 요청, 10/3 22:45 - 22:58과 함께 보였고 hide links pr 352도 같은 줄(role created, 요청, 파일 있음)을 답했습니다.
  • 확인한 것: 이 실측에서 1 MiB보다 긴 세션 파일의 뒤 조각에서 읽힌 PR 주소가 앞 조각의 요청을 잃는 버그를 찾아 고쳤고 회귀 테스트를 더했습니다.
  • 확인한 것: Rust 단위·통합 테스트. 저장소 규칙 20개(만든 세션 판정, 같은 파일 재읽기 무증가, 이어쓰기, 이전 PR 닫힘 이후 작업, 다른 Project 경계, 이름 변경, 보관, 손상 재생성 등), CLI 질의 5개, runtime 5개, hide-session 읽기 13개, helper 1개, worker 기기 경로 1개.
  • 확인한 것: web 단위 테스트(세션 줄 순서, 접기, 이어서 하기/대화 보기 차단 이유, worktree 선택, 시각 표기, 요청 턴 찾기, 이슈 키 비교, ⌘K 세션 N)와 bash scripts/verify-web.sh(typecheck, lint, e2e 크기 예산, build).
  • 확인한 것: 결정적 검증 bash scripts/verify-cargo.sh test와 lint가 최종 head에서 통과했습니다.
  • 확인한 것: 첫 CI에서 web e2e 4개 shard, desktop e2e, windows e2e, rust workspace가 통과했고, windows check는 Unix 전용 테스트 하나 때문에 컴파일이 깨져 고쳤습니다.
  • 확인하지 못한 것: web e2e(link-graph.spec.ts, 바뀐 overview-prs.spec.ts)는 이 Mac 디스크가 부족해 로컬에서 돌리지 못했고 CI로만 확인했습니다.
  • 확인하지 못한 것: 실제 mini 기기 연결(B40)은 실측하지 않았습니다. 기기 경로는 가짜 helper 채널로 worker 테스트만 했습니다.
  • 확인하지 못한 것(flaky): 이 Mac의 전체 cargo test 다섯 번 중 세 번, 이 브랜치가 건드리지 않은 hided/tests/opener_lifecycle.rs의 acceptance_timeout_ends_cli_spawned_before_watcher가 "fake helper never wrote its pid"로 실패했습니다. 단독 실행은 매번 통과했습니다.
  • 확인하지 못한 것(flaky): 그 테스트 주석대로 새로 링크된 hided의 첫 실행에 macOS가 약 2초 평가를 하고, 이 Mac은 다른 agent로 부하가 높았습니다. 최종 head는 그 테스트를 먼저 한 번 돌린 뒤 전체 실행이 통과했습니다(재시도 통과).
  • 확인하지 못한 것(flaky): 디스크가 573 MB까지 떨어진 전체 실행 한 번에서 hide-kit a_second_apply_of_an_agent_that_is_on_changes_nothing이 실패했고, 단독으로 두 번 통과했습니다.
  • 확인하지 못한 것: 연결 기록 스키마는 user_version 1 그대로 cursors.subagent 열이 늘었습니다. 출시된 적이 없어 이 브랜치의 이전 빌드가 만든 ~/.hide/state/links.sqlite3만 영향을 받으며, 그런 파일은 지워야 합니다.
추가 증거
  • hide links pr 352 결과(요약): {"number":352,"state":"merged","sessions":[{"agent":"claude","role":"created","request":"Read agents/runs/overview-modal/HANDOFF.md ...","file":"present"}]}
  • 테마 캡처는 패널 영역만 잘랐습니다. Light는 dark class를 뗀 같은 페이지입니다.
Verification record
  • PRD: agents/prd/link-graph/prd.md (sha256 eddc33101dd608397c53ed314476331a9dca7e6de14584d5150d3791407176ad)
  • Base b3a1ba7 → head c4e4b8b, verified 2026-10-06T13:02:38.825Z: PASS
  • Verification report: agents/runs/link-graph/verification-report.json and agents/runs/link-graph/verification-report.md; source fingerprint 2f846f7d872fef9c36291aafa7c4938c0f3d7304b87fa90440b5246eab690c16
  • Suites:
    • S1: GREEN bash scripts/verify-cargo.sh test (exit 0)
    • S2: GREEN bash scripts/verify-cargo.sh lint (exit 0)
  • Reviews:
    • Fidelity, Code, Security (head f37f6b92, full scope): Fix now 8건(Codex CLI 세션 id, 기기 backoff, listed_at 시점, NotFound만 파일 없음, OpenCode Off 보관, 미등록 PR 패널, store 재시도와 쓰기 실패 표시, 2,000개 상한 페이징)과 Security의 학습 경로 확장 제한을 da0bbd6e에서 고침. Security follow-up 중 WAL checkpoint와 issueUrl은 고침
    • Follow-up (head da0bbd6): REVIEW_UNAVAILABLE, 계정 주간 사용 한도(HTTP 429)로 중단. 이후 리뷰가 그 범위를 다시 봄
    • Fidelity·Code·Security 합본 follow-up (head 57eddd9): 8건 RESOLVED. Fix now 5건 중 4건(기기 stamps 실패, 기기 cursor 실패, 닫힌 store 동안의 panes/parents, 재연결 spinner)을 a4e9057e에서 고침. 스키마 버전 1 유지는 미출시라 남김(Evidence에 적음)
    • Follow-up (head a4e9057): 4건 RESOLVED, 첫 페이지 기기 listing 실패가 listed로 기록되는 1건을 bc4c96d6에서 고침
    • Follow-up (head bc4c96d): RESOLVED, 새 결함 없음
    • Follow-up (head c4e4b8b, CI windows check 컴파일 실패 수정): Unix 전용 테스트를 #[cfg(unix)]로 막음, RESOLVED. Windows에서 다른 깨짐 없음
    • Follow-up improvements(후속): 쓰기 실패를 출처별로 추적, 패널 응답을 generation으로 구분, 쓰기 실패 중 listing backoff, 손상 파일 보관 정리, 기기 Refused 메시지의 코드화, --all-projects 시간 예산, 요약 재계산 비용, 패널 하나 슬롯, 행 key 충돌, layout 없는 검색 경로, Windows 기기 helper의 HOME 대신 hide_platform::host::home_dir(), hide-host/tests/link_facts.rs의 std canonicalize
  • Evidence: 3 registered (2 screenshot, 1 api); paths are local to the run directory
    • agents/runs/link-graph/artifacts/live/pr-352-panel-light.png
    • agents/runs/link-graph/artifacts/live/pr-352-panel-dark.png
    • agents/runs/link-graph/artifacts/live/links-pr-352.json
  • Changed paths: 101 (see Files changed)

yansfil added 15 commits October 6, 2026 21:23
Each session record is parsed once and read by both the conversation
parser and a link reader: the branch it worked on (Claude Code `gitBranch`,
Codex CLI `session_meta` `git.branch`), pull request addresses from tool output
and Claude Code's `pr-link` record with the operator request before each, the
run kind (sdk entrypoints and `codex exec` are not interactive), subagent
folding into the parent session, and continuation pointers.
links::candidates and links::read list changed session files and read
them from a checkpoint, refusing paths outside the agent roots, so the
same functions can run on a device helper.
…rker

The store keeps projects, pull requests with their issue links, worktrees
and sessions with their branch spans and printed addresses, each an upsert
on a natural key. A corrupt file is set aside once and made again, a newer
schema is refused, retention follows each project's Copied history read
through a read-only ATTACH of the search index, and the worker reads
changed session files one budget at a time outside the runtime lock.
The runtime hands the link worker owned copies of its projects, pull
requests with their issue links, pane sessions and spawn parents, only when
a fingerprint of them moved. A panel read (links_open) and each project's
counts and chips come back on two sections with their own delta revisions,
off rest. agent_start_in_checkout takes a session to resume with the
provider's own resume arguments, refusing an id that is not one token. The
existing repository read also asks GitHub for the repository id, so a
rename keeps the record.
hide links pr|issue|branch|session reads the link record read-only and
prints one JSON line: the pull requests with their issues and worktrees,
and the sessions with their role, times, request, file and parent. The
caller checkout's Project is the scope; a target only another Project holds
is refused with other_project until --all-projects is given, and one the
record never saw with not_found. It needs no open shell, and there is no
write command.
Helper protocol 18 adds link_files, the device's session files changed
since a time, and link_read, the link facts of a few of them from their
checkpoints; neither answers a conversation, and a path outside the agent
roots is refused. The link worker asks each connected device every minute,
keeps every row a device gave while it is gone, and lists from where it
last stopped when it returns. A device's session joins a project here
through the pull request address it printed, and its other sessions in the
same folder through that.
The PRs tab draws each pull request on one line and opens its panel beside
the list: the head, the facts line, the issues with where each link came
from, the branch's worktrees, and the sessions that made it or worked on it.
The Issue panel gains the same sessions section, Sessions rows and the open
session's head carry the pull requests each session made or worked on, and
the command palette's PR and issue details count recorded sessions.
The PRs spec follows the one-line rows into the panel: the keyboard opens
and moves it, Link issue lives in its links section, and an issue line opens
the Issues panel. A new spec writes session files whose panes never existed
and checks the panel's lines, View conversation, the Sessions chips, a gone
file and Resume.
UI_BEHAVIOR describes the one-line PR rows, the panel, the sessions section
in the PR and Issue panels, the Sessions tab chips and the command palette's
session count. ARCHITECTURE gains the link record's store, worker, helper
calls, panel read and hide links. The resident work ledger gains the link
worker's row, INSTALL names links.sqlite3, and the docs map routes to them.
A listing is read page by page and its time is recorded only once every
page drained with every write kept, so a capped listing or a failed write
is listed again rather than skipped. Only a file that is not there marks a
line's file gone; a refused read is unreadable and keeps the line.

A device whose call failed waits a minute before it is asked again. A store
that cannot open is retried, and while it is closed or its writes fail the
panel says so. The spinner belongs to the first fill only, and an open panel
lists every 3 s so new activity reaches it in seconds.

A Codex CLI session keeps its id across appends, a printer's folder no longer
widens a project past another project's place, an OpenCode session under
Copied history Off is kept until its read finds it gone, and the panel for
a pull request the list does not hold stays open with its failure.
… on success

A page whose files were all read already no longer holds the next page
back for a whole listing period, and a device whose writes recover stops
showing the panel a failure that has passed.
A session file longer than one read budget is read in pieces; an address
printed in a piece with no request of its own now keeps the request an
earlier piece recorded, so the session that made the pull request names
what it was asked.
…s closed

A device's listing no longer moves past a page whose stamps or cursors it
could not read, so those files are listed again. Panes and parents handed
while the record could not open are written once it does. A device listed
through before does not turn the first-fill spinner when it reconnects, and
a device waiting out a failed call wakes the worker when its wait ends.
A device that drops during its listing call left a listing with no next
page and no failure, which the next turn recorded as listed through; the
call's failure now marks it, so the device's files are listed again when
it is back.
The private-file test read Unix permission bits and kept the Windows build
of the core's tests from compiling.
@yansfil
yansfil merged commit 1695dc1 into main Oct 6, 2026
22 checks passed
@yansfil
yansfil deleted the prd/link-graph branch October 6, 2026 17:05
yansfil added a commit that referenced this pull request Oct 7, 2026
…nce (#664)

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를 띄우기 전에 한 번 변환합니다.
- JSON 저장소는 원자적으로 다시 씁니다.
- Memory, 세션 검색, 링크 기록(#638)은 SQLite 트랜잭션 하나로 키를 다시 붙입니다.
- 원본은 `node-migration-backup/<ms>/`에 남깁니다.
- 마지막에 `node.json`에 폴더의 주인 node를 적습니다.
변환하지 못하면 원본은 그대로 남고, 앱 창이 어느 파일 때문에 시작하지 못했는지 보여 줍니다.

```text
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 #722, #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에서도 재현되는 실패들입니다. 고치지 않았습니다.
  - flaky #653 view-bookmarks: 전체 실행에서 1회 실패했고, 단독 2/2 통과.
- desktop terminal-links dense hover: 이 노트북 화면에서 창이 184 columns라 필요한
215를 넘지 못합니다.
- web e2e `agents-tab` 목록 테스트: kit이 `/opt/homebrew/bin`도 찾는데 이 Mac에
OpenCode가 있어 Installed가 4가 아니라 5입니다.
- `hide-platform` watch burst(#651): main의 #669가 고쳤습니다. 그 전 head들의 실패는
아래 Verification record에 남겼습니다.
- **확인하지 못한 것**: 운영자의 실제 링크 기록 레이아웃. 설치된 앱이 #638 이전 빌드라 `links.sqlite3`가
없어서 fixture 계약 테스트로만 확인했습니다.
- **확인하지 못한 것**: `check-herdr-contract.sh`의 실행 중 서버 확인. 이 PR은 Herdr 호출을
바꾸지 않습니다.

<details><summary>리뷰와 처리</summary>

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`이 있는 폴더에서 실패를 재시도할 때 백업 폴더 재사용.

</details>

<details><summary>테스트 고정값 변경 (PRD changes the wire id, D-21)</summary>

아래 파일에서는 `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`.

</details>

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

- rebase 2와 3: b5ddca5e에서 origin/main 3ee278f(#700, #702, #705, #706,
#713, #715, #724 포함)로 옮겼고, 그때 head는 34c44011이었습니다. 충돌 파일:
`herdr-core/src/delivery/worker.rs`,
`herdr-core/src/runtime/delivery.rs`,
`herdr-core/src/runtime/tests/agent_connection.rs`,
`web/e2e/agents-tab.spec.ts`, `desktop/e2e/home-layout.spec.ts`(main의
동작에 node id를 더해 해결).
- main이 더한 코드의 node id: Factory의 수신자와 `hide factory` 기기 확인(667a25c 계열),
main의 자기 기기 fixture 5곳과 #724의 show-here 테스트(e88caa6, 2a929dc). `hide
factory`의 기기 확인은 core 한 곳에서만 하고, Factory가 없을 때도 다른 기기는 main처럼
`factory_local_only`를 먼저 받습니다.
- rebase 뒤 리뷰(667a25c): Fidelity, Security Fix now 없음. Code Fix now
1(main의 자기 기기 fixture가 `"local"`로 남음) e88caa6c에서 고침. 후속:
`factory_local_only` 테스트, move 층에서 `factory:` actor의 node id 다시 쓰기, 저장된
등록이 core node와 같은 id일 때 연결에서 거르기.
- `sasu implement verify` PASS on 667a25c(S1, S2). 그 전 head 5d343e0e에서는
load 30 이상에서 main의 `gh` 5초, `lsof` 10초 시간 초과와 harness 정리 단계의 `kill
EPERM`으로 세 번 실패했고, 각 테스트는 단독으로 통과했습니다. 2a929dcd에서는 main의 GitHub 테스트가 가짜
`gh`에 준 5초 기한이 load 아래에서 다시 넘어, 34c44011에서 같은 파일의
`FIXTURE_DEADLINE`(10초)으로 맞췄습니다(GitHub 테스트 46/46). `sasu implement
verify` PASS on 34c4401(S1, S2, load 14).
- rebase 4: origin/main bcfce96(#656, #716 포함)로 옮겼고, 그때 head는
9cf059c6이었고, 그 뒤 fmt 49deea1, fixture bce1a825를 더했습니다. 충돌 파일:
`herdr-core/src/runtime/tests/agent_connection.rs`,
`herdr-core/src/runtime/agents.rs`(main의 동작에 node id를 더해 해결). #656이 더한
Codex CLI shared server 끄기의 자기 기기 확인(`runtime/kit.rs`, 연결된 helper가 필요 없는
쪽)을 core의 node id로 바꿨고, 그 테스트 9곳의 `"local"`을 `TEST_NODE`로
고정했습니다(9cf059c). web 단위 테스트 `PaneConnection.test.tsx`의 `"local"`은
snapshot이 주는 기기 id 데이터라 그대로 두었습니다(다른 web 단위 테스트와 같음).
- main이 더한 테스트의 fixture 경쟁 수정(bce1a82, 제품 동작 변경 아님, issue 641 영역):
`hide-agent-hooks/tests/fixtures/fake-codex.py`의 `hang` 모드가 자식 프로세스를
`hooks/list`를 받은 뒤에야 띄워서, load 65에서 1.5초 요청 한도가 먼저 끝나면
`a_codex_that_does_not_answer_is_stopped_and_nothing_of_it_is_left`가 "it
started a child"로 실패했습니다(verify 49deea1). 자식을 stand-in 시작 때 띄우게 바꿨습니다.
요청 한도를 50 ms로 줄이면 옛 fixture는 같은 panic으로 실패하고 새 fixture는 통과합니다. 테스트의
주장(시간 초과 뒤 app-server와 자식이 모두 끝남)은 그대로입니다. `sasu implement verify` PASS
on bce1a82.
- rebase 5: origin/main 411f34a(#722, #725 포함)로 옮겼고, 지금 head는
f422844b입니다. 충돌 파일: `herdr-core/src/runtime/delivery.rs`,
`herdr-core/src/runtime/workspace_control.rs`,
`herdr-core/src/runtime/factory.rs`. #725가 checkout caller의 pane hint를
없앴으므로 main 쪽을 따랐고, 배달 권한 목록의 자기 기기 확인만 node id로 바꿨습니다. #725가 더한 테스트의
`"local"` 5곳을 `TEST_NODE`로 고정했습니다(f422844). 관련 테스트 128/128.
- rebase: 옛 head 6605c78(base 104d308, #661 e071177f와 #669 f93ef22
포함)에서 새 base origin/main 2c15edb0로 옮겼고, 새 head는 e3f06887입니다. 두 carried
commit은 빠졌습니다. 충돌 파일:
`herdr-core/src/{lib.rs,labels/mod.rs,runtime/kit.rs,runtime/memory.rs,runtime/tests/lineage.rs}`,
`web/src/{IssueDialogs.tsx,SettingsSheet.tsx,settings.ts}`,
`desktop/e2e/{local-kit,home-layout}.spec.ts`.
- `sasu implement verify` PASS: e3f0688(S1 229.2s, rebase 뒤). 030b1867은
주석과 `hide-memory` 테스트 1건만 더했고, 그 테스트와 clippy, web lint를 따로 돌렸습니다,
6605c78(S1 179.9s), f93ef22(S1 192.6s), 4c287ce. rustc 1.99.0.
- 네이티브 Fidelity, Code, Security 리뷰: 4c287ce, f93ef22, 6605c78c에서 Fix
now 없음.
- #669 이전 head의 S1 실패 기록(모두 `hide-platform/tests/watch.rs`
`a_burst_is_bounded_and_ends_in_an_overflow_rather_than_silence`만 실패, S2
통과):
- 69693b5: 6,311에서 8,047 changes가 3회, load 11-16. 그 전 1회는 `hide-kit` 하위
프로세스 timeout 3건이었고 단독 실행으로 통과했습니다.
- c85aeef: 7,396 changes(load 6.5에서 12.4), 8,807 changes(load 7.1에서
9.5).
  - main 재현: load 14에서 3/3.
- 운영자 상태 복사본 변환: 69693b51의 debug hided(sha256 3aac76ed...).
- 네이티브 QA: a7a3d80f의 candidate 앱.

- 마지막 sasu verify head: bce1a82. 그 뒤 바뀐 것(range-diff bcfce96..bce1a82
vs 411f34a..f422844): 1, 3, 17번 commit의 충돌 해결(#725 쪽을 따름), 새 commit
f422844(#725 테스트 5곳 `TEST_NODE`). herdr-core와 hided nextest 1982/1982,
`scripts/verify-cargo.sh lint` 통과 on f422844.
</details>

## 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를 적지 않으면 지금처럼 이 기계를 뜻합니다.
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