Skip to content

에이전트 지원 선언 통합과 기본 기능 묶음 - #769

Merged
yansfil merged 20 commits into
mainfrom
feat/agent-adapter-layer
Oct 8, 2026
Merged

yansfil merged 20 commits into
mainfrom
feat/agent-adapter-layer

Conversation

@yansfil

@yansfil yansfil commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 분산된 에이전트 지원 판정을 한 선언으로 모아 core·hook·session·web이 같은 목록과 기능을 읽습니다.
  • 일부 지원의 평면 목록을 기본 칩과 기본 기능·세션 읽기·협업의 세 묶음으로 바꿉니다.
  • 알려진 철자는 시작·재개·위임·인계에서도 같은 정체성으로 비교하며, 수신한 원문과 권한 검사는 유지합니다.
  • 여섯 Factory 능력과 선택적 질문 내용을 선언하되, 새 공급자 기능이나 종은 활성화하지 않습니다.

After: English Basic feature groups in the isolated Electron renderer

변경 후: 격리 Electron renderer에서 확인한 기본 기능 세 묶음

Review

  • 판단해 주세요: 한국어·영어 팝오버의 문구와 세 묶음이 지원 경계를 충분히 설명하는지 봐 주세요.
  • 조심해서 볼 파일: coordination/{executor,mod}.rs의 원문 영수증·권한, runtime/delivery.rs의 승인 대기 종 보류.
  • 비용 검토: 조회는 고정 선언 탐색이며 할당·I/O·락·상주 작업·추가 알림이 없습니다. 진단은 128쌍·필드당512B로 제한합니다.

Evidence

  • 현재 검증: 최종 커밋의 Rust3307개 통과·17개 ignored, fmt/clippy 통과. 소스·등록 증거가 바뀌지 않았습니다.
  • CI: 최종 커밋의 필수 CI와 디자인 계약이 모두 통과했습니다. 세 플랫폼 패키징도 통과했습니다.
  • CI 재시도: 이전 CI의 기존 tab-strip #754·native CDP #768가 첫 시도 실패 후 각1회 재시도로 통과했습니다.
  • 화면·실행: 현재 설정 E2E5개와4언어×2테마를 확인했습니다. 이전 위임/인계2개·Electron8상태는 해당 P3 화면·desktop 소스의 연속성으로 연결합니다.
  • 정적·단위: 현재 web1286/desktop158개(skip1/4), type/lint/build·정책198개·staged 디자인이 통과했습니다.
  • 현재 전체 E2E: Linux web221개·Windows36개·desktop62개가 재시도 없이 통과했습니다. Desktop은 focus 검사4개를 포함하고, SSH7건·패키지1건은 사전조건이 없어 건너뛰었습니다.
  • 성능 미확정: helper3개·변경 없는 셸 기준의 p95와 두 배 sidebar 지연이 비교 범위를 벗어나 실측은 INCONCLUSIVE입니다.
  • 미확인: 조용한 기기의 성능 동등성, 로컬 P3 후보의 OS 창 캡처와 물리 키 입력은 확인하지 못했습니다.
  • 기존 테스트 변경: 단위 기대값3곳·사설 fixture3곳·새 테스트 필수 필드를 수정했습니다. 새 P3 정책 테스트는 main의 Factory 의존 관계를 반영했고, 최초 실패도 보존했습니다.
  • 생성물: contracts/agent-adapters.json96줄을 단일 선언에서 내보내며 웹·로고·계약 검사와 함께 CI가 검증합니다.
