feat: import rehearsal handoffs for focused reanalysis - #740
Conversation
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthrough검증된 BandScope 메타데이터 핸드오프를 가져오는 데스크톱 UI와 파일 검증 로직을 추가했습니다. 사용자는 로컬 오디오를 명시적으로 선택한 뒤 역할 집중 재분석을 시작합니다. 분석 엔진은 요청 역할과 관련된 결과만 반환하고 전체 결과는 캐시에 보존합니다. Changes메타데이터 핸드오프 왕복
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant 사용자
participant HandoffImportControl
participant App
participant AnalysisAPI
participant AnalysisCache
사용자->>HandoffImportControl: 핸드오프 JSON 선택
HandoffImportControl->>App: 검증된 artifact 전달
사용자->>App: 로컬 오디오 선택
App->>AnalysisAPI: 로컬 오디오와 역할 초점이 포함된 분석 요청
AnalysisAPI->>AnalysisCache: 전체 분석 결과 조회 또는 저장
AnalysisAPI-->>App: 역할 집중 분석 결과 반환
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage Decision
Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (11 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (11 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Docs: metadata-handoff-import.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: metadata-handoff-import.md"]
R2 --> V2["docs review"]
Evidence --> S3["Test: test_role_focus.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_role_focus.py"]
R3 --> V3["targeted test run"]
|
Dismissed because the requested change is an infrastructure-only coverage failure from the superseded central sandbox, not an unresolved product-code finding. Repository CI, security, SBOM, release, and build checks succeeded on this exact head; a fresh independent approval remains mandatory.
|
@cwl-noema-review @opencode-agent Please independently review exact head |
|
@coderabbitai review |
Rate Limit Exceeded
|
|
@opencode-agent @cwl-noema-review Please independently review exact current head @coderabbitai review |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='4fe7348987551937ea88ef2ef324348274837e79'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
git diff-tree --no-commit-id --name-status -r "$expected"
ast-grep outline apps/desktop/src/lib/handoff.ts --items all
ast-grep outline apps/desktop/src/features/import/HandoffImportControl.tsx --items all
ast-grep outline apps/desktop/src/App.tsx --items all --match 'App|handle|select|handoff|analysis'
ast-grep outline services/analysis-engine/src/bandscope_analysis/api.py --items all --match 'focus|cache|analy|song'
printf '\n--- handoff implementation ---\n'
cat -n apps/desktop/src/lib/handoff.ts
printf '\n--- import control implementation ---\n'
cat -n apps/desktop/src/features/import/HandoffImportControl.tsx
printf '\n--- App handoff references ---\n'
rg -n -C 8 -e 'handoff|Handoff|selectedSource|selectSource|createAnalysisRequestForSelection|YouTube' apps/desktop/src/App.tsx
printf '\n--- engine focus/cache references ---\n'
rg -n -C 12 -e '_focus_rehearsal_song|roleFocus|cache|cached|partGraph|handoff' services/analysis-engine/src/bandscope_analysis/api.pyLength of output: 57500 🏁 Script executed: #!/bin/bash
set -euo pipefail
head='4fe7348987551937ea88ef2ef324348274837e79'
base="$(git merge-base "${head}^" "$head" 2>/dev/null || true)"
printf 'COMMIT=%s\nPARENT=%s\n' "$head" "$base"
git diff --stat "${head}^" "$head"
git diff --find-renames --unified=45 "${head}^" "$head" -- apps/desktop/src/lib/handoff.ts
printf '\n--- App handlers and accessibility UI ---\n'
sed -n '390,535p' apps/desktop/src/App.tsx
sed -n '700,890p' apps/desktop/src/App.tsx
printf '\n--- desktop handoff tests ---\n'
cat -n apps/desktop/src/lib/handoff.test.ts
cat -n apps/desktop/src/features/import/HandoffImportControl.test.tsx
cat -n apps/desktop/src/App.handoff.test.tsx
printf '\n--- locate parser and reanalysis constructor ---\n'
rg -n -C 12 -g '*.{ts,tsx}' \
-e 'function parseMetadataHandoffArtifact\b|const parseMetadataHandoffArtifact\b|parseMetadataHandoffArtifact\s*=' \
-e 'function createReanalysisRequestFromHandoff\b|const createReanalysisRequestFromHandoff\b|createReanalysisRequestFromHandoff\s*=' \
.
printf '\n--- all metadata-handoff field access and dereference-related calls ---\n'
rg -n -C 4 -g '*.{ts,tsx,py}' \
-e 'MetadataHandoffArtifact|parseMetadataHandoffArtifact|createReanalysisRequestFromHandoff' \
-e '\.workspace\.|\.song\.|\.sections\.' \
apps services packages 2>/dev/null || true
printf '\n--- analysis-engine role focus regression tests ---\n'
cat -n services/analysis-engine/tests/test_role_focus.pyLength of output: 122649 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- artifact schema validator ---'
sed -n '270,325p' packages/shared-types/src/index.ts
sed -n '830,955p' packages/shared-types/src/index.ts
printf '%s\n' '--- reanalysis request constructor ---'
sed -n '140,185p' apps/desktop/src/lib/export.ts
printf '%s\n' '--- selection error and progress/summary accessibility markup ---'
rg -n -C 10 -e 'selection-error|role="alert"|aria-live|progressbar|Progress' apps/desktop/src/App.tsx
sed -n '875,960p' apps/desktop/src/App.tsx
printf '%s\n' '--- artifact field names passed to filesystem, URL, fetch, or IPC APIs ---'
rg -n -P -C 5 \
'(readFile|readTextFile|readBinaryFile|writeFile|writeTextFile|fetch\s*\(|axios|XMLHttpRequest|open\s*\(|Path\s*\(|urlopen|requests\.)' \
apps/desktop/src packages/shared-types/src services/analysis-engine/src \
-g '*.{ts,tsx,py}' | head -n 500
printf '%s\n' '--- direct imported artifact/sourceAssets accesses outside parser/export/import UI ---'
rg -n -P -C 4 \
'(sourceAssets|artifactKind|artifactVersion|createdAt|workspace\.|song\.|roleBuckets)' \
apps/desktop/src packages/shared-types/src services/analysis-engine/src \
-g '*.{ts,tsx,py}' | head -n 600Length of output: 83798
No blocker remains. The implementation enforces bounded pre-decode intake, strict UTF-8/JSON/schema validation, and payload-free localized errors. It prevents competing source actions during handoff validation. A validated import clears the prior source and requires fresh local-source selection. The role-focus projection does not mutate cached complete results. Both cache-hit and cache-miss paths retain complete cache values and return recipient-specific projections. Static inspection found no handoff path, URL, or asset dereference. The import, replacement, clear, status, error, summary, and progress controls include the required accessible labels and live regions. [approve] You are interacting with an AI system. |
Pull request was converted to draft
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current head4fe7348987551937ea88ef2ef324348274837e79. -
Head SHA:
4fe7348987551937ea88ef2ef324348274837e79 -
Workflow run: 30951152154
-
Workflow attempt: 1
Coverage evidence
Coverage Decision
- Result: FAIL
- Test evidence: not proven passing
- Docstring evidence: not proven passing when configured
- Failure count: 4
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (11 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (11 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Docs: metadata-handoff-import.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: metadata-handoff-import.md"]
R2 --> V2["docs review"]
Evidence --> S3["Test: test_role_focus.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_role_focus.py"]
R3 --> V3["targeted test run"]
|
@coderabbitai review Please review exact current head @opencode-agent Please rerun exact-head review after central npm-workspace coverage ownership is repaired; do not reuse the prior incomplete coverage evidence. @cwl-noema-review Please independently review this exact head. Merge remains subject to current-head checks, unresolved-thread policy, and qualifying non-author approval. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='4fe7348987551937ea88ef2ef324348274837e79'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
test "$actual" = "$expected"
printf '\n--- changed files ---\n'
git diff-tree --no-commit-id --name-status -r "$expected"
printf '\n--- implementation outlines ---\n'
ast-grep outline apps/desktop/src/lib/handoff.ts --items all
ast-grep outline apps/desktop/src/features/import/HandoffImportControl.tsx --items all
ast-grep outline apps/desktop/src/App.tsx --items all --match 'App|handle|select|handoff|analysis'
ast-grep outline services/analysis-engine/src/bandscope_analysis/api.py --items all --match 'focus|cache|analy|song'
printf '\n--- bounded intake and request construction ---\n'
cat -n apps/desktop/src/lib/handoff.ts
printf '\n--- import control state and accessible markup ---\n'
cat -n apps/desktop/src/features/import/HandoffImportControl.tsx
printf '\n--- parent source/handoff state and source action interlock ---\n'
rg -n -C 12 -e 'handoff|Handoff|selectedSource|selectSource|createAnalysisRequestForSelection|YouTube|isReading' apps/desktop/src/App.tsx
printf '\n--- role focus and cache paths ---\n'
rg -n -C 18 -e '_focus_rehearsal_song|roleFocus|cache|cached|partGraph|handoff' services/analysis-engine/src/bandscope_analysis/api.py
printf '\n--- validator and reanalysis constructor ---\n'
rg -n -C 12 -g '*.{ts,tsx}' \
-e 'function parseMetadataHandoffArtifact\b|const parseMetadataHandoffArtifact\b|parseMetadataHandoffArtifact\s*=' \
-e 'function createReanalysisRequestFromHandoff\b|const createReanalysisRequestFromHandoff\b|createReanalysisRequestFromHandoff\s*=' \
packages apps
printf '\n--- focused regression tests ---\n'
cat -n apps/desktop/src/lib/handoff.test.ts
cat -n apps/desktop/src/features/import/HandoffImportControl.test.tsx
cat -n apps/desktop/src/App.handoff.test.tsx
cat -n services/analysis-engine/tests/test_role_focus.py
printf '\n--- artifact access and possible dereference/automatic action APIs ---\n'
rg -n -P -C 4 \
'(sourceAssets|artifactKind|artifactVersion|workspace\.|song\.|roleBuckets|readFile|readTextFile|readBinaryFile|fetch\s*\(|axios|XMLHttpRequest|urlopen|requests\.)' \
apps/desktop/src packages/shared-types/src services/analysis-engine/src \
-g '*.{ts,tsx,py}' | head -n 800
printf '\n--- temporary write automation candidates ---\n'
rg -n -i -C 3 \
'(temporary|temp(orary)?|write automation|write[_ -]?automation|autofix|codemod|writeFile|writeTextFile|git\s+commit|git\s+push)' \
.github package.json apps services packages \
-g '!**/node_modules/**' -g '!**/dist/**' 2>/dev/null || trueLength of output: 202868 🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='4fe7348987551937ea88ef2ef324348274837e79'
test "$(git rev-parse HEAD)" = "$expected"
printf '%s\n' '--- changed paths ---'
git diff-tree --no-commit-id --name-only -r "$expected"
printf '%s\n' '--- handoff intake ---'
sed -n '1,240p' apps/desktop/src/lib/handoff.ts
printf '%s\n' '--- handoff import control ---'
sed -n '1,260p' apps/desktop/src/features/import/HandoffImportControl.tsx
printf '%s\n' '--- App handoff state, handlers, and source controls ---'
rg -n -C 18 -e 'const \[handoff|const \[.*Reading|handleHandoff|onReadingChange|onImported|onError|HandoffImportControl|selectLocal|selectYouTube|startAnalysis|createAnalysisRequestForSelection' apps/desktop/src/App.tsx
printf '%s\n' '--- parser contract and reanalysis constructor ---'
rg -n -C 10 -e 'parseMetadataHandoffArtifact|createReanalysisRequestFromHandoff' packages/shared-types/src/index.ts apps/desktop/src/lib/export.ts
printf '%s\n' '--- role focus implementation and cache call sites ---'
rg -n -C 24 -e '^def _focus_rehearsal_song|_focus_rehearsal_song\(|_load_cached_analysis|_store_cached_analysis|cache_key|role_focus' services/analysis-engine/src/bandscope_analysis/api.py
printf '%s\n' '--- focused tests: stale reads, reselection, intake, and cache isolation ---'
rg -n -C 8 -e 'reading|replace|stale|race|selectedSource|roleFocus|cache|too large|UTF-8|artifact' \
apps/desktop/src/lib/handoff.test.ts \
apps/desktop/src/features/import/HandoffImportControl.test.tsx \
apps/desktop/src/App.handoff.test.tsx \
services/analysis-engine/tests/test_role_focus.py
printf '%s\n' '--- changed workflow or automation files only ---'
git diff-tree --no-commit-id --name-only -r "$expected" | \
rg '(^|/)(\.github/|package\.json$|.*\.(sh|yml|yaml|js|cjs|mjs|ts)$)' || trueLength of output: 92449 🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='4fe7348987551937ea88ef2ef324348274837e79'
test "$(git rev-parse HEAD)" = "$expected"
printf '%s\n' '--- strict metadata artifact validator ---'
sed -n '820,955p' packages/shared-types/src/index.ts
printf '%s\n' '--- complete focused projection ---'
sed -n '590,670p' services/analysis-engine/src/bandscope_analysis/api.py
printf '%s\n' '--- localized, payload-free handoff errors ---'
rg -n -C 8 -e 'function handoffErrorMessage|const handoffErrorMessage|handoffErrorMessage|handoff.*(unsupported|tooLarge|invalid|read)' \
apps/desktop/src/App.tsx apps/desktop/src/locales/en/common.json apps/desktop/src/locales/ko/common.json
printf '%s\n' '--- imported source-assets references and operation call sites ---'
rg -n -C 5 -g '*.{ts,tsx,py}' \
-e '\bsourceAssets\b' \
-e '(fetch|readFile|readTextFile|readBinaryFile|open|urlopen|requests\.)\s*\(' \
apps/desktop/src packages/shared-types/src services/analysis-engine/src | head -n 500Length of output: 34677
No blocker remains. The handoff reader enforces the byte limit before decode. It rechecks the received byte length. It uses strict UTF-8 decoding and strict artifact validation. The artifact validator rejects unsupported kind, version, fields, and nested payload shapes. The parent receives the reading state. During validation, the UI disables local audio selection, YouTube import, and analysis start. A successful import clears the prior local source. The user must select a new local audio source before analysis can start. Handoff failures use fixed localized error codes. The UI does not expose file names, payload content, paths, or parser errors. The import flow does not dereference Role projection creates new focused section and part-graph structures. It filters graph links to focused roles. Cache hits retain the complete cached result and project per request. Cache misses store the complete result before returning the focused result. The regression tests cover both paths. The exact commit contains no workflow or temporary write-automation change. [approve] You are interacting with an AI system. |
|
@opencode-agent @cwl-noema-review Please independently re-review exact current head |
What
Complete the metadata handoff round trip in the desktop app and analysis engine. The user can import a validated handoff JSON file, inspect its workspace and role scope, explicitly pair a fresh local audio source, and receive a result projected onto the requested rehearsal roles.
Product outcome
An exported handoff becomes directly usable by another BandScope user. Audio remains local and source selection remains explicit. Importing or replacing a handoff clears any previously selected audio so unrelated source context cannot be reused accidentally; clearing the handoff preserves audio selected after that handoff.
The engine caches the complete reusable analysis and applies
roleFocusonly to each response. This prevents recipient-specific cache poisoning while removing unrelated roles and out-of-scope part-graph links from focused results.Verification
Security Notes
The imported file is untrusted. The implementation uses bounded allocation, strict schema validation, no path or URL dereference, no payload echo, no automatic analysis start, no implicit reuse of a source chosen before the imported handoff, and non-mutating projection over complete cached results.
Closes #739
Summary by CodeRabbit
새로운 기능
개선 사항