Skip to content

hcoord의 편지 전달과 감시를 hided로 흡수한다 (1, 2단계) #359

Closed

Description

@yansfil

The task you are doing when you want this

에이전트 사이 편지(request, reply)와 부모가 건 감시를 별도 TypeScript daemon인 hcoord 대신 hided에서 처리하려 한다.
전체 이행 4단계 중 1단계(편지함, 전달)와 2단계(감시)이고, 이 이슈가 그 구현을 추적한다.
이후 3, 4단계(hcoord 은퇴)는 별도 이슈에서 다룬다.

What hide does today

  • 편지 전달과 감시는 hcoord daemon이 하고, hide는 계보 토큰을 읽기만 한다.
  • hcoord는 에이전트 입력창에 직접 입력해 편지를 전한다.
    수신자가 입력 중이면 초안과 섞일 수 있다.
  • 감시는 sasu가 건 것을 hcoord가 15분 주기로 확인하고, 막힘 여부와 상관없이 소음이 생긴다.
  • 확인하지 못한 것: 입력창 초안과 섞인 실제 빈도.

What it should do instead

hided에 OS 중립 Rust로 편지함과 감시를 새로 만들고, 기존 hcoord와는 이 단계 동안 공존시킨다.

  • hide request send/reply/ack/cancel/show와 hide inbox로 편지를 보내고 받는다.
    같은 --intent로 다시 보내면 기존 편지를 돌려준다.
  • 전달은 초인종과 UserPromptSubmit hook으로 한다.
    Herdr 상태가 idle 또는 done이고, hide 창에서 30초 넘게 키 입력이 없고, 화면을 읽어 입력창이 비었을 때만 울린다.
    그렇지 않으면 입력창을 건드리지 않고 대기시킨다.
  • 편지는 디스크 장부에 보존하고, 전달됨은 hook이 편지를 출력한 뒤 확정 호출을 한 순간으로 정한다.
  • hide watch start나 hide agent spawn --parent here로 부모가 건 감시만 존재한다.
    활동은 Herdr 상태 전이와 세션 파일 쓰기 중 늦은 쪽이고, 20분 무활동이면 부모에게 알린다.
    같은 정지 상태가 이어지면 첫 알림 후 60분에 한 번 더 알린다.
  • 원격 대상의 활동은 helper 호출 session_activity(프로토콜 13에서 14)로 읽는다.
  • 모든 새 작업은 Runtime 락 밖에서 하고 상한을 둔다.
    키 입력 경로에는 마지막 입력 시각을 메모리에 쓰는 일만 더한다.

완료 조건:

  • idle이고 입력창이 빈 로컬 에이전트에 hide request send로 보낸 편지가 초인종과 hook으로 도착한다(Claude와 Codex).
  • working이거나 입력창에 초안이 있으면 입력창이 바뀌지 않고 편지는 대기하며, 기한 뒤 미전달로 표시된다.
  • 같은 intent 재전송은 한 통이고, 전달됨 확정 뒤에는 같은 편지가 다시 주입되지 않는다.
  • 상한을 넘으면 새 편지나 감시가 capacity 오류로 거절된다.
  • 20분 무활동이면 부모에게 알림 한 통이 가고, 같은 정지 상태에서는 60분 시점에 한 번 더 간 뒤 멈추며, 활동이 다시 생기면 초기화된다.
  • 감시는 대상 이탈과 hide watch stop에서만 끝나고 일반 reply로는 끝나지 않는다.
  • 키 입력 경로의 입력 지연과 snapshot 비용이 이 변경 전과 같다.
  • 기존 hcoord는 그대로 돌고 이중 감시나 이중 전달이 없다.

Where the authority for it lives

hided와 herdr-core가 소유한다.
Herdr는 pane, PTY, 에이전트 상태를 소유하고 hide는 공개 API로만 읽고 쓴다.
설계 근거와 결정 목록은 PRD(hcoord-delivery-v2)에 있다.
관련: #348(설계 문서 가이드), with-hide/hide-private#101(범위 밖 후속 작업).

