Skip to content

feat: add local analysis orchestration#47

Closed
seonghobae wants to merge 6 commits into
developfrom
feat/issue-32-analysis-orchestration-v4
Closed

feat: add local analysis orchestration#47
seonghobae wants to merge 6 commits into
developfrom
feat/issue-32-analysis-orchestration-v4

Conversation

@seonghobae
Copy link
Copy Markdown
Owner

Summary

  • add typed analysis job request and status contracts across shared types, the desktop shell, Tauri commands, and the Python engine CLI
  • expose a narrow allowlisted Tauri IPC boundary for starting and polling local analysis jobs without opening a loopback HTTP listener
  • harden the orchestration boundary with runtime engine discovery, strict schema validation, localized UI states, in-flight limiting, and pinned SBOM tooling

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: a375bdc4-8c13-47ab-94fa-1cbf2337ee21

📥 Commits

Reviewing files that changed from the base of the PR and between c28e363 and f708c01.

⛔ Files ignored due to path filters (6)
  • 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/**
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (26)
  • .github/workflows/sbom.yml
  • ARCHITECTURE.md
  • apps/desktop/package.json
  • 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/get_analysis_job_status.toml
  • apps/desktop/src-tauri/permissions/autogenerated/start_analysis_job.toml
  • apps/desktop/src-tauri/src/main.rs
  • apps/desktop/src-tauri/tauri.conf.json
  • apps/desktop/src/App.test.tsx
  • apps/desktop/src/App.tsx
  • apps/desktop/src/i18n/index.ts
  • 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-32-analysis-orchestration-design.md
  • docs/plans/2026-03-12-issue-32-analysis-orchestration.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/src/bandscope_analysis/cli.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

  • 새 기능

    • 데스크탑에 분석 워크플로 추가: 작업 제출, 폴링 기반 상태(대기·실행·성공·실패) 및 결과 렌더링.
    • 데스크탑↔분석 엔진 브리지(IPC+파이썬 서브프로세스) 및 브라우저 폴백 API 추가.
    • 분석 CLI 및 엔진 API로 데모 분석 결과 생성 지원.
  • 현지화

    • 분석 관련 UI 문자열(시작·상태·오류 등) 한국어 추가.
  • 문서

    • 분석 오케스트레이션 설계·보안·계획 문서 추가/업데이트.
  • 테스트

    • 분석 흐름, CLI, 엔진 및 타입 검증을 포함한 광범위한 테스트 추가.
  • 빌드/워크플로

    • SBOM 생성 워크플로와 런타임 설정(권한·capabilities) 업데이트.

Walkthrough

데스크탑에 분석 작업 오케스트레이션을 추가: Tauri IPC 명령(start_analysis_job, get_analysis_job_status), Rust 백엔드의 비동기 작업 스토어와 Python 서브프로세스 브리지, 프론트엔드 폴링/렌더링, 공유 타입·검증·테스트 및 문서가 포함됩니다.

Changes

Cohort / File(s) Summary
CI / SBOM
\.github/workflows/sbom.yml
Syft 바이너리 설치 단계 추가 및 기존 Generate CycloneDX 액션을 Syft 직접 호출로 교체; 생성된 bandscope-sbom.cdx.json 아티팩트 업로드로 조정.
Tauri 빌드 및 보안 설정
apps/desktop/src-tauri/Cargo.toml, apps/desktop/src-tauri/build.rs, apps/desktop/src-tauri/tauri.conf.json, apps/desktop/package.json
Serde/serde_json/time 의존성 추가, build.rstry_build로 마이그레이션해 명시적 명령 등록, tauri.conf.json에 capabilities 항목 추가, @tauri-apps/api 런타임 의존성 추가.
권한/능력 표현
apps/desktop/src-tauri/capabilities/main.json, apps/desktop/src-tauri/permissions/autogenerated/*
메인 창용 capability 파일 추가 및 start_analysis_job/get_analysis_job_status에 대한 allow/deny 권한 TOML 파일 추가.
Rust 백엔드 (Tauri)
apps/desktop/src-tauri/src/main.rs
AppState 기반 비동기 작업 관리(큐·인플라이트 제한·타임아웃), Python 서브프로세스 실행·stdin/stdout 교환, 상태 추적·갱신 및 두 개의 Tauri 명령(start_analysis_job, get_analysis_job_status) 추가.
데스크탑 브리지 (TS)
apps/desktop/src/lib/analysis.ts
TAURI invoke 우선 사용, 브라우저 폴백 구현, createDefaultAnalysisRequest/startAnalysisJob/getAnalysisJobStatus 공개 API와 입력/출력 검증 추가.
프론트엔드 UI 및 테스트
apps/desktop/src/App.tsx, apps/desktop/src/App.test.tsx
분석 시작 버튼·폴링 로직·진행 메시지·결과 렌더링 추가; 테스트를 모의 end-to-end 분석 흐름과 다양한 오류 경로로 확장.
국제화
apps/desktop/src/locales/en/common.json, apps/desktop/src/locales/ko/common.json
분석 관련 로케일 키 6개 추가(시작, 상태별 메시지 등).
공유 타입 및 검증
packages/shared-types/src/index.ts, packages/shared-types/test/index.test.ts
AnalysisJob 관련 타입(요청/상태/오류/스냅샷), 생성기·파서·검증기 및 RehearsalSong 검증 강화와 관련 테스트 대규모 추가.
Python 분석 엔진 API 및 CLI
services/analysis-engine/src/bandscope_analysis/api.py, services/analysis-engine/src/bandscope_analysis/cli.py, services/analysis-engine/tests/*
TypedDict 기반 요청/응답 타입과 validate_analysis_job_request/run_analysis_job/build_demo_rehearsal_song 등 함수 추가, stdin/stdout JSON 기반 CLI 엔트리포인트 및 광범위한 CLI/유닛 테스트 추가.
문서 및 계획
ARCHITECTURE.md, docs/architecture/overview.md, docs/plans/*, docs/security/app-security.md
분석 오케스트레이션 설계·계획·보안 가이드 문서 추가·수정 (Issue #32 관련).

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant React as React App
    participant TauriJS as Tauri JS Bridge
    participant RustBack as Rust Backend
    participant PySubproc as Python Subprocess
    participant JobState as In-Memory Job Store

    User->>React: 분석 시작 클릭
    React->>TauriJS: invoke start_analysis_job(request)
    TauriJS->>RustBack: IPC start_analysis_job
    RustBack->>JobState: job_id 생성 및 상태=queued 저장
    RustBack-->>TauriJS: queued 상태 반환
    TauriJS-->>React: queued 상태 전달

    rect rgba(200,150,100,0.5)
        RustBack->>RustBack: 워커 스레드 시작, 상태=running
        RustBack->>PySubproc: payload를 stdin으로 전달
        PySubproc->>PySubproc: 분석 실행
        PySubproc-->>RustBack: 결과를 stdout으로 반환
        RustBack->>JobState: 상태=succeeded, result 저장
    end

    loop 폴링
        React->>TauriJS: invoke get_analysis_job_status(job_id)
        TauriJS->>RustBack: IPC get_analysis_job_status
        RustBack->>JobState: 상태 조회
        RustBack-->>TauriJS: AnalysisJobStatus 반환
        TauriJS-->>React: 상태 업데이트 전달
    end

    React->>React: 결과 렌더링
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45분

Possibly related PRs

🐰 타우리 창에 당근 맥박 탭,
러스트가 큐를 세우고 파이썬이 답,
stdin으로 속삭여 stdout이 노래,
폴링이 다다르면 화면에 빛나네,
당근 한 입, 코드에 박수 짝짝 👏🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.82% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목 'feat: add local analysis orchestration'은 변경 사항의 주요 내용을 명확하고 간결하게 요약합니다.
Description check ✅ Passed PR 설명은 타입화된 분석 작업 계약, Tauri IPC 경계, 엄격한 스키마 검증 등 변경 사항과 관련된 내용을 포함합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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-32-analysis-orchestration-v4

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 03:39
@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 full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

✅ Actions performed

Full review triggered.

@seonghobae
Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@seonghobae
Copy link
Copy Markdown
Owner Author

@coderabbitai resume

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

✅ Actions performed

Full review triggered.

@seonghobae
Copy link
Copy Markdown
Owner Author

Superseded by #48 to clear the remaining stale CodeRabbit pending state after all checks passed and no actionable review remained.

@seonghobae seonghobae closed this Mar 12, 2026
auto-merge was automatically disabled March 12, 2026 03:57

Pull request was closed

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

✅ Actions performed

Reviews resumed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

✅ Actions performed

Reviews resumed.

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