Skip to content

Name why a held-letter notice reached no channel and skip phone push that cannot deliver - #793

Merged
yansfil merged 8 commits into
mainfrom
gen-prd/held-letter-notice-channels
Oct 8, 2026
Merged

yansfil merged 8 commits into
mainfrom
gen-prd/held-letter-notice-channels

Conversation

@yansfil

@yansfil yansfil commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #755
Related: PRD agents/prd/held-letter-notice-channels/prd.md · 앞선 #791 (같은 delivery/worker.rs)

Summary

  • 60분 안에 받는 agent에게 들어가지 못한 편지의 운영자 알림이 휴대폰 push와 Herdr 둘 다 닿지 않았는데, 로그에는 human.channels_failed와 편지 id만 남아 이유를 알 수 없었습니다.
  • 휴대폰 push는 보내기 전에 닿을 수 있는지 판정합니다. 닿을 수 없으면 시도하지 않고 이유(no_vapid, mode_off, app_open, mobile_off, no_subscription)를 적습니다.
  • Herdr 알림은 이 Mac에 socket이 없을 때만 건너뜁니다(no_socket). 나머지는 시도하고, 답의 이유(disabled, rate_limited, no_foreground_client, busy)나 호출 오류를 적습니다.
  • 어느 경로로도 닿지 않으면 로그 한 줄에 알림 종류, 편지 id, 경로별 이유가 남습니다. 편지 내용, endpoint, 키는 남지 않습니다.
  • 새 알림 경로, claim 규칙, 60분 기준, push 다음 Herdr 순서, ledger, 계약, 화면은 그대로입니다.

Review

  • 판단해 주세요: push 모드와 Mobile 스위치가 둘 다 꺼져 있을 때 이유는 먼저 맞는 mode_off로 적습니다(운영자가 알림을 받으려면 바꾸는 설정이 모드이기 때문). 순서가 맞는지 봐 주세요.
  • 조심해서 볼 파일: hided/src/mobile/push.rs notice_route - 틀리면 닿을 수 있던 push를 건너뜀. mode_allows를 그대로 쓰고 조건마다 단위 테스트가 있음.
  • 조심해서 볼 파일: hided/src/mobile/mod.rs - 경로 판정은 Mobile mutex 안에서만 하고 Mutex<Runtime> 아래에서는 하지 않음. 휴대폰 최대 4대로 보내는 것은 그대로.
  • 조심해서 볼 파일: herdr-core/src/delivery/worker.rs notify_herdr - 이제 Result<(), 이유>를 돌려줌.
  • 비용 검토: 상시 작업 변화 없음. 알림 한 번당 판정이 한 번 늘 뿐이고, 새 thread/timer/호출은 없습니다.

Evidence

  • 확인한 것: 경로 판정 단위 테스트 - 조건별과 경계(app_closed에서 앱 창 0개/1개), 여러 원인이 겹칠 때의 순서, Herdr 답 이유 매핑(FakeHerdr).
  • 확인한 것: 실제 hided를 자식 프로세스로 띄우는 통합 테스트 hided/tests/it/held_letter_notice (진단 sink가 프로세스당 하나라서, 한 binary 안의 다른 daemon이 로그를 가로채지 않게 함) - 시드한 ledger의 배달되지 않은 편지로 (1) Herdr socket 없음: 두 경로 이유가 로그에 남음, (2) 닿는 휴대폰: loopback 가짜 push 서비스에 201 뒤 500을 주고 편지가 처리된 것을 확인한 뒤 실패 로그가 없음(B9), (3) 고정 Herdr 0.9.3 위 ignored 테스트: push=mode_off와 Herdr 이유가 로그에 남음. 심은 결함(mode와 mobile 검사 순서 뒤바꿈, mobile 검사 반전)이 테스트를 실패시킴.
  • 확인한 것: sasu implement verify는 main을 합치기 전 헤드 19a3a23에서 PASS (S1 test, S2 lint). 마지막 헤드는 아래 '확인하지 못한 것' 참고. real_herdr의 pinned-Herdr 도우미를 tests/it/support/private_herdr.rs로 옮겼고(순수 이동) 기존 테스트도 통과.
  • 확인하지 못한 것: operator의 휴대폰, 앱, Herdr, ledger는 건드리지 않아 실제 push 도착은 보지 못했습니다. 격리된 daemon과 비공개 Herdr만 썼습니다.
  • 확인하지 못한 것: 마지막 헤드(d96282169)의 sasu implement verify는 PASS하지 못했습니다. 이 변경 밖의 hide-platform process::repeated_guarded_work_releases_children_and_capture_resources(descendants 4 != 5)가, main이 crate별 tests/it 한 binary로 합쳐진 뒤 cargo test 전체에서만 실패했습니다. 단독 실행과, main(3766d99)에서 scripts/verify-cargo.sh test -p hide-platform --test it를 두 번 돌린 결과도 통과했으므로 부하나 순서에 따라 달라지는 실패로 보입니다. 이 PR의 diff에 hide-platform은 없습니다. main 합친 뒤 변경(875ed8a, d962821)은 집중 테스트만 했고 재리뷰는 하지 않았습니다. CI가 증거입니다.
  • 확인하지 못한 것: 이 머신 부하로 로컬 verify가 letter_origin(첫 exec 데드라인) 시간 의존 테스트에서 한 번 실패했고 단독 실행과 재실행은 통과했습니다. 마지막 커밋(테스트만 변경)은 재검토 없이 재검증만 했습니다. CI가 최종 증거입니다.
Verification record
  • PRD: agents/prd/held-letter-notice-channels/prd.md (sha256 6b64ba9b28bc7f7aaeaf40194269d5d5bd19751a83153330266b2f950dc1b7c6)
  • Last verified head 19a3a23 (base 044d016), 2026-10-08T09:59:08.933Z: PASS. Pushed head d962821 (main merged, test moved to the it binary, daemon as child process): verify FAIL on an unrelated hide-platform test, see Evidence
  • Verification report: agents/runs/held-letter-notice-channels/verification-report.json and agents/runs/held-letter-notice-channels/verification-report.md; source fingerprint 7aaf71af1522cb2df6d5695589c1955db295e82ecea8d6f936dfbc34fabbede9
  • Suites:
    • S1: GREEN bash scripts/verify-cargo.sh test (exit 0)
    • S2: GREEN bash scripts/verify-cargo.sh lint (exit 0)
  • Reviews: Fidelity on d5701be and 83167bf: B1-B11 and D-01..D-11 all covered, no gaps. Code on d5701be: nothing blocking, stale scripts/ci-plan.py comment fixed. Code on 83167bf: one test defect (the reachable-phone test read the log before the daemon could write it), fixed in 19a3a23 which was re-verified only. Follow-up improvements: none.
  • Evidence: none registered separately.
  • Changed paths: 12 (see Files changed)
  • Delivery: mode pr, branch gen-prd/held-letter-notice-channels, base main

@yansfil
yansfil merged commit 5ba348f into main Oct 8, 2026
20 checks passed
@yansfil
yansfil deleted the gen-prd/held-letter-notice-channels branch October 8, 2026 15:58
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.

묶인 편지 알림이 휴대폰 push가 꺼져 있으면 아무에게도 닿지 않는다

1 participant