LeafConfig¶
Universal server configuration atlas, third-party plugin JAR introspector, and standalone browser workspace for Paper, Folia, and Spigot (leafconfig-ADR-001, leafconfig-ADR-002).
Overview¶
LeafConfig scans installed plugin JARs (plugins/*.jar) and server configuration files off-thread in under 5 ms per archive without classloading. It restores author YAML comments that Bukkit's saveConfig() stripped from disk, infers numeric ranges, enum options, and spatial map gizmos directly from plugin bytecode constant pools and method call sites, and exports a self-contained single-file browser workspace (leafconfig-workspace.html).
When installed alongside LeafRTP and LeafSleuth, LeafConfig renders teleport region boundaries, biome palettes, 16-band spatial lag heatmaps, and 4-pillar behavioral identity comparison cards inside one unified world map and configuration studio.
Key Capabilities¶
- Plane 1 + Plane 2 Comment Restoration (
JarConfigScanner): Merges original author#comments and@type/@range/@optionsdirectives from embedded plugin JAR resources onto live disk YAML files without overwriting customized server values. - 3-Pass Bytecode AST Investigation (
BytecodeConfigScanner,SchemaInferrer): Discovers undocumented configuration keys, default values, numeric clamps (Math.max/Math.min),Enum.valueOfconstants, and downstream subsystem flows directly from.classconstant pools and method bodies. - Informal Input Coercion & Guardrails (
ServerConfigAtlas): Translates human shorthand (50%->0.5,400 ticks->20s, fuzzy enum typos -> canonical constants) with before/after notes while blocking out-of-range edits. - Anti-Clobber Shutdown Queue (
DEFER_UNTIL_SHUTDOWN): Detects plugins that callsaveConfig()insideonDisable()and stages edits to flush cleanly after those plugins finish disabling. - Fleet Sync Secret Protection (
FleetSyncPolicyClassifier): Classifies every setting intoFLEET_GLOBAL,SELECTIVE_GROUP, orPINNED_LOCALso database passwords, bind addresses, and Velocity forwarding secrets are never overwritten across nodes. - Optional External Extension SPI (
ConfigExtensionProvider,ConfigExtensionRegistry): Discovers optional fleet-sync or hosted workspace relay providers via standard JavaServiceLoaderwith zero artificial lock checks in public MIT source (ADR-108).
Commands¶
| Command | Description | Permission |
|---|---|---|
/leafconfig editor |
Harvest the server config atlas, open the live loopback WebSocket session, and export the standalone HTML workspace bundle | leafconfig.admin |
/leafconfig apply <token-or-file> |
Apply a committed Web IDE payload from a byte-store token or plugins/LeafConfig/workspace/<token>.json |
leafconfig.admin |
/leafconfig trust <nonce> |
Authorize a browser WebCrypto key for live WebSocket Hot-Apply | leafconfig.admin |
/leafconfig menu |
Open the in-game menu-api parchment book dashboard (or clickable chat fallback) |
leafconfig.admin |
/leafconfig scan |
Re-scan plugins/*.jar and server configuration files asynchronously |
leafconfig.admin |
/leafconfig restore |
Restore stripped Plane 1 JAR comments onto live disk YAML files with .bak backups |
leafconfig.admin |
/leafconfig bit |
Run the [LeafConfig bit] built-in startup self-tests on demand |
leafconfig.admin |
Building & Testing¶
./gradlew :resource:LeafConfig:leafconfig-common:check :resource:LeafConfig:leafconfig-paper:check
./gradlew :resource:LeafConfig:leafconfig-plugin:build