Skip to content

Pi와 omp 안에서도 편지, 실행 가드, 하위 에이전트 수가 동작한다 - #838

Merged
yansfil merged 24 commits into
mainfrom
feat/pi-omp-extension
Oct 9, 2026
Merged

yansfil merged 24 commits into
mainfrom
feat/pi-omp-extension

Conversation

@yansfil

@yansfil yansfil commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Related: P5 OpenCode plugin #818 (이 PR이 그 위에 쌓은 플러그인 설치기와 helper), P6 session readers #804, Pi reader #826 (머지됨, 이 브랜치에 병합)

Summary

Pi와 omp 안에서 실행된 에이전트는 지금까지 Hide의 편지, 실행 가드, 하위 에이전트 수 없이 기본 지원(스킬과 Herdr 통합)만 받았습니다.
이 PR은 두 에이전트의 사용자 확장 폴더(~/.pi/agent/extensions/hide.ts, ~/.omp/agent/extensions/hide.ts)에 Hide 확장 하나를 같은 원본으로 설치합니다.
확장은 pane 자신의 TUI 세션에 첫 프롬프트 안내와 대기 편지를 숨은 메시지(display: false)로 붙이고, 호스트가 그 메시지와 답을 기록한 뒤에만 편지를 확인합니다.
셸에서 Herdr로 에이전트를 직접 띄우려는 호출은 Claude Code 훅과 같은 사유로 막고, omp에서는 서브에이전트 수를 Herdr에 보고하고 Factory 작업자의 ask를 Factory 질문 가드에 넘깁니다.
OpenCode 플러그인의 파일 처리는 세 파일이 함께 쓰는 소유 스크립트 파일(hide-agent-hooks/src/plugin.rs)로 일반화했고, 세션 한도는 세션 파일 경로를 담도록 한 규칙(4096바이트)으로 모았습니다.
그래서 설정의 Pi와 omp 행에서 기본 칩이 사라지고(PRD D-10, B1), P6의 Pi 세션 읽기와 합쳐진 Pi 행은 켜져 있으면 Ready 또는 N sessions를 보입니다.
벨은 두 에이전트 모두 꺼 둔 채이고, Memory는 P6의 omp 세션 읽기까지 머지된 뒤 따로 들어갑니다.

Review

  • 판단해 주세요: 확장은 Herdr pane 환경 변수만 보고 동작합니다(Hide 데몬이 그 Herdr를 소유하는지는 묻지 않음). PRD D-02/B11은 "Hide가 관리하는 pane"이라 쓰지만 Claude Code, Codex CLI 훅과 OpenCode 플러그인이 이미 같은 방식이라 맞췄습니다. 데몬이 없으면 helper가 {}를 답합니다.
  • 판단해 주세요: OpenCode 동작 변화 하나. main의 hided는 factory_question_guard에서 claude-code와 codex만 받아 OpenCode의 질문 가드 요청이 wire에서 거절됐고, 그래서 Factory 작업자의 질문이 그대로 보였습니다. 이제 질문 도구를 선언한 모든 런타임을 받으므로 OpenCode 작업자의 질문도 설계대로 막힙니다.
  • 판단해 주세요: 화면 변화. 어댑터 규칙(basic() = 프롬프트 받기나 실행 거절 중 하나라도 없음)에 따라 Pi와 omp는 기본 칩을 잃습니다. #818에서 OpenCode가 같은 규칙으로 바뀐 것과 같고 PRD가 정한 결과입니다. main의 설정 e2e 세 개(agent-adapter-layer, agents-follow-herdr, agents-tab)가 omp 칩을 기대해 CI가 실패했고, 기대를 새 규칙으로 고쳤습니다(이제 기본은 Grok과 Cursor뿐).
  • 판단해 주세요: Grok과 Cursor의 hook으로 직접 agent 시작을 막고 서브에이전트를 센다 #811 병합 결과. HookDialect에 Pi, omp와 Grok, Cursor가 함께 있고, 기능 표는 두 쪽을 합쳤습니다(Grok, Cursor는 실행 가드와 하위 에이전트 수만, 편지는 없음, 그래서 계속 기본). Factory 질문 가드 wire는 이 PR의 4096바이트 세션 한도와 main의 direct_ask_kind 판정을 함께 씁니다(claude-code, codex, opencode, omp).
  • 판단해 주세요: Pi native 세션 읽기와 안전한 재우기·깨우기·fork 지원 #826 병합 결과. Pi 선언은 이 PR의 hook, prompt_hook, spawn_guard와 P6의 session, sleep, fork, resume, conversation, titles를 모두 가집니다. Pi 세션은 reports_turns가 아니므로 편지가 턴 대기로 묶이지 않고, 확장이 쓰는 숨은 메시지(role: custom)는 Pi 리더에서 사람 입력으로 읽히지 않습니다.
  • 조심해서 볼 파일: hide-agent-hooks/src/pi_extension/extension.js - 운영자의 Pi와 omp 프로세스 안에서 돕니다. 모든 콜백이 자기 예외를 잡고(omp는 타이머 콜백 예외로 세션이 끝남), 모든 helper 호출이 예산과 개수 상한을 가집니다.
  • 조심해서 볼 파일: hide-agent-hooks/src/plugin.rs, src/plugin/helper.rs - 운영자 소유 폴더에 쓰는 코드이고 OpenCode와 공유합니다. OpenCode 파일의 바이트는 고정 테스트가 그대로임을 보입니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/factory.rs, hided/src/server.rs, herdr-core/src/runtime/delivery.rs - 세션 한도 256 -> 4096바이트(failure path). 해시 전에 길이를 검사합니다.
  • 비용 검토: 셸 호출마다 herdr 문자열 검사 한 번, 그 문자열이 있을 때만 helper 1회(2.5초 예산). 프롬프트마다 helper 1회(1.85초), 확인 1회(2초). 동시 helper 8개, 출력 64KiB, 대기 항목 16개(10분), 하위 에이전트 64개 상한. 세션 종료 때 진행 중인 prompt, tool, start helper를 끊습니다.

