updated 2026-11-26·6 min read
Micro-Kernel & Core Isolation
How Noether enforces zero native core leakage through Inversion of Control registries, the NoetherApp service locator, and the Disposable resource pattern.
Noether separates windowing, docking, persistence, and registries inside a strict micro-kernel host, while user-facing features like Graph View, Infinite Canvas, Tasks, Journal, and Backlinks sit on the outside of the SDK boundary as modular extensions, i.e., disabling or hot-reloading a built-in extension never breaks host compilation or leaks internal state.
1. Zero Native Core Leakage
If disabling Graph or Canvas breaks the host build, the extension boundary is fake. Native directories (src/core, src/lib, src/store, src/components, src/types, src/sdk) never import code, types, or models from src/extensions/* (which is also how I could later rip out the 2,524-line built-in sketch extension cleanly without touching the host).
All interaction between the host and extensions runs through three boundaries:
- The Noether SDK (
src/sdk): Public base classes, interfaces, and hooks (Extension,NoetherApp,Disposable,useViewSuspension). - Inversion of Control (IoC) Registries: Host registries where extensions plug in commands, views, and UI slots.
- The Typed EventBus (
EventBus): A publish-subscribe channel for lifecycle and document events.
| Architectural Layer | Scope & Subsystems |
|---|---|
| Noether Extensions Layer | Modular extensions consuming only the public SDK boundary |
Core Built-ins (src/extensions/core/) | Backlinks, Bookmarks, Canvas (with its own CanvasCardRegistry), Covers, Graph, History, Journal, Marketplace, More Icons, Outline, Properties, Sync, Tags, Tasks |
| Community & Custom (Marketplace) | Cascade, Copilot, Quicknote, Spaced Repetition (FSRS), Sketch2Text, User Extensions |
Public SDK Surface (src/sdk) | Extension base class, NoetherApp container, Disposable helpers, useViewSuspension, React UI primitives |
Micro-Kernel IoC Registries (src/core/registries/) | Central inversion-of-control registries managed by the host application |
CommandRegistry | Palette commands and hotkey listeners |
OmniboxProviderRegistry | Universal command palette search providers (task:, bm:, tag:, etc.) |
TabContextMenuRegistry | Contextual actions on tab headers in SplitTabHeader |
TabDecoratorRegistry | Custom tab icons, badges, and tooltips |
ViewRegistry | Leaf views and main content tab types |
ActionRailRegistry | Left activity bar icons and action triggers |
StatusBarRegistry | Bottom status bar items and progress indicators |
SidebarRegistry | Left and right sidebar panel tabs and file tree decorators |
EditorRegistry | TipTap extensions, slash commands, headers, footers, and transform hooks |
ContextMenuRegistry / FileContextMenuRegistry | Editor and file tree context menu actions |
ModalRegistry / SlotRegistry / ViewportActionRegistry | Custom modal dialogs, React portal slots, and viewport action buttons |
PropertyRegistry / SettingRegistry / FileTypeRegistry / IconRegistry | Frontmatter property types, extension setting tabs, custom file types, and icon packs |
ToolRegistry (MCP) | Model Context Protocol tools and prompts |
Typed EventBus | Typed publish-subscribe channel for document, vault, and extension lifecycle events |
Any extension can be toggled off, hot-reloaded, or deleted without breaking host compilation or leaving dead references behind.
2. The Host Application Container (NoetherApp)
Every extension receives a NoetherApp instance (src/core/app/NoetherApp.ts), exposing the host registries alongside workspace, vault, settings, events, vcs, dbManager, and workerPool.
NoetherApp service container (src/core/app/NoetherApp.ts)
export class NoetherApp {
public commands: CommandRegistry;
public views: ViewRegistry;
public actionRail: ActionRailRegistry;
public sidebars: SidebarRegistry;
public statusBar: StatusBarRegistry;
public editor: EditorRegistry;
public settingsRegistry: SettingRegistry;
public contextMenu: ContextMenuRegistry;
public modals: ModalRegistry;
public properties: PropertyRegistry;
public tabDecorators: TabDecoratorRegistry;
public icons: IconRegistry;
public tools: ToolRegistry;
public slots: SlotRegistry;
public fileTypes: FileTypeRegistry;
public viewportActions: ViewportActionRegistry;
public fileContextMenus: FileContextMenuRegistry;
public tabContextMenu: TabContextMenuRegistry;
public omnibox: OmniboxProviderRegistry;
public dbManager: ExtensionDatabaseManager;
public workerPool: ExtensionWorkerPool;
public events: EventBus;
public extensions: ExtensionManager;
public vcs: { /* Git snapshot & history helpers */ };
public get workspace(): WorkspaceAPI { /* ... */ }
public get vault(): VaultAPI { /* ... */ }
public get settings(): SettingsAPI { /* ... */ }
}3. The Disposable Pattern & Resource Management
When an extension gets disabled mid-session, orphaned event listeners, timers, and DOM widgets turn into zombie UI and leaked memory. Every registration helper on the Extension base class returns and tracks a Disposable ({ dispose: () => void }) automatically.
ExampleExtension lifecycle and Disposable tracking (TS)
import { Extension } from 'noether';
export default class ExampleExtension extends Extension {
async onload() {
// 1. Registering a command returns a Disposable tracked by the extension
this.addCommand({
id: 'example:greet',
title: 'Show Greeting',
action: (app) => app.workspace.showToast('Hello from extension!'),
});
// 2. Event subscriptions are also tracked automatically
this.onEvent('document:saved', (data) => {
console.log('Saved note:', data.title);
});
// 3. Intervals and custom resources can be tracked automatically or manually
this.registerInterval(() => this.tick(), 60000);
}
onunload() {
// Standard registrations are cleaned up automatically.
// Custom non-disposable cleanup can be placed here.
}
}When app.extensions.disableExtension(id) runs:
extension.unload()callsextension.onunload().- All tracked disposables are invoked and cleared.
- Extension-scoped database cascade listeners and Web Workers terminate (
dbManager.cleanupExtension()andworkerPool.terminateExtension()).
4. Namespacing and Extension Isolation
To avoid name collisions between independent extensions:
- Action Rail, Sidebar, & Status Bar IDs: Automatically prefixed by
Extensionmethods as${extensionId}:${itemId}(along with editor plugins and transform hooks). - Command IDs: Stored verbatim by
CommandRegistry(withextensionIdtracked as metadata), so extensions should prefix their ownidvalues (e.g.,my-ext:do-thing). - MCP Tool & Prompt Names: Automatically prefixed as
${extensionId}_${toolName}. - Key-Value Storage:
loadData()andsaveData()store JSON per extension inlocalStorageundernoether_extension_data_${extensionId}, while installed extension bundles live on disk under.noether/extensions/${extensionId}/. - Database Tables: Tables created via
this.defineTable()are physically namedext_${extensionId}_${tableName}in SQLite to prevent cross-extension schema collisions.
5. Dark and Light Theme Modes
Noether separates visual themes from dark/light appearance modes:
- Independent Mode Setting: The appearance setting (
themeMode: 'system' | 'dark' | 'light') is separate from the selected theme (activeTheme). Users can switch dark and light modes without resetting their active theme. - Theme Mode Support: Themes declare supported modes via
modeSupport: 'both' | 'dark-only' | 'light-only'. Single-mode themes enforce their designed aesthetic, while dual-mode themes adapt dynamically to the active mode. - Automatic Token Resolution: When activating a theme,
resolveThemeTokens()merges base variables withmodes.lightoverrides for light mode sessions, producing a single resolved token tree. - Surface Color Generation: Themes compile through
generateCssVariables(), which creates consistent surface tokens (--noether-btn-hover-bg,--noether-btn-active-bg,--noether-bg-card,--noether-bg-popover) across both modes.
6. Related Reading & References
- Noether SDK API Reference: Inspect all classes, lifecycle hooks, and service locators.
- Dual-Storage Architecture: How the host coordinates filesystem I/O with SQLite metadata.
- UI Extension Points: Learn how to register commands, ribbons, and modals.
- Model Context Protocol (MCP) Tools: Expose safe AI agent tools with JSON schema and Zod.
- Developer Policies & Guidelines: Rules for privacy, stability, and desktop performance.