Orient: what LegalWork is and how it's built
The fastest path from "never seen this repo" to knowing what the product does, the rules you build under, and how the UI is structured.
Dependency rules (enforced, all verified by madge --circular: zero cycles)
src/app/andsrc/i18n/never import fromsrc/react-app/orsrc/components/. If something in the agnostic layer needs UI behavior, invert it (callback registration) or move the primitive down.- Leaf modules (
runtime-env,desktop-types,den-types,extensions) import nothing (or types-only from other leaves). Low-level clients (opencode,legalwork-server,den) import leaves — never theutils/barrel (it drags in i18n). kernel/andinfra/sit belowdomains/: they must not import domain code. Shared query/state infrastructure lives ininfra/.shell/sits on top and may import everything.- Wire contracts shared with other processes live in
packages/types(e.g.WorkspaceWire); producer types assert assignability against them.
Toasts are rendered with sonner (@/components/ui/sonner), mounted once via
<Toaster /> in shell/providers.tsx, driven imperatively with toast().