Repository navigation
Read OMP native sessions and preserve launch ownership - #865
Merged
Merged
Conversation
yansfil
added a commit
that referenced
this pull request
Oct 9, 2026
Related: PRD `agents/prd/session-readers-grok/prd.md` · 세션 리더 공통 #804, Pi #826, omp #865 다음 순서 · Grok 훅 #811, Pi/omp 확장 #838 ## Summary Grok 1.0.46 세션을 hide가 직접 읽습니다. `~/.grok/sessions/<URL 인코딩한 cwd>/<id>/`의 `summary.json`이 id, cwd, 제목을, `updates.jsonl`이 대화를 맡습니다. 그래서 Grok 행이 Claude Code, Codex, Pi, omp처럼 자기 제목, 재우기와 깨우기(`--resume <id>`), fork(`--resume <id> --fork-session`), 폰 대화, 질문과 계획 승인 대기를 갖습니다. Grok은 편지 hook이 없어 Settings에서 기본(Basic) 칩은 그대로입니다. 화면 구성은 바뀌지 않고, Grok 행에 다른 에이전트와 같은 표시가 생깁니다. ## Review - **판단해 주세요**: 줄 상한(256 KiB)을 넘는 Grok 기록을 본문 없이 읽습니다. 이미지 붙여넣기와 큰 도구 출력이 흔해서, 예전 규칙(읽기 중단)이면 그 세션의 기능이 계속 꺼집니다. 본문이 빠진 질문은 글과 선택지 없는 질문으로 기다리고, 큰 답변과 도구 출력의 글과 PR 링크는 읽지 않습니다(`body_capacity`로 셈). - **판단해 주세요**: `/rewind`로 버린 대화를 걸러내지 않고 기록된 역사로 보여 줍니다. 버린 요청에 답이 전혀 없으면 같은 `promptIndex`의 새 요청과 한 메시지로 합쳐질 수 있습니다. - **조심해서 볼 파일**: `hide-session/src/grok.rs` - 형식 해석과 큰 기록 스캐너(`LargeLine`), checkpoint에 실리는 상태. - **조심해서 볼 파일**: `hide-session/src/conversation_cursor.rs` - 고빈도 폴링 경로. Grok은 폴마다 `summary.json`, `plan_mode.json`, `plan.md`를 읽고 그 바이트를 폴 예산에 셉니다. - **조심해서 볼 파일**: `hide-session/src/native_file.rs`, `herdr-core/src/live.rs` - 경로 증명. Grok 그룹은 정규화한 cwd의 인코딩이어야 하고, fork와 깨우기는 증명된 파일 경로로만 갑니다. - **조심해서 볼 파일**: `hided/src/mobile/conversation.rs` - 나뉜 메시지를 페이지 경계 너머로 합치고, 이어지는 기록이 오면 페이지를 다시 엽니다. - **비용 검토**: 새 프로세스 없음. 폴당 추가 읽기는 세 파일, 각각 상한(요약 256 KiB, `plan_mode.json` 4 KiB, `plan.md` 8 KiB)과 폴 예산 안. 큰 기록 스캔은 checkpoint에 고정 개수의 작은 필드만 남깁니다. ## Evidence - **확인한 것**: hide-session 계약 테스트 Grok 10개(공통 사실, 조각 합치기, 질문, 계획 승인, 제목, 소유자 증명, 경로, 목록과 링크, 잘린 줄, 상한 넘는 기록)와 스캐너 단위 테스트 3개(픽스처 모든 줄 대조, 모든 바이트 분할과 checkpoint 왕복, 반복 키). - **확인한 것**: herdr-core의 fork/resume 인자, 증명된 파일로 Grok fork(성공, 거절, 요약 변경, 실행 변경), 재우기 가능 판정, 보관함 상세 합치기. hided 폰 페이징과 재시작. - **확인한 것**: Playwright `session-readers.spec.ts` 3/3(pi, omp, grok)을 고정 Herdr 0.9.3과 이 hided에서. Grok은 제목, 계획 승인 사실과 `approval` 표시, 해제, 재우기, `--resume <id>` 깨우기. 같은 조건에서 `grok-cursor-hooks.spec.ts` 5/5(공유 e2e 대역이 세션 설정 없이도 평범한 대역으로 실행됨). - **확인한 것**: 실제 grok 1.0.46(별도 HOME)이 픽스처 세션을 `grok sessions list`로 제목과 함께 나열하고 `grok export`로 읽음. `/tmp`로 들어가도 그룹 이름은 `/private/tmp` 기준(정규화한 cwd)임을 확인. - **확인한 것**: `agent-live-check --agents grok`에서 Herdr가 Grok 세션을 `kind: id`로 보고함. - **확인하지 못한 것**: 실제 바이너리의 이어서 시작과 fork. 로그인되지 않아 헤드리스는 "Not signed in"으로 끝났고, 화면 모드는 로그인 화면에서 멈췄습니다(not_authenticated). 인자는 1.0.46 `--help`의 `--resume`, `--fork-session` 설명을 따릅니다. - **확인하지 못한 것**: 실제 바이너리가 쓴 `agentTimestampMs`, `promptIndex`, `promptId`, `x.ai/tool` 종류, `hideFromScrollback`, `turn_completed`, `plan_mode.json`, `plan.md` 모양. 픽스처는 공개된 grok-build 소스에서 만들었습니다. 255바이트 넘는 cwd의 해시 그룹은 거절만 합니다. - **확인하지 못한 것**: 부모 PRD의 다섯 리더 묶음 e2e와 B16 전체는 마지막 자식 PR에서 닫습니다. 노드 경계(본문 검색, 보관함 재개) Grok 전용 테스트는 없습니다. <details><summary>후속 개선(이 PR 밖)</summary> - `/rewind` 기록 걸러내기와 그에 따른 `u:N` 합침 - 폴 경계를 넘는 라벨 이벤트 합치기(폰은 합침), Memory 분석 경로의 조각 이벤트 - 상한 넘는 typed prompt를 빈 Human 이벤트로 남길지 - `links::candidates`가 세션 폴더 안까지 내려가며 다른 에이전트와 방문 상한을 공유하는 문제, 하위 에이전트 세션 후보 - 대화 없는 Grok 폴더가 사용할 수 없는 목록 행으로 보이는 문제, 목록 제목 실패 이유가 사라지는 문제 - `summary.json` 중복 읽기, id 없는 locate의 예산, `plan.md` 없는 계획 승인의 빈 내용, 충돌 뒤 남는 승인 대기 표시 - 노드 경계와 종 보류의 Grok 테스트, `docs/PERFORMANCE_TESTING.md`의 폴당 읽기 목록 - Pi와 omp의 256 KiB 넘는 기록은 여전히 읽기를 멈춤(Grok은 자체 스캔으로 해결, 같은 방식 적용 검토) - UUID가 아닌 Grok id를 resume/fork에서 거절할지(`--resume`은 UUID 모양이 아니면 제목으로 찾음) - 큰 기록 대조 테스트에 질문, interjection, hostTurn, 깨우기 줄과 답변 part 비교 추가 - 세션 설정을 빠뜨린 네이티브 e2e가 대역 오류 대신 시간 초과로 실패하는 문제(실패는 그대로, 진단만 약해짐) </details> <details><summary>Verification record</summary> - PRD: `agents/prd/session-readers-grok/prd.md` (sha256 745654f89e0f13bd8027bbeb085c43e45b2f2a08e45225d0a756592a7f19947d) - Base 39efc67 → head 0eeb17a, verified 2026-10-09T08:38:40.330Z: PASS - Verification report: `agents/runs/session-readers-grok/verification-report.json` and `agents/runs/session-readers-grok/verification-report.md`; source fingerprint b46295c8b30d8f4069516f9dbc2db0d28540387621d6720c5ac831a0b55a73b5 - Suites: - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0) - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0) - Reviews: - Fidelity (9c2a0aa, 3fe7f6d, bcf77c1): Fix now 1, 실제 CLI resume/fork와 형식 미측정. 실제 grok 1.0.46으로 형식과 그룹 이름을 확인하고 resume/fork는 미측정으로 명시해 닫음. Fix now 2, 경로 증명 변경 뒤 e2e 재실행 요구. 3fe7f6d와 e51a7c4에서 3/3 통과로 닫음. 마지막 회차 Fix now 없음. - Code (9c2a0aa, 3fe7f6d, bcf77c1, e51a7c4, 01e1d26, 0eeb17a): 큰 기록이 읽기를 멈춤, 보관함 상세 미결합, 재우기 테스트가 엉뚱한 이유로 통과, 쓰이지 않는 `id` 경로 분기, 큰 질문이 여전히 멈춤의 5건을 모두 고침(4f8c3c5, 45a0129, bcf77c1). main 병합 정리, checkpoint 박스화, CI e2e 대역 수정(0eeb17a) 재검토에서 Fix now 없음. - Follow-up improvements: 위 '후속 개선' 접힌 목록. - Evidence: 5 registered (5 log); paths are local to the run directory - agents/runs/session-readers-grok/evidence/e2e-session-readers.log - agents/runs/session-readers-grok/live-grok-1314/report.md - agents/runs/session-readers-grok/evidence/e2e-session-readers-3fe7f6dd6.log - agents/runs/session-readers-grok/evidence/e2e-session-readers-merged.log - agents/runs/session-readers-grok/real-grok-format/findings.md - Changed paths: 42 (see Files changed) - Delivery: mode pr, branch `feat/session-readers-grok`, base `main` </details>
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>
yansfil
added a commit
that referenced
this pull request
Oct 9, 2026
Related: PRD `agents/prd/session-readers-opencode/prd.md` · 세션 리더 공통 #804, Pi #826, omp #865, Grok #868, Cursor #877 다음의 마지막 child ## Summary - OpenCode 1.18.30의 세션을 세션 파일이 아니라 OpenCode 자신의 SQLite DB에서 읽기 전용으로 읽습니다. - 읽을 때마다 같은 transaction 안에서 id가 root session(`parent_id` 없음)이고 기록된 `directory`가 정확히 그 checkout임을 증명합니다. - 그 증명 위에서 native 제목, `question` 도구 대기, 재우기/깨우기(`opencode -s <id>`), fork(`-s <id> --fork`)를 켭니다. - 프로젝트 아카이브 목록/검색/상세와 폰 대화도 `opencode/<id>` locator로 같은 증명을 거쳐 읽습니다. - lifecycle gate는 `requires_native_proof`(native-file reader 전부 + OpenCode) 하나로 모았고, 증명 참조는 OpenCode만 id, 나머지는 path입니다.   ## Review - **판단해 주세요**: DB를 열 수 없을 때 OpenCode 행만 빠지고 화면에는 아무것도 띄우지 않으며 core 로그(`sessions.store_unreadable`)에만 남깁니다(원칙 #13). - **판단해 주세요**: 그 refusal은 기존 ProjectSessions 답의 한 행(`{"agent","store_refused"}`)으로 옵니다. 옛 core는 refused row 하나로 셉니다. protocol bump 없이 택한 방식입니다. - **조심해서 볼 파일**: `hide-agent-adapter/src/lib.rs` - Herdr/core ownership. `requires_native_proof`가 Grok/Cursor/Pi/omp gate를 그대로 덮는지. - **조심해서 볼 파일**: `hide-session/src/opencode.rs` - failure path. 모든 SQL은 progress handler 작업 상한과 행 크기 가드 아래에서 돕니다. - **조심해서 볼 파일**: `herdr-core/src/runtime/memory.rs` - Memory 분석이 Memory reader 있는 agent만 읽도록 바뀌었습니다(OpenCode, Cursor 제외). - **비용 검토**: 상시 경로 추가 없음. 읽기는 기존 label/activity 요청 때만, 한 번에 1 MiB, message 200개, part 512개, SQL step 상한 안에서 끝납니다. ## Evidence - **확인한 것**: sealed verify PASS(cargo test 249 s, lint 4 s), 최종 head에서 clippy workspace clean, nextest 10 crate 3463 통과. - **확인한 것**: e2e `session-readers.spec.ts` 8/8. DB를 쓰는 OpenCode 대역으로 제목, child 제목 제외, question 대기/해제, 재우기, `-s <id>` 깨우기, DB+WAL 무변경. - **확인한 것**: 설치된 OpenCode 1.18.30 실물(로그인 없음, private HOME과 격리 Herdr)로 `-s <id>` 정확 재개, `-s <id> --fork`가 parent 없는 새 root, 실제 WAL DB 읽기. - **확인한 것**: web typecheck/lint/test 1312 통과, design contract 통과. - **확인하지 못한 것**: `agent-live-check.py --agents opencode`는 도구 sandbox에서 agent 시작이 timeout, 모든 장면 not_tested, verdict unknown. - **확인하지 못한 것**: windows check의 `web/e2e/windows-sockets.unit.ts`가 powershell 30 s ETIMEDOUT로 실패(이 PR과 무관, quarantine #880), 실패 잡만 재실행. - **확인하지 못한 것**: 로그인한 실제 모델 턴의 question 호출, 설치된 OpenCode의 Herdr 세션 자동 보고, 패키지 앱 UI, 실제 폰. <details><summary>Verification record</summary> - PRD: `agents/prd/session-readers-opencode/prd.md` (sha256 25e35a2b30c918aa5a78c796d0be819bd0eb3de537f002e48a40fc220126b479) - Base f2ad76a → head 023cd90, verified 2026-10-09T13:20:21.197Z: PASS - Verification report: `agents/runs/session-readers-opencode/verification-report.json` and `agents/runs/session-readers-opencode/verification-report.md`; source fingerprint 76065e2461def954a490d75420ab1e8fde62f12c7ee7ba0e7ed65a0bdae735b2 - 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 1차 (1e7ab02): Fix now 8건 모두 수정. catalog가 DB 실패로 전체 이력을 비우던 것, SQL work cap 누적, pending question, Memory 분석 정지, 폰 newest page 누락, 건너뛴 message의 witness, question 크기 admission, 문서. - follow-up (fb39ca3): Fix now 3건 수정. DB 단위 실패의 진단 누락(store refusal row + `sessions.store_unreadable`), json_valid 앞 크기 가드, budget admission 테스트. - follow-up (0c82c74): Fix now 1건 수정. NotFound 이외 stat 오류를 missing으로 읽던 것. page cap 초과 refusal row도 함께 수정. - follow-up (merge 후 최종 head 023cd90): Fix now 없음. Low 1건(mode 000 테스트가 root runner에서 실패할 수 있음)은 Follow-up. - Follow-up: 로그 per-poll 중복, catalog cap에서 refusal 분리, stat 두 번의 race, OpenCode 3 s follow-up poll 없음(설계), Cursor Memory 제외 테스트, Factory guard 테스트에 Grok/Cursor 추가, 다음 protocol bump에서 typed `{sessions, refusals}` 답. - Evidence: none registered separately. - Changed paths: 51 (see Files changed) - Delivery: mode pr, branch `feat/session-readers-opencode`, base `main` </details>
yansfil
added a commit
that referenced
this pull request
Oct 15, 2026
<!-- hide-factory: f-73a54a0605/T-2 --> ## 목표 ## The task you are doing when you want this Software Factory에서 Pi나 omp를 작업자로 쓰고, Task를 일시정지했다가 다시 이어 갑니다. ## What hide does today Pi와 omp는 잠들 때 원래 pane을 닫고 core에 dormant 기록을 남긴 뒤, 깨어날 때 새 pane에서 같은 대화를 이어 갑니다. Factory의 작업자 정체, probe, wake, watch, 편지는 원래 pane과 예전 sleep 기록만 봅니다. 그래서 Factory가 Pi나 omp 작업자를 재우면, 깨운 뒤 편지가 이미 닫힌 pane 앞으로 쌓이고, 내부에서 닫은 pane이 운영자가 닫은 것(PaneClosed)으로 읽힐 수 있습니다. #826(Pi 세션 리더)과 OMP 세션 리더 PR의 리뷰에서 찾았고, Factory runtime에서 재현하지는 않았습니다. OMP 세션 리더 PR은 이 문제를 막기 위해, pane을 닫으며 잠드는 dialect의 Factory sleep, stop, wake와 새 대화 fallback을 effect 전에 거부합니다. 그래서 지금은 Factory 일시정지 중에도 Pi와 omp 작업자의 pane이 그대로 떠 있습니다. 수동 Sleep과 Wake는 그대로 동작합니다. ## What it should do instead Factory가 Pi와 omp 작업자도 재우고 깨울 수 있습니다. 깨어난 새 pane에 작업자 정체, watch, 편지, coordination 기록이 다시 묶이고, 닫힌 pane 앞으로 편지가 쌓이지 않습니다. Hide가 잠들면서 닫은 pane은 운영자가 닫은 것으로 읽히지 않습니다. 새 pane은 core의 dormant 기록으로 찾고, label, cwd, 이름, native session id로 추측하지 않습니다. 이 동작이 들어오면 OMP 세션 리더 PR이 넣은 거부 guard는 지워집니다. ## Where the authority for it lives Factory 정책(`hide-factory`)과 core의 agent sleep 기록, coordination, 편지 경로입니다. pane을 닫고 새로 여는 것은 Herdr가 하지만, Herdr는 바뀌지 않습니다. ## 완료 조건 ## 결정 기록 ```text - 라벨로 들어온 Task입니다. 카드 초안을 확인해 주세요. -> confirm - 완료 기준(criteria)이 비어 있습니다. 어떤 관찰 결과로 이 Task가 끝났다고 판단합니까? -> 기준 추가: (1) Factory 일시정지 시 Pi/omp pane이 닫히고 dormant 기록이 남는다, (2) 깨우면 새 pane에 작업자 정체·watch·편지·coordination이 묶인다, (3) 닫힌 pane 앞으로 편지가 쌓이지 않는다, (4) 내부에서 닫은 pane이 PaneClosed로 읽히지 않는다, (5) 새 pane을 dormant 기록으로만 찾는다(label/cwd/이름/session id 추측 없음), (6) OMP PR의 거부 guard가 삭제되고 수동 Sleep/Wake는 그대로 동작한다. - 이 Task는 OMP 세션 리더 PR의 거부 guard를 지우는데, 그 PR이 main에 머지되어 있습니까? 아직이면 guard가 없어 삭제할 대상이 없습니다. -> OMP 세션 리더 PR(과 #826)이 머지된 뒤 시작합니다. - 재현하지 못한 문제입니다. 실제 Factory runtime에서 Pi/omp 재우기·깨우기를 어떻게 검증합니까? -> fake dialect로 core 단위/통합 테스트를 쓰고, 가능하면 실제 Pi나 omp로 Factory 일시정지→재개를 한 번 확인해 증거를 agents/runs/ 아래에 남깁니다. - 환경 문제: 디스크 여유 공간이 약 4.7GB로 기준보다 작아 보류 상태이며, 최근 실패나 중단은 없음.. 복구 동작 remove_finished_worktrees을 실행할까요? -> approve - done: Factory can now sleep and wake Pi, omp and Grok workers (the close-pane dialects). The core binds the Factory worker to the dormant sleep record, so Hide's own close of the pane is not read as an operator close (no PaneClosed pause, no gone-restart). On wake the pane is found only through that record (kept as a Woken phase until bound), the old registration ends, the Factory parent and the new pane are registered, the watch restarts, held letters follow to the new pane, and the engine rebinds the Task worker (worker.rebound); a wake the core cannot finish stops the Task once. Factory sleep now follows the sleep the adapter declares, and the #865 rejection guard (agent_cannot_sleep / worker_dormant refusals for Pi/omp/Grok) is deleted. Docs updated: factory.md, ARCHITECTURE.md, status-model.md. Verified: full workspace tests (1849 core lib, 172 factory it), clippy and fmt clean, attribution and workstation-identity gates. Not verified live against a real Pi/omp/Grok pane. ``` Closes #857
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.
Fixes #866
Related: #804, #826
Summary
Review
hide-session/src/native_file.rs의 경로 소유권, core의 저장 순서와 Factory의 원래 연결·실행 확인 및 실패 경로.Evidence
Verification record
agents/prd/session-readers-omp/prd.md(sha256 5053e2e73a5d978c6477e9a17c2c842c158d97e38a3d91f6478f8fdea02eb025)422414f47db8940220f294e0062216f7b5de3213→ heada9f454af809abab5015c67a4a30db31c6449e6e9, verified 2026-10-09T07:28:33.175Z: PASSagents/runs/session-readers-omp/verification-report.jsonandagents/runs/session-readers-omp/verification-report.md; source fingerprint 19b287be770a330e60a075d43311de2f9590df61fdd1468fa07303b8cb9945d5bash scripts/verify-cargo.sh test(exit 0)bash scripts/verify-web.sh(exit 0)bash scripts/verify-cargo.sh lint(exit 0)a9f454af809abab5015c67a4a30db31c6449e6e9; no new Fix now; prior accepted P2/native limits retained. Source SHA256cf8a35cd3727f8c3026405e2158bfe6d1c34bea03e4686179b27771f9ad4ce22, final evidence closure SHA256adf484315158c4e26e2df9de72d2765fdfda0e1be88cdbc1bdc00acdf3e0bc6c.a9f454af809abab5015c67a4a30db31c6449e6e9; no new Fix now; prior accepted P2/native limits retained. Source SHA2566dfa2a7cc7ad703db4e5252dd45983c5c151ea654bf1d13e78c604bc213fe6c4, final evidence closure SHA256ce13a99db98fb2dceb5abd09f646e968cefa7e4d26a38f2bb8ccd6dad366fa40.a9f454af809abab5015c67a4a30db31c6449e6e9; no new Fix now; prior accepted P2/native limits retained. Source SHA256526529b218d53e098d30a86c68828b518a8fb7153342ece118f1a7de62afb6af, final evidence closure SHA256345232094df65aed4544028733ec8aef4b39f6b4cd334eb3e70d8b7d546b12e8.a83f4d8a8fa0e4bd30dd3e85b016370185704f7e27e173d6e8b9acf1b09be53d; exact-head report SHA256e99bc17ebc7429f0efed1effe0b48d007961371e3f47b0b03cefeb57a343c723; input fingerprint62b11910dcb19194b779f0ffe11150675097a3835f59a4a30af3f7f3171b9c42.feat/session-readers-omp, basemain