Activity

  1. added
    enhancement
    on Oct 3, 2026
  2. yansfil commented on Oct 3, 2026

    @yansfil
    ContributorAuthor

    본문의 "확인하지 못한 것: 입력창 초안과 섞인 실제 빈도"에 대한 실제 발생 사례입니다.
    2026-10-04 야간 총괄 Codex 세션(Codex 0.160, /goal 실행 중)에서 관찰했습니다.
    hcoord의 submitOfficial은 입력창 확인 없이(expectedInputGuard: null) herdr agent prompt로 편지를 제출합니다.

    관찰 (KST, Codex rollout 이벤트 기준)

    • 08:05:22 진행 중이던 turn이 중단(turn_aborted)되었고, 바로 다음 이벤트에서 goal이 paused로 바뀌었습니다.
    • 08:05:31 운영자가 입력창에 쓰던 질문 뒤에 HCOORD_ANSWER r_33592cc4… 편지가 이어 붙어 하나의 사용자 메시지로 제출되었습니다.
      운영자의 질문은 문장 중간에서 잘린 채 전송되었습니다.
    • 이어서 입력창의 /와 편지가 합쳐져 /HCOORD_NOTICE가 슬래시 명령으로 처리되었습니다(Unrecognized command '/HCOORD_NOTICE').
      같은 시간대에 '/resume' is disabled while a task is in progress도 표시되었습니다.
    • 서로 다른 notice 두 개(r_b02c7afe…, r_d75e255b…)가 …overnight-integrate./HCOORD_NOTICE r_d75e…처럼 한 메시지로 합쳐져 제출되었습니다.
    • goal은 약 15분 동안 paused 상태였고, 총괄은 스스로 재개하지 못했습니다(체크포인트 기록: "no tool can resume").
      입력창이 빈 idle 시점에 /goal resume을 보낸 뒤 다시 진행되었습니다.

    #359에 주는 의미

    • 섞임은 실제로 일어납니다. 워커 약 15개가 총괄 한 명에게 편지를 보내는 야간 실행에서, 운영자가 총괄 pane에 입력하는 몇 분 사이에 세 번 섞였습니다.
    • 초안이 /로 시작하면 이어 붙은 편지가 슬래시 명령이 됩니다. 단순한 텍스트 섞임보다 피해가 큽니다.
    • 짧은 간격으로 도착한 편지 여러 개가 한 메시지로 합쳐질 수 있으므로, 대기했다가 보내는 경로도 편지 단위의 경계를 지켜야 합니다.
    • 기존 AC "working이거나 입력창에 초안이 있으면 입력창이 바뀌지 않고 편지는 대기"가 이 세 경우를 모두 막는지 검증에 포함하는 것을 제안합니다.
  3. yansfil commented on Oct 4, 2026

    @yansfil
    ContributorAuthor

    Canonical platform source is clean and fully pushed at 3b596d6713c30fbaaaaaa53976446bf814571c57 on fix/durable-atomic-write.
    The requested current build/lint corrections are delivered as original commits 0d946b5858f29ab9f22bce514515c767b27252b9 and 3b596d6713c30fbaaaaaa53976446bf814571c57.
    Verification is incomplete; this is a resumable handoff.

    • Exact correction ownership: hide-platform/Cargo.toml, hide-platform/src/process.rs, hide-platform/tests/process.rs, and hide-platform/src/fs/private.rs.
      The Windows query constant now uses the pinned dependency's declared SystemServices binding and its single required feature.
      The process fixture and Unix test-fault conditionals retain their original ownership checks, errors and counters.
      No IPC, ports, assertions, deadlines, access rights, durability behavior or separate R5 source changed.
    • Delivery consumed both original commits by ordinary integration and pushed 044ff4b53f7d55c4ba729edb7cd1d9fb9ce73fa3 to PR Add durable local requests and inactivity watches #378.
      Source formatting and diff checks passed.
      Independent source review r_9b212a39-b017-48ad-9873-c662a4e19179 is CLEAR for the exact four-file diff and declared Windows binding.
      This source verdict does not claim executed Windows compilation or behavior.
    • The unchanged scoped platform check actually ran at the final head, then stopped on guardian ownership uncertainty.
      Tool 94491 ended with exit 2 after 27.97 seconds; the full lint lane was unrun by the original stop-on-failure sequence.
      Completed suites reported 18, 60, 15, 25 and 6 passes, and the 26-case process suite reported 16 passes before interruption.
      There is no complete platform-suite PASS claim.
      The guardian recorded an unproven identity in a previously owned group and rejected cleanup success.
      The raw log remains unchanged, SHA256 f9046ab9df6046e3d01c76c016b53d078bcfcaf73c7fd8fd935c658f01ade0d9.
    • Two external kernel snapshots subsequently found all 55 registered identities and all 12 recorded groups absent.
      Their SHA256 is 2f6cb27b33357b96fe055e2494282a9118692495b0e17c723d0b7218151ac717.
      All frozen source bytes and file identities match; the head is unchanged and the working tree is clean.
      Own running check, PID and job handles are now zero.
      The failed guardian result and retained private HOME and short temporary fixture remain available for ownership review; no uncertainty was cleared, unknown process signaled, fixture deleted or blind rerun started.
    • Original failures remain recorded: the earlier 97-pass/21-IPC-fixture socket-length failure, the inherited Windows unresolved binding failure and the macOS/Linux lint failures.
      Delivery's scoped lint and CLI build passed at 044ff4b53f7d55c4ba729edb7cd1d9fb9ce73fa3; that package selection excludes the platform's own test targets.
      No local Windows target is installed.
      Current CI now supplies the direct Linux and Windows platform compile/test/lint evidence described below; GUI/helper/durability acceptance remains separate.
    • The separate canonical Windows bootstrap contract remains open: private::establish_dir_durability and private::create_dir_all_durable return explicit Unsupported before mutation.
      A file write-through acknowledgement or legacy directory-sync no-op does not establish the ancestor chain.
      No Windows directory/bootstrap guarantee or three-OS acceptance is claimed.
      New durability implementation, research and helper scope remain excluded by finalization.

    The separate R5 correction remains clean and fully pushed at ae01690b4f83ccca38545909f5b76c06563f683e.
    Its 25 process contracts and full formatting/lint lane passed, with independent source and macOS evidence clear and recorded cleanup confirmed.
    PR #362 still requires its current-head gates; that proof does not complete this canonical dependency.

    Next action: root and delivery retain the original current CI evidence, finish their already-authorized unchanged checks, and disposition the retained ownership-guard interruption before another platform run.
    No new helper, gate waiver, test skip, timeout extension, source writer, operator action or phase approval is proposed.
    Root and the FIFO coordinator received actual START/END, exact source ownership, original commits, cleanup evidence and remaining gaps through hcoord.
    The public handoff remains #359 (comment).

    Current correction CI evidence is verified against tested merge c192cdb8a4a1e6ff72c1eb7331c7c24b7b75ba9f, parents cab8625fa0cc9f35db3434e231cdf74728118319 and delivery head 044ff4b53f7d55c4ba729edb7cd1d9fb9ce73fa3.
    The four original correction file blobs exactly match the pushed producer head 3b596d6713c30fbaaaaaa53976446bf814571c57 in the tested merge tree.
    Linux OS contract job passed 155 platform tests, five client tests and the two real Herdr tests, then direct platform/client all-target Clippy with -D warnings.
    Its raw 48,272-byte log SHA256 is a1e549f0a041a0ff93fd48cf1cfb8e4d56a27150ab4ac0c00d7eabc2e54a5752.
    Windows OS contract job compiled the Windows binding, passed 144 platform tests, five client tests and the two real Herdr tests, and passed direct platform/client all-target Clippy with -D warnings.
    Its raw 43,117-byte log SHA256 is b352a6f23813019ed134057f34b312d09f5db11119ac881cce948dc7e0b18dba.
    The real Herdr tests were initially excluded by their existing ignored tags, then explicitly executed by each job; there were no failed cases in these job logs.
    These jobs verify the requested Windows binding and fixture lint corrections in their actual targets.
    They do not replace the interrupted local run, prove the Windows bootstrap durability contract, or establish complete delivery/desktop acceptance.
    Full required verify and package gates remain root/delivery dependencies.

    Root disposition r_da99a007-66fb-4b0f-b9f4-956b42222c58 was fully read and answered.
    The unstarted separate local lint readiness was withdrawn before any PID or execution; local full workspace lint remains unrun, with its prepared adapter retained only as an artifact.
    No further local source/build/native/helper phase started.
    Both original commits remain pushed; no local-only commit, running check, native candidate, server, guardian or owned check PID/job remains.

  4. yansfil commented on Oct 4, 2026

    @yansfil
    ContributorAuthor

    Current finalization handoff: all coherent source is fully pushed at 044ff4b53f7d55c4ba729edb7cd1d9fb9ce73fa3; draft PR #378 remains incomplete and is not ready to merge.

    The original platform writer's commits 0d946b5858f29ab9f22bce514515c767b27252b9 and 3b596d6713c30fbaaaaaa53976446bf814571c57 were merged without rewriting them. Exactly four platform files fix the existing Windows JOB_OBJECT_QUERY binding/feature and two lint conditions. Formatting and diff checks passed; no new helper, durability, native or research scope was opened.

    Original evidence remains: six selections on 27e3f880 passed (26/5/2/4/42/1; the 5 overlap the 42), then platform lint failed. The 68d8e6c3 retry failed two delivery lint conditions in 21.93 seconds; CLI did not run. Its 20 retained process identities and process group were confirmed absent. Original 89e58df1 CI on synthetic merge 67f1a6d2 failed the Windows import and platform lint. Linux passed 5 legacy client and 155 platform tests with 2 Herdr cases ignored before lint failed; this is not the required A OS-contract coverage. All original failures are preserved.

    The unchanged scoped six-package all-target Clippy and CLI build both passed on clean 044ff4b5: 20.99s and 34.49s, total 55.973389s (02:58:57.404361-02:59:53.378133 UTC). Tool 81080, bundle and independent EOF guardian all exited zero. All 49 recorded process birth identities plus controller/guardian/bundle were absent in two external snapshots; the process group was empty and the empty private HOME was removed. No check/controller/guardian process remains here. Five byte-identical evidence files are registered in the local canonical run. Current-head required verify run 37172374530 is pending; design passed, package is pending. This is local lint/build proof, not full contract or native acceptance.

    Remaining blockers: Windows durable directory ancestry still returns explicit Unsupported; preceding protected-main helper union, OwnerWatch and real SessionActivity JSON-lines dispatch coverage are unfinished; the 45 approved behaviors, isolated native delivery/watch/restart boundaries, matched idle/driven latency, named Linux/Windows results, final independent Fidelity/Code/Security reviews and committed-head deterministic verification are incomplete. New helper/durability phases are frozen by finalization.

    Next action: await current-head required CI and independent final Fidelity/Code/Security reviews, then resume the documented native, portability and helper dependencies only within the recorded owner/scope boundaries. Full committed-head deterministic verification remains NOT_RUN (45 requirements retained, 0/2 required suites green). The finalization freezes new helper/durability phases, so this is a fully pushed resumable handoff rather than a completed contract. Keep #359 and this draft open; no PASS or completion is claimed.

  5. yansfil commented on Oct 4, 2026

    @yansfil
    ContributorAuthor

    1, 2단계가 main에 반영됐습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions