Repository navigation
Type a long agent start line only once the shell's line editor reads, and let a failed start free its pane - #870
Merged
Merged
Conversation
A fresh pane's terminal stays in canonical mode while the shell's startup files run, and the kernel drops a typed line past 1,024 bytes on macOS. A start line that can pass that limit now also waits, within the shell wait, until the pane's node says the terminal takes keys, and is refused with the limit named when it never does.
The pinned Herdr keeps an agent's name for a start it typed whose agent never showed. A start refused under such a name in its own pane now gives the name back once and starts again; a spawn asked again for the same intent answers agent_not_started instead of typing the same start; and a new attempt closes the idle pane an earlier attempt left, so a Factory retry leaves no extra tab.
pane.release_agent matches the pane's detected agent, which a start that never showed does not have, so it cannot free that name. Herdr frees it at the start's own deadline once the agent is read, so a start refused under the name reads it with agent.get and is sent again only when Herdr answers that the name is gone.
yansfil
added a commit
that referenced
this pull request
Oct 9, 2026
Related: PRD `agents/prd/pi-omp-extension/prd.md` · #838 (Pi, omp 확장, 이 PR이 그 위에 Memory를 얹음) · P6 Pi reader #826, omp reader #865 (둘 다 머지됨) · #849의 Security 8(Memory 전 프롬프트 본문 전달)을 닫음, 나머지 항목은 열린 채 ## Summary #838은 Pi와 omp에 Hide 확장(편지, 안내, 실행 가드)을 붙였고 Memory는 P6의 두 세션 리더가 머지된 뒤로 미뤘습니다(PRD D-09). 이 PR은 그 Memory를 붙입니다: 확장이 프롬프트마다 helper에 묻고, helper는 `claude-code` 훅과 같은 Memory 캡슐과 서명된 receipt를 숨은 메시지에 함께 실어 보냅니다. Memory receipt는 호스트의 `getSessionId()`(세션 파일 헤더 id)로 서명하고, 편지는 지금처럼 세션 파일 경로로 묶습니다. 코어는 Pi와 omp 세션 파일에서 Hide 자신의 `custom_message`(`customType: hide`)만 provider가 넣은 문맥으로 읽어 receipt를 받아들입니다. 사용자가 친 receipt 문자열, 다른 확장의 메시지, 부모 세션을 fork한 파일의 receipt는 받지 않습니다. 그래서 설정의 Pi와 omp 행의 기능 표에 Memory가 켜집니다(D-08, D-09). 벨은 두 에이전트 모두 계속 꺼져 있습니다. ## Review - **판단해 주세요**: Memory의 SessionStart 캡슐은 helper가 주고 호스트가 그 메시지를 기록할 때까지 매 프롬프트 다시 묻습니다(안내와 따로 추적). `claude-code` 훅의 SessionStart 한 번과 다르지만 쓰이지 않은 캡슐을 준 것으로 세지 않기 위해서입니다. - **판단해 주세요**: 확장 버전이 1에서 2로 올라 설치된 v1 확장은 kit이 다시 설치할 때까지 helper가 `{}`로 답해 아무것도 하지 않습니다. v1은 릴리스에 실린 적이 없습니다(#838은 v0.3.0 뒤). - **판단해 주세요**: Pi와 omp 세션의 `message` 항목은 이제 어떤 것도 provider-injected로 읽지 않습니다(전에는 reminder로 감싼 user 메시지가 그렇게 읽힐 수 있었음). 사용자가 붙여넣은 receipt가 Memory를 열지 못하게 하는 변경입니다. - **조심해서 볼 파일**: `hide-session/src/native_file.rs` - Memory의 신뢰 경계. Hide의 `custom_message`만 `with_provider_injected(true)`로 읽습니다. - **조심해서 볼 파일**: `hide-agent-hooks/src/plugin/helper.rs`, `src/pi_extension/extension.js` - 운영자 프로세스 안의 확장과 그 helper. `native_session`은 1~4096자 문자열만 받고, 없으면 Memory 없이 편지만 보내며 `plugin` 원인으로 진단합니다. - **판단해 주세요**: #849의 Security 8은 이 PR로 닫힌다고 봅니다. helper가 받는 프롬프트 본문은 이제 로컬 Memory 검색에 쓰이고 32KiB로 잘리며 로그에 남지 않습니다. 849의 다른 항목은 다루지 않아 issue는 열어 둡니다. - **비용 검토**: 프롬프트당 helper 호출 수는 그대로(1회)이고, 그 안에서 Memory 검색 1회(프롬프트 32KiB 상한, 로그에 남기지 않음)가 더해집니다. 코어 쪽은 기존 Memory 투영 경로에 Pi, omp 세션 파일 읽기가 붙을 뿐 새 상주 작업은 없습니다. ## Evidence - **확인한 것**: sealed `verify-cargo.sh test`와 `lint` PASS(head f657312, #868과 #870을 병합한 main a41bc1a 위). - **확인한 것**: helper 단위 테스트(Memory에 넉넉한 기한)로 Pi와 omp receipt가 호스트 세션 id로는 검증되고 파일 경로로는 검증되지 않음, OpenCode는 자기 세션 id로 서명, `memory_first:false`면 첫 프롬프트에도 시작 캡슐을 주지 않음. Pi의 세션을 파일로 서명하게 바꾸는 결함을 심으면 실패함을 확인. - **확인한 것**: 빌드된 helper 통합 테스트로 75 ms Memory 예산과 무관한 결과만: 시작 뒤 프롬프트, 쓸 수 없는 id(`-x`), Memory 꺼짐에서 `memory_start` false와 receipt 없음, 편지는 매번 도착. - **확인한 것**: 코어 테스트로 Pi와 omp 각각 SessionStart receipt가 세션 파일에 남기 전에는 프롬프트 Memory가 Unavailable, 남은 뒤에는 열리고, 부모의 receipt를 가진 fork 파일은 열지 못함. - **확인한 것**: hide-session 테스트로 Hide의 `custom_message`만 provider-injected, 사용자가 친 receipt와 reminder로 감싼 receipt는 아님, 다른 확장의 `custom_message`는 읽지 않음(Pi, omp 둘 다). - **확인한 것**: 확장 Node 테스트로 Memory의 SessionStart 캡슐이 안내와 함께든 따로든 기록된 메시지 하나에 실리고, 기록된 뒤에만 시작된 것으로 셈. - **확인한 것**: 실제 Pi 1.0.4, omp 18.7.0 TUI를 pty로 띄워(비공개 HOME, 가짜 provider, 대역 helper) 확장이 보낸 `native_session`이 세션 파일 헤더 id와 같고, 숨은 항목이 `type: custom_message`, `customType: hide`로 남음을 실측. - **확인하지 못한 것**: 실제 Memory가 켜진 프로젝트에서 로그인된 Pi, omp로 캡슐이 모델에 닿는 끝까지의 흐름(로그인 금지, issue 850), 기기에서 도는 Pi와 omp, compaction이나 resume 뒤 Memory 재전송. - **확인하지 못한 것**: 전체 nextest 한 번에서 이 PR이 건드리지 않은 `hide-host gh::tests::timed_out_gh_and_its_pipe_holding_helper_are_terminated`가 부하 기한으로 실패했고 단독으로는 통과했습니다. - **확인하지 못한 것**: load 약 64에서 돈 sealed 실행 한 번에서 이 PR이 건드리지 않은 `codex_trust` 7개가 app-server initialize 기한으로 실패했고, 단독으로는 통과했습니다. <details><summary>Verification record</summary> - PRD: `agents/prd/pi-omp-extension/prd.md` (sha256 676a51347370bcc57965ce68ef407ee2585d2fdab6d3c30b64a5ce9ff7113f7d) - Base a41bc1a → head f657312, verified 2026-10-09T09:49:58.785Z: PASS - Verification report: `agents/runs/pi-omp-extension/verification-report.json` and `agents/runs/pi-omp-extension/verification-report.md`; source fingerprint 4d05fea261dcca011e5f277a3a966f42b3e3cf8b14eefabcba9c05b7903f7601 - Suites: - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0) - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0) - Reviews (advisory): - Fidelity, Code, Security on 207b402: Fix now = omp 문서 줄에 Memory 누락, Memory의 SessionStart 캡슐이 안내 시작과 묶여 안내만 기록되면 다시 묻지 않음(Fidelity) -> 193993047에서 고침. Code, Security는 Fix now 없음; 정확한 단언, helper 테스트, `plugin` 진단, fixture helper, fork 음성 테스트, provider-injected 규칙 좁히기, 낡은 문장 -> 같은 커밋. Security: #849의 Security 8 닫힘. - Follow-up on 1939930: Fix now 없음; 재시도 문서, `plugin` 원인 문장, 이후 프롬프트와 Memory 꺼짐의 helper 테스트 -> 849a8d6. - Closure on 849a8d6: 닫힘, Fix now 없음. - Follow-up on 849a8d6 (Memory 세션 id 실측 증거 7개 등록): 증거가 README의 주장(두 호스트의 `native_session` = 헤더 id, 숨은 항목 모양)을 보임, Fix now 없음; helper가 대역이라 실제 receipt 서명까지는 보이지 않음(그 부분은 helper 통합 테스트가 맡음) - Follow-up on 4dd2b57 (#868 Grok 리더 병합): Fix now 없음; Grok은 `memory` 선언이 없어 서명되는 receipt가 없고 Pi, omp 경로와 기능 표는 그대로. - Follow-up on d44ee0e (CI의 workstation-identity 실패로 테스트 경로 수정, 부하에서 75 ms 예산을 넘긴 테스트에 넣은 재시도, #870 병합): Fix now 없음; 재시도는 docs/TESTING.md가 금지 -> 262ac05에서 helper의 Memory 단계를 deadline 인자로 빼고 단위 테스트로 바꿈. - Follow-up on 262ac05: Fix now = 테스트 문단에 새 단위 테스트 미기재 -> f657312; override 단위 케이스도 추가. - Closure on f657312: 닫힘, Fix now 없음. - Follow-up improvements: 첫 receipt만 파싱하는 경로의 큰 입력 비용, Memory가 필요 없을 때도 프롬프트 본문 전송, Pi `/export`에 캡슐이 보임, compaction이나 resume 뒤 안내와 Memory 재전송 없음, Memory 켜기 게이트가 `claude-code`, `codex` 버전만 확인(기존, OpenCode도 같음), v1 확장은 kit 재설치 전까지 동작 안 함, ARCHITECTURE의 receipt 권한 목록에 Grok의 `hideFromScrollback` provider-injected는 표시용일 뿐이라는 한 구절, `trusted_memory_receipt`가 `memory` 선언 없는 에이전트를 구조적으로 거절., 실제 바이너리의 `prompt`가 캡슐과 편지를 합치는 배선은 Rust에서 Memory 캡슐과 함께 검사되지 않음(Node와 e2e는 스크립트 쪽만), `windows_hook_command.rs`의 기존 재시도도 같은 seam으로 바꿀 수 있음. - Evidence: 20 registered (15 log, 5 file); paths are local to the run directory - agents/runs/pi-omp-extension/evidence/host-smoke/README.md - agents/runs/pi-omp-extension/evidence/host-smoke/pi-helper-calls.jsonl - agents/runs/pi-omp-extension/evidence/host-smoke/pi-session-hidden-entry.jsonl - agents/runs/pi-omp-extension/evidence/host-smoke/omp-helper-calls.jsonl - agents/runs/pi-omp-extension/evidence/host-smoke/omp-session-hidden-entry.jsonl - agents/runs/pi-omp-extension/evidence/host-smoke-tui/README.md - agents/runs/pi-omp-extension/evidence/host-smoke-tui/pi-helper-calls.jsonl - agents/runs/pi-omp-extension/evidence/host-smoke-tui/pi-session-hidden-entry.jsonl - agents/runs/pi-omp-extension/evidence/host-smoke-tui/omp-helper-calls.jsonl - agents/runs/pi-omp-extension/evidence/host-smoke-tui/omp-session-hidden-entry.jsonl - agents/runs/pi-omp-extension/live-check-1/report.md - agents/runs/pi-omp-extension/evidence/host-smoke-tui-head/README.md - agents/runs/pi-omp-extension/evidence/host-smoke-tui-head/omp-ctx-mode.txt - agents/runs/pi-omp-extension/evidence/memory-session-id/README.md - agents/runs/pi-omp-extension/evidence/memory-session-id/pi-session-header.jsonl - agents/runs/pi-omp-extension/evidence/memory-session-id/pi-prompt-call.jsonl - agents/runs/pi-omp-extension/evidence/memory-session-id/pi-hide-entry.jsonl - agents/runs/pi-omp-extension/evidence/memory-session-id/omp-session-header.jsonl - agents/runs/pi-omp-extension/evidence/memory-session-id/omp-prompt-call.jsonl - agents/runs/pi-omp-extension/evidence/memory-session-id/omp-hide-entry.jsonl - Changed paths: 19 (see Files changed) - Delivery: mode pr, branch `feat/pi-omp-extension`, base `main` </details>
This was referenced Oct 9, 2026
Closed
Merged
yansfil
added a commit
that referenced
this pull request
Oct 9, 2026
Related: #869, #870, #871 ## Summary - Read ordinary Cursor chats from native SQLite/protobuf storage with incremental paging and native identity checks. - Feed existing generated labels, archive/body search and desktop/phone conversation details from one shared reader. - Sleep/wake default-root sessions with the exact native ID; refuse known custom roots and duplicate IDs before effects. - Preserve recorded minute timestamps and absent facts; keep fork, tools, native titles and Memory insertion disabled. - Keep native files read-only and cap database work, graph traversal, discovery and returned content.   ## Review - **Judgment**: known-root checks cannot certify later native exec; shell exports may select other history or fail. - **Files to watch**: `hide-session/src/cursor.rs` (identity/caps), `herdr-core/src/live.rs` (lifecycle failures). - **Cost**: lifecycle-only root audit caps directory opens at 64, entries at 10,000 and retained path bytes at 8 MiB. - **Follow-up**: inherited old-attempt pane cleanup remains unresolved in #874; its separate fix follows this PR. ## Evidence - **Confirmed**: native graph fixtures cover paging, immutable source bytes, replacement refusal and consumer dispatch. - **Confirmed**: isolated browser labels, archive/body search, detail, exact wake arguments and pre-close root refusal. - **CI repair**: shared test-binary placement and isolated default-root fixtures preserve assertions and guards. - **Checks**: full Rust tests, web/desktop typecheck, lint, unit tests and builds, plus workspace Clippy passed. - **Limits**: authenticated continuation, installed desktop, physical phone and later native roots remain unverified. - **Images**: synthetic fixture observations on earlier reviewed heads; exact provenance remains in the folded record. <details><summary>Verification record</summary> - PRD: `agents/prd/session-readers-cursor/prd.md` (sha256 57aa6f1c78f5603500fde8af92e25ff5670d1f2877df2f30eea5940356ef193d) - Base 383bbd2 → head 5a8c9d8, verified 2026-10-09T12:33:49.268Z: PASS - Verification report: `agents/runs/session-readers-cursor/verification-report.json` and `agents/runs/session-readers-cursor/verification-report.md`; source fingerprint bf8641a0b0901418feb4be3a925b3099e4a943904c10f22e15f123f91ecbc168 - Suites: - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0) - S2: GREEN `bash scripts/verify-web.sh` (exit 0) - S3: GREEN `bash scripts/verify-cargo.sh lint` (exit 0) - Code: reviewed `5a8c9d81a01ff1a50f18670e4718f2d442c01dce`; full source coverage carried through the actual current-head fixture follow-up and sealed evidence closure; test layout/default-root isolation preserve every prior assertion and guard. Both technical P1s remain: later unknown exec-root selection and #874 cleanup. Follow-ups: proof/effect race, current connector and ownership fences. - Code report identities (current source follow-up / sealed closure): `d5c4db32067c89ec18ed5449c5b0566b19abc3513d7b94ddfff26402b392264f` / `4051b5f03ab53c3b4b12e4ab98280477bbc62d579a64043d183f389a242906c5`. - Fidelity: reviewed `5a8c9d81a01ff1a50f18670e4718f2d442c01dce`; complete canonical parent/child and negative-capability coverage plus same-head evidence closure; independent resume/helper expectations and original consumer/Sleep assertions pass without contract reduction. #874 separate repair and unknown shell roots retain accepted dispositions. Follow-ups: phone currentness, remote replacement and parent aggregate. - Fidelity report identities (current source follow-up / sealed closure): `e37196dd07258d927a2b733303e6708eda3d0bc3b95c4e80d8f0678c7571a9a5` / `eeef201a96e16100457b4fc766419b62dea248288ed1c7f423c3231bc89d9bc0`. - Security: reviewed `5a8c9d81a01ff1a50f18670e4718f2d442c01dce`; complete source/privacy coverage, bounded test-child impact and actual sealed evidence closure; all36 material identities match, with no new finding. Actual exec-root equivalence and inherited past-attempt cleanup remain technically unclosed; authorization is not fix credit. Follow-ups: bounded DTO allocation and non-atomic proof/effect interval. - Security report identities (current source follow-up / sealed closure): `a1021c7daabcc0f77461f2ac13fd619d91b1a7e879088afd18d2b02923ea1a83` / `b60e21c12083c1bcb6777dff24fe7835ed2ac7b2eed4278a8f5d84e5b4f07013`. - Evidence: 33 registered (1 api, 29 log, 1 browser, 2 screenshot); paths are local to the run directory - agents/runs/session-readers-cursor/native-start-resume.json - agents/runs/session-readers-cursor/cli-measure/negative-fork.json - agents/runs/session-readers-cursor/cli-measure/help.json - agents/runs/session-readers-common-v2/cursor-core-journey-2.log - agents/runs/session-readers-common-v2/cursor-web-native-3.log - agents/runs/session-readers-cursor/manual-browser-3/aside-body-search-complete.log - agents/runs/session-readers-cursor/manual-browser-3/cursor-archive-body-search.png - agents/runs/session-readers-cursor/manual-browser-3/cleanup.json - agents/runs/session-readers-common-v2/cursor-opencode-worker-before-fix.log - agents/runs/session-readers-common-v2/cursor-opencode-worker-fixed.log - agents/runs/session-readers-common-v2/cursor-p7-core-integration.log - agents/runs/session-readers-common-v2/cursor-p7-reader-integration.log - agents/runs/session-readers-common-v2/cursor-p7-integration-clippy.log - agents/runs/session-readers-common-v2/cursor-root-guard-reader-2.log - agents/runs/session-readers-common-v2/cursor-root-guard-browser-1.log - agents/runs/session-readers-common-v2/cursor-root-guard-browser-2.log - agents/runs/session-readers-common-v2/cursor-root-guard-clippy-1.log - agents/runs/session-readers-common-v2/cursor-root-guard-web-static-1.log - agents/runs/session-readers-common-v2/cursor-root-guard-web-static-2.log - agents/runs/session-readers-cursor/manual-browser-4/aside-refusal-final.log - agents/runs/session-readers-cursor/manual-browser-4/cursor-duplicate-sleep-refusal.png - agents/runs/session-readers-cursor/manual-browser-4/cleanup.json - agents/runs/session-readers-common-v2/cursor-root-main-integration-1.log - agents/runs/session-readers-common-v2/cursor-sealed-node-repro-1.log - agents/runs/session-readers-common-v2/cursor-sealed-web-repro-1.log - agents/runs/session-readers-common-v2/cursor-sealed-node-fixed-1.log - agents/runs/session-readers-common-v2/cursor-sealed-web-fixed-1.log - agents/runs/session-readers-cursor/delivery/ci-policy-failure.log - agents/runs/session-readers-common-v2/cursor-ci-layout-policy-1.log - agents/runs/session-readers-common-v2/cursor-ci-layout-rust-1.log - agents/runs/session-readers-cursor/delivery/ci-rust-failure.log - agents/runs/session-readers-common-v2/cursor-ci-root-repro-1.log - agents/runs/session-readers-common-v2/cursor-ci-root-fixed-1.log - Changed paths: 56 (see Files changed) - Delivery: mode pr, branch `feat/session-readers-cursor`, base `main` - Verification JSON SHA256 `6780ac85d900e4993e0913314f89c737eb2745b7f41f703f8a2fd265506eabae`; input fingerprint `5bcc6113b536b656e446e3ebf5c219b80b808469d2c35b645afc316dfbd00361`; both post-verification drift flags false, every command mutatedTree=false. - S1: 3,789 passed/0 failed/23 existing ignored; S2: web141 files/1,311 passed/1 existing skipped, desktop17 files/162 passed/4 existing skipped, both typecheck/lint/build; S3: fmt/workspace all-target Clippy warnings denied. Existing jsdom/React-act/bundle warnings remain despite exit0. - Registry: 36 identities total,33 unchanged qualified manual objects and three automatic command logs replaced by current PASS. S1 SHA256 `df7dd0c42987a9e4825b16bdb44a4750c933b403f492352c4b3949f573c6a5bb`; S2 `469e0998a9260f6330e93929dd62cc11732feff2c12a748ca274c12276b42b6d`; S3 `b8cda8538e555660c38b5c7b7be18933c1d36bc274190d4a2604cb1301f1dd6f`. - Preserved earlier sealed attempts: genuine helper-feature/resume expectation FAIL at `e373ce145`, retained report SHA256 `c8a01473a03d39676ff9139d516259690e95322a3bef95946d170c9c7341d623`; corrected `987e4dd6f` PASS retained at SHA256 `4b5421c8d6844526c223fc2cf201311f18a9d97c4e3f2a6ccb8e265e6516d578`. No skip, suite exclusion, timeout or production guard was relaxed. - First PR CI `37927765454` on `987e4dd6f` completed FAIL: existing single-integration-binary policy plus two Rust fixture failures; all other lanes passed, with one existing planned skip. Actual failed-job logs remain: policy SHA256 `ef544218c620c27fcd7189ff7d46cd314e79340e251882c64c98e72f3a459f1e`; Rust `445f578cd31f451e9824333a83751d172e26d9b71f4dd8834b2019b4329b2240`. - CI corrections: `640567fed` moves the unchanged environment audit into `tests/it`, adjusting only its relative include; independent policy3/Rust audit1 pass. `5a8c9d81` isolates two default-root positives in owned self-children before startup capture, preserving their complete bodies and original5s close assertion. The same private nondefault XDG reproduces FAIL2 before and PASS3 after, including unchanged custom/XDG/duplicate/invalid-root negatives. The actual first CI runner's override value is unconfirmed; this demonstrates fixture sensitivity, not exhaustive runner attribution. Each child retains the existing60s run/drain deadline, up to10s exit-confirmation cleanup and64KiB output/stream, without a universal wall-clock or abrupt-owner guarantee. - Browser provenance: archive body search and native detail screenshot came from the reviewed candidate through `7a723749`; duplicate-root Sleep refusal image came from root-guard source `22328f5f7` before main integration. Both use synthetic native storage, an isolated HOME and private Herdr/hided; screenshots show only the product viewport. Earlier automated browser journeys passed 6/6 and guarded-root regression passed 7/7; original failure logs remain qualified. - Native provenance: installed Cursor `2026.10.01-e373342` accepted first-prompt and exact resume argv under private Herdr but reached login only; --fork was rejected with exit1. Native database bytes stayed unchanged. This is not authenticated continuation acceptance. - Unrun limits: actual later shell execution-root equivalence, authenticated continuation/native-ID reporting, installed packaged desktop, physical phone, current remote/helper replacement, native Windows/Linux execution, idle/driven performance and RSS. Retained24 integration remains explicitly ignored pending actual payload; earlier independent compatibility fixtures retain their original scope. Parent aggregate acceptance waits the remaining reader and final integration. </details>
yansfil
added a commit
that referenced
this pull request
Oct 9, 2026
… that attempt recorded (#876) Fixes #874 ## Summary spawn 재시도는 같은 parent/name/machine의 앞 시도 중 agent가 뜨지 않은 빈 pane을 닫습니다(#870). 그 pane은 spawn record의 pane id로만 찾았는데, Herdr는 서버가 바뀌면 pane id를 다시 내주므로 운영자가 연 무관한 빈 셸이 닫힐 수 있었습니다. - spawn record가 pane을 기록할 때 그 pane의 Herdr `terminal_id`(`pane.get`)를 함께 기록합니다(`SpawnRecord.terminal`, 같은 `Advance` 한 번). - 앞 시도의 pane은 `pane.get`이 지금도 그 terminal을 답할 때만 닫습니다. 다른 terminal이면 `pane_replaced`, terminal이 없는 예전 record면 `pane_identity_unrecorded`로 `spawn` / `unstarted_attempt.close`에 남기고 열어 둡니다. - 현재 시도 자체의 처리(`agent_not_started`, 시작 실패)는 그대로입니다. 나이 기준, 지연, 이름 추정은 없습니다. ``` 격리된 pinned Herdr 0.9.3, server stop 후 재시작(복원): before [('w1:p1', 'term_65d66b459dfdf1')] after [('w1:p1', 'term_65d66b46b777b1')] ``` ## Review - **판단해 주세요**: 이 변경 전 build가 쓴 미완료 spawn record는 terminal이 없어 그 pane을 더는 자동으로 닫지 않습니다. 그런 탭이 남으면 운영자가 닫아야 합니다. - **조심해서 볼 파일**: `herdr-core/src/coordination/executor.rs` - failure path: pane을 기록하던 두 갈래(기존 worktree, 새 worktree)를 하나로 모아 `pane.get` 뒤 `Advance` 한 번. `pane.get` 실패는 spawn 실패로 올라가고, 같은 intent 재시도는 `hide:<spawn>` tab label로 그 pane을 다시 찾습니다. - **조심해서 볼 파일**: `herdr-core/src/coordination/mod.rs` - delivery ledger 필드 추가(`#[serde(default)]`, ledger version 1 유지). `Advance`는 저장된 terminal과 다른 값이 오면 다른 필드처럼 `intent_conflict`. - **비용 검토**: spawn이 pane을 기록할 때 `pane.get` 1회, 재시도마다 앞 시도 pane당 `pane.get` 1회. 고빈도 경로 아님, lock 밖. ## Evidence - **확인한 것**: 격리된 pinned Herdr 0.9.3에서 서버 재시작 뒤 복원된 pane이 같은 id(`w1:p1`)에 새 terminal id를 받음(위). Herdr v0.9.3 소스도 terminal마다, 복원 때도 `TerminalId::alloc()`. - **확인한 것**: 새 단위 테스트(FakeHerdr): 같은 terminal은 닫힘, pane id 재사용(다른 terminal)과 terminal 없는 record는 열린 채 이유와 함께 로그. 앞 시도 판정을 빼면 `["w2:p1","w2:p2","w2:p3"]`가 닫혀 실패함을 확인. - **확인한 것**: device spawn 테스트가 record에 `device-terminal`이 기록됨을 확인. `herdr-core`+`hided` nextest 2,255 passed, `verify-cargo.sh lint` pass. - **확인한 것**: `check-core-touches-no-machine.py`, `check-no-workstation-identity.sh`, `check-capability-readers-off-lock.sh`, `check-no-attribution.py` pass. - **확인하지 못한 것**: 운영자 Herdr에서의 실제 재현(이슈 단계 3의 서버 교체 + 무관한 빈 셸)은 운영자 서버를 건드리지 않으려고 하지 않았습니다. live handoff에서 terminal id가 유지되는지는 재지 않았습니다(유지되면 같은 pane으로 닫히고, 바뀌면 열어 둡니다). Linux/Windows는 CI에 맡깁니다.
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 #867
Summary
새 pane에서 셸 시작 파일이 도는 동안 터미널은 canonical 모드라, macOS 커널이 타이핑된 한 줄을 1,024바이트에서 자르고 Enter까지 버립니다.
Factory 첫 시작(
claude ... -- '<수 KB 첫 프롬프트>')이 이 때문에 약 1,022바이트에서 잘려 agent가 뜨지 않았고, 재시도는 Herdr가 쥔 이름 때문에agent_name_taken으로 막히며 탭을 하나씩 남겼습니다.hide_platform::process::line_input(셸 pid의 제어 터미널을tcgetattr) ->Call::LineInput(node 프로토콜 27). 코어는 lock 밖에서 묻습니다.agent_not_started로 답하고 다시 치지 않으며, 새 시도는 앞 시도의 빈 pane을 닫아 이름과 탭을 함께 풉니다.agent_name_taken을 받으면agent.get으로 이름을 한 번 읽어 Herdr가 기한 지난 시작을 정리하게 하고, 풀렸을 때만 다시 보냅니다.Review
agent_not_started로 Task를 멈춥니다. 사람이 retry하면 새 시도가 그 pane을 닫고 새로 시작합니다.herdr-core/src/coordination/executor.rs- failure path: 앞 시도 pane 닫기는 같은 parent/name/machine, child 없음, agent 없음, 셸 단독일 때만.hide-node-link/src/protocol.rs- 프로토콜 26 -> 27, 연결된 장치의 helper도 이 빌드가 필요합니다.herdr-core/src/agent_start.rs- Herdr contract 밖: v0.9.3process_info.tty가 null이라 node가 셸 pid로 터미널을 찾습니다.Evidence
.zshrc)에서 재현: 지금 규칙은 4,896바이트 줄이 ~1,022에서 잘리고 agent 미실행, line editor를 기다리면 전부 도달.start_at_shell_checked+ 실제 로컬 node: 5,856바이트 줄, 1.6초 대기 뒤 stand-in이 5,859바이트 수신.agent.list에 남지만agent.get한 번에 풀려 재시작 성공.pane.close는 이름과 탭을 함께 해제.pane.release_agent는 감지된 agent가 없는 시작의 이름을 풀지 못함(실측, Herdr 소스 확인) - 그래서 쓰지 않습니다./Applications/hide.app과 Factory 전체 흐름(운영자 앱은 건드리지 않음), 장치 helper의 프로토콜 27.Verification record
502698fd39, head9dd184f69(7 commits and a merge of main).teston the merge: 3,736 passed, 0 failed.verify-cargo.sh lint,hakari: pass.test: 3,707 passed, 0 failed.test-scoped -p hide-platform -p hide-herdr-client -p hide-node-link -p hide-host -p hide-node: pass.check-core-touches-no-machine.py,check-capability-readers-off-lock.sh,check-no-workstation-identity.sh,check-no-attribution.py: pass..zshrcand a stand-in agent, driven by the product start path with the real local node.