Skip to content

feat(roles): wire measured register overlap into section warnings - #873

Draft
cursor[bot] wants to merge 54 commits into
developfrom
cursor/bc-250fad94-8fb4-48fa-b3e0-959ae4494cb3-d696
Draft

feat(roles): wire measured register overlap into section warnings#873
cursor[bot] wants to merge 54 commits into
developfrom
cursor/bc-250fad94-8fb4-48fa-b3e0-959ae4494cb3-d696

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Canonical buyer-visible slice

This Draft replaces fabricated role-overlap copy with section-windowed measured overlap, keeps mixed htdemucs other off named keyboard/guitar identity, and preserves the isolated active-stem optimization.

Protected base: develop@acdbea6344fe1231c39535b575f4de35e4c607c9.
Exact current head: 9423ae62492fd9bc3530f9a603bbd5b864322a21.

Product / evidence contract

  • No clash copy unless pitched stems measurably share a register in the relevant section.
  • Mixed other remains accompaniment and cannot authorize Keyboard Left Hand, Keyboard Right Hand, or Acoustic Guitar identity/presence.
  • Missing/mismatched/invalid section authority produces no overlap warning rather than whole-song fallback.
  • Register analysis accepts only one-dimensional mono arrays with finite positive non-Boolean sample-rate evidence.
  • Section slicing accepts only finite non-Boolean start/end/sample-rate evidence and requires finite scaled sample positions before integer conversion.
  • Valid warnings attach only to roles supported by evidence and use next-action copy.

Test-first current-head repairs

Boolean temporal/sample-rate authority

Exact-code review found Python bool values could pass ordinary numeric checks because bool is an int subtype: sr=True could enter FFT frequency construction, and Boolean section start/end/sample-rate values could become 0/1 timing authority.

  • RED 2b2ca42f1bbfa604943177aad124e9b26b1d7e11 adds direct Boolean sample-rate and section-window regressions.
  • GREEN 2db7a4797e57f4271bae260efc090fa99e51692f rejects Boolean sample rate in band_energy_profile and Boolean start/end/rate evidence in slice_stems_to_window, returning zero/empty evidence without I/O authority.
  • e7ef5eadbaf1db8809318a0938467e03d6e76621 records the repair in CHANGELOG.
  • Current head 9423ae62492fd9bc3530f9a603bbd5b864322a21 aligns docs/doctoring/register-overlap.md with the exact trust/test boundary and preserves the APA 7 psychoacoustic/MIR references.

Earlier branch repairs remain current: malformed multichannel stems fail closed before FFT; non-finite direct sample rates fail closed; finite raw timing whose scaled sample-index product overflows fails closed; matching result ordering and role-honesty are preserved.

Exact-current-head verification

The first workflow generation for 9423ae62492fd9bc3530f9a603bbd5b864322a21 was cancelled before repository jobs executed. Job inspection showed cancelled CI jobs with no executed steps; the log endpoint had no job log because execution never started. Cancelled evidence is not success.

After that exact cancellation boundary was inspected, ci run 31972445814 was rerun on the unchanged head and is currently queued, therefore still non-passing. The other exact-head workflow runs remain cancelled and are also non-passing:

  • security-audit 31972445819
  • secret-scan-gate 31972445831
  • SAST Semgrep 31972445850
  • release 31972445830
  • bandit 31972445853
  • aggregate Security Scan 31972445818
  • build-baseline 31972445824
  • sbom 31972445862

Do not infer source failure from the cancellation and do not count the rerun until terminal. Any subsequently failed job must be inspected at exact job/check-run/annotation/log level before source edits or another rerun.

Dependency / merge gate

This branch changes no JavaScript dependency/root lock or vulnerability suppression. Protected-base dependency findings remain canonical #783-owned only after exact-current-head log confirmation and must never be suppressed or copied here. Python statement+branch merge evidence remains #861-owned. The current central required-workflow replacement is read-only .github#1020; historical #1008 is closed unmerged.

Keep Draft and unmerged until the unchanged then-current head has realistic focused/full tests GREEN, exact 100% owned production statement/branch coverage and public docstrings, applicable numerical parity, all required repository/central SAST/security/SBOM/supply-chain/package/release gates terminal-success, zero valid unresolved findings, dependency prerequisites integrated/regenerated, a qualifying independent non-author last-push approval, and ordinary branch-protection acceptance without bypass. Never count queued, cancelled, skipped-required, failed, predecessor-head, protected-base, model-only, self/author, or bypass evidence as success.

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 2 commits August 17, 2026 00:38
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]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Head 8cf7d26e27a685181d4561643562d900c3bf7a96 still has two merge-blocking honesty bugs. Do not merge this Draft. The landing vehicle is #876 (9f1e166d).

