Skip to content

test(analysis): lock verse/chorus chord recovery on a known take - #891

Draft
cursor[bot] wants to merge 6 commits into
developfrom
cursor/bc-8911e2fe-4263-4b04-915d-b05c370db508-343a
Draft

test(analysis): lock verse/chorus chord recovery on a known take#891
cursor[bot] wants to merge 6 commits into
developfrom
cursor/bc-8911e2fe-4263-4b04-915d-b05c370db508-343a

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Summary

Players copy from the recording. A verse in C and a chorus in G must stay two answers. This branch locks that contract on annotated windows: the production ChordRecognizer plus section summary must recover C then G, and the reverse order, with duration-weighted chord symbol recall at or above 0.70. Minor labels cannot satisfy a major window.

Exact current head: 92fe9155a1896e13ba8e06e1762f6848fc2efdfa.
Protected base: develop@acdbea6344fe1231c39535b575f4de35e4c607c9.

This is a distinct analysis-accuracy evidence slice. Do not mix Stem Lab (#884), lock-in (#888), NIM contract (#881), dependency remediation (#783), or Python branch-coverage ownership (#861) onto this PR.

Test-first evidence-integrity repair

Exact-code review found that the test's _duration_weighted_symbol_recall helper added every matching segment overlap independently. Overlapping or duplicate recognizer segments could therefore count the same annotated section time twice and inflate the acceptance score above its real covered fraction, including above 1.0.

  • RED/test-first head e8461e4bbece72193bf6b4f2a548d616e79deb07 adds test_duration_weighted_symbol_recall_unions_duplicate_time. The fixture has two overlapping matching C estimates over the first four-second section plus a matching G estimate over the second. Correct covered duration is 8/8 = 1.0; the predecessor helper would sum 3 + 3 + 4 seconds and report 1.25.
  • GREEN head 5ffb4203b8d92282a7d2dde6bb2178ad4a0cc3cb clips matching estimates to each truth window, sorts them, unions overlapping/adjacent intervals, and accumulates only union duration before dividing by annotated duration.
  • 041aa617b573c446f96075c27404dd9ee4a84a9a aligns docs/doctoring/section-harmony-known-progression.md with the evidence boundary.
  • Current head 92fe9155a1896e13ba8e06e1762f6848fc2efdfa records the correction in CHANGELOG.md.

This repair changes only test/acceptance evidence and its documentation. No runtime dependency, lockfile, network, filesystem, IPC, database, model, or reviewer-credential authority changes.

Verification

Exact current-head repository workflows have now completed. Terminal-success evidence for 92fe9155a1896e13ba8e06e1762f6848fc2efdfa is:

  • ci run 31965144636;
  • release run 31965144735;
  • build-baseline run 31965144724;
  • sbom run 31965144698;
  • SAST Semgrep run 31965144727;
  • bandit run 31965144654; and
  • secret-scan-gate run 31965144665.

The two remaining repository security failures were inspected at exact job/log level before classification:

No review thread is unresolved. The only formal review is COMMENTED automation guidance distinguishing this temporal section-change proof from the single-chord WAV/tempo slice; it is not qualifying independent approval. Exact Python statement+branch evidence remains #861-owned, and current read-only central review/coverage prerequisites are .github#939 / .github#1020.

Security Notes

Attack surface

  • Synthetic in-memory float audio arrays, annotated section bounds, and recognizer segment timings inside pytest. No user files, URLs, network calls, or subprocesses.

Trust boundary

  • Untrusted production input: decoded audio and recognizer segments.
  • Trusted acceptance input: fixture frequencies, true section bounds, labels, and the 0.70 floor.

Mitigations

  • No file I/O, network, or shell.
  • Major windows reject Cm / Gm.
  • Matching intervals are clipped and unioned per annotation window, so duplicate-time estimates cannot fabricate additional covered duration.

Test points

  • test_duration_weighted_symbol_recall_unions_duplicate_time
  • test_canonical_major_symbol_rejects_minor_as_major
  • test_section_harmony_recovers_verse_c_then_chorus_g
  • test_section_harmony_keeps_later_c_off_the_opening_window

Dependency and Supply Chain

  • No new direct dependency was added
  • No dependency classification or lockfile change is required for this test-only repair
  • SBOM/supply-chain surface is unchanged

i18n impact

  • No user-visible string changed

Merge gate

Keep Draft and unmerged until the unchanged exact head has the focused known-progression test and full applicable suite GREEN; exact 100% owned production statement/branch coverage and public-docstring evidence are terminal-success through the canonical #861/central path; all required repository/central SAST/security/SBOM/supply-chain/package/release gates are terminal-success; zero valid unresolved findings remain; #783 and current central prerequisites are integrated/revalidated where applicable; a qualifying independent non-author last-push approval exists; and branch protection permits merge without bypass. Never count absent, queued, skipped-required, failed, predecessor-head, protected-base, model-only, self/author, or bypass evidence as success.

cursoragent and others added 2 commits August 16, 2026 16:48
Keep section harmony honest: a C-then-G rehearsal take, and the reverse
order, must recover each section's main chord with duration-weighted
recall instead of collapsing to one song-wide answer.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Keep C/G major windows from passing on Cm/Gm. Document that the
section bounds are annotated so the lock is not read as form detection.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@cursor
cursor Bot requested a review from seonghobae August 16, 2026 16:56

@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.

Relation to #890

#890 is the Tier 1 real-audio landing (decoded C-major WAV duration + 120 BPM Acc1). This PR is the section-change complement: annotated C-then-G and G-then-C windows, live recognizer, duration-weighted recall, minor labels rejected.

Do not merge both as competing single-chord locks. Prefer #890 for the WAV/tempo package. Keep this head for the temporal song -> section proof. Rebase after #890 if the shared ADR files conflict.

Do not mix Stem Lab (#884), lock-in (#888), or NIM (#881) here. Do not self-approve.

View PR

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed exact head 92fe915 against protected develop@acdbea6344fe1231c39535b575f4de35e4c607c9. The section-level known-progression acceptance is bounded to test/evidence/docs, uses the production ChordRecognizer + section summary, keeps major/minor distinct, and unions overlapping matching intervals so duplicate-time estimates cannot inflate recall. No actionable inline finding remains in the current diff. APPROVE applies only to this unchanged head and does not waive the still-required #783/#861/central security, coverage, exact-head check, Draft, or branch-protection gates.

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