Skip to content

feat(memory): kick scoped nunchi ingest on distill local-sink completion - #989

Merged
jinon86 merged 1 commit into
mainfrom
feat/nunchi-session-close-kick
Aug 6, 2026
Merged

feat(memory): kick scoped nunchi ingest on distill local-sink completion#989
jinon86 merged 1 commit into
mainfrom
feat/nunchi-session-close-kick

Conversation

@jinon86

@jinon86 jinon86 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

문제

audience-scoped Piri 노드에서 세션이 끝나고 다음 세션이 시작될 때 예전 메모리가 주입되는 증상(오너 보고). 조사 결과 nunchi 레인(gate-3 동안 primary 작업 메모리)은 10분 cron dispatcher로만 ingest되므로, 직전 세션이 닫힌 직후 시작한 세션은 닫힌 세션 내용이 아직 어떤 저장소에도 없는 상태의 메모리를 주입받는다. (load-memory.sh의 '지금 캐시 서빙 + 백그라운드에서 다음 세션용 갱신' 설계와 중첩되어 체감이 커짐)

변경

distill local-sink worker가 sink+index 기록을 마친 시점에, 해당 job의 route(private/shared scope)에 대해 detached scoped piri-feed.sh 1회 실행을 kick한다. 방금 닫힌 세션이 다음 세션 시작 전에 scope DB/snapshot까지 도달.

  • cron dispatcher와 동일한 env shape(CCC_NUNCHI_SCOPED_CHILD=1, scope/kind, scope-local NUNCHI_HOME/DB/SNAPSHOT, PIR*_SESSIONS_DIR)로 재사용 — feed 측 flock + seen-file로 cron과의 중첩은 멱등
  • best-effort: kick 실패/부재/unsafe 경로는 조용히 스킵, job 상태에 무영향(cron이 안전망). env는 allowlist + Piri 래퍼 passthrough만(시크릿 차단), stdio는 전부 DEVNULL(body-free), detached + bounded drain(기본 900s timeout 후 kill)
  • 배선: bridge_memory_mode=audience-scoped 이고 agent_provider=piri일 때만 materializer sibling nunchi/piri-feed.sh로. 그 외 프로바이더/모드는 바이트 동일

검증

  • 신규 테스트 4건: 정상 kick(env 계약·시크릿 미전달), feed 부재 skip, symlink feed 미실행, feed 실패가 job에 무영향
  • test_distill_local_worker.py 12/12, 관련 스위트 76/76, 전체 브리지 스위트 2345 passed / 5 skipped (기존 환경 의존 test_skill_candidate_inventory.py 제외 — pristine baseline과 동일)
  • worktree 격리 venv에서 수행, 라이브 트리 묳변경

롤아웃

머지만으로는 동작 변화 없음 — 각 Piri 노드는 /opt/ccc-node 갱신 + 브리지 재시작 시 적용. kick은 추가 LLM 비용 없음(cron이 어차피 하던 추출을 앞당길 뿐).

@jinon86
jinon86 requested a review from seoseo-ai as a code owner August 6, 2026 09:51

@seoseo-ai seoseo-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after explicit operator authorization using the local seoseo-ai credential.

On audience-scoped Piri nodes the nunchi lane (primary working memory during
the gate-3 transition) only ingested via the 10-minute cron dispatcher, so a
session started right after the previous one closed was injected with
pre-close memory. The distill local-sink worker now fires one detached,
body-free scoped piri-feed run for the job's own route once the sink+index
land: the closed session reaches the scope DB/snapshot before the next
session starts. The cron dispatcher remains the owner of record; feed-side
flock + seen-file keep overlap idempotent, kick failures never affect job
state, and an absent/unsafe feed path skips silently.
@jinon86
jinon86 force-pushed the feat/nunchi-session-close-kick branch from f62e4d5 to 726c6cd Compare August 6, 2026 10:16

@seoseo-ai seoseo-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after explicit operator authorization using the local seoseo-ai credential.

@jinon86
jinon86 merged commit 7577cea into main Aug 6, 2026
8 checks passed
@jinon86
jinon86 deleted the feat/nunchi-session-close-kick branch August 6, 2026 10:25
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.

2 participants