Skip to content

fix: show one pull request list per session on every surface - #1859

Merged
yansfil merged 12 commits into
mainfrom
feat/pr-display-one-source
Oct 30, 2026
Merged

yansfil merged 12 commits into
mainfrom
feat/pr-display-one-source

Conversation

@yansfil

@yansfil yansfil commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

같은 세션이 태스크 줄, pane 머리, 세션 기록에서 서로 다른 PR 수를 보였습니다(한 Conductor가 기록 15개, 태스크 줄 3개).
화면마다 PR을 따로 모았고, 끝난 자식의 PR은 줄에서 빠졌으며, 닫힌 PR은 버려졌기 때문입니다.
이제 core가 세션마다 PR 목록 하나를 만들고(자기 것 + 살아 있거나 끝난 모든 자손의 것), 모든 화면이 그 목록만 읽습니다.
merge된 PR은 모두, 닫힌 PR은 흐리게 남습니다. GitHub 목록(최근 200개) 밖의 PR은 기록의 마지막 상태로 stale 표시하며 남깁니다.
기록에서 merge된 PR 4개가 빠지던 원인도 고쳤습니다: 각 세션의 gh pr create가 주소를 GitHub 생성 시각보다 2.63.2초 먼저 찍었는데(두 시계 차이), 판정 창이 앞쪽 2초뿐이었습니다.
이제 PR을 만드는 호출(gh pr create, gh api POST repos/o/n/pulls, create_pull_request 도구)이 성공해 돌려준 주소는 GitHub 생성 시각 -10초
+30초 안이면 그 세션이 만든 PR입니다. 그 밖의 출력은 예전 창(-2초/+30초) 그대로입니다.

사이드바 줄: 리드의 목록에 끝난 자식(P4)의 PR이 남고, 닫힌 #819는 흐리게
사이드바 줄: 리드의 목록에 끝난 자식(P4)의 PR 두 개가 남고, 닫힌 #819는 흐리게 그려집니다(gallery).

Review

  • 판단해 주세요: 닫힌 PR을 목록 끝에 흐리게 남기고 개수에도 셉니다(예전에는 빠짐). 부모 줄 개수가 늘어납니다.
  • 판단해 주세요: 기록이 이제 pane이 체크아웃 브랜치로 맡은 PR도 보입니다(줄 표시와 같게). 예전 기록은 세션이 만든 PR만 보였습니다. e2e 두 개의 기대 수를 2에서 3으로 바꿨습니다.
  • 판단해 주세요: 만든 세션 판정은 생성 행위입니다. 호출과 출력을 형식별 id로 짝짓고(Claude tool_use_id, Codex call_id, Pi·Grok toolCallId, OpenCode는 한 part), 출력에서 줄 하나가 주소뿐인 것 또는 응답 JSON의 html_url만 만든 PR로 봅니다(본문에 든 다른 PR 주소는 아님). agy는 결과가 호출을 가리키지 않아 시간 창만 씁니다.
  • 판단해 주세요: link 기록 v12가 session_prs.made 열을 더하고 최근 90일 파일을 다시 읽습니다(v10 때와 같은 방식). 그래야 업그레이드 전에 만든 PR도 잡힙니다. 업그레이드 직후 한 번 읽기 부하가 있습니다.
  • 판단해 주세요: 생성 호출로 인정하는 조건. 호출에 ||가 없고(앞 명령이 실패해야 도는 명령이 없음), 기록이 실패로 표시하지 않은 호출(Claude is_error, Codex 종료 코드, Pi isError·exitCode, Grok failed, OpenCode 상태·종료 코드)만입니다. 실패한 gh pr create는 브랜치에 이미 있는 PR 주소를 찍기 때문입니다. &&, ;, 파이프로 이어진 호출은 인정합니다: test: keep the terminal address whole on Linux and record why the Windows shell never draws #1810~#1813을 만든 호출이 모두 cd … && B=…; cat > $B <<EOF … EOF 다음 gh pr create … | tail -1 모양이었습니다.
  • 판단해 주세요: 생성 호출 출력의 앞쪽 창은 -10초입니다. 이 Mac 기록에서 생성 출력 234개 중 가장 이른 것이 GitHub 시각보다 3.4초 앞이었습니다(test: keep the terminal address whole on Linux and record why the Windows shell never draws #1810~#1813은 2.6~3.2초). 10초 창이 같은 호출에서 조회만 한 오래된 PR(gh pr create && gh pr view 42)을 걸러냅니다.
  • 남는 위험: 생성 호출이 같은 호출 안에서, 다른 세션이 10초 안에 만든 PR을 조회해 주소만 한 줄로 찍으면 그 PR도 이 세션이 만든 것으로 잡힙니다.
  • 알려진 위험(이번 범위 밖, 기존과 같음): 뒤쪽 +30초 안에 다른 세션이 같은 주소를 찍으면(예: 리드가 막 생긴 PR을 gh pr view) 그 세션도 만든 세션으로 잡힙니다.
  • 조심해서 볼 파일: hide-session/src/links.rs, named_prs.rs, opencode.rs, conversation_cursor.rs, hide-shell/src/lib.rs - 생성 호출 판별(ShellLine::fallback), 형식별 실패 표시, 호출-출력 짝짓기, 아직 출력이 없는 호출 id를 체크포인트에 실어 다음 poll로 넘김(최대 16개).
  • 조심해서 볼 파일: herdr-core/src/runtime/session_state.rs - high-frequency path, 모든 줄을 다루는 교차 패스에 목록 계산을 얹었습니다.
  • 조심해서 볼 파일: herdr-core/src/agent_state/work/family.rs - 새 단일 출처. 줄, 기록 그룹, 200개 창 밖 처리가 모두 여기서 나옵니다. 기록 그룹은 잘린 목록만 나눠 담고 같은 omitted(pr_omitted)를 싣습니다. 여러 장비가 같은 PR을 읽으면 fresh > 최근 read > 나쁜 상태 순으로 고르고, 살아 있는 줄의 PR도 고른 read의 상태와 제목을 씁니다(read가 없을 때만 줄이 든 값).
  • 조심해서 볼 파일: herdr-core/src/links/ledger_store.rs, links/store.rs, links/mod.rs - 판정 창 SQL(made면 -10초, 아니면 -2초)과 요약에 부모 간선, 만든 PR의 상태를 싣는 부분.
  • 조심해서 볼 파일: web/src/prMark.ts, components/pr-mark.tsx - snapshot wire: AgentRow.pulls 신설, state.pr 삭제, pr_groups[].pulls.
  • 비용 검토: 목록은 기존 교차 패스 안에서 메모리로만 계산합니다. lock 밑 I/O나 subprocess는 없습니다.
  • 비용 검토: 기록 쪽 색인은 link worker 요약이 바뀔 때만 다시 만듭니다. 줄은 목록이 바뀐 때만 publish되고, 기록 그룹은 비교 후 바뀐 때만 복사합니다. fresh PR은 읽은 시각을 싣지 않아 GitHub가 같은 답을 다시 줘도 목록이 바뀌지 않습니다.
  • 비용 검토: sync_session_state는 자동 해결을 저장했을 때만 두 번째 projection을 돌립니다.
  • 비용 검토: 줄당 PR 200개 상한, 넘으면 omitted 개수와 넘는 순간 진단 한 번. 기록 세션 탐색은 줄당 2000개 상한이고 넘으면 같은 진단에 lineage_capped로 남깁니다. 상한 안에서 PR을 하나도 못 찾아도 이 사실은 남습니다.
  • 비용 검토(측정 안 함): lock 보유 시간과 snapshot 크기는 재지 않았습니다. 계산이 메모리 안이고 상한으로 묶인다는 것까지만 말할 수 있습니다.
  • 비용 검토: 조상이 자손 PR을 반복해 실으므로 snapshot이 트리 깊이만큼 커지지만, 줄당 상한으로 묶입니다.

Evidence

  • 확인한 것: 운영자 links.sqlite3 읽기 전용 사본과 원래 transcript 복사본에 새 reader를 돌림(이번 규칙으로 다시). test: keep the terminal address whole on Linux and record why the Windows shell never draws #1810(-2744ms) test: fix the Windows-only flaky tests at their causes #1811(-2968ms) test: let the sleeping-child handoff test decide every delivery pass #1812(-2586ms) fix: remove the causes of the hided core move, remote core and node owner flakes #1813(-3182ms) 모두 자기 세션의 복합 gh pr create 호출 출력으로 made. 같은 주소를 나중에 찍은 다른 세션 출력은 made 아님.
  • 확인한 것: 검토 반례 테스트. gh pr create --fill || gh pr view 42 호출은 Claude·Codex·Grok·Pi·omp·OpenCode 두 스키마 모두 made 아님. 실패한 Claude 생성 호출이 찍은 기존 #42도 made 아님. 하루 전에 만든 #42를 ||와 && 호출이 찍은 세션은 store에서 둘 다 Worked뿐(Created 아님). test: keep the terminal address whole on Linux and record why the Windows shell never draws #1810~#1813의 실제 복합 호출 모양은 -3.2초에 Created, -12초 made 출력은 빠짐.
  • 확인한 것: 생성 행위 테스트. Claude·Codex·Grok·Pi·omp·OpenCode 두 스키마에서 gh pr create 출력은 made, agy와 bash scripts/ship.sh 출력은 아님. 호출과 출력이 다른 poll에 읽혀도 made. 목록에 혼자 있는 주소는 made 아님.
  • 확인한 것: 저장 경로 테스트. 생성 호출이 3.2초 먼저 찍은 PR은 Created, gh pr list가 3초 먼저 찍은 PR은 아님. v11 기록이 열과 재읽기로 업그레이드됨. 기록 출력에서 made 3.4초 전은 남고 made 12초 전과 목록 3초 전은 빠짐. label 판정도 같음.
  • 확인한 것: core 목록 테스트. 줄이 옛 open #42를 들고 reads가 최신 merged를 줄 때 줄 목록이 merged(read 순서 3가지 모두), fresh 재읽기는 목록 같음, 상한 뒤 세션에만 PR이 있는 2001개 lineage는 빈 목록이지만 lineage_capped이고 pulls.capacity 진단 한 번, 끝난 자식 100+101개에서 줄 200개 omitted 1과 기록 200개 pr_omitted 1이 같은 URL 집합, 세션 2001개 lineage는 lineage_capped, A→B→C에서 B의 줄·기록이 C 진행 중과 끝난 뒤 모두 같음.
  • 확인한 것: web 태스크 자식 줄 테스트(A→B→C의 B가 Make the recent-panel chord span every project #41·Route background AI requests through an owned provider boundary #42 둘 다). web vitest 전체 262개 파일 2283개 통과, tsc, eslint 통과.
  • 확인한 것: hide-shell·hide-session nextest 전체 365개 통과, herdr-core 바뀐 모듈 nextest 254개 통과, hide-agent-hooks nextest 395개 통과, clippy(herdr-core, hide-session, hide-shell, hide-agent-hooks, all-targets) 경고 없음, cargo fmt --check 통과.
  • 확인하지 못한 것: 전체 Rust suite, Playwright e2e, Windows·Linux lane은 CI에 맡깁니다.
  • 확인하지 못한 것: 실제 Conductor 세션 native 확인, 업그레이드 후 재읽기를 실제 기록에서 돌려본 것. 운영자 앱·서버는 건드리지 않았습니다.
추가 증거

세션 기록 PR 영역: 같은 목록, 끝난 자식의 닫힌 #1538 흐림
세션 기록 PR 영역을 펼친 상태: 같은 목록에서 그룹을 나누고, 끝난 자식의 닫힌 #1538은 흐리게(gallery).

Verification record
  • base origin/main, head 0ca41fd92
  • scripts/verify-cargo.sh nextest -p hide-shell -p hide-session: 365 passed
  • scripts/verify-cargo.sh nextest -p hide-agent-hooks: 395 passed
  • scripts/verify-cargo.sh nextest -p herdr-core -E 'test(/links::|labels::facts|work::family|session_state|request_view|session_record|node_migration|pulls/)': 254 passed
  • scripts/verify-cargo.sh clippy -p herdr-core -p hide-session -p hide-shell -p hide-agent-hooks --all-targets -- -D warnings: clean; check --workspace --all-targets: clean; cargo fmt --check: clean
  • scripts/verify-web.sh web test (head 7d46918d7, no web change since): 262 files, 2283 passed; typecheck, lint: clean

…before GitHub's creation time

The creation window compared this machine's clock with GitHub's and allowed
only 2 s on the early side; mission-13's #1810 to #1813 were printed 2.6 to
3.2 s before GitHub's createdAt and left their sessions' records. The window
is now 30 s either way, one constant shared by the link record and the label
worker.
…ants included

One list per row (agent_state::work::family) gathers the pull requests the
session holds or made and every descendant's: live ones from their rows,
ended ones from the link record's summary, which now carries each session's
parent and the record's last read of each pull request. A pull request
GitHub's 200-newest list no longer holds keeps the record's state as stale
instead of leaving the list, and closed ones stay listed. The session
record's PR section is laid by the runtime from the same function, so the
record and the row show the same list. RowState.pr and own_prs are removed.
The task row, pane header, project tree, Overview task card and session
record now read the one list the core lays on each session row, so an ended
child's pull requests stay on its parent and a closed one stays listed,
dimmed. The web's own family and session gathering is removed.
… on the branch

The record now reads the session's one list, which holds the pull request
the pane holds on its checkout's branch, as its row's mark does; the e2e
fixture opens every pull request on main, so #32 is listed from the start.
…w draws

The record cut the parent's list at 200 and then read each child's list
again, which put the pull requests past the cap back. It now places only
the capped list into groups and carries the same omitted count; a lineage
past the 2,000-session walk is logged instead of ending quietly.

The same pull request read on several machines takes the fresh, latest
read whatever order the reads arrive in, and a fresh read carries no read
time, so GitHub answering the same again publishes nothing. The second
projection after queueing automatic resolutions runs only when one was
saved.
…ess back

A tool output that answers gh pr create, a gh api POST to the pulls path or
a create_pull_request tool now marks the address it gave back as made by
the session, in the link facts and on the label worker's sightings. Each
format pairs a call with its output by its own id (Claude tool_use_id,
Codex call_id, Pi toolCallId, Grok toolCallId; OpenCode keeps both in one
part), and a reader that reads in polls carries the waiting call ids in its
checkpoint. agy's results name no call, so its prints stay judged by time.
… s early edge for other prints

The earlier change widened the window to 30 s either way, which would also
count a session that only listed a new pull request on a skewed clock as its
maker. The window goes back to 2 s before and 30 s after GitHub's createdAt,
and an address its creating call gave back (session_prs.made, a label
sighting's made) is the session's making at any distance. Version 12 of the
link record adds the column and reads the last 90 days of files again, so
mission-13's #1810 to #1813, printed by their own gh pr create 2.6 s to
3.2 s before GitHub's time, are found.
…ep the walk's cap on an empty list

A live row's pull request kept the state and title its request carried
even when the read chosen across machines said otherwise, so a merge one
machine had read showed as open. It now takes the chosen read and falls
back to the request's copy only when no list holds the pull request.

A lineage whose pull requests all lay past the 2,000-session walk returned
no list and so dropped the fact that it stopped early; the list is now
returned empty with the fact, and the row and the record log it.
…ed and has no fallback

A shell call joining gh pr create to another command with || runs that
command when the create fails, and a failed create prints the pull request
already on its branch, so neither proves the session made the address it
printed. The shell reader now marks a call holding ||, and each session
reader passes its format's failure flag to the output that answers a
creating call.
A creating call's print was taken whatever the clocks said, so a call that
also viewed an old pull request made it. The store now takes a made print
from 10 s before GitHub's createdAt to 30 s after, and any other print from
2 s before as before. This Mac's record held 234 creating prints, the
earliest 3.4 s ahead; mission-13's four were 2.6 s to 3.2 s ahead.
@yansfil
yansfil merged commit 92b3964 into main Oct 30, 2026
55 checks passed
@yansfil
yansfil deleted the feat/pr-display-one-source branch October 30, 2026 05:03
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