Skip to content

feat(workspace): name tonight's first playable range on the map - #957

Merged
seonghobae merged 11 commits into
developfrom
feat/workspace-first-playable-range
Aug 26, 2026
Merged

feat(workspace): name tonight's first playable range on the map#957
seonghobae merged 11 commits into
developfrom
feat/workspace-first-playable-range

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Buyer-visible gap

The ready rehearsal workspace already shows chords, cues, setup notes, simplification, and overlap warnings, but it did not name the first playable span. The initial implementation also trusted typed runtime range structure too far: malformed/inverted note labels could become confident guidance and malformed song/section/role collections could crash the new callout boundary.

Product outcome

When analysis is ready, the map names tonight's first valid playable range and the next instrument check:

  • clash present: {role} sits {low}–{high} in {section}. Hear that clash on your instrument before the {section}.
  • named span only: {role} sits {low}–{high} in {section}. Check that span on your instrument before the {section}.
  • no valid evidence: guidance stays fail-closed instead of manufacturing a playable span.

Section cards show the same valid span and next action. English and Korean copy stay in sync. Selecting a role limits the callout to that part.

Exact current identity

  • Protected base: develop@acdbea6344fe1231c39535b575f4de35e4c607c9
  • Exact head: bd0915dae91c5ab0d54758d0b7475445bee94009
  • Branch: feat/workspace-first-playable-range
  • Open, non-Draft, mergeable, and unmerged at the latest refetch.

Scope / trust boundary

  • Prefer the first valid named span that also carries a meaningful clash warning, then fall back to the first valid named span.
  • Blank, whitespace, and none sentinels are not notes, names, labels, ids, or warnings.
  • Both range endpoints must be bounded scientific-pitch labels and satisfy low ≤ high.
  • Runtime song roots, section collections, section members, role collections, role members, range objects, and warning collections are treated as untrusted at the new buyer-visible resolver boundary. Malformed entries are isolated; malformed roots fail closed.
  • Ready-workspace callout plus Section Roadmap range row remain presentation-only. No filesystem, URL, subprocess, IPC, WebView, model, export, dependency, or persistence authority is added.
  • One-pass template filling keeps replacement-token- and placeholder-shaped rehearsal values literal.

Test-first repairs

Playable-range integrity

Fresh comparison with the existing Stem Lab range-integrity contract showed that the predecessor helper only checked for nonblank strings. Shared runtime range fields are strings, so not-a-note–E3 and E3–C#2 could be presented as playable.

  1. RED b42cc90f3ed2f4a95b6b0224efe07b0079d56ae9 adds selected-role regressions requiring malformed and inverted spans to produce no playable-range evidence.
  2. GREEN 28f4f7bcb246df130f36672bd76d623d37b51ba6 adds scientific-pitch parsing and chromatic low≤high validation.

Runtime containment

Adversarial current-source review then found firstRangeSqueeze() dereferenced song.sections, section.roles, and role.range directly. A runtime-corrupted analysis payload could therefore crash the ready workspace despite the documented fail-closed analysis-data boundary.

  1. RED 2143fbf71ffc22d88ebc5545be4980b2f39331af adds malformed root/collection/member cases plus a fail-isolation case proving one malformed role must not erase a valid neighboring role.
  2. GREEN/current bd0915dae91c5ab0d54758d0b7475445bee94009 validates runtime objects/collections before property authority, accepts textual evidence only from actual strings, isolates malformed entries, and preserves the existing valid demo/selected-role/clash behavior.

The prior CodeRabbit replacement-token finding is resolved/outdated on current code.

Exact-current-head verification

Fresh repository workflows are dispatched for exact head bd0915dae91c5ab0d54758d0b7475445bee94009: CI 32356196475, build-baseline 32356196512, release 32356196620, SBOM 32356196442, security-audit 32356196551, aggregate Security Scan 32356196622, SAST Semgrep 32356196715, Bandit 32356196529, and secret-scan-gate 32356196621.

At the latest refetch all nine are queued. Queued evidence is non-passing; no predecessor-head result transfers. The only visible inline review thread is resolved/outdated. No merge readiness is claimed from status-only or model-only evidence.

Dependency ownership

Canonical #783 exclusively owns the protected-base npm HIGH set (pdfjs-dist / nanoid / undici). This branch does not copy, suppress, or restate that remediation. Any exact-head security failure must still be inspected at its job/log boundary before classification.

Merge gate

Keep unmerged until one unchanged resulting exact head has every applicable repository and central CI/security/SAST/SBOM/supply-chain/coverage/review gate terminal-success, zero valid unresolved findings, exact required owned coverage/docstring evidence, a qualifying independent non-author last-push APPROVE, and ordinary protected-branch acceptance without bypass. Queued, pending, skipped, cancelled, failed, stale, predecessor-head, inherited protected-base, model-only, self/author, or status-only evidence is non-passing.


Open in Devin Review