Identity contract is not locked through RoleExtractor. Production already maps mixed other to no role IDs, so Bass Guitar + accompaniment may warn bass-guitar only. The only extractor test that measures overlap still requires keys-left to share that warning. That assertion is the old unsafe contract and will fail ci / build-and-test on this head.

Missing section windows fail open. When stems exist and boundaries is missing or shorter than sections, _section_overlap_warnings FFTs the whole song and repeats that average on every card. Doctoring already forbids that atomistic path. Fail closed instead.

Also restore the accidental deletion of the historical 0.1.1 changelog line, and use _STEM_TO_ROLE_IDS.get(stem, ()) so a later display-only name cannot KeyError.

Local successor evidence on #876, not transferable to this head: focused overlap/role tests 42 passed; full engine 679 passed, 24 skipped, 100% statement coverage. Hosted checks on this exact SHA are still queued and are not counted as success.

Leave #801 inside this lineage; do not merge it separately. Leave #783 / #781 / #866 on their owners. Do not self-approve or merge #873 or #876 from this review.

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

Comment thread services/analysis-engine/tests/test_roles.py Outdated
Comment thread services/analysis-engine/src/bandscope_analysis/roles/extractor.py Outdated
Comment thread services/analysis-engine/src/bandscope_analysis/roles/extractor.py Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (9f1e166da9acf043b7f4b8b6df84b5e1a2417706)

Prior threads on 8cf7d26e are fixed on this head.

  • Missing or short boundaries no longer measures the whole song. Admission is stems plus len(boundaries) == len(sections); otherwise _section_overlap_warnings returns {}.
  • Mixed htdemucs other stays role-agnostic (_STEM_TO_ROLE_IDS["other"] = ()). Bass or Lead Vocal can carry the measured warning; Keyboard Left/Right and Acoustic Guitar stay empty.
  • Extractor tests lock both contracts, including other + vocals and missing/mismatched windows.

CodeRabbit CLI is not authenticated in this environment (automatic_login_failed). Fallback correctness/security pass on this 10-file slice found no new blocking defect: no added I/O, network, subprocess, or fail-open window path.

Do not merge this Draft on review text. Exact-head repository/central checks, #783/#861/#781/#866 lineage, and an independent non-author last-push approval remain merge evidence.

Out of this slice

Browser-fallback, shared-types, and Rust demo fixtures still ship fabricated Density warning / Melodic overlap copy, and map_stems_to_roles still marks Keyboard Left/Right and Acoustic Guitar active from mixed other. That is the next successor, not a reopen of this wiring PR.

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

Keep htdemucs other from activating Keyboard Left/Right or Acoustic
Guitar, and replace fabricated demo clash copy with the engine
next-action wording on unambiguous bass and vocal roles.

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (23678f3931dd497dc3c21312544e5843da99a9d4)

Prior threads on 8cf7d26e remain fixed on this head. The new delta is 23678f39 (closed #883 folded in): mixed other no longer activates Keyboard Left/Right or Acoustic Guitar, and demo / browser-fallback / Rust fixtures use the same next-action sentence the engine emits.

  • Admission is still stems plus len(boundaries) == len(sections); otherwise _section_overlap_warnings returns {}.
  • _STEM_TO_ROLE_IDS["other"] = () still holds. Bass or Lead Vocal can carry the measured warning; named keyboard and guitar roles stay empty and inactive on the stem path.
  • Heuristic no-stem extraction still builds the catalog roles, as the plan requires.
  • Known-frequency RMSE (80 Hz verse vs 1 kHz chorus) still locks section-local copy.
  • No added I/O, network, subprocess, or fail-open window path.

The PR body now binds this exact SHA and both plans. Do not reopen #883.

CodeRabbit CLI is not authenticated here (not_authenticated). Fallback correctness/security pass found no Critical defect.

Residuals (not merge-blocking)

  • Measured extractor tests lock warning text and presence, not the HIGH/MEDIUM priority refresh on that same fixture. A successor on this run adds those assertions plus retires the leftover Melodic overlap priority-unit phrase.
  • Do not widen the SectionRoadmap queryByText regex with Keyboard 1 Right Hand. That name is still a visible demo catalog card; matching the whole tree would fail for the wrong reason. Warning-string locks already live in shared-types.
  • Demo still shows Keyboard Right Hand as an active catalog part. That is accepted heuristic demo, not a clash-copy lie.

Out of this slice

A dedicated accompaniment role card needs a later contract. Leave #801 inside this lineage. Leave #783 / #781 / #866 on their owners. Do not self-approve or merge this Draft. Exact-head repository/central checks and an independent non-author last-push approval remain merge evidence.

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

Keep the 80 Hz verse / 1 kHz chorus fixture from dropping HIGH/MEDIUM
priority when warnings attach or clear, and retire the leftover
Melodic overlap phrase in the priority unit test.

Co-authored-by: Seongho Bae <[email protected]>
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