Evidence

  • 확인한 것: sealed verify-cargo.sh test와 lint PASS(head a8996db). herdr-core, hided, hide-agent-hooks, hide-kit, hide-agent-adapter 전체 nextest 3585개 통과(Pi native 세션 읽기와 안전한 재우기·깨우기·fork 지원 #826, Grok과 Cursor의 hook으로 직접 agent 시작을 막고 서브에이전트를 센다 #811 병합 뒤).
  • 확인한 것: Node 22+에서 생성된 확장을 실제 Pi 1.0.4, omp 18.7.0에서 잡은 사건 표본으로 재생: 밖에서는 등록 안 함, 숨은 메시지 모양, 답 뒤 한 번만 확인, 실패한 확인의 재시도, omp 재진입에서도 안내 유지, 예산, omp 수와 ask, 어떤 입력에도 예외 없음.
  • 확인한 것: Playwright e2e(고정 Herdr 0.9.3, 격리 서버)에서 kit이 두 파일을 쓰고 Pi와 omp 대역 host가 이를 읽음: 양방향 편지와 기록 후 확인, 두 에이전트의 실행 거절 사유, omp 서브에이전트 수(Herdr 토큰과 snapshot), 서브에이전트 프롬프트에는 편지 없음. 확인 호출을 지운 결함을 심으면 실패함을 확인.
  • 확인한 것: 실제 Pi 1.0.4와 omp 18.7.0 TUI를 pty로 띄워(비공개 HOME, 가짜 provider, 대역 helper) 확장 파일 그대로 실측: start, prompt, confirm 순서, 숨은 메시지가 세션 파일에 display:false와 details.hide로 남고 화면에는 그려지지 않으며 모델에는 닿음, omp TUI의 ctx.mode는 tui, Pi RPC 모드에서는 helper 호출 0.
  • 확인하지 못한 것: 로그인된 에이전트로 한 실측. scripts/agent-live-check.py --agents pi,omp를 격리 Herdr에서 돌렸지만 두 에이전트 모두 not_authenticated였습니다. Pi는 startup 장면만 닿아 판정 unsafe(벨 뒤 비공개 설정 쓰기), rest는 시간 초과, 나머지는 건너뜀. omp는 모든 장면 건너뜀. 로그인은 하지 않았고 벨은 꺼 둡니다.
  • 확인하지 못한 것: 실제 omp의 재진입과 실제 서브에이전트 수(합성 사건으로만), 사이드바 배지 표시(issue 810), 기기에서 도는 Pi와 omp, Windows(확장을 쓰지 않음), Memory(P6 뒤 별도 PR).
  • 확인한 것: 고친 설정 e2e 세 개, pi-omp-extension, opencode-plugin, P6의 session-readers와 link-graph를 병합한 트리에서 로컬 통과. pi-omp-extension은 20회 중 1회 native_identity_required(코어가 pane의 세션을 아직 못 들음)로 실패해, 두 pane에서 hide inbox가 답할 때까지 기다리도록 고친 뒤 24회 모두 통과.
  • 확인하지 못한 것: sealed 실행에서 spawn_guard::a_pane_run_or_send_text_launch_leaves_the_name_and_intent_for_the_agent가 한 번 빈 stdout으로 실패했고 단독 3회, 전체 binary 2회는 통과했습니다(이 PR이 건드리지 않은 테스트, bell_intake와 같은 부하 기한 부류).
  • 확인하지 못한 것: sealed 실행 한 번에서 bell_intake::a_prompt_that_only_starts_like_the_bell_is_an_operator_prompt가 0.5초 payload 읽기 기한을 넘겨 실패했고, 단독과 이후 네 번은 통과했습니다. 같은 binary에서 두 Node 테스트가 동시에 돌던 것을 순서대로 돌게 바꿨습니다.
Verification record
  • PRD: agents/prd/pi-omp-extension/prd.md (sha256 676a51347370bcc57965ce68ef407ee2585d2fdab6d3c30b64a5ce9ff7113f7d)
  • Base ba980fa → head a8996db, verified 2026-10-09T00:08:11.704Z: PASS
  • Verification report: agents/runs/pi-omp-extension/verification-report.json and agents/runs/pi-omp-extension/verification-report.md; source fingerprint af86a6093a02254b19bcf251c29d027666767d7cd5d857f3bd2d85198399727a
  • 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 274e824: Fix now = Factory 질문 가드의 256바이트 세션 한도(세 리뷰 모두), 확인 전 confirmed 기록(세 리뷰 모두), 준비 시점에 안내를 준 것으로 기록(Fidelity, Code), omp RPC를 pane의 루트로 셈(Security), 문서의 범위 과장(Fidelity). 모두 3236fdd, 95e9876, a301065, 4e5808444에서 고침.
    • Follow-up on 4e58084: 고친 8건 모두 닫힘, 새 코드 결함 없음; head에서 omp TUI 재실측, 치환 순서 테스트, 문서 한 문장 요청 -> 2ed0090f4에서 처리.
    • Follow-up on 2ed0090: 새 테스트의 rustfmt 위반 -> d5fbf81.
    • Follow-up on 37b60ff: fmt 닫힘, 두 Node 테스트를 순서대로 돈 변경은 결함을 가리지 않는 부분 완화, main 병합(Open the child list only after the delegated move in the agent tab group tests #832)은 상호작용 없음; Fix now 없음. bell_intake는 cargo test 레인에서 재발할 때 issue로(그때는 부하에 기대지 않는 payload 기한으로 고침).
    • Follow-up on 1337720 (CI 설정 spec 수정): Fix now 없음; UI_BEHAVIOR 세션 수 문장과 AgentsTab 단위 테스트의 omp 모델링 -> da63cfd.
    • Follow-up on 27c8409 (Pi native 세션 읽기와 안전한 재우기·깨우기·fork 지원 #826 병합): Fix now = UI_BEHAVIOR의 Pi Basic popover 문장 -> 고침. 낡은 주석 둘, factory.md 작업자 문단, 단위 테스트 fixture도 함께 고침. 잠든 Pi 부모의 계보(경로 digest vs native id)는 P6 영역의 Follow-up.
    • Follow-up on 30d351f: Fix now = factory.md 작업자 문단이 Pi의 sleep과 OpenCode, Pi, omp의 다음 프롬프트 편지를 뭉갬 -> 54af6dc14에서 기능별로 나눠 고침, model.rs 주석도 실제 이유로.
    • Closure on 54af6dc: 두 항목 닫힘, Fix now 없음.
    • Follow-up on 428ac77 (Grok과 Cursor의 hook으로 직접 agent 시작을 막고 서브에이전트를 센다 #811 Grok, Cursor hooks 병합): Fix now 없음; 안 쓰는 HookDialect::plugin() 삭제, kit hook status와 질문 가드 parse 테스트에 Pi, omp 추가, 문서와 테스트 이름 정리 -> 32f9e2c.
    • Closure on 32f9e2c (+ main Refuse a timed producer in the doorbell test fixture #842, Finish the closing handshake when the daemon refuses a client #844 병합 a8996db): 닫힘, Fix now 없음.
    • Follow-up improvements: 잠든 Pi 부모 아래 자식의 계보가 깨어날 때까지 끊김(SleepRecord에 살아 있던 행의 계보 digest 보관), Herdr pane이면 Hide 데몬 여부와 무관하게 동작(OpenCode 플러그인과 같음), 다음 프롬프트 편지 pull이 pane 자신의 세션인지 코어에서 확인, 256KiB를 넘는 herdr 셸 명령, symlink로 된 hide.ts, Memory 전 프롬프트 본문 전달, 확장 미동작 에이전트의 편지 대기, CI 부하에서 Node 기동과 제품 예산의 경쟁.
  • Evidence: 13 registered (9 log, 4 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
  • Changed paths: 64 (see Files changed)
  • Delivery: mode pr, branch feat/pi-omp-extension, base main

yansfil added 16 commits October 9, 2026 04:59
…sion

# Conflicts:
#	contracts/agent-adapters.json
#	hide-agent-adapter/tests/it/contract.rs
#	hide-agent-hooks/tests/it/main.rs
…e rule

Pi and omp name a session by its file path, which on a deep checkout passes
the old 256-byte bound. The letter pull, the inbox hook flag and the Factory
question guard now share hide_agent_hooks::delivery::valid_session, bounded
at Herdr's own 4096-byte agent session. The daemon's question guard also
takes every runtime whose adapter declares a direct question tool rather than
a fixed pair.
One source, written to ~/.pi/agent/extensions/hide.ts and
~/.omp/agent/extensions/hide.ts and differing only in the agent's name, gives
the pane's own session start guidance and next-prompt letters in a hidden
message, confirms them after the reply is written, refuses a shell call that
starts an agent through Herdr, puts omp's ask to the Factory question guard
and reports omp's subagent counts. The OpenCode plugin's file handling
becomes a generic owned script file both use, and the kit, the core's hook
status and Settings read Pi's and omp's piece as an extension. Bells stay off
and Memory stays undeclared for both.
Pi's RPC mode reports a UI too but draws nothing in the pane, so an RPC Pi
started inside a Herdr pane would have taken the pane's letters. The
extension now treats Pi's TUI and omp's session with a UI as the pane's own
agent, the sessions Herdr's integrations report.
A Pi stand-in and an omp stand-in load the files the kit wrote into a
private HOME, report their session file as Herdr's integrations do, and
check a letter in each direction on the next prompt and its confirmation
once written, the spawn guard's refusal in both, and omp's subagent counts
with a subagent prompt that takes no letter. The snapshot count reader the
OpenCode spec used moves to a module both specs share.
agent-hooks.md gains the extension's section, its rows in the file, support
and feature tables and its tests; delivery.md says Pi and omp take letters on
the next prompt with no bell and that a session may be a 4096-byte file path;
ARCHITECTURE.md names the extension as their hook piece.
# Conflicts:
#	contracts/agent-adapters.json
#	hide-agent-hooks/tests/it/main.rs
The core still bounded the guard's session at 256 bytes, so an omp worker
whose session file passes that bound had its ask shown instead of refused.
The guard now uses the same 4096-byte session rule as a letter pull, the
wire contract says so and lists every runtime with a question tool of its
own, and the daemon's parse of the request is tested for each runtime.
A letter counted as confirmed before Hide answered, so a confirmation that
failed left it riding every later prompt; the session guidance counted as
given when a message was prepared, so omp's second attempt at a submission
carried none and a failed read was never retried. Both now wait for what
the host and Hide report. Only the host's TUI session takes guidance and
letters, since omp's RPC mode reports a UI too; the tests wait on a helper
call rather than a fixed time before saying a call was not made.
The helper passed a script's letter ids to hide inbox --confirm unchecked;
they now meet the rule a pull's ids meet, and none may read as an option. A
script file's constants go in before the helper path, so a placeholder's
spelling inside the path stays the path's.
cargo test runs a binary's tests on parallel threads, and two Node runs at
once crowded the hook tests that read their payload within half a second;
one such test missed it in a sealed run.
…rs and the spawn guard

The adapter grades an agent Basic when it lacks prompt intake or spawn
refusal. Hide's extension gives Pi and omp both, so the settings specs
and the agents guide now list only Grok and Cursor as Basic. The Pi and
omp e2e waits for hided to hear each pane's session before writing to it.
# Conflicts:
#	docs/ARCHITECTURE.md
#	hide-kit/src/tests/agent_cases.rs
Pi's popover line, the Factory worker paragraph, two comments and the
settings fixture still described Pi as a Basic agent with no hook.
# Conflicts:
#	contracts/hided-ws.schema.json
#	docs/agent-hooks.md
#	herdr-core/src/agent_hooks.rs
#	herdr-core/src/runtime/agents.rs
#	herdr-core/src/runtime/tests/agent_features.rs
#	hide-agent-adapter/src/lib.rs
#	hide-agent-hooks/src/bin/hide-agent-hooks.rs
#	hide-agent-hooks/src/runtime.rs
#	hide-kit/src/agents.rs
#	hide-kit/src/tests/agent_cases.rs
#	hided/src/server.rs
#	web/src/generated/hided-ws.ts
@yansfil
yansfil merged commit 7491f29 into main Oct 9, 2026
22 checks passed
@yansfil
yansfil deleted the feat/pi-omp-extension branch October 9, 2026 00:38
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 yansfil changed the title Pi와 omp 안에서도 편지, 실행 가드, 하위 에이전트 수가 동작한다 Pi와 omp에도 프로젝트 Memory가 붙는다 Oct 9, 2026
@yansfil yansfil changed the title Pi와 omp에도 프로젝트 Memory가 붙는다 Pi와 omp 안에서도 편지, 실행 가드, 하위 에이전트 수가 동작한다 Oct 9, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant