Add no-filler tags, media CLI, and ask-before-edit iron law.
selftest / selftest (push) Canceled after 0s

Default solo-lead tags and report-only filler_ratio; slim Agent docs with media CLI; require consent, git backup or plugin path, and explicit commit/push before code changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
swl
2026-10-10 02:35:42 +08:00
co-authored by Cursor
parent dbfb9b52f9
commit 0ab8d8ad4d
13 changed files with 464 additions and 72 deletions
+19 -1
View File
@@ -685,6 +685,21 @@ def _collapse_runs(s, max_run=3):
return "".join(out)
def filler_ratio(asr_text, lang="zh"):
"""ASR 文本中语气/哼唱衬词占比(弱参考,不单独否决)。"""
if _is_en(lang):
words = _en_words(_strip_tags(asr_text or ""))
if not words:
return 0.0
n = sum(1 for w in words if w in EN_FILLER)
return n / float(len(words))
chars = cjk(asr_text or "")
if not chars:
return 0.0
n = sum(1 for c in chars if c in FILLER)
return n / float(len(chars))
def coverage(asr_text, lyrics, lang="zh"):
"""ASR 召回率:ASR 里命中的歌词单元 / 歌词正文单元。
@@ -875,6 +890,8 @@ def measure(path, expect=None, cache_dir=None, with_asr=True):
if half > vsr else 0.0
cov = coverage(txt, lyr, lang) if with_asr else 0.0
# 衬词占比:弱参考,不单独导致 FAIL(与 style_fam 同级)
fill_r = filler_ratio(txt, lang) if with_asr else 0.0
# ---- 风格分类:只看混音轨,不掺 demucs(见 qc_style 文件头坑位 4)
svec, sraw = qc_style.features(path, expect_bpm=expect.get("bpm"))
@@ -901,7 +918,8 @@ def measure(path, expect=None, cache_dir=None, with_asr=True):
f0_p98=round(float(np.percentile(f0v, 98)), 1) if f0v.size else 0.0,
f0_drift_st=round(f0_drift_st, 2),
asr_chars=len(tokens(txt, lang)), asr_segs=len(segs),
coverage=round(cov, 4), asr_head=txt[:120],
coverage=round(cov, 4), filler_ratio=round(fill_r, 4),
asr_head=txt[:120],
voice_self=round(float(e_self), 4),
flatness=round(sraw.get("flatness", 0.0), 4),
expect=dict(expect),