Verification record
  • PRD: agents/prd/agent-adapter-layer/prd.md (sha256 872247d2f5c28def7d38524fef7f1d1699a06240b8f3b6975ff3234457cf9840)

  • Base 343e144 → head 71aed12, verified 2026-10-08T02:34:45.876Z: PASS

  • Verification report: agents/runs/agent-adapter-layer/verification-report.json and agents/runs/agent-adapter-layer/verification-report.md; source fingerprint af4e920b51011ab3eb872518ec4596fcc8ee41e248081ecd26fc1adb7abefbdc

  • Suites:

    • S1: GREEN bash scripts/verify-cargo.sh test (exit 0)
    • S2: GREEN bash scripts/verify-cargo.sh lint (exit 0)
  • Reviews (independent advice, no reviewer execution):

    • Code reviewed final71aed127: the Factory consumer omission is fixed from independent manifests, focused41 and policy198 pass; no Fix now remains. Source advice sha256 bf50ffc1570e923b669092c86d9294cd242cd7521cc9ada00ee5131507202f54; same-head post-PASS evidence settlement complete, all43 registered/30 inventory hashes match, no Fix now; evidence advice sha256 1ad6bbd8365f3fedda3073ad8685ef2e5a64dcb15e375cca3cf2c34a8dbd8d54.
    • Fidelity reviewed final71aed127: all16AC continuation and moved fixture byte boundary retained; policy oracle closure accepted, no Fix now remains. Source advice sha256 98e327ddd54544331873ce4cb35dddef6811ba58ccec8889d1bfd43b46dea503; same-head post-PASS evidence settlement complete, all43 registered/30 inventory hashes match, no Fix now; evidence advice sha256 83371a3b787288270d7d0782e289fd27ad2401c94fa5efb9430dea406bda5142.
    • Security reviewed final71aed127: node/link and pane/session identity, Origin/token and session-root confinement retained; no P3 Fix now. Source advice sha256 ae1443bf9f0d0ecc464ab04ef112569aeef3b42454a5891950b514d8b8d500d4; same-head post-PASS evidence settlement complete, all30 inventory hashes match, no Fix now; evidence advice sha256 541539f7909c5ea7878561fdd636b5d823b36b09684a08c08d96ecf3ecb1fdf8.
  • Evidence: 43 registered (40 file, 2 screenshot, 1 browser); paths are local to the run directory

    • agents/runs/agent-adapter-layer/grouping-interpretation.md
    • agents/runs/agent-adapter-layer/focused-verification.md
    • agents/runs/agent-adapter-layer/integrated-static-verification.md
    • agents/runs/agent-adapter-layer/review-fix-verification.md
    • agents/runs/agent-adapter-layer/b8-bounded-diagnostic-disposition.md
    • agents/runs/agent-adapter-layer/ci-topology-interpretation.md
    • agents/runs/agent-adapter-layer/source-proof-979b426f.json
    • agents/runs/agent-adapter-layer/acceptance-packet-979b426f.md
    • agents/runs/agent-adapter-layer/cli-core-verification-979b426f.md
    • agents/runs/agent-adapter-layer/browser-verification-979b426f.md
    • agents/runs/agent-adapter-layer/provisional-cli-verification-3d192d9c.md
    • agents/runs/agent-adapter-layer/accepted-main-readiness-32458fa4.md
    • agents/runs/agent-adapter-layer/baseline-cli-verification-04af60e7.md
    • agents/runs/agent-adapter-layer/b11-setup-return-2171.md
    • agents/runs/agent-adapter-layer/b11-valid-setup-return-2247.md
    • agents/runs/agent-adapter-layer/b11-installer-return-2302.md
    • agents/runs/agent-adapter-layer/b11-installed-setup-return-2326.md
    • agents/runs/agent-adapter-layer/b11-load-setup-return-2354.md
    • agents/runs/agent-adapter-layer/final-runtime-observations-85383664.json
    • agents/runs/agent-adapter-layer/coordination-deviations-2659.md
    • agents/runs/agent-adapter-layer/source-proof-85383664.json
    • agents/runs/agent-adapter-layer/final-static-checks-85383664.json
    • agents/runs/agent-adapter-layer/native-2622/public-en-dark.png
    • agents/runs/agent-adapter-layer/native-2622/public-ko-dark.png
    • agents/runs/agent-adapter-layer/source-proof-df64ee80.json
    • agents/runs/agent-adapter-layer/fixture-repairs-df64ee80.md
    • agents/runs/agent-adapter-layer/aside-2622/final-observation.json
    • agents/runs/agent-adapter-layer/final-desktop-background-df64ee80.json
    • agents/runs/agent-adapter-layer/final-e2e-evidence-df64ee80.json
    • agents/runs/agent-adapter-layer/final-acceptance-packet-df64ee80.md
    • agents/runs/agent-adapter-layer/source-proof-da4023c3.json
    • agents/runs/agent-adapter-layer/final-acceptance-continuity-da4023c3.md
    • agents/runs/agent-adapter-layer/source-proof-0c56cf21.json
    • agents/runs/agent-adapter-layer/final-integration-acceptance-0c56cf21.md
    • agents/runs/agent-adapter-layer/final-integration-evidence-0c56cf21.json
    • agents/runs/agent-adapter-layer/native-final-0c56cf21/public-en-dark.png
    • agents/runs/agent-adapter-layer/native-final-0c56cf21/public-ko-dark.png
    • agents/runs/agent-adapter-layer/source-proof-f2f9672b.json
    • agents/runs/agent-adapter-layer/ci-fix-evidence-f2f9672b.json
    • agents/runs/agent-adapter-layer/ci-fix-acceptance-f2f9672b.md
    • agents/runs/agent-adapter-layer/source-proof-71aed127.json
    • agents/runs/agent-adapter-layer/main-integration-evidence-71aed127.json
    • agents/runs/agent-adapter-layer/main-integration-acceptance-71aed127.md
  • Changed paths: 98 (see Files changed)

  • Delivery: mode pr, branch feat/agent-adapter-layer, base main

  • The first PR CI run37713434046 ended with19successful checks and a failed Linux remote-mailbox job113104460120; both attempts stopped before device registration.

  • Fixfff5df116 keeps the private authenticated Origin-bearing setup connection open through an ordered Ping/Pong receipt barrier, surfaces daemon errors and retains mailbox assertions, original deadlines and retry configuration.

  • The corrected f2 Linux mailbox lane passed first attempt32.720s and actual aggregate CI37715503335 completed PASS; it retains two known single-retry flakes (Flaky test: Selecting an Agent tab moves the title width to it, and the selected tab stays in sight once the strip scrolls #754/Flaky test: browser CDP: the native guard cancels a pending preattach file load and remains restricted after disconnect #768), not a zero-failure claim.

  • Current accepted main343e144a includes the device-node change Run a device's node as hided and carry its panes on the node link (core-host-node 2b) #751, merged in1351; final71aed127 is a test-only correction. Both Cargo conflicts preserve both sides, the receipt renderer moved byte-exact to hided, and delivery remains98paths.

  • Actual1351 web/desktop wrapper passes1286/158tests with1/4skips plus typecheck/lint/build; design/staged1 pass. Its CLI build54.36s and privateSSH1PASS36.486s use the new device node. Final71 changes only the new P3 policy test.

  • Actual1351 browser settings5 pass in62.0738s with one worker/retries0, including8language/theme states; ko-dark and ja-light images were visually inspected.

  • The initial browser invocation failed5setup checks because the collector's evidence folder was missing; that log/JSON are retained, then the corrected invocation passed without changing source, assertions, deadlines or retry configuration.

  • Current ordinary and staged design checks pass; the prior staged missing-module and adapter-contract omissions are closed.

  • The prior whole web221/background57+7skip remain observed853; handoff/spawn2 and native8state remain observed0c and support only named unchanged P3/desktop source continuity.

  • Native8state images are actual Electron renderer captures with recorded0c binary/PID identities; OS exact-window capture and physical Space/IME input remain unverified.

  • Accepted-main Factory and device-node/session/packaging changes prevent blanket historical production, wire or runtime continuity claims; all existing web E2E files remain unchanged relative to current343e main.

  • Eight pre-move hook byte barriers and382external Cargo packages remain unchanged.

  • Three old B14 unit-oracle migrations, the new-web required-field correction and three private fixture repairs remain disclosed. A1351 policy198 run additionally found two subcase failures in the new P3 consumer test: accepted-main Factory now depends on node-link and therefore on the adapter. The expectation adds that tenth manifest-derived consumer while preserving both cases and all lane/negative/full assertions; focused41PASS0.724s then final71 policy198PASS36.373s close it, with the original failures retained.

  • No full real-native alias E2E is inferred from modular identity tests or ordinary desktop journeys.

  • B11 completion is accepted under the disclosed coordination disposition; independent empirical parity remains INCONCLUSIVE.

  • All eight final historical hook p50s meet the original observational bands; quiet-device, release, internal-paint and sustained-RSS parity remain unestablished.

Historical hook path Baseline p95 ms Candidate p95 ms Observation
Claude direct helper 89.029708 120.409875 Outside band
Codex ordinary shell helper 34.797542 65.914458 Outside band
Codex direct helper 30.831750 39.428416 Outside band
Unchanged Claude shell reference 16.685750 48.190834 Outside band

Double-scale CLI-to-correlated-complete-state p50/p95:858.514540/982.728420 to1051.155080/1241.751420ms, both outside bands.
The unchanged reference tail supports uncertainty but does not prove a causal host-load explanation.
No repeat-until-green performance measurement was used to replace those outcomes.
Historical local native background checks preserve the operator focus; that local run did not execute focus-dependent tests.
Six external SSH cases and one packaged-app case retain explicit prerequisite skips in the historical full background run.
No installed operator app, settings, Herdr server, pane or peer worktree was changed for verification.

Existing flaky issues predate this PR: #754 expected16/received15, first seen in PR749, expires2026-10-14; #768 TypeError this.cdpChanged is not a function, first seen on main8ea, expires2026-10-15.
Each failed once and passed one existing CI retry on f2; their first-failure artifacts and automatically attached issue records remain unresolved, with no P3 or host-load causality established.
The final71 CI run has no flaky test in the Rust, remote-mailbox, four Linux web shards, Windows web or desktop reports; the historical issues remain open and are not claimed fixed.

Final candidate CI run37718924925 attempt1 completed SUCCESS at2026-10-08T02:58:18Z for71aed1274913540bc22b4cb4523065dbbe73d789.
The aggregate verify job113126644789 succeeded at02:58:17Z; the separate design run37718924619 also passed, yielding21SUCCESS/1intentionalSKIP checks.
The skipped Windows build job is the reusable workflow's unneeded build branch, not the Windows check, E2E or package job, all of which passed.
Actual current CI: Rust3290passed/16skipped in120.895s; privateSSH1passed/0skipped first attempt41.731s; Linux web59+54+53+55=221passed; Windows web36passed; desktop62passed/8prerequisite skips, including4focus-dependent tests passed.
The eight desktop skips are seven external SSH prerequisites and one packaged-app prerequisite; local P3 OS-window capture and physical Space/IME input remain unverified.
Current CI unit checks match web1286passed/1skipped and desktop158passed/4skipped, and macOS/Linux/Windows package checks all passed.
The final artifact inventory contains only three package archives, the Linux hided build and zsh packages; no failure or flaky-log artifact was emitted.

Current supported full PASS generated 2026-10-08T02:34:45.876Z; report sha256 9d7174088a411510aec34717a24ba403e716c1707486a6d3b4fff444feb49b4e.
Actual S1 has90 result blocks3307passed0failed17ignored,287.127s; S2 fmt/clippy exit0,26.448s; sourceChangedAfterVerification=false and inputsChangedAfterVerification=false.

Final delivery diff: 98 files changed, 3315 insertions(+), 590 deletions(-).
The registered source-proof71 summary diffStat string retains1351’s3314insertions; the explicit final test-only closure/head/tree/98path proof is correct, and actual final71 has3315insertions after that net+1line.
Delivery completed2026-10-08T03:00:48Z by merge commit5956123e3292533d53630d192a5d605561b74409 with parents343e144abf10ce6f8cc49181d3c3ab1fc4da3c10 and71aed1274913540bc22b4cb4523065dbbe73d789.
GitHub's actual merged tree45f6f240bb0df6efbdaed46d2bf0f2dbb59d48e2 exactly matches the verified candidate tree, and main contains the merge; the verification report retains its original candidate identity.

@yansfil
yansfil merged commit 5956123 into main Oct 8, 2026
22 checks passed
@yansfil
yansfil deleted the feat/agent-adapter-layer branch October 8, 2026 03:00
yansfil added a commit that referenced this pull request Oct 8, 2026
Related: #769, #786

## Summary

- 설치된 Grok, Pi, omp, Cursor, OpenCode를 기존 시작 화면에서 선택하고 지원 인자로 첫 지시를
보냅니다.
- 검색과 Memory의 공급자 판별을 명시해 알 수 없는 세션을 Claude Code로 읽지 않습니다.
- 인증된 연결의 실제 읽기 기능을 따로 확인하며, 감사한 이전 helper의 기존 기능을 유지합니다.
- 새 읽기 기능을 위한 저장 확인, pane 닫기, 같은 세션 깨우기 경계를 기존 소유자에 추가합니다.
- 여섯 PR 중 첫 공통 변경이며, 다섯 새 reader의 활성화는 각 후속 PR이 완료될 때까지 꺼져 있습니다.

![격리된 시작 화면에서 선택 가능한 일곱
종류](https://github.com/yansfil/pr-assets/blob/main/hide/session-readers-common-v2/1ed704f/png_kinds.png?raw=true)

![Pi를 선택하고 한국어 첫 지시를 입력한 상태, Start 실행
전](https://github.com/yansfil/pr-assets/blob/main/hide/session-readers-common-v2/1ed704f/png_pi.png?raw=true)

## Review

- **판단해 주세요**: 지원하는 모델 인자의 목록을 읽지 못하면 기존처럼 비활성 기본값을 보여줍니다.
- **조심해서 볼 파일**: `hide-node-link/src/link.rs`와 `readers.rs`는 연결별 기능과
decode 거부 경계입니다.
- **조심해서 볼 파일**: `runtime/agent_sleep/dormant.rs`, `persistence.rs`는 저장
확인과 중복 실행 경계입니다.
- **비용 검토**: wake 확인 대기 중에는 pane과 최대 256개 기록을 한 번씩 읽고, 변경을 기존 notifier로
알립니다.
- **상한과 종료**: 기존 worker를 쓰며 진행 의도 4개, 180초 제한, 세대 검사와 종료 시 소유 해제를 유지합니다.
- **후속 항목**: 오래된 Reopen 요청이 잠드는 중인 행 대신 이전 일반 복원 항목을 소비할 수 있는 P2가 남습니다.

## Evidence

- **확인한 것**: sealed 필수 3개 suite가 모두 통과했으며 core 1,777개, web 1,288개,
desktop 159개 테스트가 포함됩니다.
- **확인한 것**: sleep/wake 회귀 18개가 통과했으며 실제 저장 파일과 외부 Herdr
close/create/start/확인 경계도 검사했습니다.
- **확인한 것**: Identity 독립 게이트와 이전 프로토콜·혼합 응답·교체된 연결 회귀 29개가 통과했습니다.
- **확인한 것**: 격리 브라우저의 일곱 종류 메뉴, Pi 선택, 한국어 입력과 비활성 기본 모델을 관찰했습니다.
- **확인한 것**: 이전 후보에서 실제 retained helper SSH 연결과 일반 교체, 기존 sleep 재현이
통과했습니다.
- **CI**: Linux 네 shard와 Windows 브라우저, desktop e2e, 세 OS 패키징을 포함한 모든 필수
lane이 통과했습니다.
- **확인하지 못한 것**: 실제 새 제공자 start·resume·fork, 패키지 앱의 native 화면과 로컬 전체
Playwright는 미실행입니다.
- **미확인 원인**: 첫 legacy-sleep 준비 실패와 hook first-exec warmup 실패는 원인
미확인입니다. 변경 없는 재현과 이후 전체 suite는 통과했습니다.

<details><summary>Verification record</summary>

- PRD: `agents/prd/session-readers-common-v2/prd.md` (sha256
9126b0c36344a96bebe9cc2e9d08f3eebbfc38dc704a585c56fc4c1dfbe044e6)
- Merge-base 5ba348f, current accepted main tip 7a42024 → head eddaa24,
verified 2026-10-08T16:58:41.341Z: PASS
- Verification report:
`agents/runs/session-readers-common-v2/verification-report.json` and
`agents/runs/session-readers-common-v2/verification-report.md`; source
fingerprint
4da488e1312397a66b032153d9bc7f8ede402925798c1731d5327f13c2cd3fbd
- 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)
- Fidelity review: complete common B1-B6 review through 1ed704f and
source integration review on exact eddaa24; no P0/P1. Original
successful durable-owner coverage, independent Identity gate and dormant
sole-resume authority findings closed. Parent/current-guide Model
interpretation remains a human judgment alongside Code's literal-child
concern.
- Code review: complete common B1-B6 review through 1ed704f and source
integration review on exact eddaa24; no P0/P1. Original Identity decode
fence and dormant duplicate-authority fixes remain intact; accepted
older ordinary-Reopen P2 and literal B1 Model presentation disagreement
retain their closure conditions.
- Security review: complete common B1-B6 review through 1ed704f and
source integration review on exact eddaa24; no P0/P1. Authentication,
immutable connection facts, path/owner retirement, write guards and
private phone boundaries remain intact. Existing P2 and external-probe
limits retained.
- Final evidence closure: Fidelity, Code and Security independently
checked the exact eddaa24 replacement report, all three current command
logs, three new registered diagnostic artifacts and the complete
five-file main5ba..7a interaction diff; no new P0/P1. Their complete
prior B1-B6 review and supplemental policy dispositions remain
incorporated. Accepted P2 follow-ups and unrun provider/native surfaces
retain their stated limits.
- Integration: ordinary merge of accepted main
5ba348f without conflicts or manual
resolution; tree exactly matches precomputed
ee5e456. Seventy-two of 78 common path
blobs remain unchanged; all six interactions reviewed. GitHub had
reported the previous head dirty and scheduled no CI; the old no-checks
watch never granted merge authority.
- Current report SHA256
ec4f773ca6710d0ce4cddd6a8e5053358aa8d36b9893103bb5594d75fc0fbb5c, input
fingerprint
f55fdc827c05242e1e46f533ecaef905b0c712f6606e257559c98881035cfa88, source
fingerprint
4da488e1312397a66b032153d9bc7f8ede402925798c1731d5327f13c2cd3fbd, no
exclusions or tree/input mutations.
- Current command logs: S1 mechanical-1e7f95913dc6076b.log
exit0/288.053s SHA256
f8e2c1a71110124bf983b054950dc0a7afd0b439e600ca21a758412373833f75; S2
mechanical-b64896c596730ee1.log exit0/81.765s SHA256
bf9179a2f23d8e9d172c0162c1a161a9a9c789946c245b0aabde00845a3d0899; S3
mechanical-3cc9f5d9093a2614.log exit0/5.625s SHA256
8e4bdfb11ddf9dd009b7946b2d21dab0371805b31c728033e7200dd861760978.
- Base-tip follow-up: 7a42024 is not merged into this candidate;
conflict-free prospective merge tree
a14e1fd is uncompiled.
Repository-configured premerge checks must validate current main before
merge. The report binds baseTip7a and merge-base5ba without changing
HEAD.
- Failure disposition: original kit expectation and node-link test lint
fixed in 2a5ca10; bounded immutable guard clone and equivalent
confirmation filter lints fixed in 1ed704f. Unsupported inherited
C.UTF-8 diagnosed independently; supported invocation-only en_US.UTF-8
makes unchanged watcher assertions pass. New same-head hook warmup FAIL
retained: 20 copied-executable first-exec Deadlines before behavior
assertions, cleanup unconfirmed. One unchanged case then all63
normal-parallel integration tests and final full suite passed. High load
is correlation, cause/initial cleanup remain unknown. No test deadline,
thread setting, exclusion or global environment change.
- CI disposition: [verify
run37809556284](https://github.com/modakbul-gongbang/hide/actions/runs/37809556284)
attempt2 completed SUCCESS at2026-10-08T17:18:44Z on exact eddaa24.
Attempt1 passed every planned lane except desktop e2e, which acquired no
hosted runner and executed no steps; GitHub annotation names macOS arm64
capacity constraints. Failed-jobs-only retry acquired a runner, desktop
e2e and its flaky reporter passed, and final aggregation passed. [Main7a
verify
run37810892341](https://github.com/modakbul-gongbang/hide/actions/runs/37810892341)
also passed attempt2 after the identical infrastructure failure.
Separate Design contract run37809554930 passed. No source, runner policy
or assertion change was made for either retry.
- Supplemental current-head checks: 209 Python policy tests, eight other
repository gates and hakari pass; actual log SHA256
68c8f8f04f092c169e5ea7405fe6f22775515756b1568a529fd1d963e6679638.
- Earlier surface provenance: screenshots and actual browser observation
target f5f2, with no Start submitted; retained24 SSH and normal
replacement target 0815, with no repeated actual SSH probe on this
integration head.
- Evidence: 40 registered (24 log, 13 file, 1 browser, 2 screenshot);
paths are local to the run directory
- agents/runs/session-readers-common-v2/common-integration-lib-fixed.log
  - agents/runs/session-readers-common-v2/common-cli-build.log
  - agents/runs/session-readers-common-v2/common-retained24-current.log
  - agents/runs/session-readers-common-v2/common-browser-regression.log
-
agents/runs/session-readers-common-v2/common-legacy-sleep-reproduction.log
  - agents/runs/session-readers-common-v2/common-review-fixes-libs.log
-
agents/runs/session-readers-common-v2/common-dormant-fixture-corrected.log
- agents/runs/session-readers-common-v2/common-dormant-folder-owner.log
  - agents/runs/session-readers-common-v2/review-fidelity-0815.md
  - agents/runs/session-readers-common-v2/review-code-0815.md
  - agents/runs/session-readers-common-v2/review-security-0815.md
  - agents/runs/session-readers-common-v2/common-dormant-canonical.log
- agents/runs/session-readers-common-v2/common-identity-gate-current.log
  - agents/runs/session-readers-common-v2/common-cli-rebuild-f5f2.log
  - agents/runs/session-readers-common-v2/review-code-f5f2.md
  - agents/runs/session-readers-common-v2/review-fidelity-f5f2.md
  - agents/runs/session-readers-common-v2/review-security-f5f2.md
-
agents/runs/session-readers-common-v2/manual-browser/aside-start-observation.txt
  - agents/runs/session-readers-common-v2/manual-browser/png_kinds.png
  - agents/runs/session-readers-common-v2/manual-browser/png_pi.png
  - agents/runs/session-readers-common-v2/manual-browser/cleanup.json
-
agents/runs/session-readers-common-v2/common-sealed-verify-f5f2-registered.log
  - agents/runs/session-readers-common-v2/common-kit-start-repro.log
  - agents/runs/session-readers-common-v2/common-node-clippy-repro.log
  - agents/runs/session-readers-common-v2/common-kit-start-fixed.log
  - agents/runs/session-readers-common-v2/common-node-fixed.log
  - agents/runs/session-readers-common-v2/common-node-clippy-fixed.log
- agents/runs/session-readers-common-v2/common-watchers-locale-repro.log
-
agents/runs/session-readers-common-v2/common-watchers-supported-locale.log
- agents/runs/session-readers-common-v2/common-core-clippy-2a5-repro.log
-
agents/runs/session-readers-common-v2/common-core-clippy-guard-fixed.log
  - agents/runs/session-readers-common-v2/common-dormant-guard-fixed.log
  - agents/runs/session-readers-common-v2/locale-diagnosis.json
  - agents/runs/session-readers-common-v2/review-code-2a5.md
  - agents/runs/session-readers-common-v2/review-fidelity-2a5.md
  - agents/runs/session-readers-common-v2/review-security-2a5.md
-
agents/runs/session-readers-common-v2/verification-report-2a5-fail.json
-
agents/runs/session-readers-common-v2/common-hook-warmup-single-repro.log
-
agents/runs/session-readers-common-v2/common-hook-warmup-integration-repro.log
  - agents/runs/session-readers-common-v2/hook-warmup-diagnosis.md
- Changed paths: 78 (see Files changed)
- Delivery: mode pr, branch `feat/session-readers-common`, base `main`

</details>
yansfil added a commit that referenced this pull request Oct 8, 2026
Related: #769 (adapter declarations this builds on), #810 (no agent row
draws an in-process subagent count yet)

## Summary

OpenCode has no command hook, so inside Hide it got none of Hide's
collaboration: no letters on its prompt, no spawn guard, no Memory, no
subagent count.
This adds a Hide-owned OpenCode plugin,
`~/.config/opencode/plugins/hide.js` beside Herdr's, written and removed
only by `hide-agent-hooks` and installed as OpenCode's hook piece in the
kit.
Inside a Hide-managed Herdr pane it adds guidance, Project Memory and
waiting letters to a root session's prompt as one synthetic part, and
confirms the letters only after OpenCode reports that part stored.
It also refuses `herdr agent start` with the spawn guard's reason,
refuses `question` in a Factory worker pane, and reports subagent counts
from child-session events.
OpenCode stays unbelled, since its resume picker reads `done`. Outside a
managed pane the plugin registers nothing.

Settings now name OpenCode's piece `Plugin`, drop its `Basic` chip, and
say on any agent's row why its hook could not be put in (for example,
the agent's config folder does not exist yet).

## Review

- **판단해 주세요**: the agent row now shows one quiet line when a hook is
Absent with a reason, for every agent (B14). On Windows, Cursor's row
says its hook is not written there.
- **판단해 주세요**: the subagent count reaches Herdr's pane tokens and the
snapshot (`children.subagents`), as Claude Code's does. No row draws it
yet for any agent: #810.
- **조심해서 볼 파일**: `hide-agent-hooks/src/opencode/plugin.js` - runs inside
the operator's OpenCode. Every hook has a budget and fails open except
the refusal.
- **조심해서 볼 파일**: `herdr-core/src/delivery/mailbox.rs` - an unbelled kind
with a prompt hook now takes letter bodies on any prompt. The plugin
confirms later.
- **조심해서 볼 파일**: `herdr-core/src/runtime/memory.rs` - receipts from
OpenCode's label read are recorded on one owned thread off the lock,
with queues capped at 64 and 256.
- **조심해서 볼 파일**: `.github/workflows/pr.yml`, `herdr-update.yml` - the
rust lane installs Node 22, because `hide-agent-hooks` runs the plugin
under Node in its tests.
- **비용 검토**:
- Per OpenCode prompt: one helper process, plus one count report after
it.
- Per child status change: at most one running report, with only the
newest waiting.
- Session bookkeeping is capped at 512, evicting finished children
first.
- Nothing is added on hided's high-frequency paths. The lineage pass
reads one kit status instead of cloning the kit.

## Evidence

- **확인한 것**: sealed suite `verify-cargo.sh test` and `lint` PASS on the
final head, merged with main at #821.
- **확인한 것**: Node plugin test, run with OpenCode 1.18.30's hook and
event shapes:
  - root and child prompts;
  - deferred confirm and an unstored prompt;
  - budgets, plus slow, failing and garbled helpers;
  - spawn and question refusal, including a subagent's question;
  - background child counts;
  - more than 512 sessions.
- **확인한 것**: `web/e2e/opencode-plugin.spec.ts` on a private pinned Herdr
0.9.3, where the kit writes the plugin and a stand-in OpenCode in two
panes loads it:
  - a letter rides the next prompt and is confirmed only once stored;
  - `herdr agent start` is refused;
- Herdr's tokens and the snapshot's `children.subagents.working` go 1
then 0.
- 9/9 over 3 repeats, 6/6 over 2 repeats after the last fix; with
`agent-adapter-layer.spec.ts` (OpenCode no longer Basic) 4/4 on the
merged head.
- **확인한 것**: unit tests for every file state (current, stale, edited,
foreign, config folder absent, Windows); kit apply, Reinstall and
switch-off; Memory receipts from synthetic parts; mailbox next-prompt
pull.
- **확인하지 못한 것**: the live check with a real OpenCode (PRD D-13) ran but
measured nothing (exit 3, every cell UNKNOWN):
- run: `scripts/agent-live-check.py --agents opencode`, OpenCode
1.18.30, `opencode-go/deepseek-v4.1-flash`, private pinned Herdr 0.9.3,
this branch's hided;
- Herdr saw OpenCode idle and ready in every scene, but every screen
read came back empty, so all ten scenes timed out at arrival; OpenCode
draws a full-screen interface the tool's read does not return;
- the tool loads Herdr's integration, not Hide's plugin, so the letter
cell is UNKNOWN as well;
- nothing unsafe was seen, cleanup was confirmed, and no login or
operator setting was changed;
- still unproven live: a letter and a refusal reaching the model, B8
after repeated refusals, coexistence with Herdr's plugin, Bun.
- The event samples in `tests/fixtures/opencode/events-1.18.30.json` are
built from OpenCode's source, not captured.
- **확인하지 못한 것**: a machine whose OpenCode reads `$XDG_CONFIG_HOME` loads
neither Hide's nor Herdr's plugin from `~/.config/opencode` (a
limitation shared with Herdr).

<details><summary>Follow-up improvements (not needed for this
contract)</summary>

- Claude Code's hook is silenced inside OpenCode even where Hide's
plugin is not working (Windows, a foreign `hide.js`).
- `hide inbox` offers no `ack_command` to OpenCode; letters are
confirmed by the plugin only.
- Guidance is read once when OpenCode loads the plugin.
- A failed confirm can deliver a letter again (at least once); SIGKILL
of a helper can orphan its grandchildren; no symlink tests for
`hide.js`.
- `done` stops growing once finished children are evicted at 512.
- No e2e for the question guard (B19) or for an idle pane receiving no
input (B5); both are covered below e2e.
- A bash command over the helper's 256 KiB input, or a call past the 8
running helpers, passes the spawn guard unchecked (it guards accidents,
not a sandbox).
- A subagent's `question` from a session the plugin never saw created
asks about the subagent's own id, which the Factory guard does not know.
- On a timeout the helper is killed but the `hide` call it started ends
at its own deadline.
- Letter ids are not checked for a leading `-` on pull or confirm; they
come from Hide's own ledger.
- `herdr-update.yml` takes `actions/setup-node@v4` by tag, as the rest
of the repository does.

</details>

<details><summary>Verification record</summary>

- PRD: `agents/prd/opencode-plugin/prd.md` (sha256
91a061f42e55e18f8f0834a17d9b98c8623e8e8cdf3e8d579208af0e8b9d9448)
- Base b33fb57 → head bb7bf9d, verified 2026-10-08T20:08:54.127Z: PASS
- Verification report:
`agents/runs/opencode-plugin/verification-report.json` and
`agents/runs/opencode-plugin/verification-report.md`; source fingerprint
01745cef3e161c615ddbf9ebbd8a6d16fb839f090be81b6040ff408874b81036
- Suites:
  - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0)
  - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0)
- Reviews:
- Fidelity (full contract, earlier head): Fix now items fixed before the
follow-up rounds; closure confirmed, nothing blocking.
- Code (full contract, then follow-ups through the merge with main): Fix
now items fixed (plugin eviction, report coalescing, root lookup for
question, receipts off the lock); nothing blocking on the merged head.
- Security (on the merged head): Fix now 1, a letter or Memory line
could close the plugin's own reminder tags; fixed with a test that fails
without the fix. Six hardening follow-ups listed above.
- Code follow-up (after merging #815/#816/#817): Fix now 1, the OpenCode
tests copied or wrote the programs they start, against TESTING.md rule
8; converted to the build's stand-ins. Merge resolutions confirmed.
- Evidence: none registered separately.
- Changed paths: 63 (see Files changed)
- Delivery: mode pr, branch `feat/opencode-plugin`, base `main`

</details>
yansfil added a commit that referenced this pull request Oct 8, 2026
Related: #769 (P3), #810, #818

## Summary

Grok과 Cursor는 지금까지 hide의 기본 단계라 셸에서 `herdr agent start`로 hide의 책임 기록을
우회해도 막히지 않았고, 서브에이전트 수도 보이지 않았습니다.
이 PR은 두 에이전트가 공식 문서로 제공하는 hook에 hide 항목을 설치해 실행 차단(spawn guard)과 서브에이전트
수를 `Claude Code`와 같은 수준으로 줍니다.

- Grok: hide 소유 파일 `~/.grok/hooks/hide.json`을 Herdr, Orca 파일 옆에 둡니다.
이벤트는 `SessionStart`, `PreToolUse`(matcher
`Bash|ask_user_question|exit_plan_mode`), `SubagentStart`,
`SubagentStop`, `Stop`입니다.
- Cursor: 함께 쓰는 `~/.cursor/hooks.json`에 hide 표지(`hide-guidance@2`)가 있는
항목만 더하고 지웁니다. 이벤트는 `sessionStart`, `preToolUse`(`Shell`),
`subagentStart`, `subagentStop`, `stop`입니다.
- 거절은 각 에이전트의 모양으로 합니다. Grok은 `Claude Code`의 envelope을, Cursor는
`{"permission":"deny","agent_message":...}`을 씁니다. Cursor의 권한 hook은 거절하지
않는 모든 경로에서 `{"permission":"allow"}`를 냅니다.
- Grok 안에서는 hide의 `Claude Code` hook과 Cursor 항목이 조용히 끝나므로, 한 사건은 한 번만
셉니다(`GROK_HOOK_EVENT`).
- 코어는 #818의 dialect 기준 설계를 그대로 따라, Grok/Cursor pane의 계측 여부를 OpenCode
플러그인처럼 그 에이전트 행의 hook 조각으로 판정합니다(`kit_hook_status`).
- 운영자가 고친 hide 항목은 "edited" 사유와 함께 Outdated로 보이고 Reinstall 전까지 그대로 둡니다.
#818의 OpenCode 플러그인과 같은 규칙입니다(B8).
- 에이전트 폴더가 없으면 아무것도 만들지 않고, 행이 #818의 대기 줄로 그 이유를 보입니다(B8).
- Factory 질문 가드는 adapter 표가 `direct_ask`를 선언한 에이전트에만 갑니다. hook, CLI,
daemon 소켓이 같은 표(`direct_ask_kind`)를 읽습니다. Grok은 실측 전이라 Unconfirmed로 두고,
그 질문은 그대로 뜹니다.

화면: Settings `기본` 칩 팝오버의 실행 차단과 서브에이전트 수가 Grok/Cursor에서 `✓`로 바뀝니다. 폴더가
없을 때는 Grok/Cursor 행에 "Hook: Grok has not created …/.grok yet; the hook
is put in once it has" 줄이 Reinstall 없이 보입니다(격리 e2e 스크린샷으로 확인, 이미지는 run
디렉터리에 둠).

## Review

- **판단해 주세요**: Grok 파일은 PRD D-01의 이벤트에 `SessionStart`를 하나 더 등록합니다.
서브에이전트에서는 불리지 않는 이벤트라 pane 수를 새로 시작하고 계측 token을 쓰는 자리로 씁니다(lead 승인).
- **판단해 주세요**: 사이드바 수 배지는 어느 에이전트에도 그려지지 않습니다(#810). 이 PR은 `Claude
Code`와 같은 수준, 곧 스냅샷 `children.subagents`까지만 맞춥니다(lead 결정).
- **판단해 주세요 (B8)**: #818 위에서 B8을 맞췄습니다. 폴더가 없을 때의 이유는 Grok/Cursor 행에 대기
줄로 보이고(Reinstall 없음), 고친 항목은 Outdated와 "edited" 사유로 보이며 Reinstall이
되돌립니다. 다음 pass는 고친 항목을 덮어쓰지 않습니다. 둘 다 e2e가 실제 행에서 확인합니다.
- **판단해 주세요 (D-14, B13)**: Grok의 질문 도구가 `PreToolUse`에 오는지 아직 실측하지 못해
`direct_ask`는 Unconfirmed입니다. 그래서 Factory 작업자 pane의 Grok 질문은 지금 그대로 뜹니다.
matcher와 읽기 코드는 남겨 두었으니, 로그인된 Grok으로 실측한 뒤 칸을 Available로 바꿀지
Unavailable로 두고 코드를 지울지 정해 주세요.
- **조심해서 볼 파일**: `hided/src/server.rs` `factory_question_guard` - 소켓 허용
목록을 `direct_ask_kind`로 바꿨습니다. main에서는 `claude-code|codex`만 받아 OpenCode
플러그인의 질문 가드가 `invalid_request`로 떨어져 질문이 그대로 떴습니다. 이 PR에서 OpenCode도 받습니다.
- **조심해서 볼 파일**: `hide-agent-hooks/src/bin/hide-agent-hooks.rs`
`run_basic_hook` - failure path. Cursor가 잘못된 출력을 거절로 읽으므로 allow가 빠지는 경로가
없어야 합니다.
- **조심해서 볼 파일**: `hide-agent-hooks/src/guidance.rs` - 운영자 소유 파일을 쓰는 유일한
코드입니다. 다른 도구의 바이트 보존과 `@1`에서 `@2`로의 교체를 봐 주세요.
- **조심해서 볼 파일**: `hide-kit/src/lib.rs`, `agent_kit.rs` - 새
`Observed::Edited`. `Claude Code`/Codex hook 부품은 Edited를 만들지 않으므로 그 동작은
그대로입니다.
- **조심해서 볼 파일**: `hide-agent-hooks/src/counters.rs` - 모든 count 사건이
`panes.lock` 배타 잠금(1초 대기)을 거치고, 바뀌지 않는 사건은 공유 잠금으로 읽습니다. `Claude Code`와
`Codex`도 같은 경로입니다.
- **조심해서 볼 파일**: `herdr-core/src/runtime/agents.rs`, `runtime/kit.rs` -
`Mutex<Runtime>` 안의 일입니다. Grok/Cursor는 OpenCode와 같이 kit 행의 hook 조각을
pass당 한 번 읽고, 조각이 바뀔 때만 lineage를 다시 맞춥니다.
- **비용 검토**: hook 사건당 잠금 한 번과 기록 쓰기 한 번이 듭니다(fsync 없음). 기록이 보내는 사이 바뀌었으면
보고를 한 번 더 합니다. 상시 작업과 틱 작업은 없습니다.

## Evidence

- **확인한 것**: `hide-agent-hooks/tests/it/grok_cursor_hooks.rs`는 빌드된 도우미를
각 에이전트의 문서 payload, 가짜 `hide`, 가짜 Herdr 소켓과 함께 돌립니다. 확인한 항목은 다음과 같습니다:
  - 거절 모양;
- Cursor allow (pane 밖, 미등록, daemon down/mute/later/slow, 읽을 수 없는
payload, owner handshake 실패);
  - Grok 질문 도구가 가드를 묻지 않고 그대로 뜨는 것;
  - 서브에이전트 수 (Grok 배경 서브에이전트 유지, 서브에이전트 자신의 Stop 무시);
  - Grok 안에서 세 hook이 한 번만 세는 것.
- **확인한 것**: `web/e2e/grok-cursor-hooks.spec.ts`(5개)는 격리 Herdr와 kit를 돌리는
hided, 개인 HOME 위에서 main 병합 후 통과했습니다. 확인한 항목은 다음과 같습니다:
  - 스위치가 hide 항목만 쓰고 지우며, 다른 도구의 바이트가 그대로인 것;
- 지운 hook이 "Hook: Removed"로, 고친 hook이 "edited" 사유로 행에 보이고 Reinstall로
돌아오는 것;
- Grok과 Cursor 폴더가 없으면 아무것도 만들지 않고, 두 행이 "has not created …" 대기 줄을
Reinstall 없이 보이는 것;
  - 설치된 명령 그대로의 거절과 allow;
  - Herdr가 grok/cursor로 분류한 pane의 스냅샷 수;
  - Grok 환경에서 한 번만 세는 것.
- **확인한 것**: Cursor CLI 2026.10.01 번들의 hook 실행 코드를 읽었습니다. 명령은 셸로 돌고,
exit 2와 JSON이 아닌 출력만 막습니다. 다른 exit와 빈 출력은 `failClosed`가 없으면 진행하므로, 도우미가
사라져도 막히지 않습니다.
- **실측 결과 (`scripts/agent-live-check.py --agents grok,cursor`, 격리 Herdr
0.9.3, 이 worktree의 hided, 2026-10-09 06:19-06:33 KST)**: 로그인과 운영자 설정 변경
없이 한 번 돌렸고, exit 3이었습니다. 표는 보고서 그대로입니다.
- grok 1.0.46, 모델 `grok-4.5`: 판정 `unsafe`, 선언된 bell `False`. `grok
models`가 "You are not authenticated."를 답했고, 화면은 "Connection failed |
Retrying"이었습니다. 장면은 startup reached/settings_write, working·model_picker
reached/ambiguous이고, 나머지 7개는 timeout/not_tested입니다.
- cursor 2026.10.01-e373342, 모델 `gpt-5.3-codex-low`: 판정 `unknown`, 선언된
bell `False`, loaded integration
`not_observed`(`global_hooks_not_excluded`). 모든 장면이 "Do you trust the
contents of this directory?" 화면에 머물렀습니다. 장면은
startup·working·model_picker·mcp_approval reached/ambiguous이고, 나머지 6개는
timeout/not_tested입니다.
- 정리: `cleanup.confirmed=true`, 공유 설정 변경 0, 자격 사본 제거. Cursor가 자기 상태 폴더
9개를 `~/.cursor/projects/` 아래에 만들었고(일회용 probe 폴더용), 지우지 않았습니다.
- 두 에이전트 모두 bell은 그대로 꺼 둡니다. 이 도구는 bell 안전성을 재며 hide의 hook을 실제 에이전트에
설치하지 않으므로, 아래 hook 동작은 이 실측으로 확인되지 않았습니다.
- **확인하지 못한 것**: 실제 Grok과 Cursor에서의 hook 동작입니다. 확인할 것은 다음과 같습니다:
  - Grok이 `Claude Code` 호환 hook과 Cursor 항목에도 `GROK_HOOK_EVENT`를 주는지;
  - Grok의 deny envelope과 빈 출력 처리;
  - `ask_user_question`과 `exit_plan_mode`가 `PreToolUse`에 오는지 (D-14);
  - `Stop` 페이로드 모양;
  - 자식 세션의 `SubagentStop`이 부모 pane에 닿는지;
  - Cursor `stop`이 서브에이전트 안에서도 불리는지, 도우미가 없을 때 빈 출력으로 진행하는지.
  Grok은 로그인이 필요하고, Cursor는 trust 화면을 넘길 준비가 필요합니다.
- **확인하지 못한 것**: Windows입니다. 이 hook은 Windows에 쓰지 않습니다(셸 명령, 두 문서 모두
Windows 형태 없음).
- **확인하지 못한 것**: OpenCode 질문 가드가 실제 daemon 소켓을 거치는 경로입니다. 테스트는 `hide`를
대역으로 둡니다.

<details><summary>추가 증거</summary>

- 리뷰: native subagent로 Fidelity, Code/Security, 후속 리뷰 4회를 돌렸습니다. Fix
now는 모두 반영했습니다:
  - 보고 순서;
  - `GROK_SESSION_ID`만으로 `Claude Code` hook이 꺼지던 문제;
  - 잠금 파일 권한;
  - lock 아래 kit 복제;
  - 잘린 기록 경합;
  - CI의 잠금 대기 초과: fsync 제거, 공유 잠금 재읽기;
  - #818 병합 후 daemon 소켓의 질문 가드 허용 목록.
- 마지막 후속 리뷰의 나머지 판단:
- Grok 셸에서 띄운 `Claude Code`의 실행 차단은 main
계약(`inside_another_agents_session_the_guard_stays_out`)대로 꺼진 채 두고, 주석만
바로잡았습니다.
- Follow-up: 이벤트 하나만 지운 항목은 Outdated로 다음 pass가 되돌림. 항목 바이트를 버전에 묶는 테스트.
- 이 브랜치와 무관한 flaky 테스트 하나를 함께 고쳤습니다(`hide-platform` 자손 수 비교).
- Follow-up:
  - `observe_guidance`가 pass당 파일을 세 번 읽음;
  - 잠금 실패 문구가 소켓 실패처럼 읽힘.

</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