Skip to content

feat: add metadata-only handoff export - #305

Merged
seonghobae merged 2 commits into
developfrom
feat/issue-150-metadata-handoff
Jun 15, 2026
Merged

feat: add metadata-only handoff export#305
seonghobae merged 2 commits into
developfrom
feat/issue-150-metadata-handoff

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

Summary

  • Add a metadata-only BandScope handoff artifact contract with runtime validation and parser coverage.
  • Export handoff JSON from the workspace without source paths, transcription data, stems, or audio bytes.
  • Add recipient-side reanalysis request creation from a selected local source asset.

Verification

  • ./scripts/harness/quickcheck.sh

Security Notes

  • Handoff files are treated as untrusted project/export data and must pass the shared runtime parser before reuse.
  • The exported artifact deliberately excludes absolute source paths, cache roots, temp roots, transcription payloads, stems, and audio bytes; it only carries file metadata, section summaries, role buckets, and confidence values.
  • Reanalysis requires the recipient to select a local source asset, keeping local file access explicit and avoiding remote/network runtime paths.
  • Tests assert path redaction and schema rejection for leaked sourcePath fields.

Closes #150

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@seonghobae, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 minutes and 14 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b755aaa6-50a6-4121-b004-4cb604078377

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4526d and fdf6830.

📒 Files selected for processing (2)
  • apps/desktop/src/App.test.tsx
  • apps/desktop/src/App.tsx
📝 Walkthrough

Walkthrough

shared-typesMetadataHandoffArtifact 타입 계약과 검증/파싱 함수를 추가하고, export.ts에 핸드오프 JSON 생성(generateMetadataHandoffJson)과 재분석 요청 변환(createReanalysisRequestFromHandoff) 함수를 구현했다. Workspace 컴포넌트에 sourceBootstrap prop과 "Export Handoff (JSON)" 버튼을 추가하고, App.tsx에서 selectedBootstrap을 전달하도록 연결했다.

Changes

메타데이터 전용 핸드오프 기능

