Skip to content

feat(listener): report recent projects instead of past sessions - #36

Merged
tak-bro merged 1 commit into
mainfrom
refactor/drop-past-sessions
Nov 2, 2026
Merged

tak-bro merged 1 commit into
mainfrom
refactor/drop-past-sessions

Conversation

@tak-bro

@tak-bro tak-bro commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

리스너의 세션 보고가 지난 실행 목록(knownSessions, 최대 50건·약 21KB)을 더 이상 싣지 않습니다. 대신 이 컴퓨터가 최근에 연 프로젝트 목록인 recentProjects 를 싣습니다. 프로젝트는 최대 12개이고, 프로젝트·에이전트 쌍마다 그 프로젝트에서 연 가장 최근 세션 하나를 적습니다. 폰은 이 목록으로 '+' 새 세션 시트를 채웁니다. 지금 실행 중인 세션이 없는 프로젝트도 계속 고를 수 있습니다(hwip docs/session-runs.md Q47·Q49).

hwip 쪽 스택 PR(server → iOS → Android → 제거) hwipit/hwip#679 ~ hwipit/hwip#688 과 짝입니다. server PR(#679·#682·#683)이 배포된 뒤 머지합니다.

Changes

  • src/recent-projects.ts(새 파일): recentProjectsToReport(now) 는 레지스트리의 knownSessions(now) 순서대로 (project ?? name, agentKind)별 첫 항목만 남깁니다.
    • 서브에이전트(<parent>.<digits>)와 예약 세션(-sched-)은 뺍니다.
    • 12개 프로젝트까지만 싣습니다.
    • 항목에 시각을 넣지 않습니다. 매 스윕마다 바뀌는 시각이 들어가면 "목록이 그대로면 보내지 않는" 게이트가 무력해집니다.
  • src/sessions-report.ts: planSessionsReport 가 첫 조각에 recentProjects 를 싣습니다. 레지스트리를 읽을 수 없으면(registryUnreadable()) 필드를 아예 뺍니다. 빈 배열을 보내면 서버가 폰의 프로젝트 목록을 지우기 때문입니다.
  • src/listener.ts: knownSessionsToReport·지문·KNOWN_SESSIONS_REPORTED 를 제거하고, 테스트 listener-known-sessions.test.ts 를 삭제했습니다.
  • 그대로 둔 것: 레지스트리, recallRun·recallSession, runId 다시 시작·forget 핸들러.
    • fresh 시작이 레지스트리에서 폴더·에이전트를 고릅니다.
    • 옛 앱이 아직 다시 시작·forget 을 보낼 수 있습니다.
  • README 의 세션 보고 설명을 갱신했습니다.

줄 수: +227 / −456. 삭제한 테스트 파일 하나가 319줄입니다.

How to Test

GitHub Actions 가 돌지 않아 로컬에서 .github/workflows/test.yml 단계를 돌렸습니다.

  • npm run build: 통과
  • npx vitest run --exclude src/http-proxy.test.ts: 211 files, 5635 passed / 1 skipped
    • http-proxy.test.ts 는 main(8e2daa1)에서도 로컬 프록시 환경 탓에 8개가 실패해서 뺐습니다.

Evidence

  • 리뷰: 슬라이스 게이트 리뷰, 브랜치 전체 /review --full, 교차 모델(sonnet) 파인더에서 cli 쪽 지적은 0건입니다.
  • 보안 스캔: Critical·High 0건입니다. project 에는 절대경로가 아닌 프로젝트 이름만 나갑니다.

Risks

  • 배포 순서: hwip server → cli.
    • 옛 server 는 recentProjects 를 무시합니다.
    • 새 server 는 옛 cli 의 보고(필드 없음)를 받으면 저장값을 그대로 둡니다.
  • 이 cli 로 올리기 전의 컴퓨터는 폰 '+' 시트에 실행 중인 세션의 프로젝트만 보입니다.

사람 할 일

  • hwip server PR 이 배포된 뒤 이 PR 을 머지하고 cli 를 릴리스합니다.

Door: two-way(필드 추가·제거. 옛 앱의 다시 시작 경로는 남겨 둠)

🤖 Generated with Claude Code

The phone no longer lists ended runs, so the sessions report stops
carrying knownSessions (up to 50 runs, ~21 KB) and carries
recentProjects instead: the projects this machine ran lately, up to 12,
each agent of a project once with the newest session it ran there. That
is the list the phone starts a new session from (hwip session-runs Q47).

Entries carry no times: a running session's lastSeenAt moves on every
sweep and would defeat the unchanged-inventory gate. An unreadable
registry leaves the field out rather than sending an empty list, which
would clear the phone's project list.

The registry, recallRun/recallSession and the runId resume and forget
handlers stay: fresh starts read folders from the registry, and older
apps may still resume or forget a run.
@tak-bro
tak-bro marked this pull request as ready for review November 2, 2026 15:12
@tak-bro
tak-bro merged commit d47fad6 into main Nov 2, 2026
4 checks passed
@tak-bro
tak-bro deleted the refactor/drop-past-sessions branch November 2, 2026 15:13
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.1.18 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant