Wave 6 Track B: Boundary cleanup + documentation#1389
Merged
breznknecht merged 4 commits intomainfrom Apr 1, 2026
Merged
Conversation
Move misclassified modules to their correct architectural layers: - MingaEditor.UI.Devicon → Minga.Language.Devicon (pure filetype-to-icon mapping) - MingaEditor.UI.Highlight.Grammar → Minga.Language.Grammar (filetype-to-treesitter ETS registry) - MingaEditor.UI.Highlight.Span → Minga.Language.Highlight.Span (pure data struct) - MingaEditor.UI.Highlight.InjectionRange → Minga.Language.Highlight.InjectionRange (pure data struct) - MingaEditor.UI.Popup.Rule → Minga.Popup.Rule (pure data struct with validation) - MingaEditor.UI.Popup.Registry → Minga.Popup.Registry (ETS registry) Extract parser protocol into Layer 0: - Create Minga.Parser.Protocol with all tree-sitter encode/decode functions - MingaEditor.Frontend.Protocol delegates parser functions to it - Parser.Manager now uses Minga.Parser.Protocol (no Layer 2 dependency) Replace direct cross-layer calls with events: - Config.Loader theme loading → :load_user_themes event (Editor subscribes) - Parser.Manager log_to_messages → :log_message event broadcast Also fixes bonus violations found during audit: - Minga.LSP.SemanticTokens → was using MingaEditor.UI.Highlight.Span - Minga.Editing.Comment → was using MingaEditor.UI.Highlight.InjectionRange Thin delegate modules at old paths preserve backward compatibility for MingaEditor callers. The @allowed_references list in the credo check now contains only structural dispatch entries (Protocol → Protocol.GUI). 35 files changed. All 7,418 tests pass. make lint clean.
…e sections Update docs/ARCHITECTURE.md with three new sections: - Three-Namespace Architecture: explains Minga/MingaAgent/MingaEditor layer structure and the credo check that enforces it - Headless Runtime: Minga.Runtime.start/1 and what it boots - API Gateway: WebSocket + JSON-RPC, method names, event streaming Update AGENTS.md module grouping table to reflect the three-namespace layout with Layer 0/1/2 sections replacing the old single flat table. Update docs/PLAN-runtime-first.md progress log and discoveries with Wave 6 Track B findings.
File tree integration tests were intermittently flaky (~1-2 out of 20 runs) because the file tree scanned Project.root() (the real project directory) instead of each test's tmp_dir. Concurrent async tests creating/deleting files shifted the entry list between operations. The fix adds a project_root field to FileTreeState. When set, Commands.FileTree.open/1 uses it instead of Project.root(). Tests pass project_root: dir through start_editor opts so each test's file tree scans only its own fixture directory. Also tightened expand/collapse assertions to check for specific file content (gamma.txt visible/hidden) instead of comparing row counts, which were a weak signal even without the concurrency issue. Changes: - lib/minga_editor/state/file_tree.ex: add project_root field - lib/minga_editor/commands/file_tree.ex: use project_root in open/1 - lib/minga_editor/startup.ex: thread project_root from editor opts - lib/minga_editor/state.ex: preserve project_root in tab context snapshots - test/support/editor_case.ex: thread project_root to editor_opts - test/minga_editor/integration/file_tree_test.exs: pass project_root, tighten assertions - test/minga_editor/commands/file_tree_editing_test.exs: pass project_root - test/minga_editor/commands/file_tree_reveal_test.exs: pass project_root - test/minga_editor/file_tree_integration_test.exs: pass project_root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Resolves the 9 pre-existing Layer 1→2 violations tracked in #1368, plus updates documentation to reflect the runtime-first architecture.
PR B-6.1: Resolve Layer violations
6 modules moved to correct layer (Layer 0):
MingaEditor.UI.Devicon→Minga.Language.DeviconMingaEditor.UI.Highlight.Grammar→Minga.Language.GrammarMingaEditor.UI.Highlight.Span→Minga.Language.Highlight.SpanMingaEditor.UI.Highlight.InjectionRange→Minga.Language.Highlight.InjectionRangeMingaEditor.UI.Popup.Rule→Minga.Popup.RuleMingaEditor.UI.Popup.Registry→Minga.Popup.RegistryParser protocol extracted to Layer 0:
Minga.Parser.Protocolwith all tree-sitter encode/decode functionsMingaEditor.Frontend.Protocoldelegates parser functions to itMinga.Parser.ManagerusesMinga.Parser.Protocoldirectly (no Layer 2 dep)Cross-layer calls replaced with events:
:load_user_themesevent broadcast:log_messageevent broadcastBonus fixes:
Minga.LSP.SemanticTokensandMinga.Editing.Commenthad undiscovered violations (fully qualified struct references the credo check doesn't catch).Thin delegate modules at old paths preserve backward compatibility for existing MingaEditor callers.
PR B-6.2: Documentation pass
docs/ARCHITECTURE.md: Three-Namespace Architecture, Headless Runtime, API GatewayAGENTS.mdmodule grouping table for three-namespace layoutdocs/PLAN-runtime-first.mdprogress log and discoveriesVerification
make lintpasses (format + credo + compile + dialyzer)mix test.llm: 7,418 tests, 0 failures@allowed_referencescontains only structural dispatch entries (Protocol → Protocol.GUI)alias MingaEditor/import MingaEditorinlib/minga/orlib/minga_agent/Closes #1368