File size: 1,551 Bytes
11330a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
import json
from note_alignment_report import build_alignment

def load(path):
    with open(path) as f: return build_alignment(json.load(f))

def main():
    c5 = load('/tmp/notepilot-left-loop/mic-shadow-single-worklet-20260918.json')
    retry = load('/tmp/notepilot-left-loop/mic-self-onset-fix-live-20260918.json')
    final = load('/tmp/notepilot-left-loop/mic-previous-guard-live-final-20260918.json')
    assert c5['orphanAdvances'], 'C5 false advance was not exposed'
    assert retry['orphanAdvances'], 'previous-retry false advance was not exposed'
    assert not final['orphanAdvances'], 'post-guard trace gained an orphan advance'
    for out in (c5, retry, final):
        assert all(a.get('status') for a in out['attempts'])
        assert all(a.get('physicalMicArrivalKnown') is False for a in out['attempts'])
        assert not any(c.get('code') == 'SCORE_BIASED_PITCH_AS_ACOUSTIC' for c in out['sanityChecks'])
        assert 'runQuality' in out and 'suitableForTuning' in out['runQuality']
    diag = load('/tmp/notepilot-left-loop/mic-follower-hold-diagnostics-20260918-v2.json')
    gsharp = [a for a in diag['attempts'] if a['scoreEventId'] == 1]
    assert len(gsharp) == 4 and all(a['holdTimeline'] for a in gsharp)
    assert all(a['peakPosteriorHold'] and a['peakEvidenceHold'] for a in gsharp)
    assert all('candidate' in h and 'runner' in h and 'onsetTiming' in h for a in gsharp for h in a['holdTimeline'])
    print('note alignment regression fixtures: PASS')

if __name__ == '__main__': main()