Engineering Docs
This is a technical deep dive to explain the code behind the
kernel, the conventions, and proper usage of the kernel.
Overall purpose of the kernel
The kernel presents a facade for product resources to consume. In this context, a product could be a customer/client facing application (desktop, mobile app, web app), an internal application (async process worker, data ingestion process), or an internal business operation app.
Parts of the kernel
Convention over configuration
This saying was popularized by Ruby on Rails and in the age of AI coding, this is much needed. The less decisions that the AI model has to make, the better the output. The folder structure of a kernel is clearly labeled. Here is an example Python kernel folder structure:
+-- src | +-- kerneltest | | +-- implementations (system interfaces go here) | | | +-- __init__.py | | +-- processes (system processes go here) | | | +-- __init__.py | | +-- __init__.py (Python-specific; bootstraps the kernel) | | +-- kernel.py (Kernel data structures and classes) +-- tests | +-- __init__.py +-- specs (Spec and AI workplans are placed here) +-- pyproject.toml +-- .gitignore +-- .python-version +-- README.md
Kernel Flow
The entrypoint for a kernel is the cmd function. This function takes a System Command – which is usually an enum – and an arbitrary number of keyword parameters. Internally, the kernel keeps an associative map of System Commands to System Processes. System Processes are then called with the corresponding keyword arguments that were passed in the `cmd` function.