Add V2 rehearsal collaboration metadata and workspace surfacing#324
Conversation
…ed-rehearsal-collaboration
There was a problem hiding this comment.
Pull request overview
This PR extends BandScope’s shared rehearsal song contract with V2 collaboration metadata (assignments/comments/approvals + sync posture) and role-level planning fields (harmonic explanation + transposition plan), then surfaces these planning primitives in the desktop Workspace UI with EN/KO localization and updated demo seed/test coverage.
Changes:
- Extended
RehearsalSong/RehearsalRolecontracts with collaboration + planning fields, and added runtime validation for the new shapes. - Enriched demo rehearsal song seed + shared-types tests to exercise the new fields and validation branches.
- Added Workspace UI panels for collaboration summary and role-scoped planning (explanation + transpose/simplify + filtered collaboration items), plus new EN/KO strings and UI tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/shared-types/src/index.ts | Adds new collaboration/planning types, demo seed data, and validation logic for the expanded rehearsal contract. |
| packages/shared-types/test/index.test.ts | Updates shared-types tests to assert new fields and validation failures for collaboration/planning data. |
| apps/desktop/src/features/workspace/Workspace.tsx | Surfaces collaboration summary + role-level planning details in the workspace UI. |
| apps/desktop/src/features/workspace/Workspace.test.tsx | Adds UI test coverage for the new collaboration + planning panels. |
| apps/desktop/src/locales/en/common.json | Adds English copy for collaboration/planning UI labels and fallback messaging. |
| apps/desktop/src/locales/ko/common.json | Adds Korean copy for collaboration/planning UI labels and fallback messaging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
OpenCode Review Overview
Pull request overviewThe PR introduces updates to workspace and shared-types modules, including new tests and localized strings. No failed checks or structural issues found. FindingsNo blocking findings from OpenCode's independent review. Verification
Gate evidence
|
There was a problem hiding this comment.
Pull request overview
PR adds new workspace features but introduces type safety risks in shared types and lacks test coverage for critical components. Requires additional validation and tests before merging.
Findings
1. HIGH packages/shared-types/src/index.ts:23 - Missing runtime validation for ProjectSummary
- Problem: ProjectSummary type lacks runtime validation which could lead to data integrity issues when passed between processes
- Root cause: No validation function exists for ProjectSummary type while similar types have validation (e.g., validateRehearsalSong)
- Fix: Add runtime validation using Zod or custom validation function
- Regression test: Add unit tests that verify validation rejects invalid ProjectSummary objects
- Suggested diff:
@@ -344,0 +345,10 @@
+export function validateProjectSummary(value: unknown): string | null {
+ if (typeof value !== 'object' || value === null) return 'Invalid type';
+ const obj = value as ProjectSummary;
+ if (!obj.id || typeof obj.id !== 'string') return 'Invalid id';
+ if (!obj.title || typeof obj.title !== 'string') return 'Invalid title';
+ if (!['idle','running','done','failed'].includes(obj.status)) return 'Invalid status';
+ if (!Array.isArray(obj.supportedAudioFormats)) return 'Invalid audio formats';
+ return null;
+}
2. MEDIUM apps/desktop/src/features/workspace/Workspace.tsx:12 - Incomplete prop validation
- Problem: WorkspaceProps interface doesn't validate sourceBootstrap prop structure
- Root cause: ProjectBootstrapSummary type lacks runtime checking before usage
- Fix: Add PropTypes or runtime validation for sourceBootstrap prop
- Regression test: Add test case that passes invalid sourceBootstrap and verifies error handling
- Suggested diff:
@@ -15,0 +16,3 @@
+ if (sourceBootstrap && !isValidProjectBootstrap(sourceBootstrap)) {
+ throw new Error('Invalid sourceBootstrap structure');
+ }
3. HIGH apps/desktop/src/features/workspace/Workspace.test.tsx:82 - Insufficient test coverage for new types
- Problem: No tests exist for new RehearsalWorkspace and ProjectSummary types
- Root cause: Test file doesn't cover type validation or component behavior with new data structures
- Fix: Add tests that verify component behavior with valid/invalid ProjectSummary objects
- Regression test: Cover all status cases ('idle','running','done','failed') in tests
- Suggested diff:
@@ -82,0 +83,25 @@
+describe('ProjectSummary validation', () => {
+ test('validates correct structure', () => {
+ const valid: ProjectSummary = {
+ id: '1',
+ title: 'Test',
+ status: 'running',
+ supportedAudioFormats: ['mp3']
+ };
+ expect(validateProjectSummary(valid)).toBeNull();
+ });
+
+ test('rejects missing id', () => {
+ const invalid = { title: 'Test', status: 'running', supportedAudioFormats: ['mp3'] };
+ expect(validateProjectSummary(invalid)).toMatch('Invalid id');
+ });
+
+describe('Workspace component', () => {
+ test('handles invalid sourceBootstrap prop', () => {
+ jest.spyOn(console, 'error').mockImplementation(() => {});
+ expect(() => render(
+ <Workspace song={mockSong} sourceBootstrap={{ invalid: true }} />
+ )).toThrow('Invalid sourceBootstrap structure');
+ });
+});
Verification
- Review source: independent OpenCode review of the current checkout, focused changed hunks, and current-head GitHub Check evidence.
- Structural exploration: mandatory before any conclusion; use CodeGraph first when available, otherwise focused local source/diff inspection is required.
- Result: REQUEST_CHANGES
- Reason: Found critical issues in type safety and test coverage
Gate evidence
- Head SHA:
e223cb51bc476e3a7450c0a55a522781ea6b4f1b - Workflow run: 27755819508
- Workflow attempt: 1
There was a problem hiding this comment.
Pull request overview
The PR introduces updates to workspace and shared-types modules, including new test coverage and localized strings. No critical issues or regressions were identified during structural exploration.
Findings
No blocking findings from OpenCode's independent review.
Verification
- Review source: independent OpenCode review of the current checkout, focused changed hunks, and current-head GitHub Check evidence.
- Structural exploration: completed before approval; if structural exploration, changed-file inspection, or evidence completeness is missing, OpenCode must not approve.
- Result: APPROVE
- Reason: Structural exploration completed with no critical issues found. Changes are well-contained and tested.
Gate evidence
- Head SHA:
8f9255e7ecc23fa780e0f9c519e0ce1dfffa698a - Workflow run: 27756997777
- Workflow attempt: 1
There was a problem hiding this comment.
Pull request overview
The PR introduces updates to workspace and shared-types modules, including new tests and localized strings. No failed checks or structural issues found.
Findings
No blocking findings from OpenCode's independent review.
Verification
- Review source: independent OpenCode review of the current checkout, focused changed hunks, and current-head GitHub Check evidence.
- Structural exploration: completed before approval; if structural exploration, changed-file inspection, or evidence completeness is missing, OpenCode must not approve.
- Result: APPROVE
- Reason: Structural exploration completed with no source-backed blockers. Changes are well-contained and tested.
Gate evidence
- Head SHA:
c98aac7588509009b5d12a6adef4bc702b0aba57 - Workflow run: 27757618874
- Workflow attempt: 1
V2 collaboration work needs the Rehearsal Workspace to carry more than static role cards: richer assignments, discussion/approval state, and clearer harmonic simplification/transposition context. This change adds those planning primitives to the shared song model and exposes them in the desktop workspace without introducing cloud sync behavior.
Refs #152.
Shared rehearsal contract
RehearsalSong.collaborationmetadata for assignment, comment, approval, and sync posture summaries.Workspace UI
Verification
npm run test --workspace @bandscope/shared-typesnpm run typecheck --workspace @bandscope/shared-typesnpm run lint --workspace @bandscope/shared-typesnpm run typecheck --workspace @bandscope/desktopnpm run lint --workspace @bandscope/desktopnpm run test --workspace @bandscope/desktopnpm run build --workspace @bandscope/desktophttp://127.0.0.1:5173/using the browser YouTube fallback path; verified desktop and mobile widths.Security Notes
local_only/planned_cloud) so the UI does not imply active cloud behavior before security and conflict-resolution rules exist.