Skip to content

v4.0 - MakeCode, Architecture & State management Rewrite - #667

Open
r59q wants to merge 187 commits into
mainfrom
development2
Open

r59q wants to merge 187 commits into
mainfrom
development2

Conversation

@r59q

@r59q r59q commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR delivers the v4.0 refactor and feature update for ML Machine. It consolidates shared ML/domain logic into a clearer core architecture, moves stateful/business logic out of legacy stores into backend services/controllers reducing hard coupling on the Svelte framework, improves model training/validation behavior (especially KNN + confusion matrix flows), and expands MakeCode integration.

Key Changes

  • Core architecture reorganization:
    • Moved shared entities/models/vector/filter/live-data/repository logic into core-focused modules.
    • Introduced/cleaned interfaces around classifier/model training/repositories.
    • Renamed and aligned domain types (for example gesture-related state naming cleanup).
  • Store-to-service migration:
    • Reduced legacy store responsibilities and moved domain behavior to backend application/domain/controller layers.
    • Added/improved services for recording, validation, output handling, and feature/controller coordination.
    • Improved dependency setup and bootstrapping for cleaner ownership boundaries.
  • Model/training/validation fixes:
    • Reworked parts of training state and pending-change handling.
    • Multiple KNN fixes (graph rendering, training points handling, observer/state cleanup).
    • Confusion matrix and evaluation/validation edge-case fixes (including undecided gesture handling).
  • MakeCode experience improvements:
    • Added embedded MakeCode flow (path/iframe/button/project save-load/blocks rendering support).
    • Improved flashing/download logic and warning/error behavior.
    • Added UX safeguards around unchanged projects and connection states.
  • UI and reliability improvements:
    • Added reusable icon button usage and additional cleanup across components.
    • Improved live graph behavior and gesture selection/listening updates.
    • General cleanup, formatting, licenses, and legacy code removal.
    • Better handling in cases where confidence are equally assigned, i.e no gesture has the majority confidence
  • Testing
    • Added tests of core components.
    • Architectural tests added to ensure coherence.

Why

  • Establish cleaner boundaries between core domain logic, backend orchestration, and UI.
  • Making introducing tests easier by moving logic from UI components to the backend.
  • Cleaner boundaries would help an eventual upgrade to Svelte 5 and make it easier for React downstreams use ML-Machine.
  • Reduce duplicated/legacy model paths and improve maintainability.
  • Fix model UX correctness issues in training/validation visualizations.
  • Improve MakeCode integration.

Final Notes

The last of my time have been adding tests and testing all of the features as thoroughly as i could while on Linux, Windows testing is however limited. It should only effect how Bluetooth and USB interaction works though as its highly platform dependent. I am fairly confident it's as stable as the other branch 'development', but in case something is amiss please do reach out to me.
The contents of v3.6 is also part of this PR as that's the branch this is based off of.
I'll continue to monitor the project occasionally out of interest, but given the level of activity I doubt I'll be contributing.

As part of the handoff i've let an AI agent whip up an ARCHITECTURE.md, which I felt captured the general architecture very well. Take a peak at it if you ever want to dive into the changes as it lays the land in a very brief summary.

It has been a great journey to be a part of and I will miss the novel challenges and the learning that it brings. Farewell for now and I wish you the best of luck :)

@r59q
r59q marked this pull request as draft July 2, 2026 21:54
@r59q r59q changed the title v4.0 v4.0 - Architecture Rewrite Jul 2, 2026
@r59q r59q changed the title v4.0 - Architecture Rewrite v4.0 - Architecture & State management Rewrite Jul 2, 2026
@r59q r59q changed the title v4.0 - Architecture & State management Rewrite v4.0 - MakeCode, Architecture & State management Rewrite Jul 2, 2026
@r59q
r59q marked this pull request as ready for review July 8, 2026 11:20
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.

2 participants