Repository navigation
Close a request's answer wait when a party ends or after 24 hours - #791
Merged
Merged
Conversation
A request or block letter waited for its answer until the recipient replied or the sender cancelled, so letters nobody answers filled the 1024 open-letter cap and every new send was refused with capacity. The wait now ends when the sender's or the recipient's registration ends, in the same transition that ends its watches, or 24 hours after the letter was sent, judged in the store's existing maintenance pass. The letter keeps its state, waiting_answer turns false, finished_at is set, and a new optional answer_wait_ended field (party_ended or deadline) tells the sender why through hide request show. The ledger stays at version 1 and an older ledger loads unchanged. Each closed wait logs one structured answer_wait.ended diagnostic without the body. The open and retained limits, hide inbox and the screen are unchanged. The CLI contract and docs/delivery.md follow the new field.
…ided The external delivery lane registers the local recipient, has a remote pane send it a request the recipient takes in, ends the recipient's registration, and reads from the sender's pane through hide request show that the wait ended as party_ended with the state unchanged. The core log carries one answer_wait.ended line with the reason and no body.
…end rule A registration ending now ends the answer wait only of letters the recipient took in, so a request still awaiting intake follows its 60-minute delivery deadline as before. Repeating hide agent end on a registration that already ended no longer ends the waits of the live registration that took the same pane and session. Tests pin the exact pane, device and session match, and the guide states the retention of finished waits.
yansfil
added a commit
that referenced
this pull request
Oct 8, 2026
…that cannot deliver (#793) 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가 최종 증거입니다. <details><summary>Verification record</summary> - 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` </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #764
Related: PRD
agents/prd/request-answer-wait-ends/prd.md· 이어서 #755 (같은delivery/worker.rs를 건드려 이 PR 뒤에 시작)Summary
request/block편지가 답이나 취소가 올 때까지 열린 채 남아, 열린 편지가 1024개에 닿으면 모든hide request send가capacity로 거절됐습니다.hide agent end, pane 사라짐) 받아 간 편지의 답 기다리기가 그 전이에서 같이 끝납니다.waiting_answer: false,finished_at, 새 필드answer_wait_ended(party_ended또는deadline)를 남기며hide request show로 보입니다.hide inbox, 화면은 바뀌지 않습니다. ledger 버전 1과 새State값 없음을 지켜 옛 build도 파일을 읽습니다.Review
Pending) 편지는 등록이 끝나도 닫지 않고 기존 60분undelivered기한에 맡겼습니다. PRD B1의 "받아 간" 문구를 따른 해석입니다.herdr-core/src/coordination/mod.rs-end_record가pane+device+session일치로 actor를 고르고 이미 끝난 등록의 반복 end는 건드리지 않음 (live 가드). 틀리면 살아 있는 대기가 닫힘.herdr-core/src/delivery/{ledger,worker}.rs- 기한 판정now - created >= 24h, 유지 보수 idle 조건에answer_overdue추가, 진단은 저장 성공 뒤에만 한 줄씩(본문 없음).Evidence
hide agent end하면 보낸 쪽hide request show가waiting_answer:false,party_ended, 상태delivered를 보이고 로그에 이유만 있고 본문은 없음.nextest --profile ci --workspace3320개 통과, lint와 fmt 통과, 심은 결함(유지 보수 조건 제거, live 가드 제거) 두 가지가 테스트를 실패시킴.sasu implement verifyPASS (S1 test, S2 lint).watch.rs가waiting_answer를 셈)로만 성립합니다.origin/main을 합친 뒤 헤드에서 PASS했습니다. CI가 최종 증거입니다.Review notes (advisory)
683892179에서 PASS (노트 있음), Fidelity+Code+Security는550ced2fa까지 PASS (Fix now 없음). 이후 변경은origin/mainmerge뿐입니다.Pending편지 제외, actor 매칭 표 테스트, 보관 기간 문서 보강.record_intake가 등록을 보지 않음). 늦은 reply/cancel 뒤에도answer_wait_ended가 남아show에 "답 없이 닫힘"으로 보임. 둘 다 24시간 상한 안이라 이 PR 밖으로 둡니다.resolve_actor가 parent를 id 또는 name/pane으로 맞춤. 이 변경과 별개라 따로 이슈로 둡니다.Verification record
agents/prd/request-answer-wait-ends/prd.md(sha256 711af4228dd6a5c608077d339c8bf5290707f7b31d10bc374750fc29e51b83d0)agents/runs/request-answer-wait-ends/verification-report.jsonandagents/runs/request-answer-wait-ends/verification-report.md; source fingerprint 22130f4d05a8e0615987bcca155e53014dab58bbd72aa3e82414a1d0873cc5d6bash scripts/verify-cargo.sh test(exit 0)bash scripts/verify-cargo.sh lint(exit 0)gen-prd/request-answer-wait-ends, basemain