Architecture and Lifecycle
The root launcher module — module map, startup sequence, classloading, the bytecode pipeline, events, threading, readiness, shutdown, and Gradle ownership.
Covers the root launcher module (src/main/java/dev/n3u): module map, startup sequence, classloading, patching, generated resources, events, threading, readiness, shutdown, and ownership between the Gradle modules. Accepted rationale lives in docs/development/DECISIONS.md in the repository; the injection DSL itself is documented in Injection DSL; build/validation workflows in docs/development/GITHUB.md. Every claim cites a current source path or symbol; anything not source-backed is labeled inference or an open question. Live runtime behavior is not asserted from source inspection (docs/development/FOUNDATION.md keeps live startup a separate gate). Source of truth: docs/development/architecture.md in the n3Client repository.
1. Module map
From settings.gradle.kts (only these four includes; the root project is N3Client):
| Module | Role | Compile-time dependencies | Runs where |
|---|---|---|---|
root (build.gradle.kts) | Launcher/host: bootstrap, classloading, injection, patching, packaging | :base-api (implementation), pinned upstream runtime (guava/guice/logback versions derived from the pinned manifest by getRuneLiteArtifacts, build.gradle.kts:165), ASM, gson, jbsdiff | The client JVM. Main-Class: dev.n3u.N3Client (build.gradle.kts jar and shadowJar manifests) |
base-api | Shared contracts: dev.n3u.api N-interfaces, events, services, reflective host handles (dev.n3u.model), ClientPaths/Static/N3ClientOptions, logging; also exceptions, headless, packets | No project dependencies (verified: base-api/build.gradle.kts has no project(...) references); guice is compileOnly; vendored upstream net.runelite.api snapshot lives here | Loaded into the client (embedded as api.jarData) and reused by manager |
api | Higher-level services: dev.n3u.api.{entities,game,handlers,loadouts,threaded,widgets}, plus dev.n3u.{data,queries,services,ui,util} | :base-api (compileOnly), net.runelite:client (compileOnly, api/build.gradle.kts) | Embedded as api.jarData, loaded through RLClassLoader |
plugins | Six bundled plugins (authgen, bankvaluer, breakhandler, codeeval, multiclientutils, profiles) | :api, :base-api, net.runelite:client (all compileOnly, plugins/build.gradle.kts) | Embedded as plugins.jarData, injected into RuneLite's core plugin list (runelite/Install.java:24) |
manager | Standalone desktop application, separate entrypoint dev.n3u.manager.ui.ManagerApp | :base-api only (manager/build.gradle.kts) | Its own JVM/fat jar (scripts/run-manager.bat / run-manager.sh); never embedded in the client runtime. Owned by the Manager guide |
Vendored upstream code: base-api/src/main/java/net/runelite/api (plus annotations, clan, gameval, widgets subpackages — DBTableID lives under gameval/) is refreshed only by :base-api:syncRuneliteApi (base-api/build.gradle.kts:86), which downloads selected files from runelite/runelite at ref runelite-parent-<runeliteVersion> (runeliteVersion = 1.13.6, build.gradle.kts:12). Attribution: THIRD_PARTY_NOTICES.md in the repository. Per AGENTS.md, review overwritten local sources after each refresh.
Root-module package map
| Package | Purpose | Key symbols |
|---|---|---|
dev.n3u | Entrypoint only | N3Client |
dev.n3u.bootstrap (+ beans) | Pinned-artifact bootstrap | RLUpdater, Properties, GradleUtils, JdkVersionUtil; beans Bootstrap, Artifact, Diff, Platform, Update |
dev.n3u.classloader | Client classloading | RLClassLoader, ProxyClassBuilder, ProxyClassProvider |
dev.n3u.client | Startup orchestration | Main, Versioning |
dev.n3u.injector (+ annotations, pipeline, types, util, util/expreditor) | Dev-time bytecode injection | Injector (gamepack), RLInjector (RuneLite), OSGlobalMixin, RLGlobalMixin; DSL reference: Injection DSL |
dev.n3u.mixins | 26 active gamepack mixins (27 files — NDeviceIDMixin.java is fully commented out) attaching the N* API surface to game classes | Injection DSL, Mixin catalogs |
dev.n3u.rlmixins | 18 RuneLite-host mixins | Injection DSL, Mixin catalogs (rlmixins) |
dev.n3u.model | Loaded-artifact model and bytecode condition enums | Libs, Artifact, ConditionType |
dev.n3u.patch | Binary patch generation/application | PatchGenerator, PatchApplier, BytecodePatcher, PatchInputs, PatternBuilder |
dev.n3u.runelite (+ jvm) | Host integration and JVM parameters | Install, ClientUIUpdater, ShellTheme, ClassByte; JvmParams, HardwareAccelerationMode, OS |
dev.n3u.util (+ asm, dto) | Launch/classpath/mapping/ASM helpers | MappingProvider, SignerMapper, PackageUtil, ArtifactReader, JarDumper, JVMLauncher, HashUtil, BytecodeBuilder, ClassNodeUtil, GamepackClassWriter, InsnUtil; DTOs JClass/JField/JMethod |
src/main/resources | Runtime resources | see section 4 |
src/foundationFixture | External-plugin acceptance fixture (built by foundationFixtureJar, build.gradle.kts:366) | — |
2. Entrypoint and startup sequence
Two stages, both required to pass the -safeLaunch gate.
Stage 0 — dev.n3u.N3Client (N3Client.java:9). If -safeLaunch is absent, main relaunches dev.n3u.client.Main in a fresh JVM via JVMLauncher.launchInNewJVM with a classpath that prepends this jar's code source (buildFullClasspath, N3Client.java:26), then System.exit(0). Any exception becomes IllegalStateException("n3Client startup failed"). Accepted basis: D02/D08 (retained native startup, dev.n3u identity).
Stage 1 — dev.n3u.client.Main (Main.java:53), in order:
- Static initializer (
Main.java:37-46): createClientPaths.CACHE, redirectjava.io.tmpdirinto it, setn3client.logs, selectn3client-logback.xmlas the logback config (src/main/resources/n3client-logback.xml: console appender + 10 MB/30-day rolling file appender into${n3client.logs}). LogFileManager.initialize()(base-api/.../logging/LogFileManager.java) tees stdout/stderr into daily log files and registers a JVM shutdown hook to flush and restore the streams (LogFileManager.java:62; the codebase's other hook is the hot-swapper's, section 5).- Parse
N3ClientOptions(base-api/src/main/java/dev/n3u/N3ClientOptions.java). Flags:rsdump,noPlugins,incognito,safeLaunch,min(impliesnoPlugins+noMusic),noMusic,proxy,launcherCom(port),disableMouseHook,legacyLogin,jagexLogin,runInjector,targetBootstrap,world,autoEnterGame. Without an audio device,_checkAudioforcesnoMusic(skipped while-Dn3client.generatePatches=true,Main.java:58). Missing-safeLaunchaborts withIllegalStateException("Use the n3Client entrypoint or -safeLaunch")(Main.java:61-63) — the gate is re-checked here so bypassing stage 0 fails fast. - Early option effects (
Main.java:64-84):ProxyManager.process,AutoLogin.setCredentials(legacy or Jagex login; arguments only, never persisted here),forced.runelite.versionsystem property fromtargetBootstrap,WorldSetter.setWorld. - Create
ClientPaths.REPOSITORYandCACHE; setn3client.cacheHome(consumed by the gamepackuser.homerewrite,injector/OSGlobalMixin.patch). JvmParams.set()(runelite/jvm/JvmParams.java:10): hardware-acceleration params fromHardwareAccelerationMode.defaultMode(OS.getOs()), macOS appearance property,runelite.launcher.version— all as system properties.RLUpdater.run()(bootstrap/RLUpdater.java:41): parse the pinned manifestsrc/main/resources/dev/n3u/bootstrap/pinned-bootstrap.json(43 artifacts, each withname/path/hash/sizeand optional per-release clientdiffsentries). IftargetBootstrapwas given it must equal the manifest version or startup aborts (IOException("Unsupported RuneLite version: ..."),RLUpdater.java:70). Every platform-matching artifact is checked for existence and SHA-256 (HashUtil.computeSha256). On any mismatch the whole repository directory is deleted and every artifact re-downloaded and re-verified; a second mismatch aborts startup (RLUpdater.java:96-136). The remote launcher-properties fetch (bootstrap/Properties.fetch) is currently bypassed —run()builds a local map with onlyrunelite.launcher.version(RLUpdater.java:43).loadArtifacts()(Main.java:122): every repository jar whose file name does not containguice,javax,guava,logback-core,logback-classic, orslf4j-api(substring filter,Main.java:126-134) becomes a classpath URL.ArtifactReader.read(util/ArtifactReader.java:16) splits classes intoLibsbuckets by package:net.runelite.*→runelite, gamepack jar →gamepack, everything else →other; signed entries record certificates and their jar URL for later reuse. Failure:IllegalStateException("Unable to load pinned client artifacts").SignerMapper.map()scans for cert-checked classes; those classes are later loaded from their original signed jars, not from modified bytecode.loadClassLoader()(Main.java:150): twoRLClassLoaderinstances over the same URLs —CLASSLOADER(the runtime loader) andCTX_CLASSLOADER(theClassWriterclass-lookup context used byClassNodeUtil.toByteswhen computing frames,util/asm/ClassNodeUtil.javatoBytes). When not running from a shaded jar,UIManager.put("ClassLoader", CLASSLOADER); the thread-context loader is set;Static.set(CLASSLOADER, "CLASSLOADER")(first write wins,Static.set).- Bytecode phase, exactly one of:
- Injector mode —
-runInjectoror-Dn3client.generatePatches=true:PatchGenerator.enableCapture()→Injector.patch()(gamepack) →RLInjector.patch()(RuneLite) →PatchGenerator.writePatchesZip(n3client.patchOutput)(Main.java:93-103). Used by thegenerateClientPatchesbuild task and IDE development. - Patch mode (production):
PatchApplier.applyPatches()(Main.java:105). With-Dn3client.generatePatches=truethe process writes branding assets into the patch output and exits without launching (Main.java:107-111).
- Injector mode —
MappingProvider.getMappings().clear()— obfuscated-name mappings are only needed during injection; the static loader notes it "will fail in release builds" if mappings.json is absent (util/MappingProvider.javastatic block).- Readiness: with
-launcherCom <port>,LauncherCom.sendReadySignal(port, "Done")opens a TCP socket to localhost and printsDone(base-api/.../util/LauncherCom.java:8); failure is ignored ("launcher may have already exited"). CLASSLOADER.launch(args)(classloader/RLClassLoader.java:64): reflectively invokesnet.runelite.client.RuneLite.mainwith--disable-telemetryappended.Install.install()(runelite/Install.java:37): reads the Guice binding fornet.runelite.api.Clientout of RuneLite's injector and stores it viaStatic.set(..., "RL_CLIENT")— the point whereStatic.getClient()becomes usable.Logger.norm("N3Client started. - Did you know... ")(Main.java:119).
Failure and recovery summary
Startup is fail-fast: every step above throws and aborts. The only self-healing path is the bootstrap re-download; patch application verifies before, during, and after (section 4). No retry loops exist elsewhere; there is no fallback to unpatched bytecode. One exception inside RuneLite startup: built-in plugin injection is best-effort — Install.injectBuiltInPlugins swallows any exception with a stack trace (runelite/Install.java:31-34), leaving plugins silently absent, while a missing plugins.jarData resource reaches System.exit(1) from inside RuneLite startup (Install.java:44-47).
3. Classloading model
RLClassLoader extends URLClassLoader with Main.class.getClassLoader() as parent (classloader/RLClassLoader.java:29). Its constructor extracts the embedded api.jarData resource to a temp file in the cache and adds it as a URL (RLClassLoader.java:31); plugins.jarData is extracted lazily by Install.getBuiltIns (runelite/Install.java:53 reads the resource, :55 writes the cache temp file) when core plugins load — invoked from the injected PluginManagerMixin.loadCorePlugins bytecode (rlmixins/PluginManagerMixin.java:166), not during Install.install() (§2 step 15).
loadClass resolution order (RLClassLoader.java:86):
- Already-loaded classes.
SignerMapper.shouldIgnore(name)→ load the class from its original signed jar (loadClassFromSignedJar), building aCodeSourcewith the jar's certificates; if signers cannot be restored, throw. Modified bytecode is never used for these classes.- Generated proxy classes from
ProxyClassProvider.PROXY_CLASSES— currently a single runtime-built classnet.runelite.proxies.PluginPanelProxy(superclassnet.runelite.client.ui.PluginPanel, constructors()Vand(Z)V,classloader/ProxyClassBuilder.java). - Gamepack bytes by name (
Main.LIBS.gamepackByName) — any name, so obfuscated game classes resolve here. - Anything not under
net.runelite.with no bytes → parent loader. - RuneLite/other bytes from
Libs.classByName. defineClassafter a0xCAFEBABEmagic check (loadArtifactClass); a define failure prints the error and callsSystem.exit(0)(RLClassLoader.java:183) — the classloader treats malformed injected bytecode as unrecoverable.- Fall through to the parent loader if nothing matched.
Protection domains map classes back to their original jar URL and certificates from Libs.getClassCerts()/getUrls() (makeProtectionDomainFor). addResource/getResourceAsStream serve in-memory byte arrays ahead of jar resources. Public surfaces: Main.CLASSLOADER / Main.CTX_CLASSLOADER statics and Static.getClientClassLoader(). lookupClass(name, bytes) is an internal define fallback whose only caller is RLClassLoader.loadClass(String, byte[]) (RLClassLoader.java:197); the hot-swap plugin loader is a separate dev.n3u.services.hotswapper.PluginClassLoader constructed over Static.getClassLoader() (api/.../services/hotswapper/PluginReloader.java:55).
Invariants: one class identity per RLClassLoader; signed classes must keep their certificates (D05's host boundary relies on this for cert-checked game code); gamepack bytes always win over parent lookups for game classes.
4. Bytecode pipeline: injection (dev) and patches (production)
Both modes produce identical gamepack/RuneLite bytecode: injector mode transforms ASM ClassNodes directly and (optionally) records the diffs; production mode replays those recorded diffs. The DSL, transformers, and mixin catalogs are documented in Injection DSL; this section covers lifecycle only.
- Injector mode (
Injector.patch,injector/Injector.java:29): loads ~17.5k gamepack classes (full frame expansion only for mixin targets), applies interfaces + mixins, then per class appliesFieldHookTransformer.instrumentandOSGlobalMixin.patch, writes modified bytes back intoLibs.gamepack, and an annotation-stripped copy intoLibs.gamepackClean(used for-rsdumpviaJarDumper.dump).RLInjector.patch(injector/RLInjector.java) does the same againstLibs.runelitewith thedev.n3u.rlmixinspackage plusRLGlobalMixin(currently empty,injector/RLGlobalMixin.java). - Patch artifacts:
PatchGenerator.writePatchesZip(patch/PatchGenerator.java:134) writesdev/n3u/patches.zipwith entriesgamepack/<class>.diff,runelite/<class>.diff, andmetadata.properties(namespace, patch counts, per-input hashes written byPatchInputs.append). Diffs are only recorded for classes whose bytes actually changed (BytecodePatcher.isIdenticalguard). - Patch mode (
PatchApplier.applyPatches,patch/PatchApplier.java:28): streamspatches.zipentry-by-entry, verifies metadata (PatchInputs.verify), verifies each input class hash before applying (PatchInputs.verifyInput), reconstructs bytes withBytecodePatcher.applyDiff(jbsdiff,io.sigpipe:jbsdiff:1.0inbuild.gradle.kts), and enforces exact patch counts (verifyCounts). Failures: missing zip →IllegalStateException("Generated patches are missing"); zero-count sets →"Required native patch sets are empty"; any original-hash mismatch, extra entry, or shortfall aborts startup. This is F07's fail-fast contract (docs/development/FOUNDATION.md). - Build integration (
build.gradle.kts):copySubmoduleJar/copySubmoduleJar2(build.gradle.kts:77,:89) rename:api:jar→api.jarDataand:plugins:jar→plugins.jarDataintobuild/generated/embedded;generateClientPatches(build.gradle.kts:324) runsdev.n3u.client.Main -safeLaunch -runInjectorheadless with-Dn3client.generatePatches=true,n3client.homeinbuild/patch-workspace, and outputbuild/generated/patches;processResourcesdepends on both and excludes stale source-tree copies ofpatches.zip,jarData, and the listed icons (build.gradle.kts:337-344).sourceSets.mainaddsbuild/generated/embeddedandbuild/generated/patchesas resource dirs (build.gradle.kts:312-315). Never hand-editbuild/generated/**.
Runtime resource map (src/main/resources)
| Resource | Consumer |
|---|---|
dev/n3u/bootstrap/pinned-bootstrap.json | RLUpdater artifact pinning; also drives build dependency versions (getRuneLiteArtifacts) |
dev/n3u/injector/mappings.json | MappingProvider (injection-time obfuscated-name resolution) |
n3client-logback.xml | Logging config (selected in Main static init) |
dev/n3u/client/*.png | Branding/icons; regenerated into patch output by ClientBranding.writeAssets during patch generation |
dev/n3u/api.jarData, dev/n3u/plugins.jarData, dev/n3u/patches.zip | Generated only — embedded API/plugins and binary patches |
Packaging
shadowJarRelease (build.gradle.kts:255) builds the release fat jar: excludes dev/n3u/injector/**, dev/n3u/mixin/**, dev/n3u/rlmixin/**, mappings.json, dev/n3u/services/pathfinder/ui/**, signature files, module-info.class, and all net/runelite/api/** constant classes except the four whitelisted gameval classes; merges Swing LookAndFeel and FileSystemProvider service files. Note the exclusion literals spell mixin/rlmixin while the actual packages are mixins/rlmixins; no automated check covers this today — check_distribution.py verifies archive contents, Main-Class, N-class presence and patch metadata, but not mixin retention (its only related reference is the obsolete-name check TDeviceIDMixin, scripts/check_distribution.py:50), which strengthens the open question below. packageRelease (build.gradle.kts:377) zips N3Client.jar (renamed shadow jar), LICENSE, THIRD_PARTY_NOTICES.md, and the platform scripts (LF-normalized for Linux/macOS). publishRelease shells out to a hard-coded local gh.exe path — a local release convenience, not a CI gate.
5. Events, threading, readiness, shutdown
Events
Owned event types live in base-api/src/main/java/dev/n3u/events: PacketReceived, PacketSent, BankCacheChanged. Delivery is RuneLite's event bus, wrapped reflectively: Static.post (base-api/.../Static.java:169) → RLEventBus.post (base-api/.../model/RLEventBus.java:20), which reflects EventBus.post(Object) and logs (does not rethrow) failures. Producers found in source: NServerPacketLoggerMixin posts PacketReceived, NPacketWriterMixin posts PacketSent, api/dev/n3u/services/BankCache posts BankCacheChanged; login-related LoginMessage/LoginResponse (dev.n3u.data) are posted by NGameEngineMixin. Consumers: packet events go two ways — they are posted to the bus via Static.post and delivered to N3ClientOptionsPanel by direct calls from the producing mixins (NPacketWriterMixin.java:90 and NServerPacketLoggerMixin.java:80 invoke N3ClientOptionsPanel.getInstance().onPacketSent(...)/onPacketReceived(...) right after Static.post); the panel handlers (N3ClientOptionsPanel.java:674, :724) carry no @Subscribe and never register on the bus. True bus consumers (@Subscribe): GameManager (LoginResponse, GameManager.java:801-802) and BankValuerPlugin (BankCacheChanged). EventBusMixin (rlmixins/EventBusMixin.java) edits EventBus.register to remove a Preconditions.checkArgument call; the edit has no shape guard — after upstream drift the @Insert becomes a generation-time stderr miss (injector/pipeline/InsertTransformer.java:71) and the checkArgument removal silently does not happen — and its motivating purpose is inference (registration validation is being loosened; exact rationale not recorded in source).
Threading model
- Client thread: all game-state reads/writes go through
Static.invoke/Static.invokeLater/Static.invoke(Supplier)/Static.invokeLater(Supplier)(Static.java:101+). Off-thread calls are routed to RuneLite'sClientThreadviaRLClientThread(base-api/.../model/RLClientThread.java:51), which reflects the chainRuneLite.rlInstance→clientUI→clientThreadProvider.get(); therlInstancestatic field is added byRuneLiteMixin.main(rlmixins/RuneLiteMixin.java). On-thread calls run directly. - EDT: Swing mutation stays on the Event Dispatch Thread (ownership rule in DECISIONS).
ClientUIMixininjectsClientUIUpdater.inject()intoClientUI's init lambda, so its Swing re-styling runs in ClientUI init context (inference: EDT because RuneLite initializesClientUIon the EDT; not verified at runtime). - Plugin loop:
NPlugin.loop()runs at the start of every game tick, is safe to sleep in, and is not thread-safe — documented in External Plugins (owning guide). - Workers: persistence/network work belongs on workers with explicit shutdown ownership (DECISIONS ownership model; per-service ownership is the owning service guide's topic).
Readiness
Two readiness signals exist: the launcher-com TCP "Done" (step 13 of the startup sequence, sent after bytecode preparation and before RuneLite starts) and Install.install()'s RL_CLIENT binding (the point where plugin-facing Static.getClient() works). Versioning.getLiveRuneliteVersion() (root module, client/Versioning.java:15, delegating to RuneliteConfigUtil.getRuneLiteVersion()) reports the running RuneLite version at runtime.
Shutdown
Two JVM shutdown hooks exist in the codebase: LogFileManager's flush-and-restore hook (base-api/.../logging/LogFileManager.java:62, registered at startup) and the hot-swapper's plugin-classloader cleanup hook (api/.../services/hotswapper/PluginReloader.java:36, registered inside PluginReloader.init() when the hot-swapper initializes; it cleans up all loaded PluginContexts). There is no n3Client-owned ordered shutdown sequence in source; teardown otherwise follows RuneLite's own shutdown path, which n3Client does not replace — the host mixins only neutralize the updater (UpdaterMixin.tryUpdate is an empty @MethodOverride) and the legacy cache import (RuneLiteMixin.isolateStorage empties copyJagexCache). Static.resetForRecovery() clears the cached client/RuneLite/classloader references but currently has no callers in src/ or the modules (open question below).
6. Ownership and dependency directions
Direction invariant: dependencies point toward base-api; nothing depends on the root project; the root project is the composition root that embeds api and plugins at build time (as copied resources, not Gradle dependencies).
| Edge | Kind | Evidence |
|---|---|---|
root → base-api | implementation — the root's only project dependency | build.gradle.kts:226 |
api → base-api | compileOnly | api/build.gradle.kts dependencies |
plugins → api, plugins → base-api | compileOnly (plus net.runelite:client compileOnly) | plugins/build.gradle.kts |
manager → base-api | implementation | manager/build.gradle.kts |
root → api, root → plugins | not Gradle dependencies — their jars are copied into resources as api.jarData/plugins.jarData | copySubmoduleJar/copySubmoduleJar2, build.gradle.kts:77, :89 |
base-apinever imports root/api/pluginsclasses (verified from its build file) and has no compile-time dependency on the RuneLite client — host access is behind reflective handles (dev.n3u.model.RuneLite,Guice,RLEventBus,RLClientThread,RLClientUI,PluginManager,GameApplet).apiandpluginscompile against the real RuneLite client (compileOnly) and the embedded jars are what ship;pluginsproduces its own versioned jar (plugins/build.gradle.kts, version1.11.19.1).- Lifecycle ownership: the retained native injector/loader owns startup (D02, DECISIONS "Ownership model": one lifecycle owner per host); the manager is a separate process with its own guide (the Manager guide).
- Storage ownership:
ClientPathsdeclares the client's owned paths (n3client.homeroot, default%USERPROFILE%\.n3client, withrunelite/,client/,logs/,repository/,cache/;base-api/.../ClientPaths.java:7-17); two other directories under that root are notClientPathsfields —jdk/is provisioned by the Windows launch script (JDK_DIR=%USERPROFILE%\.n3client\jdk,scripts/run-windows.bat:5), and the manager derives its data directory asClientPaths.ROOT.resolve("manager")(manager/.../db/Database.java:16-18). The sideload directory stays at~/.runelite/sideloaded-plugins(D15; enforced in the host byPluginManagerMixin.preserveSideloadedPluginsredirectingSIDELOADED_PLUGINStoClientPaths.PLUGINS).
7. Accepted vs inferred rationale
Accepted (from DECISIONS — do not re-derive): D02 native injector/loader retained; D05 dual-host support with bridges confined to the legacy-host adapter; D07/D08 dev.n3u N-naming and package identity; D09 fresh data/no import; D10 no release channel for the current milestone; D15 sideload path exception; the JDK 25 build / --release 11 artifact boundary (DECISIONS "Compatibility boundaries" + docs/development/GITHUB.md).
Author-stated, not measured here (code comments — treat as claims, not receipts): memory rationale for the pre-sized gamepack map ("saves 20-30MB", Injector.java:26), selective frame expansion ("saves 200-300MB", Injector.java:45), and PatchApplier's streaming rationale (PatchApplier.java:21-23).
Inference (labeled): EventBusMixin's purpose (see Events); EDT context for ClientUIUpdater.inject(); ProxyClassProvider existing so external/plugin code can extend PluginPanel through the client classloader (single generated proxy; no written rationale); the min-mode plugin allow/disallow prefix lists in PluginManagerMixin representing an intentional core-plugin curation (behavior verified, intent not recorded).
Open questions (no source answer; tracked in the repository's issue tracker):
shadowJarReleaseexcludesdev/n3u/mixin/**anddev/n3u/rlmixin/**but the packages aredev/n3u/mixins/dev/n3u/rlmixins— confirm whether release jars are expected to retain mixin classes and either fix the literals or document the intent. Exit criterion: build-file confirmation recorded in the guide or DECISIONS, withcheck_distribution.pyoutput as evidence.Static.resetForRecovery()has no production caller — confirm its intended recovery flow or remove it from the contract. Exit criterion: caller identified or API removed.- No ordered shutdown sequence exists in source; document the intended client teardown contract (what must flush before JVM exit beyond LogFileManager) once decided. Exit criterion: shutdown contract section backed by an implemented hook or an explicit decision that RuneLite's shutdown is authoritative.
8. Tests
Root-module tests (src/test/java): JdkVersionTest, StorageIsolationTest, patch/PatchInputsTest (patch metadata verification), lookup/PluginLookupTest (+ LookupSubscriber helper). PatchInputsTest covers the patch-integrity contract described in section 4; StorageIsolationTest covers the ClientPaths fresh-root contract (section 6). Test conventions and the full module test map: Development Testing.
9. Known limits
- All bytecode-pipeline behavior above is asserted from source inspection; the foundation's live receipts (
docs/development/FOUNDATION.md,docs/development/VALIDATION.md) predate current code, and packaged startup on the newest branding commit has not been revalidated (FOUNDATION.md records this gap). RLGlobalMixin.patchis empty — the RuneLite-side "global mixin" hook exists but applies nothing (injector/RLGlobalMixin.java).bootstrap/Properties/GradleUtils/JdkVersionUtilsupport the upstream launcher's remote version discovery; onlyJdkVersionUtil.calculateJreVersion()(returnsjava.version) has a live caller today —RLUpdaterbypassesProperties.fetch(section 2, step 7).BytecodePatcher.createFullPatchis a TODO stub in source (patch/BytecodePatcher.java); only jbsdiff deltas are used.patch/PatternBuilder(patch/PatternBuilder.java) has no callers outside its own file — a pattern-building helper retained for future patch work (inference from absence of references; verified by a repository-wide symbol scan during the guide's authoring session).
Development Overview
The n3Client development tracker — document ownership map, current handoff state, working protocol, agent navigation, and source authority rules.
Injection DSL
The n3Client bytecode injection DSL — annotations, transformers, mixin pairing, the gamepack and RuneLite mixin catalogs, and pipeline failure behavior.