Skip to content

feat: add local audio intake bootstrap#57

Merged
seonghobae merged 3 commits into
developfrom
feat/issue-33-audio-intake-bootstrap
Mar 12, 2026
Merged

feat: add local audio intake bootstrap#57
seonghobae merged 3 commits into
developfrom
feat/issue-33-audio-intake-bootstrap

Conversation

@seonghobae
Copy link
Copy Markdown
Owner

Summary

  • add a secure local-audio selection and project bootstrap flow that keeps source validation and bootstrap roots inside the Tauri boundary
  • expand shared contracts and Python validation so local_audio requests use a trusted projectId handoff while Rust rehydrates the stored source metadata before engine execution
  • document the reference-only bootstrap decision, app-owned Tauri path roots, and the rfd admission rationale for the native file picker

Verification

  • ./scripts/harness/quickcheck.sh
  • cargo check --manifest-path apps/desktop/src-tauri/Cargo.toml

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1e4666ad-de61-41f1-92db-74cd68a1c714

📥 Commits

Reviewing files that changed from the base of the PR and between 1e40121 and 322f3be.

⛔ Files ignored due to path filters (5)
  • apps/desktop/src-tauri/Cargo.lock is excluded by !**/*.lock
  • apps/desktop/src-tauri/gen/schemas/acl-manifests.json is excluded by !**/gen/**
  • apps/desktop/src-tauri/gen/schemas/capabilities.json is excluded by !**/gen/**
  • apps/desktop/src-tauri/gen/schemas/desktop-schema.json is excluded by !**/gen/**
  • apps/desktop/src-tauri/gen/schemas/macOS-schema.json is excluded by !**/gen/**
📒 Files selected for processing (20)
  • ARCHITECTURE.md
  • apps/desktop/src-tauri/Cargo.toml
  • apps/desktop/src-tauri/build.rs
  • apps/desktop/src-tauri/capabilities/main.json
  • apps/desktop/src-tauri/permissions/autogenerated/select_local_audio_source.toml
  • apps/desktop/src-tauri/src/main.rs
  • apps/desktop/src/App.test.tsx
  • apps/desktop/src/App.tsx
  • apps/desktop/src/lib/analysis.ts
  • apps/desktop/src/locales/en/common.json
  • apps/desktop/src/locales/ko/common.json
  • docs/architecture/overview.md
  • docs/plans/2026-03-12-issue-33-audio-intake-bootstrap-design.md
  • docs/plans/2026-03-12-issue-33-audio-intake-bootstrap.md
  • docs/security/app-security.md
  • packages/shared-types/src/index.ts
  • packages/shared-types/test/index.test.ts
  • services/analysis-engine/src/bandscope_analysis/api.py
  • services/analysis-engine/tests/test_api.py
  • services/analysis-engine/tests/test_cli.py

Cache: Disabled due to Reviews > Disable Cache setting

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

릴리스 노트

  • 새 기능
    • 로컬 오디오 선택 버튼과 파일 대화상자 추가(WAV/MP3/FLAC/M4A 지원) 및 로컬 오디오 분석 흐름 도입(부트스트랩 요약과 프로젝트 ID 반환)
    • 데스크탑 권한/선택 명령 추가로 안전한 파일 선택 지원
  • 문서
    • 아키텍처·계획·보안 문서에 로컬 오디오 부트스트랩 설계 및 앱 소유 경로 권장사항 추가
  • 테스트
    • 로컬 오디오 성공·다양한 오류 경로를 검증하는 단위·통합 테스트 추가
  • 현지화
    • 선택 관련 UI 문자열(한국어/영어) 추가 및 안전 안내 메시지 보강

Walkthrough

데스크탑(Tauri)에서 파일 대화상자를 통해 사용자가 선택한 오디오 파일을 Rust에서 검증·정규화하고, 앱 소유의 프로젝트/캐시/임시 루트를 생성·저장한 ProjectBootstrapSummary를 반환하여 React가 projectId 기반의 local_audio 요청을 구성하고 Python 분석 엔진이 해당 요청을 검증·처리하도록 연동합니다.

Changes

Cohort / File(s) Summary
아키텍처·설계·보안 문서
ARCHITECTURE.md, docs/architecture/overview.md, docs/plans/2026-03-12-issue-33-audio-intake-bootstrap-design.md, docs/plans/2026-03-12-issue-33-audio-intake-bootstrap.md, docs/security/app-security.md
로컬 오디오 부트스트랩 설계·계획·보안 지침 추가: Rust에서 파일 검증·정규화, 원본 참조 방식(복사 아님), 앱 소유 Tauri 데이터/캐시 경로 사용 권고 등 문서화
Tauri 구성·권한
apps/desktop/src-tauri/Cargo.toml, apps/desktop/src-tauri/build.rs, apps/desktop/src-tauri/capabilities/main.json, apps/desktop/src-tauri/permissions/autogenerated/select_local_audio_source.toml
rfd 의존성 추가, 빌드 매니페스트에 select_local_audio_source 명령 등록, 권한(capability/permission) 및 자동 생성된 권한 TOML 추가
Tauri 백엔드 구현
apps/desktop/src-tauri/src/main.rs
파일 선택 명령/파일 대화상자 호출, 오디오 형식·크기 검사 및 정규화, app-owned project/cache/temp 루트 생성, ProjectBootstrapSummary 생성·저장·조회, select_local_audio_source 명령 및 start_analysis_job의 local_audio 처리 추가
데스크탑 프론트엔드
apps/desktop/src/App.tsx, apps/desktop/src/App.test.tsx, apps/desktop/src/lib/analysis.ts
UI에 로컬 오디오 선택 흐름(버튼/상태/오류) 추가, selectLocalAudioSource API와 관련 테스트·에러 마스킹 로직 추가, 분석 시작 시 local_audio 분기 사용
국제화(로케일)
apps/desktop/src/locales/en/common.json, apps/desktop/src/locales/ko/common.json
로컬 오디오 선택 관련 문자열(chooseLocalAudio, selectedAudio, sourceModeReference, unsupportedLocalAudio) 추가
공유 타입·검증
packages/shared-types/src/index.ts, packages/shared-types/test/index.test.ts
AnalysisSourceKind에 local_audio 추가, LocalAudioSource·ProjectBootstrapSummary 타입 및 create/parse/validate 함수 추가, AnalysisJobRequest를 판별 유니온으로 리팩터링 및 단위 테스트 확장
분석 엔진(Python)
services/analysis-engine/src/bandscope_analysis/api.py, services/analysis-engine/tests/test_api.py, services/analysis-engine/tests/test_cli.py
local_audio 경로 지원 추가, LocalAudioSource TypedDict 추가, 요청 검증 로직 강화 및 로컬 오디오 관련 테스트 추가

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant ReactUI as React UI
    participant AnalysisLib as analysis.ts
    participant TauriInvoke as Tauri Invoke
    participant RustHandler as Tauri/Rust
    participant AppState as App State (Tauri)
    participant PythonEngine as Python Engine

    User->>ReactUI: 클릭 "로컬 오디오 선택"
    ReactUI->>AnalysisLib: selectLocalAudioSource()
    AnalysisLib->>TauriInvoke: invoke("select_local_audio_source")
    TauriInvoke->>RustHandler: open file dialog & validate
    RustHandler->>RustHandler: 검사/정규화 (확장자, 크기)
    RustHandler->>RustHandler: app-owned project/cache/temp 루트 생성
    RustHandler->>AppState: store ProjectBootstrapSummary (projectId 등)
    AppState-->>RustHandler: 저장 완료
    RustHandler-->>TauriInvoke: return bootstrap summary
    TauriInvoke-->>AnalysisLib: bootstrap 응답
    AnalysisLib-->>ReactUI: { ok: true, bootstrap } 또는 { ok: false, error }
    User->>ReactUI: 클릭 "분석 시작"
    ReactUI->>PythonEngine: start_analysis_job(request with sourceKind: "local_audio", projectId)
    PythonEngine->>PythonEngine: validate_analysis_job_request (local_audio 경로)
    PythonEngine-->>ReactUI: 작업 시작(또는 오류)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 파일을 골라 입에 문 당근처럼,
Rust가 살피고 뿌리와 캐시를 심네,
React는 버튼을 눌러 신호 보내고,
Python은 검증받은 뿌리로 노래하네 🎶
부트스트랩 한 입, 분석이 달콤해!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/issue-33-audio-intake-bootstrap

Comment @coderabbitai help to get the list of available commands and usage tips.

@seonghobae
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@seonghobae seonghobae enabled auto-merge (squash) March 12, 2026 10:32
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae seonghobae merged commit 169f05a into develop Mar 12, 2026
55 of 56 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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