Skip to content

feat(workspace): name tonight's first swell plan on the map - #1045

Open
seonghobae wants to merge 28 commits into
developfrom
feat/workspace-first-swell-plan
Open

feat(workspace): name tonight's first swell plan on the map#1045
seonghobae wants to merge 28 commits into
developfrom
feat/workspace-first-swell-plan

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Name tonight's first swell plan on the mounted rehearsal map so the staying part can grow into the next downbeat.

A swell is distinct from a drop (#1040): the source set stays, the landing is already active, and named vocals or bass RMS grows by at least 1.8× after an already-audible previous section. Accompaniment other never owns. Heuristic topology stays unnamed.

Open moves to the matching rendered map section. Customer-facing copy names the next action. Inherited, accessor-backed, or Proxy-substituted runtime metadata remains guidance-only.

Test plan

  • Engine: corroborated solo/partner swells; drop vs swell; silence-to-loud; accompaniment swap; energy fail-closed
  • Resolver: earliest named swell; same-source continuity; accompaniment cannot own; fail-closed on hostile metadata
  • Callout: Open, armed model copy, user copy preserved, Korean particle-safe, reduced-motion, navigation fail-closed
  • Workspace keeps the opened swell armed across immutable practice-progress updates
  • Shared-types + native project contract reject blank/multiline/unknown swell provenance

Devin Review

Summary by CodeRabbit

  • 새 기능

    • 리허설 워크스페이스에 ‘오늘 밤 첫 스웰 계획’ 안내를 추가했습니다.
    • 실제 스템 에너지 상승이 확인된 경우 담당 역할, 섹션, 시간과 다음 행동을 표시합니다.
    • 안내를 선택하면 해당 맵 섹션으로 이동합니다.
    • 영어와 한국어를 지원하며, 사용자 작성 문구는 원문 그대로 유지됩니다.
  • 개선

    • 스웰 계획이 없거나 탐색할 수 없을 때 상태 안내를 제공합니다.
    • 축소 모션 설정을 존중합니다.
    • 스웰 계획의 형식과 출처를 더욱 엄격하게 검증합니다.

Exact-head verification

  • Base: 749511c
  • Head: 0b03fb7
  • Local evidence: shared-types 34 tests with 100% statements/branches/functions/lines; desktop swell resolver 22 tests; native swell contract 6 tests; shared/desktop lint and typecheck; cargo fmt and diff check.

Security Notes

  • Shared, renderer, and native project boundaries reject blank, Unicode-line-separated, and multiline swell copy consistently.
  • User-authored single-line copy remains verbatim; only model-generated template guidance keeps its existing bounded normalization. No new dependencies or runtime trust boundary was added.

Name the earliest corroborated intensity rise so the staying part can
grow into the next downbeat. Engine emission requires the same source
set, already-audible named vocals or bass, and RMS ≥1.8×. Heuristic
topology, accompaniment other, drops, and breakdowns stay unnamed.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 909a6c0d-e0fa-47c7-a1bf-5311ff346c1b

📥 Commits

Reviewing files that changed from the base of the PR and between e4ad759 and 8c4827e.

📒 Files selected for processing (2)
  • services/analysis-engine/src/bandscope_analysis/roles/extractor.py
  • services/analysis-engine/tests/test_swell_nonfinite_energy.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

분석 엔진이 확증된 스템 에너지 상승에서 첫 swell 계획을 생성합니다. 프로젝트 계약이 계획과 provenance를 검증합니다. 데스크톱 워크스페이스가 계획을 지역화하고 해당 맵 섹션으로 이동합니다.

Changes

첫 swell 계획

Layer / File(s) Summary
Swell 계획 계약과 provenance 검증
packages/shared-types/..., apps/desktop/core/...
RehearsalRole이 선택적 swellPlanswellPlanSource를 지원합니다. 잘못된 값과 출처 조합을 거부합니다.
스템 에너지 기반 swell 생성
services/analysis-engine/src/bandscope_analysis/roles/..., services/analysis-engine/tests/...
스템 RMS를 역할 에너지로 매핑합니다. 동일한 source를 유지하고 에너지가 1.8배 이상 증가한 보컬 또는 베이스에만 모델 swell 계획을 추가합니다.
첫 swell 계획 해석
apps/desktop/src/features/workspace/firstSwellPlan.ts, apps/desktop/src/features/workspace/firstSwellPlan*.test.ts
가장 이른 유효 계획을 선택합니다. 활성 상태, 섹션 연속성, source 유지, 시간 범위, 역할 우선순위와 안정적인 ID를 검증합니다.
워크스페이스 표시와 맵 탐색
apps/desktop/src/features/workspace/FirstSwellPlanCallout.tsx, apps/desktop/src/features/workspace/Workspace.tsx, apps/desktop/src/i18n/..., apps/desktop/src/locales/...
계획을 영어와 한국어로 표시합니다. 버튼이 해당 섹션으로 이동합니다. 탐색 실패, reduced motion, provenance와 불변 업데이트를 처리합니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 8c482

The change adds fail-closed swell guidance and carries it through the workspace without introducing a concrete merge-blocking risk; it is merge-ready after normal checks and review.

Suggested reviewers: claude

Sequence Diagram(s)

sequenceDiagram
  participant AudioAnalysis
  participant RoleExtractor
  participant RehearsalContract
  participant Workspace
  participant MapRenderer

  AudioAnalysis->>RoleExtractor: stem RMS 에너지 전달
  RoleExtractor->>RoleExtractor: staying source와 1.8배 상승 검증
  RoleExtractor->>RehearsalContract: swellPlan과 swellPlanSource 저장
  Workspace->>RehearsalContract: 유효한 프로젝트 역할 읽기
  Workspace->>MapRenderer: 대상 sectionIndex로 이동
  MapRenderer-->>Workspace: 섹션 표시 또는 탐색 실패 상태
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 84.95% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 93 functions across 31 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 mounted rehearsal map에서 오늘 밤의 첫 corroborated swell plan을 명명하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/workspace-first-swell-plan

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.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Repair PR #1045 on its existing contributor branch only, starting from exact head 3e5d7752e124c78cb8365b9202d8dda1b6d01ae4 against protected develop@749511c3ad4000090048718f685c6bee6b3d2c25; refetch both before any mutation and adapt if moved. Apply systematic-debugging and verification-before-completion.

Exact release-preflight run 33143987005, job 98760900491, checked out merge SHA 17c6e5c2ae3d5d9b995c02be6a1d3bdb4e2f44a8 and now gets past Ruff lint, but ruff format --check src tests fails because src/bandscope_analysis/roles/extractor.py and tests/test_swell_plan.py are not canonical-formatted. Run the repository-pinned formatter on only those affected Python files (or the smallest canonical equivalent) and commit its deterministic result; do not hand-format by guesswork.

While verifying the same current source, remove the unreachable _activity_swell_plan branch if len(partners) != 1: return None: _NAMED_SWELL_ROLE_IDS contains exactly lead-vocal and bass-guitar, the current role has already been removed, and the empty-partner case already returns solo guidance, so a non-empty partner list has exactly one member. Preserve missing-display-name fail-closed behavior and every RMS/source-set/swell semantic. After repair run focused swell tests, Ruff check+format check, 100% analysis-engine coverage, and canonical quickcheck/full relevant tests. Do not resolve the remaining provenance/info review thread unless the successor head actually addresses it; do not force-push/rebase or weaken gates.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Please review current exact head f41b5e095fd9575c42f3570e6f548817a880e12e; the prior CI blocker was only pinned Ruff formatting in the PR's test file and has been repaired. Publish a current-head verdict; required Checks, unresolved threads, independent approval, and protected merge rules still apply.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

Please run the required OpenCode review for current HEAD 8ea3b6c. The review must produce a current-head verdict; this request is not an approval or bypass.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

Please run the required OpenCode review for current HEAD 7d6db4b. The review must produce a current-head verdict; this request is not an approval or bypass.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Review PR #1045 only at exact current head against the protected develop base. Refetch the head and base before reviewing, then submit a formal current-head APPROVED or CHANGES_REQUESTED verdict. Do not modify source, weaken gates, or manufacture approval/evidence.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Review PR #1045 only at exact current head 7d6db4b against the protected develop base. Refetch the head and base before reviewing, then submit a formal current-head APPROVED or CHANGES_REQUESTED verdict. Do not modify source, weaken gates, or manufacture approval/evidence.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

Exact HEAD 7d6db4b: local analysis verification passed 698 tests, 24 skipped, 100.00% coverage; hosted CI, release, Windows/macOS builds, security, SBOM, and coverage are terminal-success. Remaining required failures are opencode-review (no current-head verdict) and Strix (central provider invalid_tools/provider-unavailable failure). No source finding or gate bypass was applied.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Repair PR #1045 on its existing contributor branch only. Start from exact current head 9bff468504bc3c4af3bd110e60675e480373bc62 against protected develop@749511c3ad4000090048718f685c6bee6b3d2c25; refetch both immediately before any mutation and adapt if the head moved. Apply receiving-code-review, systematic-debugging, test-driven-development, and verification-before-completion.

Three current-head review findings are validated and RED regressions are already on the branch:

  1. packages/shared-types/test/swellPlanProvenance.test.ts commit db73b7a1c4908d6e55ff49dca1a4712281484eaf requires a persisted swellPlan without swellPlanSource to fail closed. Make packages/shared-types/src/index.ts enforce presence parity in both directions while preserving valid model/user pairs and existing blank/multiline/unknown-source rejection.
  2. apps/desktop/core/tests/swell_plan_contract.rs commit 6c0fafc2d51bfda1551c5df1c1f3ef1b15210433 pins the same invariant in native persistence. In validate_swell_plan_provenance, reject when swell_plan.is_some() != swell_plan_source.is_some(). Do not weaken deny_unknown_fields or existing validation.
  3. services/analysis-engine/tests/test_swell_plan.py commit 9bff468504bc3c4af3bd110e60675e480373bc62 now covers both drum entrance and drum exit while vocal RMS rises. Production currently loses drums in map_stems_to_roles, so source-set continuity is falsely preserved and a swell can be emitted during a real density change. Preserve the raw detected stem-activity maps for continuity evidence (or an equivalently narrow source-of-truth path) so any drums entrance/exit blocks swell naming without adding drums as a rendered role or contaminating compute_handoffs.

Keep the repair narrowly causal. Do not touch unrelated UI/navigation semantics, do not force-push/rebase, do not weaken any gate, and do not resolve unrelated informational threads. Run the focused shared-types provenance test, desktop core swell contract, analysis-engine swell tests including both drum transitions, pinned Ruff lint/format, exact owned 100% analysis-engine coverage where exposed, then canonical quickcheck/full relevant tests. Commit only after RED→GREEN proof and leave exact successor-head evidence.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Repair only the current-head non-finite RMS fail-closed defect on the existing canonical branch feat/workspace-first-swell-plan, starting from exact head 5acb40172f8097920e7143a196685c0805aeebb3 against protected develop@749511c3ad4000090048718f685c6bee6b3d2c25, and only if both remain current immediately before mutation. Refetch head/base, services/analysis-engine/src/bandscope_analysis/roles/extractor.py, affected tests, current review thread/check state before every write. Apply receiving-code-review, systematic-debugging, test-driven-development, and verification-before-completion. Never force-push, self-approve, weaken gates, or touch foreign repositories.

Current exact-source verification confirms unresolved thread PRRT_kwDORjvEXs6dHTge is valid. _named_swell_ids currently does float(previous_role_energy.get(role_id, 0.0) or 0.0) / float(role_energy.get(role_id, 0.0) or 0.0) and then ratio comparisons without any finiteness guard. NaN and inf are truthy; in particular a non-finite current RMS can make current_rms < previous_rms * _SWELL_RATIO false and incorrectly add the role to swelled, violating the fail-closed audio/data-integrity contract.

RED first: add the smallest realistic regression(s) through the existing public swell/extractor path proving non-finite energy cannot produce a swellPlan. Cover at least NaN and positive infinity for current RMS; include non-finite previous RMS as needed to pin symmetric fail-closed behavior. Preserve the real finite floor and 1.8× success boundary. Then make the narrow owning fix at _named_swell_ids: safely reject/skip a candidate when either compared RMS is non-finite (use the existing project math/numpy conventions rather than converting non-finite values into a finite success). Do not alter drum source-continuity, model/template, navigation, provenance, or #1040's native optional-role-field dependency lane.

Verification: focused swell/extractor regressions first, pinned Ruff lint+format, exact 100% analysis-engine statement/branch coverage where exposed, then canonical ./scripts/harness/quickcheck.sh and applicable security/build gates. Resolve only PRRT_kwDORjvEXs6dHTge when the successor exact head proves it addressed. Refetch exact new head/live base after the push. Do not merge or claim merge readiness without every applicable unchanged-head required gate plus qualifying independent non-author approval.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Review PR #1045 only at exact current head 8c4827e050da02125a8644e088225dcdceaa7afb against protected develop@749511c3ad4000090048718f685c6bee6b3d2c25. Refetch head/base before reviewing. The successor head has already repaired the non-finite RMS finding with explicit NaN/+inf/current+previous regressions and exact-head ci / build-and-test is GREEN; CodeRabbit’s review of the e4ad759d…8c4827e0 delta reports no actionable comments. The required OpenCode workflow run 33164294537, job 98825978625 failed closed specifically at Fail closed without a current-head OpenCode verdict, so publish a formal current-head verdict without modifying source, weakening gates, or treating predecessor evidence as approval. Verify the complete current diff and existing unresolved review threads; submit APPROVED only if the unchanged exact head is actually review-clean, otherwise submit CHANGES_REQUESTED with concrete current-head findings.

seonghobae commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Repair only the reopened runtime-provenance defect on the existing canonical feat/workspace-first-swell-plan branch. The branch moved compatibly after the prior reservation: refetch and start from exact current head f50dc24f75c1da7a76d9687eac70e5e0917f3e45 against protected develop@749511c3ad4000090048718f685c6bee6b3d2c25. The intervening commit only deep-copies section role payloads in the analysis extractor; exact current firstSwellPlan.ts is unchanged and still accepts source-less copy. Apply receiving-code-review, TDD, and verification-before-completion; adapt rather than race if the head moves again.

RED first: add/change the smallest resolver/callout provenance regression proving a nonblank, otherwise valid-looking swellPlan with no swellPlanSource is rejected at runtime and yields no named swell / unavailable guidance. Then change only ownedSwellPlan() so it fails closed unless the snapshotted own source is exactly model or user. Preserve valid explicit user copy verbatim, valid model template localization, existing template-drift fail-closed behavior, hostile inherited/accessor/Proxy defenses, source continuity, 1.8× finite RMS semantics, and all navigation behavior. Do not add a migration that re-authorizes provenance-less copy: persisted validators already reject it.

Run focused firstSwellPlan provenance/resolver/callout tests, desktop type/lint checks, then canonical relevant/full verification. Resolve reopened PRRT_kwDORjvEXs6dFsem only after the successor exact head proves the runtime contract is aligned. Do not touch #1040 native optional-role-field ownership, central workflows, unrelated feature lanes, or review/security gates. No force-push, destructive rebase, self-approval, or gate weakening.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

@OpenCode Repair the existing canonical branch feat/workspace-first-swell-plan only. Start by refetching and require exact head 284d0a39bd0fe2483eaf2d0d43774eff5a44081e; if it moved, inspect the intervening delta and do not overwrite concurrent work. Apply systematic-debugging + TDD + verification-before-completion.

Hosted RED is now exact and causal: CI run 33186260743, job 98900133758, merge checkout 04e9814a90b143ea819d8d4cc95d195274e8a988 (head 284d0a39... over protected develop@749511c3ad4000090048718f685c6bee6b3d2c25) fails only tests/test_feature_cache_schema_independence.py::test_feature_cache_paths_survive_final_analysis_schema_bumps; 728 Python tests pass, 1 skipped, owned Python coverage remains 100%. The RED proves _feature_cache_paths() incorrectly inherits ANALYSIS_CACHE_SCHEMA_VERSION through _analysis_cache_path(), so a final-result schema bump invalidates expensive reusable stem/features even though FEATURE_CACHE_SCHEMA_VERSION remains 1.

Make the narrow owning-layer fix in services/analysis-engine/src/bandscope_analysis/api.py: compute feature cache identity independently using FEATURE_CACHE_SCHEMA_VERSION with the same source identity fields (projectId, sourcePath, fileName, fileSizeBytes). Preserve the existing on-disk v1 feature location for backward reuse: use the legacy-compatible analysis-cache-v{FEATURE_CACHE_SCHEMA_VERSION} directory and the feature-schema digest, rather than inventing a new directory that orphans already-persisted .features.json/.features.npz. Do not delete old v1 analysis directories, because after this repair that location intentionally still owns v1 feature artifacts. Do not weaken validation, cache integrity, security gates, or source identity.

Keep the RED regression. Obtain GREEN for the focused regression and full ./scripts/harness/quickcheck.sh; report exact commands/results. Update only this branch, no force-push/rebase, no unrelated UI/swell/security changes, no self-approval. Resolve review thread PRRT_kwDORjvEXs6dNCMN only after the successor exact head is GREEN.

Copy link
Copy Markdown
Collaborator Author

Exact-head repair handoff after revalidating current 284d0a39bd0fe2483eaf2d0d43774eff5a44081e against protected develop@749511c3ad4000090048718f685c6bee6b3d2c25 and current api.py blob 0773e9edcfc215933f9a1f9eafedc579d9aae176.

The latest commit 284d0a39 correctly adds the RED contract (test(cache): preserve stems across result schema bumps), but the production path is still RED: _feature_cache_paths() still calls _analysis_cache_path() and strips the suffix, so the feature/stem cache digest and analysis-cache-v2 directory remain coupled to ANALYSIS_CACHE_SCHEMA_VERSION. The unresolved Devin thread PRRT_kwDORjvEXs6dNCMN is therefore still valid on this exact head.

This PR is the earliest active BandScope owner for this shared cache boundary (it predates #1047 and already introduced the result-schema bump plus the regression), so please finish the repair here rather than in #1047/#1049. Narrow production fix: compute the feature-cache base from a dedicated key payload containing FEATURE_CACHE_SCHEMA_VERSION plus the same project/source identity used for cache integrity, under a feature-specific versioned directory; do not call _analysis_cache_path() from _feature_cache_paths(). Preserve app-owned cacheRoot, fail-closed metadata/source validation, stem arrays, and all temporal no-redecode behavior. Then run the new schema-independence regression, feature store/load tests, temporal cache tests, and full Python/desktop/shared coverage. Resolve PRRT_kwDORjvEXs6dNCMN only after the exact repaired head is GREEN. Descendants #1047/#1049 must be restacked/revalidated afterward; no predecessor check/review evidence transfers.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent Review PR #1045 only at exact current head 995e3fc5475f47117c9eb15f3eb1e0a6dbd249c0 against protected develop@749511c3ad4000090048718f685c6bee6b3d2c25. Refetch both before reviewing; do not mutate source unless a fresh current-head finding is proven.

The previously validated defects have now been repaired on this canonical branch: non-finite swell energy fails closed; drum entrance/exit participates in raw source continuity; persisted and runtime swell provenance is paired; section-local role objects are isolated; the feature/stem cache is independently keyed by FEATURE_CACHE_SCHEMA_VERSION; and RehearsalRolePayload now carries the swell fields. All currently visible review threads are resolved. The exact-head required opencode-review still fails closed solely because no current-head formal verdict exists; predecessor verdicts do not transfer.

Independently review the complete current diff, especially the feature-cache compatibility path, swell source/energy continuity, shared/Rust/runtime provenance parity, payload typing, buyer-visible navigation/state behavior, and all addressed review findings. Publish a formal current-head APPROVED or CHANGES_REQUESTED verdict through the authorized review path. Do not self-approve for the PR author, weaken gates, force-push, create a competing PR, or treat skipped/neutral/predecessor evidence as success.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

Re-requesting review for current HEAD 0b03fb7 after aligning swell-plan validation across shared-types, desktop, and native persistence contracts.

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