System architecture
The system separates presentation, decisions and game observations. The desktop uses Tauri and a local Node engine; the Companion runs Lua inside WoW. They do not share a network connection.
- 01WoW + TSM
Bags, mail, recipes, accounting
- 02Saved files
TradeSkillMaster.lua · AppData.lua
- 03D&P engine
Read → validate → calculate → explain
- 04Desktop + Companion
Choose a plan, then act in TSM
Responsibilities
| Layer | Responsibility | Boundary |
|---|---|---|
| Tauri / Rust | Window, engine lifetime, native exports, allowed navigation | No economic formulas |
| Node / AppStore | Source reads, analysis, persistence, local API | No game actions |
| HTML / CSS / JavaScript | Presentation, filters and user intentions | Receives a calculated snapshot |
| Companion / Lua | Inventory, native observations, local decisions, TSM preparation | Transactions confirmed in game |
| VitePress / Vue | This static documentation | Dependencies separate from the application |
From file to screen
AppStore reads allowed files, normalizes TSM, builds analysis, then returns, performance, restocking and session views. Persistent reads and writes are coordinated; a read failure does not turn missing information into zero stock. The interface consumes /api/state. Not every detailed internal ledger is exposed in that snapshot.
The engine listens on 127.0.0.1 using an OS-assigned port. Tauri starts the shipped Node runtime, receives the session URL and manages process lifetime. Shutdown and the instance lock prevent uncoordinated engines from modifying the same state.
Why these boundaries
Pure Node financial modules are testable without WoW. The Companion operates within client constraints and applies a subset of rules; it is not an identical second execution of the desktop engine. See Companion and decisions.
An interface change must not move formulas into the DOM. A new source must specify identity, age, scope and failure behavior before influencing recommendations. A new game action remains an exported intention controlled by the player.