Layer / File(s) Summary
MetadataHandoffArtifact 타입 계약 및 검증기
packages/shared-types/src/index.ts
MetadataHandoffSourceAsset, MetadataHandoffRoleBucket, MetadataHandoffSection, MetadataHandoffArtifact 타입과 HANDOFF_ASSET_STATUSES 상수, 내부 재귀 validator 4종, 공개 isMetadataHandoffArtifact/parseMetadataHandoffArtifact를 추가한다.
shared-types 계약 검증 테스트
packages/shared-types/test/index.test.ts
유효한 아티팩트 통과 및 중첩 필드의 다양한 잘못된 입력에 대해 기대 오류 경로 메시지를 반복 검증하는 테스트를 추가한다.
export.ts 핸드오프 생성 및 재분석 요청 함수
apps/desktop/src/lib/export.ts
createMetadataHandoffArtifact, generateMetadataHandoffJson, createReanalysisRequestFromHandoff 세 함수를 추가하고 @bandscope/shared-types에서 필요한 parse 함수들을 임포트한다.
export.ts 핸드오프 함수 단위 테스트
apps/desktop/src/lib/export.test.ts
생성된 JSON의 구조 검증 및 로컬 경로 미포함 여부, 재분석 요청 필드 매핑을 확인하는 테스트를 추가한다.
Workspace sourceBootstrap 연결 및 Export Handoff UI
apps/desktop/src/features/workspace/Workspace.tsx, apps/desktop/src/App.tsx
WorkspacePropssourceBootstrap 옵션 추가, 공통 downloadTextFile 유틸 도입, handleExportHandoff 구현 및 "Export Handoff (JSON)" 버튼 연결, App.tsx에서 selectedBootstrap 전달.
Workspace 핸드오프 내보내기 통합 테스트
apps/desktop/src/features/workspace/Workspace.test.tsx
URL mock과 Blob 파싱을 통해 핸드오프 내보내기 결과를 검증하는 비동기 테스트 및 afterEach 정리 로직을 추가한다.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Workspace
  participant export_ts as export.ts
  participant shared_types as shared-types

  User->>Workspace: "Export Handoff (JSON)" 버튼 클릭
  Workspace->>export_ts: generateMetadataHandoffJson(song, {sourceBootstrap, workspaceId, workspaceTitle})
  export_ts->>export_ts: createMetadataHandoffArtifact() 호출 (섹션/roleBucket 매핑)
  export_ts->>shared_types: parseMetadataHandoffArtifact(payload)
  shared_types-->>export_ts: MetadataHandoffArtifact (검증 통과)
  export_ts-->>Workspace: JSON 문자열
  Workspace->>Workspace: downloadTextFile()로 *_handoff.json 다운로드
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 핸드오프 JSON을 품에 안고,
경로도 전사도 쏙 빼놓았지!
타입 계약서 꼼꼼히 검증하며,
파서가 틀린 값은 에러로 튕겨~
토끼가 버튼 하나로 뚝딱 내보내요 🎵


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 94.12% which is insufficient. The required threshold is 100.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add metadata-only handoff export' clearly and accurately describes the primary change of implementing metadata-only handoff export functionality.
Description check ✅ Passed The description comprehensively explains the metadata-only handoff feature, security measures, and recipient-side reanalysis request creation, which aligns with the changeset.
Linked Issues check ✅ Passed The PR fulfills all primary objectives from #150: adds metadata-only handoff artifact with validation, enables workspace/song metadata export without sensitive data, and implements recipient-side reanalysis request creation.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the metadata-only handoff feature: artifact types, export functions, workspace integration, validation/parsing, and comprehensive tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-150-metadata-handoff
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/issue-150-metadata-handoff

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@seonghobae
seonghobae enabled auto-merge (squash) June 15, 2026 08:45
coderabbitai[bot]
coderabbitai Bot previously requested changes Jun 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/desktop/src/App.tsx`:
- Line 348: The Workspace component in the return statement at line 348 is
receiving jobResult and a separately tracked selectedBootstrap, which can become
misaligned. When users select a new file after a successful analysis completes,
the old jobResult gets paired with new selectedBootstrap metadata, breaking
consistency between the analysis result and its source. Instead of passing the
current selectedBootstrap state directly, you need to capture and store which
bootstrap was actually used at the time the jobResult was obtained, then pass
that captured bootstrap to the Workspace component. This ensures the handoff
metadata always reflects the bootstrap source that generated the jobResult, not
whatever the user has currently selected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 10cbf1e7-383c-49dd-964f-0a137bc7c326

📥 Commits

Reviewing files that changed from the base of the PR and between dfd7916 and 4b4526d.

📒 Files selected for processing (7)
  • apps/desktop/src/App.tsx
  • apps/desktop/src/features/workspace/Workspace.test.tsx
  • apps/desktop/src/features/workspace/Workspace.tsx
  • apps/desktop/src/lib/export.test.ts
  • apps/desktop/src/lib/export.ts
  • packages/shared-types/src/index.ts
  • packages/shared-types/test/index.test.ts

Comment thread apps/desktop/src/App.tsx Outdated
@seonghobae
seonghobae dismissed coderabbitai[bot]’s stale review June 15, 2026 09:03

Addressed in fdf6830; CodeRabbit marked the thread resolved/outdated on the current head.

@opencode-agent

opencode-agent Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: fdf6830cb2a3f9ba34d8dd9bf22d415cfe6486d1
  • Workflow run: 27535532165
  • Workflow attempt: 1
  • Gate result: APPROVE (approval step)

OpenCode Agent approved this PR.

The changes in PR #305 are well-tested and do not introduce any critical issues. The modifications in App.test.tsx ensure proper metadata handling, and the updates to shared types and workspace logic are consistent with the existing architecture. No security, privacy, or regression risks were identified.

  • Result: APPROVE
  • Reason: No critical issues found in the changes. The PR includes thorough test coverage and maintains existing functionality.
  • Head SHA: fdf6830cb2a3f9ba34d8dd9bf22d415cfe6486d1
  • Workflow run: 27535532165
  • Workflow attempt: 1

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OpenCode Agent approved this PR.

The changes in PR #305 are well-tested and do not introduce any critical issues. The modifications in App.test.tsx ensure proper metadata handling, and the updates to shared types and workspace logic are consistent with the existing architecture. No security, privacy, or regression risks were identified.

  • Result: APPROVE
  • Reason: No critical issues found in the changes. The PR includes thorough test coverage and maintains existing functionality.
  • Head SHA: fdf6830cb2a3f9ba34d8dd9bf22d415cfe6486d1
  • Workflow run: 27535532165
  • Workflow attempt: 1

@seonghobae
seonghobae merged commit 1ddbe70 into develop Jun 15, 2026
29 of 30 checks passed
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.

V1.1: Metadata-only local handoff

1 participant