Skip to content

Add new chart-transform plugin capability - #1000

Merged
byrongamatos merged 7 commits into
got-feedBack:mainfrom
jphinspace:develop
Jul 19, 2026
Merged

byrongamatos merged 7 commits into
got-feedBack:mainfrom
jphinspace:develop

Conversation

@jphinspace

@jphinspace jphinspace commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What

Apologies if this change is pre-emptive, since I know you all have a lot on your plate at the moment!

The idea behind this change is to expose more chart data to plugins, including access & modification of the placements of notes, strings, hand positions, and other chart data, all without modifying the original.

The motivation for this change was to unblock my alternate-tuning plugin (shift all the notes to a different tuning) but it could also be used for things like chord simplification (alternate voicing or root-notes-only), alternative dynamic difficulty implementations, new practice modes, and so on.

This would remove the need for these types of plugins to have to fork and maintain their own note highways/renderers. This change also provides data for note-detection to use to support the transformed notes.

Resolves #952.

feedpak surface

  • This PR does not change how the app reads/writes feedpaks (manifest keys, pack files, folder layout)
  • …or it does, and the spec change landed first via the FEP process — FEP / spec PR: got-feedback/feedpak-spec#___ (once it merges, re-run this PR's checks and the gate goes green)

Checklist

  • CHANGELOG.md [Unreleased] updated (user-visible changes)
  • Tests added/updated for new behaviour
  • Commits are DCO signed off (git commit -s)

Summary by CodeRabbit

  • New Features

    • Added chart-transform support for plugins, allowing charts to be adjusted before rendering and scoring.
    • Transformations apply across standard, custom, and splitscreen views, with provider selection persisted between sessions.
    • Updated chart data, metadata, templates, and note timelines are reflected consistently in supported renderers and controls.
  • Bug Fixes

    • Failed or invalid transformations safely retain the original chart.
    • Improved 3D highway handling of transformed tuning and capo information.
  • Documentation

    • Added guidance for configuring, managing, and troubleshooting chart-transform providers.

@jphinspace jphinspace changed the title Develop Add new chart-transformation plugin capability Jul 18, 2026
@jphinspace jphinspace changed the title Add new chart-transformation plugin capability Add new chart-transform plugin capability Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@byrongamatos, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 09b33c39-6200-4937-845a-e8684d563763

📥 Commits

Reviewing files that changed from the base of the PR and between c4d7ad2 and 6d9d756.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • plugins/highway_3d/plugin.json
  • plugins/highway_3d/screen.js
  • static/v3/index.html
📝 Walkthrough

Walkthrough

Adds a chart-transform provider domain with persisted selection, synchronous post-filter chart staging, failure isolation, transformed renderer/getter data, multi-highway propagation, and comprehensive tests and documentation.

Changes

Chart transform capability

Layer / File(s) Summary
Provider coordinator and capability wiring
static/capabilities/chart-transform.js, static/capabilities.js, static/v3/index.html, plugins/capability_inspector/screen.js
Adds provider registration, selection, persistence, refresh, diagnostics, failure events, highway discovery, and capability-inspector support.
Synchronous highway transform stage
static/highway.js
Adds isolated synchronous transformation after difficulty filtering, sorted staged outputs, transformed getters and bundles, lifecycle resets, and failure reporting.
Rendering and consumer integration
static/js/highway-draw.js, plugins/highway_3d/screen.js
Updates 2D drawing, chord-template caches, anchor handling, and 3D tuning/capo labels to use effective transformed data.
Provider and highway validation
tests/js/chart_transform_domain.test.js, tests/js/highway_chart_transform.test.js, tests/js/highway_chord_render_cache.test.js
Covers lifecycle commands, persistence, multiple highway surfaces, isolation, sorting, failure handling, getters, rendering, and cache invalidation.
Capability documentation and release metadata
docs/capability-*.md, CLAUDE.md, CHANGELOG.md, plugins/highway_3d/CLAUDE.md, plugins/highway_3d/plugin.json
Documents the domain and provider contract, updates validation and safety metadata, records the release note, and increments the highway_3d version.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Plugin
  participant Coordinator as chart-transform coordinator
  participant Highway
  participant Renderer as Renderers and getters
  Plugin->>Coordinator: Register and select provider
  Coordinator->>Highway: Install transform
  Highway->>Plugin: Request synchronous transform
  Plugin-->>Highway: Return transformed chart
  Highway->>Renderer: Expose effective chart data
Loading

Possibly related PRs

Suggested reviewers: topkoa, byrongamatos

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.92% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the main change: adding a new chart-transform plugin capability.
Description check ✅ Passed The PR description follows the template with What, feedpak surface, and checklist sections completed.
Linked Issues check ✅ Passed The changes implement a chart-transform hook that stages transformed chart data for renderers and scoring, matching issue #952's core request.
Out of Scope Changes check ✅ Passed The docs, tests, and manifest/version updates all support the chart-transform feature and do not appear unrelated.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
plugins/highway_3d/screen.js (1)

