Skip to content

fix(sections): track per-section stats on the desktop engine path - #82

Closed
mattromano wants to merge 1 commit into
got-feedBack:mainfrom
mattromano:fix/81-sections-on-engine-path
Closed

mattromano wants to merge 1 commit into
got-feedBack:mainfrom
mattromano:fix/81-sections-on-engine-path

Conversation

@mattromano

Copy link
Copy Markdown

What

Closes #81

On the desktop engine-verifier path, checkMisses() returns before its section scan, so currentSection never advanced and every updateSectionStat() call did nothing. sectionStats and notedetect:session.sections were always empty on desktop.

  • Moved the section scan into _ndTrackSection(t), using a small _ndSectionNameAt(t) lookup. checkMisses() still calls it at the same point on the browser path. On the engine path it now calls it with the same corrected playhead before returning, so the playhead's section row still opens with 0/0.
  • updateSectionStat(type, noteTime) now bins a judgment by the section its note is in (judgment.noteTime), and falls back to the playhead's currentSection when the note time is unknown. Engine verdicts land after a note's window closes, often once the playhead is in the next section. Without this, a section's last notes would be credited to the following one. On the browser path, the judgments that carry a note time now bin by the note too, which is the same or more accurate.
  • No change to the sectionStats / notedetect:session.sections shape.

No version bump: there's no stylesheet change. #72, #74, #76 and #78 all bump to 1.33.0, so the maintainer can re-bump after those land if they want one. This branch merges cleanly with all four and with the technique-flags fix (checked with git merge-tree).

Note: #78 adds a top-level _ndSectionAt(sections, t) for the section field on hit/miss payloads, with the same semantics. Once both land, the two lookups can be merged into one.

Tests

  • New test/engine_section_stats.test.js (2 tests). It uses the engine-verifier harness: a stubbed feedBackDesktop.audio with queued verdicts and a chart with Intro/Verse sections.
    • verdicts bin into [{Intro 1/1}, {Verse 2/0}]. Before the fix this was [].
    • a late verdict for the Intro's last note, delivered once the tracker has opened the Verse, still counts toward the Intro
    • Both tests fail on main. With the tracker change but without note-time binning, both still fail.
  • npm test: 355/355 pass. node --check screen.js is OK, and feedBack-plugin-spec/tools/validate.py reports ok.

Checklist

🤖 Generated with Claude Code

currentSection only advanced at the tail of checkMisses(), which returns
early under the engine verifier, so desktop sessions recorded no
per-section stats and notedetect:session.sections was always empty.
Keep the section tracker running on that path, and bin each judgment by
the section its note sits in (engine verdicts land after the playhead
may have crossed into the next section), falling back to the playhead's
section when the note time is unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: mattromano <42412983+mattromano@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15f572b1-301a-4233-ac1a-0035078f6a51

📥 Commits

Reviewing files that changed from the base of the PR and between 412433d and d679215.


📒 Files selected for processing (2)
  • screen.js
  • test/engine_section_stats.test.js


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mattromano

Copy link
Copy Markdown
Author

Consolidated into #84 (commits kept, rebased onto main, plus the review fixes).

@mattromano mattromano closed this Oct 15, 2026
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.

Desktop engine path records no per-section stats (session.sections is always empty)

1 participant