Skip to content

feat(discord): 디코 #비서 새 글을 우편으로 비서에게 (--to-mail·다리 세션) - #158

Merged
fwkyle merged 5 commits into
mainfrom
kyle/feat/discord-mail
Oct 15, 2026
Merged

fwkyle merged 5 commits into
mainfrom
kyle/feat/discord-mail

Conversation

@fwkyle

@fwkyle fwkyle commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Why

kyle이 디코 #비서에 쓴 질문이 Codex 운영 비서(Monitor 구독 불가)에게 실제로 닿게 한다. #156의 stdout 줄 방식 대신 카단 우편(저장·입력 보호·미확인 재안내)을 쓴다.

변경

  • kadan discord watch --to-mail [역할]: 출력 대상만 우편 저장으로 교체(조회·잠금·상태·가림 재사용). 우편 ID가 돌아온 때가 출력 완료 → 그 뒤 cursor → 👀. 저장 실패 시 cursor 불변.
  • 중복: 우편 사건에 sourceKey: discord:<글 id>, 같은 수신자·같은 키면 새로 만들지 않고 정상 반환.
  • 우편: 보낸이 디코(사용자 행위자 아님), 종류 request, 머리에 id/threadId/where/at/답 명령/자료 표시/조회·답변만.
  • kadan up: discord-bot 비밀값이 있을 때만 tmux kadan-디코 다리 보장(start 기록 없음 → 감시 경보 대상 아님, 끄기 kadan stop 디코).
  • 문서·비서 스킬 갱신.

알려진 한계 (본문 참고)

  • 창에 닿는 길은 감시기의 미확인 우편 재안내(5분 유예, 코드 고정값) → "1분 안에 답" 미보장.
  • 비서가 새 대화로 시작되면 그 전 우편은 이전 세대라 재안내 안 됨(inbox --previous-generations).
  • 다리가 4xx로 멈추면 알리는 곳 없음(다음 kadan up이 재기동).

검증

tests/discord-mail.test.mjs 8건(가짜 디코 서버·격리 홈·격리 tmux), 전체 node --test 1578/1579(N3 SIGTERM 시험은 부하 간헐, 단독 3회 통과), check:public 0건. 실제 디코 요청 없음.

🤖 Generated with Claude Code

fwkyle and others added 5 commits October 14, 2026 20:16
- discord watch --to-mail: 출력 대상만 우편 저장으로 바꾼다(조회·잠금·상태·가림 재사용). 우편 ID가 돌아오면 출력 완료
- 디코 글 id를 sourceKey로 원장에서 중복 거름(저장↔cursor 사이 죽음)
- kadan up이 discord-bot 비밀값이 있을 때만 kadan-디코 세션을 보장(start 기록 없음 → 감시 경보 없음)
- 비서 지침·문서 갱신

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- 잠금에 mode(mail/stdout) 기록, ensureBridge는 우편 모드·대상 비서·세션 안 주인일 때만 재사용, 아니면 blocked/locked와 이유
- sourceKey 중복 조회를 SQLite 좁은 조회(최신부터 첫 일치)로, 프로세스 첫 줄들에서만 조회
- N3 SIGTERM 시험: 자식 종료 뒤에 소비 재개

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fwkyle
fwkyle merged commit 5df74a4 into main Oct 15, 2026
4 checks passed
@fwkyle
fwkyle deleted the kyle/feat/discord-mail branch October 15, 2026 00:50
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