From a252c256c4caea0a863e02f402d20532b1f2c652 Mon Sep 17 00:00:00 2001 From: Minimons Date: Wed, 26 Aug 2026 17:54:37 +0200 Subject: [PATCH] 76: Introduce the Nenjim component registry and move runtime composition into its manager --- README_alarm.md | 33 +- build.gradle.kts | 3 +- debug.sh | 2 +- docs/Nenjim-public.html | 36 +- docs/Nenjim.md | 47 ++- docs/Terminologi.md | 18 +- .../.openspec.yaml | 2 + .../design.md | 79 ++++ .../proposal.md | 34 ++ .../assetaz-currency-identity-service/spec.md | 16 + .../specs/assetaz-ticker-service/spec.md | 124 +++++++ .../specs/nenjim-component-registry/spec.md | 179 +++++++++ .../tasks.md | 25 ++ .../assetaz-currency-identity-service/spec.md | 8 +- .../assetaz-raydium-pool-price-source/spec.md | 2 +- openspec/specs/assetaz-ticker-service/spec.md | 48 +-- .../specs/nenjim-component-registry/spec.md | 181 +++++++++ run.sh | 2 +- .../com/fanitas/evelyn/core/Evelyn.tjava | 3 +- .../evelyn/core/impl/ref/EvelynImpl.tjava | 3 +- .../burner/EvelynIOUBurnerService.tjava | 3 +- .../impl/ref/EvelynIOUBurnerServiceImpl.tjava | 3 +- .../cis/CurrencyIdentityService.tjava | 3 +- .../services/ticker/TickerService.tjava | 3 +- .../ticker/impl/ref/TickerServiceImpl.tjava | 30 +- .../{plugins => }/pricesource/PriceSink.tjava | 2 +- .../pricesource/PriceSource.tjava | 5 +- .../impl/hardcoded/HardcodedPriceSource.tjava | 6 +- .../raydiumpool/RaydiumPoolPriceSource.tjava | 6 +- .../cryptowallet/solana/SolanaWallet.tjava | 3 +- .../evelyn/emc/EvelynMissionControl.tjava | 4 +- .../impl/ref/EvelynMissionControlImpl.tjava | 11 +- .../jupiterperpsalarm/JupiterPerpsAlarm.tjava | 4 +- .../impl/ref/JupiterPerpsAlarmImpl.tjava | 12 +- .../jupiter/perps/JupiterPerpsService.tjava | 3 +- .../jupiter/swap/JupiterSwapService.tjava | 3 +- .../r35157/libs/objcache/ObjectCache.tjava | 3 +- .../com/r35157/libs/raydium/Raydium.tjava | 3 +- .../r35157/libs/solana/SolanaBlockChain.tjava | 3 +- .../nenjim/component/NenjimApplication.tjava | 6 + .../nenjim/component/NenjimComponent.tjava | 5 + .../tjava/com/r35157/nenjim/hubd/Main.tjava | 16 + .../com/r35157/nenjim/hubd/NenjimHub.tjava | 43 --- .../r35157/nenjim/hubd/impl/ref/Main.tjava | 12 - .../nenjim/hubd/impl/ref/NenjimHubImpl.tjava | 324 ---------------- .../r35157/nenjim/kicker/NenjimProcess.tjava | 2 +- .../nenjim/kicker/impl/ref/Initializer.tjava | 2 - .../kicker/impl/ref/NenjimProcessImpl.tjava | 2 +- .../registry/NenjimRegistryService.tjava | 20 + .../NenjimRegistryServiceManager.tjava | 8 + .../impl/ref/NenjimRegistryServiceAdmin.tjava | 12 + .../impl/ref/NenjimRegistryServiceImpl.tjava | 154 ++++++++ .../NenjimRegistryServiceManagerImpl.tjava | 351 ++++++++++++++++++ .../valuetypes/NenjimComponentId.tjava | 16 + .../BoundNotificationService.tjava | 3 +- 55 files changed, 1451 insertions(+), 480 deletions(-) create mode 100644 openspec/changes/archive/2026-08-30-76-introduce-nenjim-component-registry/.openspec.yaml create mode 100644 openspec/changes/archive/2026-08-30-76-introduce-nenjim-component-registry/design.md create mode 100644 openspec/changes/archive/2026-08-30-76-introduce-nenjim-component-registry/proposal.md create mode 100644 openspec/changes/archive/2026-08-30-76-introduce-nenjim-component-registry/specs/assetaz-currency-identity-service/spec.md create mode 100644 openspec/changes/archive/2026-08-30-76-introduce-nenjim-component-registry/specs/assetaz-ticker-service/spec.md create mode 100644 openspec/changes/archive/2026-08-30-76-introduce-nenjim-component-registry/specs/nenjim-component-registry/spec.md create mode 100644 openspec/changes/archive/2026-08-30-76-introduce-nenjim-component-registry/tasks.md create mode 100644 openspec/specs/nenjim-component-registry/spec.md rename src/main/tjava/com/r35157/assetaz/services/ticker/{plugins => }/pricesource/PriceSink.tjava (84%) rename src/main/tjava/com/r35157/assetaz/services/ticker/{plugins => }/pricesource/PriceSource.tjava (68%) rename src/main/tjava/com/r35157/assetaz/services/ticker/{plugins => }/pricesource/impl/hardcoded/HardcodedPriceSource.tjava (94%) rename src/main/tjava/com/r35157/assetaz/services/ticker/{plugins => }/pricesource/impl/raydiumpool/RaydiumPoolPriceSource.tjava (96%) create mode 100644 src/main/tjava/com/r35157/nenjim/component/NenjimApplication.tjava create mode 100644 src/main/tjava/com/r35157/nenjim/component/NenjimComponent.tjava create mode 100644 src/main/tjava/com/r35157/nenjim/hubd/Main.tjava delete mode 100644 src/main/tjava/com/r35157/nenjim/hubd/NenjimHub.tjava delete mode 100644 src/main/tjava/com/r35157/nenjim/hubd/impl/ref/Main.tjava delete mode 100644 src/main/tjava/com/r35157/nenjim/hubd/impl/ref/NenjimHubImpl.tjava create mode 100644 src/main/tjava/com/r35157/nenjim/service/registry/NenjimRegistryService.tjava create mode 100644 src/main/tjava/com/r35157/nenjim/service/registry/NenjimRegistryServiceManager.tjava create mode 100644 src/main/tjava/com/r35157/nenjim/service/registry/impl/ref/NenjimRegistryServiceAdmin.tjava create mode 100644 src/main/tjava/com/r35157/nenjim/service/registry/impl/ref/NenjimRegistryServiceImpl.tjava create mode 100644 src/main/tjava/com/r35157/nenjim/service/registry/impl/ref/NenjimRegistryServiceManagerImpl.tjava create mode 100644 src/main/tjava/com/r35157/nenjim/service/registry/valuetypes/NenjimComponentId.tjava diff --git a/README_alarm.md b/README_alarm.md index 74e3751..feea2ad 100644 --- a/README_alarm.md +++ b/README_alarm.md @@ -4,10 +4,11 @@ The Jupiter Perps Price Alarm monitors the Jupiter Perps aggregated oracle accou Oracle prices are received through Solana WebSocket `accountSubscribe` using `processed` commitment. The application does not poll prices once per second. It also fetches the current oracle account state whenever a WebSocket connection opens, reconnects automatically, and supports multiple RPC endpoints for redundancy. -The alarm is currently initialized and started by `NenjimHubImpl`. Its -`SolanaWallet` and `JupiterPerpsService` are selected by the Hub and injected -before startup. The alarm action configuration files do not select a wallet or -signing key. +The Registry service manager currently constructs and registers the alarm as +`jupiter-perps-alarm.default`, but deliberately does not start it. Its +`SolanaWallet` and `JupiterPerpsService` are selected by the manager's hardcoded +composition and injected before registration. The alarm action configuration +files do not select a wallet or signing key. > **Important:** This application is not necessarily notification-only. Every active entry in a Jupiter Perps position action file can sign and submit a real transaction. Review both transaction action files before running it. @@ -56,27 +57,29 @@ There is currently no alarm-specific automated self-test task. ## Running through Nenjim -The alarm no longer has a standalone `main` method. `NenjimHubImpl` constructs -the wallet, Jupiter service and alarm, then starts the alarm as part of normal -Hub startup. Run the configured application with: +The alarm no longer has a standalone `main` method. The Registry service +manager constructs and registers the wallet, Jupiter service and alarm, but the +alarm is intentionally absent from the current explicit application startup +list. Running the Hub therefore leaves the registered alarm inactive: ```bash ./gradlew run ``` -After `./gradlew prepareLibs`, it can also be started explicitly with the Nenjim -Hub main class: +After `./gradlew prepareLibs`, the same Registry-managed Hub can be invoked with +its main class (the alarm still remains inactive): ```bash java --enable-preview \ -cp "build/libs/*" \ - com.r35157.nenjim.hubd.impl.ref.Main + com.r35157.nenjim.hubd.Main ``` -The current Hub composition binds the alarm to `conf/alarms.conf` and to the +The current manager composition binds the alarm to `conf/alarms.conf` and to the test Jupiter Perps wallet and service. Until Nenjim provides configured -injection, a different configuration or wallet must be selected in the Hub's -composition code, not in an alarm action file. +injection and activation, a different configuration, wallet, or startup choice +must be selected in the Registry manager's composition code, not in an alarm +action file. The repository contains example files for the alarm configuration and every action configuration. The real `conf/*.conf` files are ignored by Git; keep @@ -84,8 +87,8 @@ credentials and operational details out of version control. ### Environment variables -The Hub does not currently forward alarm-specific command-line options. Solana -WebSocket endpoints can be overridden with: +The Registry manager does not currently forward alarm-specific command-line +options. Solana WebSocket endpoints can be overridden with: ```bash export SOLANA_WS_URLS='wss://first-provider.example,wss://second-provider.example' diff --git a/build.gradle.kts b/build.gradle.kts index 5c6047f..1d34cd0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ if (version == "UNSET" && gradle.startParameter.taskNames.any { it.startsWith("p } application { - mainClass.set("com.r35157.nenjim.hubd.impl.ref.Main") + mainClass.set("com.r35157.nenjim.hubd.Main") applicationDefaultJvmArgs = listOf("--enable-preview") } @@ -54,6 +54,7 @@ dependencies { implementation("org.slf4j:slf4j-api:2.0.18") testImplementation("org.junit.jupiter:junit-jupiter:5.13.4") + testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.13.4") } java { diff --git a/debug.sh b/debug.sh index 3993249..b0636e3 100755 --- a/debug.sh +++ b/debug.sh @@ -21,4 +21,4 @@ exec java \ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=${DEBUG_SUSPEND},address=*:${DEBUG_PORT}" \ -Dlog4j.configurationFile=conf/log4j2.xml \ -cp "$CLASSPATH" \ - com.r35157.nenjim.hubd.impl.ref.Main + com.r35157.nenjim.hubd.Main diff --git a/docs/Nenjim-public.html b/docs/Nenjim-public.html index 88c5c20..0cbd55c 100644 --- a/docs/Nenjim-public.html +++ b/docs/Nenjim-public.html @@ -3,7 +3,7 @@ - Nenjim Journal Documentation + Nenjim Documentation