Repository navigation
Take an agent's acknowledgement as its receipt and end registrations whose pane is gone - #753
Merged
Merged
Conversation
…whose pane is gone An acknowledgement can only come from the recipient's own pane and session, so it now records hook_confirmed and ends a matching report watch for every agent kind. A bell turn hands over pending letters before letters an earlier build acknowledged without a receipt, and such a letter stops awaiting intake at its delivery deadline, so the existing backlog drains on the store's first pass. A registration ends, with the watches on it, when the host's in-sync replica stops listing its pane, or when the fresh snapshot of a connect lacks the pane of a registration made before that snapshot was asked for. Nothing is judged while a lost stream is replaced or a host is unreachable. The delivery store ends it and logs agent.ended once with its reason.
…ne-pane-registrations
…ne-pane-registrations
…the registration tests
…ne-pane-registrations
yansfil
added a commit
that referenced
this pull request
Oct 7, 2026
Related: #753 ## Summary - On retry, a retired coordinator could overwrite its replacement and end live registrations or watches. - Check installed connector identity under all four coordinator write locks, including after projection. - Admit current bootstrap before connected status and preserve authoritative disappearance handling. ## Review - **Focus**: identity lifetime across retry/removal; current bootstrap and genuine child-only pane loss. - `herdr-core/src/session_sync/coordinator.rs`: ownership must be checked before each affected mutation. - `herdr-core/src/runtime.rs`: installed connector identity must work before connected status. - **Cost**: one map lookup, transient Arc clone/drop and pointer comparison per check; two checks per publication. - Added allocations, retained state, I/O, workers, queues, timers and notification fan-out: zero. ## Evidence - **RED**: one positive case passed and six intended stale-write assertions failed after healthy preconditions. - The initial fixture compile error executed zero tests and is excluded from reproduction evidence. - **Local**: focused 7/7, format and lint passed; workspace 3,220 passed, 0 failed, 17 ignored across 85 summaries. - All seven fence cases also passed in the ordinary workspace run; nine static gates passed. - Final Code, Fidelity and independent Security reviews found no Fix now at the checked head. - Private fixtures exercise real coordinator/watch callbacks and durable ledger outcomes. - Ignored cases include opt-in remote/provider probes and subprocess entry points. - Logs include `delivery_unavailable`; fixture teardown is a plausible explanation, with ordering unproven. - **CI**: verify and Design contract passed at the checked head, both on their first workflow attempt. - CI Rust: 2,070 passed; private SSH mailbox: 1 passed; Linux/Windows OS contracts and Windows checks passed. - Browser CI: Linux 219 passed + 1 flaky; Windows 35 passed + 1 flaky, each flaky case passed on retry. - Tracked flaky cases: #759 (daemon launch) and #760 (process list); causality to this change is unproven. - Both flaky cases are tracked for resolution by 2026-10-14; first-attempt behavior remains unproven. - Planned skips: macOS OS contract, desktop e2e, packaging, and standalone web/desktop checks. - **Unverified**: actual SSH reconnect, live handoff/restart, native agent/app behavior and measured performance.
yansfil
added a commit
that referenced
this pull request
Oct 7, 2026
Related: #749, #753, #758 ## Summary - 분산된 상태 판단을 `herdr-core/src/agent_state/`로 모아 웹과 휴대폰이 core 투영을 그립니다. - 다섯 상태 축, 그룹·요청 동사·주의·push 전이, PR/issue/duty 연결과 checkout/project/device/전체 집계를 이전했습니다. - 기존 화면 값을 회귀 테스트로 고정했고, 상태 모델과 아키텍처 가이드에 소유권을 함께 정리했습니다. 전후 Projects 캡처의 상태·배지·집계는 같습니다. 이전 화면은 기준 소스 archive로 재현했으며, 이후 화면의 Factory 메뉴와 행 이동은 별도로 병합된 main 변경입니다. 두 이미지는 초기 추출의 gallery 비교이며 최종 커밋의 macOS 캡처는 아닙니다.   ## Review - **기존 해석**: 읽은 질문의 Seen+Answer, 위임 행의 Working/Seen, Requests 자식 제외, 물리 수와 루트 수의 차이를 보존했습니다. - **선택 규칙**: 중복 pane의 첫/마지막/전체 선택과 로컬 pet 집계도 기존 화면별 규칙을 유지했습니다. - **주의 파일**: `agent_state/`, `runtime/agents.rs`, `model.rs`의 mutex·snapshot 비용과 웹·hided의 판단 소비 경계를 봐 주세요. - **비용**: 입력 비교 후 변경 시 집계하며 입력/출력 한 쌍을 보관합니다. 새 worker·timer·큐나 mutex 안의 I/O·subprocess·큰 직렬화는 없습니다. - **측정**: 이전 통합의 2-agent driven 21프레임은 같고 payload는 426,263→694,865 bytes(+63.0%)입니다. 유휴는 1프레임/32,529 bytes입니다. - **한계**: 목록 크기는 현재 작업량을 따르며 숫자 cap은 없습니다. 공유 머신 부하·중간 main 변경을 통제하지 않아 대규모 비용과 지연은 미확인입니다. ## Evidence - **CI**: 필수 verify와 design contract 통과. E2E 317개가 통과했고 12개 flaky 보고 모두 실패·flaky가 없었습니다. - **최종 검증**: workspace Rust 3,237개 PASS·17개 ignored, lint PASS. 현재 CLI 빌드·코디네이터 교체 방어 7개·격리 그래프 E2E 2개도 통과했습니다. - **웹·폰**: 이전 통합 웹 1,266개·scope 11개·typecheck/lint/web·desktop build 통과 후 해당 코드가 유지됐습니다. 폰·push 회귀와 실제 격리 폰 흐름도 확인했습니다. - **화면**: 격리 후보 macOS 창 PNG 3개, 현재 그래프 renderer PNG와 기존 sidebar·phone·device 비교를 각 실행 시점·방법에 맞춰 검토했습니다. - **확인하지 못한 것**: 최종 커밋의 OS 캡처·성능 재측정, 설치 bundle, 실제 SSH 기기·물리 폰·외부 push, 전체 로컬 웹 E2E와 fleet/깊은 계보·입력/렌더 지연입니다. - **생성물**: gallery의 `agentStates.json`, `agentScopes.json`, `cmdkScopes.json`은 기존 화면 값을 고정한 fixture입니다. <details><summary>Verification record</summary> - PRD: `agents/prd/agent-state-module/prd.md` (sha256 544eecba9adc7c528111d1b916192f765d7d807f50173446a96ec48ea84cce73) - Base 04af60e → head 4fed648, verified 2026-10-07T22:07:51.839Z: PASS - Verification report: `agents/runs/agent-state-module/verification-report.json` and `agents/runs/agent-state-module/verification-report.md`; source fingerprint 444e26c6ee17e5c55dde8ef62950093dead4b273dbaba0282eb869001d2c43c3 - Suites: - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0) - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0) - Fidelity: reviewed `4fed6484` with the final PASS and all 107 registered identities; no Fix now. Complete B1-B12 responsibility retained; inherited retired-coordinator P2 and F1-F4/C1-C3 are closed. Follow-ups: independent differential corpus, larger/deeper workload measurements and optional future RequestView dependency coverage. - Code: reviewed `4fed6484` with the same final PASS and evidence; no Fix now. Inherited P2 and previous findings are closed. Follow-ups: shared independent differential fixtures and larger/deeper workload measurements. - Material evidence: 105 registered (30 file, 43 log, 32 screenshot); paths are local to the run directory - agents/runs/agent-state-module/final/observations.md - agents/runs/agent-state-module/final/source-audit.md - agents/runs/agent-state-module/final/performance.md - agents/runs/agent-state-module/baseline/publication-measure.json - agents/runs/agent-state-module/final/publication-measure.json - agents/runs/agent-state-module/final/locale-reproduction.json - agents/runs/agent-state-module/final/locale-C-UTF-8.log - agents/runs/agent-state-module/final/locale-en-US-UTF-8.log - agents/runs/agent-state-module/final/scripts-tests-valid-locale.log - agents/runs/agent-state-module/baseline/web-e2e-standard.log - agents/runs/agent-state-module/final/web-e2e.log - agents/runs/agent-state-module/final-phone/web-e2e.log - agents/runs/agent-state-module/final/native-current.log - agents/runs/agent-state-module/phone-count-core.log - agents/runs/agent-state-module/phone-count-web.log - agents/runs/agent-state-module/final-web.log - agents/runs/agent-state-module/final/herdr-contract.log - agents/runs/agent-state-module/final/gate-0.log - agents/runs/agent-state-module/final/gate-1.log - agents/runs/agent-state-module/final/gate-2.log - agents/runs/agent-state-module/final/gate-3.log - agents/runs/agent-state-module/final/gate-4.log - agents/runs/agent-state-module/final/gate-5.log - agents/runs/agent-state-module/final/gate-6.log - agents/runs/agent-state-module/final/gate-7.log - agents/runs/agent-state-module/baseline/electron-agents.png - agents/runs/agent-state-module/final-current/electron-agents.png - agents/runs/agent-state-module/baseline/aside-requests.png - agents/runs/agent-state-module/final/aside-requests.png - agents/runs/agent-state-module/baseline/aside-graph.png - agents/runs/agent-state-module/final/aside-graph.png - agents/runs/agent-state-module/final/before-sidebar.png - agents/runs/agent-state-module/final/after-sidebar.png - agents/runs/agent-state-module/baseline/screens/mobile-phone-list.png - agents/runs/agent-state-module/final-phone/e2e/mobile-phone-list.png - agents/runs/agent-state-module/final-phone/e2e/mobile-phone-detail.png - agents/runs/agent-state-module/final/asm-device-before-two.png - agents/runs/agent-state-module/final/asm-device-before-busy.png - agents/runs/agent-state-module/final/asm-device-before-offline.png - agents/runs/agent-state-module/final/asm-device-after-two.png - agents/runs/agent-state-module/final/asm-device-after-busy.png - agents/runs/agent-state-module/final/asm-device-after-offline.png - agents/runs/agent-state-module/final-current/native-provenance.json - agents/runs/agent-state-module/integration-749/observations.md - agents/runs/agent-state-module/integration-749/build-focused.json - agents/runs/agent-state-module/integration-749/binary-provenance.json - agents/runs/agent-state-module/integration-749/core.log - agents/runs/agent-state-module/integration-749/cli.log - agents/runs/agent-state-module/integration-749-web-all-fixed.log - agents/runs/agent-state-module/integration-749-typecheck.log - agents/runs/agent-state-module/integration-749-lint.log - agents/runs/agent-state-module/integration-749-build.log - agents/runs/agent-state-module/integration-749-desktop-build.log - agents/runs/agent-state-module/integration-749/graph-e2e.log - agents/runs/agent-state-module/integration-749/graph-e2e/graph-cross-project-all-dark.png - agents/runs/agent-state-module/integration-749/graph-e2e/graph-cross-project-all-light.png - agents/runs/agent-state-module/integration-749/graph-e2e/graph-cross-project-opened.png - agents/runs/agent-state-module/integration-749/graph-e2e/graph-cross-project-selected-light.png - agents/runs/agent-state-module/integration-native/os-provenance.json - agents/runs/agent-state-module/integration-native/cleanup.json - agents/runs/agent-state-module/integration-native/launch.log - agents/runs/agent-state-module/integration-native/launch-retry.log - agents/runs/agent-state-module/integration-native/os-agents.png - agents/runs/agent-state-module/integration-native/os-projects.png - agents/runs/agent-state-module/integration-native/os-requests.png - agents/runs/agent-state-module/integration-753/observations.md - agents/runs/agent-state-module/integration-753/cli.log - agents/runs/agent-state-module/integration-753/cli-execution.json - agents/runs/agent-state-module/integration-753/binary-provenance.json - agents/runs/agent-state-module/integration-753/compiler-return-sampler.json - agents/runs/agent-state-module/integration-753/e2e.log - agents/runs/agent-state-module/integration-753/e2e-execution.json - agents/runs/agent-state-module/integration-753/measure.log - agents/runs/agent-state-module/integration-753/measure-execution.json - agents/runs/agent-state-module/integration-753/publication-measure.json - agents/runs/agent-state-module/integration-753/cleanup.json - agents/runs/agent-state-module/integration-753/graph-e2e/graph-cross-project-all-dark.png - agents/runs/agent-state-module/integration-753/graph-e2e/graph-cross-project-all-light.png - agents/runs/agent-state-module/integration-753/graph-e2e/graph-cross-project-opened.png - agents/runs/agent-state-module/integration-753/graph-e2e/graph-cross-project-selected-light.png - agents/runs/agent-state-module/integration-753-ignore.log - agents/runs/agent-state-module/integration-753-asset.log - agents/runs/agent-state-module/integration-753-lock.log - agents/runs/agent-state-module/integration-753-identity.log - agents/runs/agent-state-module/integration-753-worktree.log - agents/runs/agent-state-module/integration-753-pin.log - agents/runs/agent-state-module/integration-753-machine.log - agents/runs/agent-state-module/integration-753-design.log - agents/runs/agent-state-module/integration-758/candidate.json - agents/runs/agent-state-module/integration-758/source-continuity.md - agents/runs/agent-state-module/integration-758/binary-provenance.json - agents/runs/agent-state-module/integration-758/focused.log - agents/runs/agent-state-module/integration-758/focused-execution.json - agents/runs/agent-state-module/integration-758/cli.log - agents/runs/agent-state-module/integration-758/cli-execution.json - agents/runs/agent-state-module/integration-758/e2e.log - agents/runs/agent-state-module/integration-758/e2e-execution.json - agents/runs/agent-state-module/integration-758/cleanup.json - agents/runs/agent-state-module/integration-758/observations.md - agents/runs/agent-state-module/integration-758/graph-e2e/graph-cross-project-all-dark.png - agents/runs/agent-state-module/integration-758/graph-e2e/graph-cross-project-all-light.png - agents/runs/agent-state-module/integration-758/graph-e2e/graph-cross-project-opened.png - agents/runs/agent-state-module/integration-758/graph-e2e/graph-cross-project-selected-light.png - agents/runs/agent-state-module/integration-758/monitor-interruption.md - agents/runs/agent-state-module/integration-758/verify-execution.json - Changed paths: 158 (see Files changed) - Delivery: mode local, branch `prd/agent-state-module`, base `main` - Current S1: 3,237 passed, 0 failed, 17 ignored across 85 result blocks; 196.318 seconds. Current S2 formatting/clippy: exit 0, 20.520 seconds. - Report JSON SHA256: `bb1b2a9aefa99992641c60efd4a8525d5ecb1140faef808470b936e18dd33525`; Markdown SHA256: `f0bef321e08310d0bf0ffa7c35a23040e44e21887c82c9803622b25abd42bdf7`. - Evidence identity: 107 registered paths, comprising the 105 material entries above and two fresh suite logs; all hashes independently checked by both reviewers. - Captures: reconstructed baseline source `9f144877` and extraction gallery `132a875e`; genuine isolated OCU OS PNGs at `73afb9b2`, PID 75917/window 34005. The latter show graph/question/Projects/Requests and do not add an Agents-sidebar-list scenario. Current graph Chromium screenshots use the 4fed CLI and unchanged web build from 73. - Build provenance: recorded 4fed hided/hide hashes identify the CLI/E2E-time build; subsequent workspace tests overwrite ignored target binaries, so those hashes do not assert present on-disk equality. - Measurement: two local synthetic agents at `05515bdf`; idle 1 frame/32,529 bytes; driven 21 frames/694,865 bytes in 12.270 seconds, versus 426,263 baseline bytes (+63.0132%). Uncontrolled external load and intervening main changes prevent causal or final-head performance claims. - Execution history: current focused 7/7, CLI and graph 2/2 completed on their first attempt. The first final sealed attempt was interrupted by an ignored disk monitor racing a disappearing rustc temporary file (owned child -15), not a product test failure; supported recovery preceded the complete PASS retry. Historical native fixture locator failure and locale reproduction remain preserved, with their successful corrected/valid-locale executions separately attributed. - Scope choices: preserved screen-authoritative read/delegated/request/physical-root/local-pet/duplicate-occurrence policies; no Herdr API, persistence schema or dependency change. Accepted main PRs supply the integration baseline. - Evidence limits: historical request comparison uses different sidebar tabs; reconstructed gallery/synthetic devices do not prove current OS capture or live SSH. No installed-bundle, physical-phone/external-push, whole local web E2E, fleet/deep-lineage, mutex or render/echo-latency claim. - Review report SHA256: Fidelity `d708dde37f3cbc41fa579d1b40d40b7d313dec7f0e9515424de58c35184183db`; Code `ac8acd56127be5fb63391eefdd84d3cdd6715ae843f12a57884cbebf18497512`. - Delivery: one PR to `main`; explicit instruction “then ship PR and CI.” overrides this worktree's absent PR-mode configuration without editing it. Merge remains with the Observer. - CI: [verify run](https://github.com/modakbul-gongbang/hide/actions/runs/37696226091), attempt 1, completed success at 2026-10-07T22:42:28Z; 17 successful jobs and 2 configured skips, including the final required verify gate. Design contract also passed. No GitHub rerun. - CI test record: desktop E2E 61, Windows web E2E 36, Linux web E2E shards 55+53+56+56=220; all 317 passed. All 12 native flaky-report steps explicitly reported no flaky test; zero reported failed tests. Linux workspace nextest 3,220 passed/16 skipped. - Delivery image check: both public before/after images loaded in the actual PR browser with complete=true and natural size 608×1800; the checking page was closed. </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.
Related: #747, #749
Summary
수신자 자신의 ack를 모든 kind의 수령 증명으로 기록하고 해당 report watch를 끝냅니다.
예전 빌드의 acknowledged·미수령(false) 편지도 재ack로 복구하며, 기한이 지난 미수령은 unknown(null)으로 종료합니다.
호스트의 확실한 pane 읽기에서 사라진 등록을 delivery store가 끝내되, resync·단절·도달 불가 상태에서는 판단하지 않습니다.
영구 삭제한 device의 pane 캐시를 해제하고 늦게 도착한 retired coordinator의 읽기도 거부합니다.
Review
runtime/delivery.rs의 lock 안 pane 비교와 snapshot 등록 floor, host/device/Factory 범위입니다.delivery/mailbox.rs의 수신자 identity 검사와 durable intake, matching report watch, 재ack replay입니다.delivery/worker.rs의 저장 실패 재시도와runtime/events.rs의 영구 device 삭제 경계입니다.Evidence
추가 근거와 실행 범위
최종 후보는
9b7a68543c9343ef2211697ebe1c3afb04e5329f이며main의 #749 merge148b0e0b를 통합했습니다.Code/Fidelity·독립 Security 최종 리뷰는 이 SHA의 깨끗한 소스와 저장된 원본 실행 로그를 확인했습니다.
d5fb2d32는 legacy ack intake,dac044b2는 영구 삭제 device의 캐시 수명 수정입니다.후속 커밋은 회귀 fixture의 초기 ledger와 assertion 형식을 바로잡았습니다.
로컬
scripts/verify-cargo.sh lint와test는09bf6f2f2d3081faaedfdba71c29897cb9171fdf에서 exit 0입니다.workspace는 85개 suite에서 3213 passed, 0 failed, 17 ignored이며 core는 1743 passed, 7 ignored입니다.
최종 통합본의 Rust·manifest·contract·toolchain 입력 510개와 소유 소스 5개의 해시를 실제 비교해 차이 0을 확인했습니다.
통합으로 들어온 13개 경로는 이 PR의 소유 소스와 겹치지 않습니다.
로컬 전체 suite를 통합 SHA에서 다시 실행한 것으로 표기하지 않습니다.
최종 SHA의 verify 37660855128는 성공했습니다.
Design contract 37660854731는 성공했습니다.
CI Rust workspace는 2063 passed·11 skipped, 별도 remote mailbox는 1 passed·0 skipped입니다.
Linux E2E 네 shard는 각각 55·53·56·56 passed이며 Windows E2E는 36 passed입니다.
Rust·remote mailbox·Windows 검사·Windows E2E·Linux E2E 네 shard의 flaky report 8개가 모두
no flaky test in this run입니다.macOS OS contract·desktop E2E·package lane은 실행되지 않았습니다.
재ack 회귀는 실제 저장·재로드 뒤 receipt true, pull 제외, capacity 회복, matching watch 종료 및 무관한 watch 보존을 확인하도록 구성했습니다.
confirmed replay 뒤 새로 건 watch를 유지하는지도 검사합니다.
null은 expiry 전의 legacy 레코드일 수도 있으며 모델과 계약 모두 pull에서 제외하므로 false 복구와 구분합니다.
cache 회귀는 실제 register/remove 이벤트로 역사적 ID 8개를 순환하고 local·남은 device의 캐시와 전체 ledger·pending end 상태를 보존하는지 확인합니다.
삭제 뒤 늦은 begin/publication 각각의 재생성도 검사합니다.
일반 disconnect/retry에는 영구 삭제의 캐시 제거를 적용하지 않습니다.
9acee99f의 green fixture에서 네 가지 단일 변경 mutant가 receipt·캐시 삭제·늦은 begin·늦은 publication의 의도한 assertion으로 실패했습니다.각 실행은 원래 소스 bytes로 복구하고 HEAD와 소스 청결을 확인했습니다.
이전 세 cache mutant는 fixture 초기화에서 실패했으므로 회귀 증거에서 제외했습니다.
17개 ignored 항목에는 실제 CLI 로그인·원격 fixture·pinned Herdr를 요구하는 외부 lane과 subprocess용 진입점이 있습니다.
CI의 원격 mailbox fixture 성공은 실제 등록된 원격 device의 재연결을 증명하지 않습니다.
이전
dc6fbda1의 verify 37651853773는 성공했습니다.그 실행의 성공은 새 수정 후보의 성공이 아닙니다.
이전 작업자는 격리된 pinned Herdr 재시작 시 첫 snapshot이 같은 pane ID를 복원하는 것을 관찰했지만 live handoff는 실행하지 않았습니다.
운영 ledger 사본의 replay도 이전 작업의 제한된 근거이며 실제 후보 앱의 등록·배달·종료 동작을 증명하지 않습니다.
새 UI는 없고 네이티브 창 검증도 수행하지 않았습니다.