Summary by CodeRabbit

  • 새로운 기능

    • 작업 공간에서 첫 연주 가능 구간과 다음 악기 점검 항목을 확인할 수 있습니다.
    • 역할별 유효한 음역과 음역 충돌 또는 누락 상태를 안내합니다.
    • 영어와 한국어 안내 문구를 지원합니다.
  • 버그 수정

    • 잘못된 형식, 역순 또는 인식할 수 없는 음역 정보가 화면에 잘못 표시되지 않도록 개선했습니다.
    • 손상되거나 누락된 곡 데이터도 안전하게 처리합니다.

The ready rehearsal board showed chords, cues, and clashes but never
named the first playable span, so players still guessed whether a part
would fit before the next section.

Security Notes: no new filesystem, URL, subprocess, IPC, or model
authority. Copy is derived from already-validated rehearsal analysis
fields already rendered in the workspace.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

Next included review available in 2 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 719a34e1-2832-4f3b-b156-1fd0fd2cf3ac

📥 Commits

Reviewing files that changed from the base of the PR and between 7b620e2 and 3a42d47.

📒 Files selected for processing (2)
  • apps/desktop/src/features/workspace/firstRangeSqueeze.test.ts
  • apps/desktop/src/features/workspace/firstRangeSqueeze.ts
📝 Walkthrough

Walkthrough

첫 번째 유효 음역을 선택하는 유틸리티를 추가했습니다. Workspace에 첫 음역 확인 안내를 표시합니다. SectionRoadmap은 검증된 역할 음역만 표시합니다. 영어와 한국어 번역 및 관련 테스트를 추가했습니다.

Changes

음역 기반 리허설 안내

Layer / File(s) Summary
첫 음역 분석 유틸리티
apps/desktop/src/features/workspace/firstRangeSqueeze.ts, apps/desktop/src/features/workspace/firstRangeSqueeze.test.ts
음역 표기를 정규화하고 순서를 검증합니다. 선택 역할과 충돌 경고를 기준으로 첫 유효 음역을 선택합니다. 허용된 템플릿 토큰만 치환합니다.
Workspace 안내 통합
apps/desktop/src/features/workspace/Workspace.tsx, apps/desktop/src/features/workspace/Workspace.test.tsx, apps/desktop/src/locales/*/common.json, AGENTS.md, ARCHITECTURE.md, CHANGELOG.md, CLAUDE.md
Workspace가 첫 음역의 충돌, 확인, 누락 상태를 계산하고 번역된 안내 섹션을 표시합니다. 제품 지침과 변경 기록도 갱신합니다.
역할 카드 음역 표시
apps/desktop/src/features/workspace/SectionRoadmap.tsx, apps/desktop/src/features/workspace/SectionRoadmap.test.tsx
SectionRoadmap은 유효한 음역의 최저음과 최고음 및 다음 행동 문구를 표시합니다. 역전된 음역과 비표준 음 이름은 표시하지 않습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: 🔵 Low · up to 7b620

The new workspace guidance may display unintended text when a template contains an unknown inherited token, though the impact is localized to presentation and the PR remains mergeable with explicit owner follow-up.

Sequence Diagram(s)

sequenceDiagram
  participant Workspace
  participant firstRangeSqueeze
  participant Localization
  participant SectionRoadmap

  Workspace->>firstRangeSqueeze: 활성 역할과 곡 데이터 전달
  firstRangeSqueeze-->>Workspace: 검증된 첫 음역과 충돌 상태 반환
  Workspace->>Localization: 상태별 안내 문자열 조회
  Localization-->>Workspace: 번역된 안내 문구 반환
  Workspace->>SectionRoadmap: 역할 음역 데이터 전달
  SectionRoadmap->>Localization: 음역 라벨과 다음 행동 문구 조회
  Localization-->>SectionRoadmap: 번역된 문자열 반환
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 유효한 첫 연주 가능 음역을 작업 공간 지도에 표시하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. (1 skipped: 1 u…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 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-playable-range

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.

coderabbitai[bot]

This comment was marked as resolved.

@opencode-agent opencode-agent Bot added area: ui-ux Frontend, interaction, design, or user experience priority: medium Normal-priority or P2 work scope: product-gap Customer-visible product gap status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability labels Aug 22, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

The section card range row gated only on meaningfulRangeText, so an
inverted or malformed span (e.g. E3-C#2) rendered as valid playable-range
guidance while firstRangeSqueeze failed closed on the same data. Export
the shared playableRange helper and gate the roadmap row on it so both
surfaces reject non-pitch or low>high evidence identically.
coderabbitai[bot]

This comment was marked as resolved.

values[token] also resolves inherited members, so a {toString} token with no
matching value would render the inherited function source instead of keeping
the placeholder. Look up via hasOwnProperty and pin the regression with a
{toString}/{missingToken} test.
This was referenced Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-ux Frontend, interaction, design, or user experience priority: medium Normal-priority or P2 work scope: product-gap Customer-visible product gap status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant