feat(telemetry): Add internal research mode for comprehensive data collection

Resolved 💬 4 comments Opened Feb 5, 2026 by nextstage09 Closed Feb 8, 2026

Summary

Development 빌드에서 내부 연구용 전체 텔레메트리 데이터 수집 모드 추가.

Background

Issue #4378에서 구현한 텔레메트리 시스템은 GDPR 준수를 위해 익명화된 데이터만 수집합니다.
내부 연구 및 성능 최적화를 위해 더 상세한 데이터가 필요한 경우가 있습니다.

Proposed Solution

1. Internal Research Mode 활성화 조건

// 다음 조건을 모두 만족할 때만 활성화:
// 1. Development 빌드 (--features internal_research)
// 2. 환경변수 설정 (NARSHA_INTERNAL_RESEARCH=1)
// 3. 내부 사용자 인증 (Firebase Auth의 내부 도메인 확인)

#[cfg(feature = "internal_research")]
const INTERNAL_RESEARCH_MODE: bool = true;

#[cfg(not(feature = "internal_research"))]
const INTERNAL_RESEARCH_MODE: bool = false;

2. 수집 데이터 범위

| 데이터 | Anonymous Mode | Internal Research Mode |
|--------|---------------|------------------------|
| Tool name | ✅ | ✅ |
| Execution time | ✅ | ✅ |
| Success/failure | ✅ | ✅ |
| Error category | ✅ | ✅ + full error message |
| Arguments (sanitized) | ❌ | ✅ (paths redacted) |
| Response size | ❌ | ✅ |
| Memory usage | ❌ | ✅ |
| CPU time | ❌ | ✅ |
| Cache hit/miss | ❌ | ✅ |
| PDB index stats | ❌ | ✅ |
| Blueprint complexity | ❌ | ✅ |

3. 데이터 보호

  • 경로 정보 자동 제거: 프로젝트 경로, 파일 경로 등 자동 redaction
  • 민감 정보 필터링: API 키, 토큰 등 자동 제거
  • 내부 네트워크 전용: 외부 전송 불가, 로컬 파일 또는 내부 서버로만 전송

4. 빌드 방법

# Release 빌드 (Anonymous mode only - 배포용)
cargo build --release

# Internal Research 빌드 (내부 연구용)
cargo build --release --features internal_research

5. 사용 방법

# 환경변수 설정
export NARSHA_INTERNAL_RESEARCH=1

# MCP 서버 실행 (internal_research feature로 빌드된 바이너리)
./narshamcp --project-path /path/to/project

Implementation Tasks

  • [ ] internal_research Cargo feature flag 추가
  • [ ] 확장된 텔레메트리 이벤트 정의
  • [ ] 경로/민감정보 자동 redaction 구현
  • [ ] 내부 사용자 인증 체크 추가
  • [ ] 로컬 파일 출력 옵션 추가
  • [ ] 문서화

Acceptance Criteria

  1. --features internal_research 없이 빌드하면 확장 데이터 수집 코드가 컴파일되지 않음
  2. 환경변수 없이는 internal research mode 비활성화
  3. 민감 정보(경로, 토큰 등)가 자동으로 redaction됨
  4. Release 빌드 바이너리 크기에 영향 없음

Related Issues

  • #4378 - Rust MCP 텔레메트리 시스템 구현 (Parent)

Labels

enhancement, telemetry, internal

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