Repository navigation
Per-section sync 3/5: per-section alignment engine (#24) - #69
Merged
Merged
Conversation
Author
|
All tests pass locally (401 JS tests) and lint is clean (only 3 pre-existing warnings). The section-sync implementation and tests in PR #69 are passing. No changes needed.
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by free · Input: 154.7K · Output: 6K · Cached: 168.5K |
cchacs
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Scope
Sub-issue 3/5 of #8 (per-section syncing), implementing #24. Pure analysis only — the engine reads the chart grid and the audio onset strip and returns one independent proposal per section. It never mutates note timestamps (baking is #25) and never touches the UI (review is #26).
What's in the change
src/section-sync.js— the alignment engine, plus the other pieces the design doc requires: region splitting (_sectionRegionsPure, half-open intervals, explicit leading region, final endpoint), a DTW anchor pass (_dtwAlignPure), Theil-Sen slope, affine fit, and confidence/reason.tests/section_sync.test.mjs— 14 acceptance tests, all reading clicks through the shipped onset path (_spectralFluxOnsetsPure).How it works
audioStart= previous accepted region's map at the first note, snapped to a real onset), so sections a-failed section sits after can never be dragged off — the failed section's line is simply not carried.[audioStart, audioStart + slope·span + tailPad]. The lower edge is the snapped onset itself (everything below belongs to the previous section); the tail pad is capped under a beat period. With on-the-beat clicks every period-shifted window fits a straight line equally well, so absolute place comes from the chain, never from a minimisation — hence the whole alignment is byte-for-byte insensitive to whether the previous section matched.reason: 'low-confidence', is analysed not skipped, and its evidence stays inside it (_trimPairsPuredrops off-fit correspondences before refitting).Acceptance tests
Plus a regression: a section whose first note is not on its marker keeps the marker's place (first anchor lands on the first real onset, not the boundary).
npm test= 401 pass / 0 fail.npm run lint= 0 errors (3 pre-existing warnings increate.js/main.js). Commits reference #24; this is one PR for this one issue. Not merged intomain.big-pickle(free) | 𝕏