Repository navigation
Track Herdr mutations as core-owned async operations - #89
Merged
Merged
Conversation
Every pane split, zoom, resize, tab move, remote mutation and close now has one core-owned operation record with a connection generation, target and conflict scope, phase, stage, start time and absolute five-second deadline, exported as status.async_operations. Transport success no longer settles a mutation: the record waits for an authoritative session event or a fresh snapshot to show the created, changed or absent topology, an expired or ambiguous answer becomes an explicit unknown that is never resent, and a same-scope request is refused while one is in flight. A close enters closing as soon as it is approved, moves selection to a confirmed surviving pane or tab, refuses input, focus and a second close on the same target, and only then exports the layout and sends the close. The captured item is a reservation apart from the twenty confirmed undo entries, so a refused or unknown close cannot evict history, and only an authoritative absence promotes it in request order. An ambiguous result starts one read-only status check whose fresh snapshot is applied to the navigator before the reservation is classified, so a target confirmed absent cannot stay drawn until an unrelated event. Unknown agent activity blocks a destructive close until a fresh status arrives, separately from the one-time work-interruption confirmation, and an unread completion no longer prompts. The session coordinator gains a 250 ms tick that advances every deadline without waiting for a Herdr event, drains a shell-requested status refresh into the next agent.list read, publishes independent workspaces while a dependent workspace still waits for its layout or replacement focus, and no longer joins a blocked subscription reader on disconnect. Ports agents/prd/hide-async-state onto the runtime, session_sync and shell module split; the operation records live in runtime/operations.rs and the close lifecycle beside reopen in runtime/editor.rs.
The approved contract for core-owned asynchronous pane and tab state: immediate local intent, Herdr-confirmed existence and placement, bounded deadlines, unknown results that are never resent, and a close reservation separate from confirmed undo history.
The shell decodes status.async_operations and the pending close reservations and renders them in the surfaces that already own request feedback: the pane header suffix and notice, the tab strip label, a warning glyph on the affected tab, and the tab strip's compact line with a read-only Check status action when a close result is unknown. Reopen follows the core's can_reopen verdict instead of counting entries, so a pending close never reopens an older item. A close whose target has an unknown activity status is stopped before the destructive confirmation and offers the read-only Check status action from the interaction notice. The confirmation itself keeps Keep open as the default and names Stop work and close as the destructive choice, and an approval is fingerprinted against the tab's pane set and each pane's close verdict so a pane that appeared or started work while the prompt was open cancels the approval rather than inheriting it. Accessibility labels carry the activity and notice on the pane focus and close controls. CoreRecentClosedPending and CoreAsyncOperation join the CoreBridge module inventory.
The pane header and mutation feedback boards say that one core operation record owns pending, unavailable, failed and unknown outcomes, that topology confirmation settles geometry, and that unknown activity shows the read-only Check status action before a close. DESIGN.md records the target-scoped activity suffix, the separate unknown-status guard and the Keep open / Stop work and close confirmation.
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.
Summary
2026-09-17 16:04
core.jsonl에서 본 두 증상을 고칩니다: Herdr가pane.close를 인정한 뒤에도 pane이pane_closed이벤트가 소비될 때까지(~5초) 화면에 남아 클릭을 받았고, 그 pane을 한 번 더 닫으면layout.export가 다시 실행돼layout_not_found로 실패했습니다.원인은 core가 close를 전송 응답만으로 끝난 것으로 보고, 같은 대상에 대한 두 번째 요청을 막지 않은 데 있습니다. 이 PR은
prd/hide-async-state의 구현을 현재main모듈 구조(#81, #85, #86, #87, #88 분할) 위로 옮긴 것입니다.status.async_operations로 내보냅니다. 전송 성공은 topology 확정이 아니며, 만료되거나 결과가 불명인 mutation은 재전송 없이unknown으로 표시되고 같은 범위의 새 요청은 거절됩니다.closing에 들어가 입력, focus, 같은 대상 재닫기를 막고 확인된 생존 pane/tab으로 선택을 옮긴 뒤에야 layout export와 close를 보냅니다. 캡처한 항목은 확정된 20개 undo 기록과 분리된 예약이라 거절되거나 불명인 close가 이전 기록을 밀어내지 않고, fresh snapshot의 부재 확인만 예약을 요청 순서로 확정합니다.Check status), 작업 중 확인 모달과 분리합니다. 읽지 않은 완료는 더 이상 확인을 묻지 않습니다.Check status로 이 상태를 그리고, 확인 모달은Keep open을 기본으로,Stop work and close를 destructive 선택으로 둡니다.포팅 판단은
agents/runs/hide-async-state-port/port-report.md(로컬)에 정리했습니다.Related
agents/prd/hide-async-state/prd.md(이 PR에 포함)prd/hide-async-state(1feb151, basecc8f02f), main 분할 이후라 rebase 불가hide-herdr-client, Add the Agent Conversation Viewer #80 Agent Conversation Viewer, Split runtime into responsibility-owned modules #81/Split session synchronization responsibilities #85/Split ShellModel navigation and pane selection #86/Split CoreBridge models from runtime coordination #87/Split HideUI into responsibility-owned modules #88 모듈 분할Review focus
Keep open기본 /Stop work and closedestructive). 원본 브랜치의DESIGN.md는Close and stop work라 적었고 코드는Stop work and close였는데, PRD B31 문구를 따라 코드 쪽으로 맞췄습니다.git,lsof)가 이제 subscription이 살아 있을 때만 돌고, 이벤트 직후 한 pass는 건너뜁니다. Herdr 연결이 끊긴 동안 Explorer Git 장식, ports, usage 갱신이 멈추는 것을 받아들일지.ActiveSubscription::stop이 reader 스레드를 더 이상 join하지 않습니다(detached reader의 다음 메시지는 세대 검사로 버려짐).herdr-core/src/runtime/editor.rs: close 수명주기 전체가 교체됐습니다.close_precondition_failure(승인 뒤 대상 변화 감지),promote_close_reservations(요청 순서 확정),ingest_close_status_results(lock 안에서ingest_session_with_catalog재진입).herdr-core/src/runtime/operations.rs(신규): 레코드 정의와 pane/remote/tab-move 수명주기,observe_pane_operations의 resize 확정 기준(raw rect 비교).herdr-core/src/session_sync/replica.rs:published_state와 workspace 단위 부분 게시. 잘못되면 서로 다른 시점의 pane/layout/focus가 섞입니다.herdr-core/src/session_sync/coordinator.rs: tick과 background read 게이팅.#[test]를 추가하지 않았고 기존 단언만 바꿨습니다(unread completion, close reservation, ambiguous effect,pane.close_status_unknown). 이 PR도 같은 범위입니다. B10(응답/이벤트 역전), B12(deadline 만료), B17(가득 찬 undo stack) 회귀 테스트를 이 PR에 넣을지, 후속으로 뺄지 정해 주세요.Risk surface
tick_async_operations(메모리 비교만),ingest_close_status_results의ingest_session_with_catalog재진입(기존 세션 ingest와 같은 비용). 서브프로세스나 I/O는 없고check-capability-readers-off-lock.sh가 통과합니다. 다만 coordinator 스레드 자체는 여전히 usage HTTP,git,lsof를 inline으로 실행하므로 이벤트 소비가 그만큼 늦어질 수 있습니다. 이번 PR은 그 창을 줄이기만 하고 없애지 않습니다(port-report의 coordinator-thread finding).status.async_operations와recent_closed.pending/can_reopen/reopen_blocked_reason은 revisionedrest에 실립니다. 셸이 매 프레임 그리는 값이 아니라 상태 전이 때만 바뀌는 값이라 그 채널입니다.session.snapshot,layout.export,pane.close,tab.close,agent.list만 씁니다.check-herdr-contract.sh --schema-onlypass(protocol 23).refused로 끝내고 closing과 예약을 풉니다. transport/malformed는unknown으로 남아 예약을 보존하고 pane 헤더 또는 tab strip 안내에 이유와Check status를 보입니다. 모두push_diagnostic으로core.jsonl에 남습니다(recent_closed.*,pane.operation.*,tab.move.*,remote.control.*).Evidence
bash scripts/verify-cargo.sh test: 553 passed, 6 ignored. 한 번 실패한migrate_branch_refuses_before_overwriting_an_ignored_file은Couldn't find key in agent(commit 서명 agent)였고 단독 재실행에서 통과.cargo clippy --locked --workspace --all-targets -- -D warnings,cargo fmt --all --check: clean.bash scripts/verify-swift.sh test: 465 tests passed.node scripts/check-design-contract.mjs,gen-pen.mjs/check-pen.mjs: pass, canvas 144 generated / 73 authored.zsh scripts/check-herdr-contract.sh --schema-only: pass.check-core-bridge-structure.py,check-capability-readers-off-lock.sh,check-typed-contract-structure.py,scripts/tests38건,check-no-workstation-identity.sh,check-no-attribution.py, shortcut/right-panel/accessibility 게이트: pass.core.jsonl2026-09-17 16:04)에 대한 재검증도 아직 없습니다. 머지 전 격리 Herdr에서 한 번은 확인이 필요합니다.AI tooling
손으로 확인한 것: 원본 브랜치의 각 hunk가 main의 어느 모듈로 갔는지,
main이 이긴 자리(hide.pen의 ACV 보드, ARCHITECTURE의 coordinator 문장,hide_herdr_client::ApiError, CoreBridge inventory),_confirmed미사용 인자 제거, DESIGN.md 문구 정정.