5594-5606: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Avoid caching bundle.tuning by reference.

The fast-path checks _lastSyncBundleTuningRef === bundleTunRef to skip label updates. As per coding guidelines, bundle is mutable and its identity must not be compared across frames. If a plugin mutates the bundle.tuning array in-place, this reference check will incorrectly pass and the tuning labels will fail to update.

Consider comparing the array contents directly (e.g., using a fixed-size scratch array) to maintain the zero-allocation fast path while respecting in-place mutations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/highway_3d/screen.js` around lines 5594 - 5606, Update the
tuning-label fast path around _lastSyncBundleTuningRef so it does not rely on
bundle.tuning or bundleTunRef identity. Compare the relevant tuning array
contents using a reusable fixed-size scratch representation, preserving zero
allocations and ensuring in-place mutations invalidate the cache and refresh
labels.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/capability-recipes.md`:
- Around line 516-518: Update the recipe manifest’s compatibility value in the
documented capability entry from “degrade-noop” to “none” so it matches the
runtime registration in chart-transform.js and the domain documentation. Leave
the ownership and safety fields unchanged.

In `@plugins/highway_3d/screen.js`:
- Around line 861-865: Unify tuning and capo fallback behavior across
plugins/highway_3d/screen.js: in the tuning/capo initialization at lines
861-865, require Array.isArray(bundle.tuning) before using it and otherwise fall
back to songInfo.tuning; at lines 5555-5561, change the capo fallback from an
empty string to 0; and at lines 5596-5597, change the capo fallback from NaN to
0 so cache signatures match rendered output.

In `@static/highway.js`:
- Around line 1597-1602: Guard _restageChartTransform so it returns without
invoking the provider until the chart-ready state is established, while
preserving provider attachment during highway:created. Ensure readiness is
checked before processing notes or songInfo, and allow the normal ready path to
rerun the transform and clear any stale transform-failed diagnostic.

In `@tests/js/highway_chart_transform.test.js`:
- Around line 55-59: Strengthen the test around _reportChartTransformFailure by
invoking the catch path with a sentinel error and asserting the emitted payload
contains only the approved fields. Replace the narrow doesNotMatch check for
reason: e with an assertion against the actual reported detail, rejecting any
exception-derived field such as error, error.message, or equivalent while
preserving the local console.error assertion.

---

Outside diff comments:
In `@plugins/highway_3d/screen.js`:
- Around line 5594-5606: Update the tuning-label fast path around
_lastSyncBundleTuningRef so it does not rely on bundle.tuning or bundleTunRef
identity. Compare the relevant tuning array contents using a reusable fixed-size
scratch representation, preserving zero allocations and ensuring in-place
mutations invalidate the cache and refresh labels.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bdfddc5d-492c-4819-a3db-13bc3af37d47

📥 Commits

Reviewing files that changed from the base of the PR and between 1c077c9 and af443f2.

📒 Files selected for processing (18)
  • CHANGELOG.md
  • CLAUDE.md
  • docs/capability-domains.md
  • docs/capability-recipes.md
  • docs/capability-roadmap.md
  • docs/capability-safety-matrix.md
  • plugins/capability_inspector/screen.js
  • plugins/highway_3d/CLAUDE.md
  • plugins/highway_3d/plugin.json
  • plugins/highway_3d/screen.js
  • static/capabilities.js
  • static/capabilities/chart-transform.js
  • static/highway.js
  • static/js/highway-draw.js
  • static/v3/index.html
  • tests/js/chart_transform_domain.test.js
  • tests/js/highway_chart_transform.test.js
  • tests/js/highway_chord_render_cache.test.js

Comment thread docs/capability-recipes.md Outdated
Comment thread plugins/highway_3d/screen.js Outdated
Comment thread static/highway.js
Comment thread tests/js/highway_chart_transform.test.js Outdated
Signed-off-by: Joe <jphinspace@gmail.com>
@jphinspace

jphinspace commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Outside diff range comments (1) intentionally skipped:

The identity-based cheap key is the documented contract, not an oversight: bundle array fields are specified as swap-reference-on-change and read-only (CLAUDE.md's bundle rules; the chord render cache and the merge caches in highway_3d all key on identity the same way). No core path mutates a tuning array in place, and since the hardening pass deep-clones staged transform output, even a misbehaving provider can't reach the staged _xfTuning after the fact. Guarding against an in-contract-violating mutation with a per-frame content scan would contradict the zero-allocation purpose of the fast path and diverge from every sibling cache in the codebase.

@jphinspace

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Signed-off-by: Byron Gamatos <xasiklas@gmail.com>

# Conflicts:
#	CHANGELOG.md
#	plugins/highway_3d/plugin.json
#	plugins/highway_3d/screen.js
@byrongamatos
byrongamatos merged commit 05be9eb into got-feedBack:main Jul 19, 2026
1 check passed
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.

Feature request: let plugins transform chart data (notes/chords) before rendering and scoring

2 participants