Skip to content

fix(roles): fail closed on missing windows and lock identity tests - #876

Closed
cursor[bot] wants to merge 33 commits into
developfrom
cursor/bc-0af5d1de-f22b-4292-954d-76e563ce40eb-8cac
Closed

fix(roles): fail closed on missing windows and lock identity tests#876
cursor[bot] wants to merge 33 commits into
developfrom
cursor/bc-0af5d1de-f22b-4292-954d-76e563ce40eb-8cac

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Summary

Successor to #873. The identity-safety repair in _STEM_TO_ROLE_IDS was already in production, but the only RoleExtractor measured-overlap test still required keys-left to share Bass Guitar's warning. Missing or mismatched section windows also failed open into a song-wide FFT, repeating one average clash on every card.

Buyer-visible contract on this head:

  • An 80 Hz verse vs 1 kHz chorus fixture warns Bass Guitar only in the crowded section. Keyboard Left Hand, Keyboard Right Hand, and Acoustic Guitar stay empty.
  • other + vocals warns Lead Vocal only.
  • Stems without matching section windows emit no overlap warning.
  • A partial boundary list is not enough evidence to measure any section.
  • Next-action copy still tells the player to thin one part in that section.

Do not merge #873 in parallel. Leave dependency remediation on #783 and audio resource admission on #781/#866.

Verification

  • Focused overlap/role tests: 42 passed
  • uv run --project services/analysis-engine pytest --cov=src/bandscope_analysis --cov-report=term-missing --cov-fail-under=100 — 679 passed, 24 skipped, 100% statement coverage
  • ./scripts/harness/quickcheck.sh (hosted CI on this head is the merge evidence; this environment is not counted as a substitute)

Security Notes

Attack surface

  • In-memory stem arrays and section boundary timestamps already admitted by canonical orchestration
  • Role-warning strings rendered in the desktop WebView

Trust boundary

  • Python analysis engine → shared rehearsal-role contract → React workspace cards

Mitigations

  • No file I/O, network, subprocess, dependency, or model authority added
  • Missing windows, mismatched boundary counts, non-array stems, and mapping exceptions fail closed to no warning
  • Display-only stem names use .get(..., ()) so a later label cannot KeyError into the extractor fail-soft path
  • Mixed other remains usable in player-facing copy but cannot authorize named keyboard-hand or guitar roles

Test points

  • Known 80 Hz bass+accompaniment verse versus 1 kHz chorus fixture, with band-energy RMSE vs the ideal low/mid profiles
  • Empty warnings when stems exist but section windows are missing or the boundary count mismatches
  • other + vocals warns only lead-vocal
  • Display-only stem names do not raise and do not invent a new role id

Dependency and Supply Chain

  • No new direct dependency was added
  • If a new dependency was added, this PR explains why it is needed
  • runtime / dev / build / test classification is recorded
  • alternatives were considered
  • maintainer trust and update health were checked
  • license fit was checked
  • known security issues were checked
  • transitive footprint impact was considered
  • SBOM or supplemental inventory impact was recorded

i18n impact

  • No user-visible string changed
  • Korean and English locale impact was updated

Engine warning copy is already English next-action text from #873. This successor does not add or change locale keys.

Reviewer checklist

  • Gitflow target branch is develop
  • protected-branch rules were not weakened
  • required checks are expected to stay green on this exact head

Keep this Draft-equivalent until the unchanged resulting exact head has realistic focused/full tests GREEN, 100% owned production coverage, and ordinary branch-protection acceptance. Queued, skipped, predecessor, or self/author evidence is not success.

Open in Web View Automation 

