Mycroft-core is a large and complex code base that has grown massively since its initial commit in May 2016. We know that it’s not perfect, and want your help to map out what the issues are with the current framework.
Whilst we’ve done some great work improving the user experience on the Mark II using the current system, this often comes with more work arounds or one-off tweaks. The deeper, structural changes that are needed into the future become more complex and get put off even further. In a nutshell - technical debt.
Seeing the impact of that technical debt, we want to do three things:
-
Take a brief step back and map out the issues that the broader community see with the current system;
-
Define a small set of fundamental principles for what we should be working toward; and
-
Explore the best way for us to get from where mycroft-core is today, to where it needs to be for tomorrow.
What are the issues we’ve seen and heard about?
For some of our core developers, you will have seen, heard and been frustrated by many of these. We have been listening, and our own developers have been facing the same challenges. Whilst each have numerous possible solutions, some of these will require some fundamental changes. So we wanted to put them out on one big table together so that we don’t miss something.
We’d love your help in extending this list with anything you don’t love about Mycroft right now.
So without further ado… we have noticed that Mycroft currently:
-
Includes all possibilities for every possible implementation in a single code base. There are a broad range of services to choose from for STT, TTS, Audioservices, and Wake Word engines. There are also a lot of hard coded references to particular hardware platforms like the Mark 1.
-
Has tightly coupled Services across what could be very distinct components.
-
Implicitly depends on external libraries tightly coupling itself to their conventions, such as the Mycroft Skills Manager.
-
Has circular dependencies, such as utils that have configurable parameters, but the configuration module also relies on the utils.
-
Uses multiple paradigms for inter-process communication including:
-
Web socket based message bus
-
Files with hard-coded locations (mic level)
-
File system “signals” (button presses, isSpeaking)
-
File system locks (writing config files)
-
-
Has an inconsistent Message structure and schema. To determine what you should be emitting or listening for requires searching through mountains of code. API’s for each Service should be better defined, making it clearer what you can expect from each component, how to invoke it and the structure of the data it returns.
-
Re-implements standard library functionality in unique ways, such as our logging module.
-
Has varying levels of testing across the code which are mostly based on who wrote them, rather than how important it is for that code to have rigorous tests.
-
Has tight coupling of dependencies. Skills and plugins share the same Python virtual environment with core. This creates dependency conflicts and adds limitations to the system, particularly as it scales. Even the need to use a single version of Python creates an unnecessary dependency between core and its extensions. More broadly, having all systems share the same process space means that a poorly performing component can bring down the entire stack.
-
Almost requires that downstream projects fork the code. For a lot of use cases, modifications to core are required in order to add or modify some functionality. This also adds additional burden to ensure that any changes made maintain backwards compatibility, as well as merging in new changes from upstream.
-
Lacks state awareness and introspection at most levels of the system, requiring meticulous investigation to determine what is currently happening, or has recently happened. An important part of this is any concept of an interaction session. There is currently no way to determine what speech input caused a particular response, let alone any side effects that might have been triggered.
-
Is in need of some deep re-organization to account for the way each system has evolved over time.
Phew!!! That is quite a list, but unfortunately I’m sure there are things we have missed.
What has frustrated you about the current Mycroft architecture?
… and the good news?
That is a lot of stuff that we want to fix, but it’s not all bad news. To address these issues will require some new foundational concepts be added, however it will result a much more reliable and stateful system; faster and more robust future development efforts; and easier onboarding and for downstream projects and core contributors.
There is also a huge amount of great work that has gone into Mycroft over many years and some incredible technologies that bring Mycroft to life. Fixing these issues isn’t about replacing all of that work, it’s about giving those existing components better foundational structures so they can interoperate with each other more effectively.
Once we have mapped out the key foundational issues, we want to explore what that means for our development principles and explore the best way forward. But for now, please give us your honest and constructive feedback on mycroft-core as it currently stands.
We don’t want to propose solutions just yet. We want to map out all of the issues so that future solutions are developed with the broader picture in mind. So, what would you change about mycroft-core?