seonghobae and others added 30 commits August 9, 2026 09:36
- 레지스터 중복 감지 이중 루프를 필터-루프로 개선하여 O(N^2) 성능 오버헤드 완화
- 대형 배열 오디오 처리에 의한 Unbounded Memory Consumption 완화 위해 사이즈 제한 적용
- trivy-fs 스캔에서 보고된 pdfjs-dist 취약점 패치 및 예외 처리
- 레지스터 중복 감지 이중 루프를 필터-루프로 개선하여 O(N^2) 성능 오버헤드 완화
- 대형 배열 오디오 처리에 의한 Unbounded Memory Consumption 완화 위해 최대 1억 샘플 사이즈 제한 적용
- 수많은 stem 인풋으로 인한 Denial of Service 방지를 위해 최대 stem 갯수 100개 제한 적용
- trivy-fs 스캔에서 보고된 pdfjs-dist 취약점 패치 및 예외 처리
- 레지스터 중복 감지 이중 루프를 필터-루프로 개선하여 O(N^2) 성능 오버헤드 완화
- 대형 배열 오디오 처리에 의한 Unbounded Memory Consumption 완화 위해 최대 1억 샘플 사이즈 제한 적용
- 수많은 stem 인풋으로 인한 Denial of Service 방지를 위해 최대 stem 갯수 100개 제한 적용
- trivy-fs 스캔에서 보고된 pdfjs-dist 취약점 패치 및 예외 처리
- 레지스터 중복 감지 이중 루프를 필터-루프로 개선하여 O(N^2) 성능 오버헤드 완화
- 대형 배열 오디오 처리에 의한 Unbounded Memory Consumption 완화 위해 최대 1억 샘플 사이즈 제한 적용
- 수많은 stem 인풋으로 인한 Denial of Service 방지를 위해 최대 stem 갯수 100개 제한 적용
- trivy-fs 스캔에서 보고된 pdfjs-dist 취약점 패치 및 예외 처리
- 레지스터 중복 감지 이중 루프를 필터-루프로 개선하여 O(N^2) 성능 오버헤드 완화
- 대형 배열 오디오 처리에 의한 Unbounded Memory Consumption 완화 위해 최대 10,000,000 샘플 사이즈 제한 적용
- 수많은 stem 인풋으로 인한 Denial of Service 방지를 위해 최대 stem 갯수 10개 제한 적용
- trivy-fs 스캔에서 보고된 pdfjs-dist 취약점 패치 및 예외 처리
Revert the latest branch-wide dependency, Trivy, Jules-note, and altered resource-limit drift. Preserve the previously reviewed two-file register-overlap optimization and its focused resource-guard regressions; coordinated dependency security remains owned by #783.
Drop the Bolt-head 10M-sample and 10-stem silent guards, the Trivy
ignore, and the npm/PDF.js lock churn so this change stays an overlap
optimization. Keep fail-closed invalid thresholds and the policy-owned
admission regressions.

Co-authored-by: Seongho Bae <[email protected]>
Stop fabricating keyboard and vocal clash copy. Slice admitted stems
to each section, format honest accompaniment labels, and refresh
rehearsal priority from measured occupancy.

Co-authored-by: Seongho Bae <[email protected]>
seonghobae and others added 3 commits August 17, 2026 00:37
Keep mixed accompaniment evidence off named keyboard and guitar roles in
the RoleExtractor suite, and omit overlap warnings when section windows
are missing or do not match the section list so a song-wide FFT cannot
repeat on every card.

Co-authored-by: Seongho Bae <[email protected]>

Copy link
Copy Markdown
Collaborator

Superseded by canonical PR #873 with all unique work preserved. Immediately before consolidation, compare(8cf7d26e27a685181d4561643562d900c3bf7a96, 9f1e166da9acf043b7f4b8b6df84b5e1a2417706) reported this branch as exactly one direct child commit (ahead_by=1, behind_by=0, merge-base 8cf7d26…). #873 was then fast-forwarded non-forced to exact head 9f1e166da9acf043b7f4b8b6df84b5e1a2417706; post-consolidation compare is identical with zero commits/files. Required checks/reviews must regenerate on #873; #876 evidence does not transfer for merge.

@seonghobae seonghobae closed this Aug 16, 2026
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.

2 participants