Extract Hermodr from Odin

Hermodr is the Eve browser lowering. It was an organ of Odin: Node inside a Rust
repository, sharing a common module directory with Odin's coordinator, and until
recently running its own provider-session ingress and accepting publications
into a private store.

The ingress was removed first, deliberately. An extraction that carried it would
have moved a second acceptance authority into a repository of its own and called
that progress. What moved here is a bridge: it resolves providers through Odin's
catalog, reads those providers directly, and relays operator intent to
provider-advertised command routes.

Contents: the daemon, the provider subscription source and its lifecycle tests,
the state stream registry, the browser catalog tests, the four lifecycle
scripts, and the persona avatar.

Three dependencies on Odin were resolved rather than carried. The swarm document
catalog now comes from CultLib's cultcache-ts alongside defineDocumentType.
Idunn's health contract is declared locally in idunn-health.cjs, over the generic
transport that also moved to CultLib, with sourceRuntimeId "hermodr" rather than
Odin's. parseArgs is seventeen lines in args.cjs, because Hermodr used one of
that utility module's six functions and carrying the other five would have been
carrying a library nobody here reads.

MIT, matching CultLib, Odin, Idunn, Eve and Erycina, so the deployment chain is
one a creator may lawfully run end to end.

Verified: 17 tests pass, every module loads with CultLib resolving from the new
location, and no import references Odin. Not verified: behaviour against a live
provider over RUDP, which needs a running Verse.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta 2026-09-06 19:44:53 +02:00
commit 43d4590c27
16 changed files with 2303 additions and 0 deletions

View file

@ -0,0 +1,14 @@
param(
[string] $BaseUrl = $(if ($env:HERMODR_BASE_URL) { $env:HERMODR_BASE_URL } else { "http://127.0.0.1:8798" })
)
$ErrorActionPreference = "Stop"
$healthUrl = $BaseUrl.TrimEnd("/") + "/health"
$response = Invoke-RestMethod -Uri $healthUrl -Method Get -TimeoutSec 3
if ($response.authority -ne "lowering-only") {
throw "Hermodr responded, but did not report lowering-only authority."
}
Write-Host "Hermodr browser lowering responds at $BaseUrl; authority=$($response.authority). This is not daemon health or Verse discovery authority."

View file

@ -0,0 +1,23 @@
param(
[string] $HostAddress = $(if ($env:HERMODR_BIND_HOST) { $env:HERMODR_BIND_HOST } else { "127.0.0.1" }),
[int] $Port = $(if ($env:HERMODR_PORT) { [int]$env:HERMODR_PORT } else { 8798 }),
[string] $OdinCultMeshUri = $(if ($env:HERMODR_ODIN_CULTMESH_URI) { $env:HERMODR_ODIN_CULTMESH_URI } elseif ($env:ODIN_CULTMESH_URI) { $env:ODIN_CULTMESH_URI } else { "cultmesh://odin/rendezvous/provider-catalog" }),
[string] $IdunnRudpHealth = $(if ($env:HERMODR_IDUNN_RUDP_HEALTH) { $env:HERMODR_IDUNN_RUDP_HEALTH } else { $env:IDUNN_RUDP_HEALTH }),
[string] $IdunnDaemon = "hermodr",
[string] $IdunnHealthContract = "hermodr.cultnet-rudp-browser-lowering-health"
)
$ErrorActionPreference = "Stop"
if ($env:IDUNN_ACTUATOR -ne "1" -or $env:IDUNN_COMMAND_AUTHORITY -ne "idunn-daemon") {
throw "restart-hermodr.ps1 is an Idunn actuator body. Redeploy by poking Idunn; direct service restart is not an owned path."
}
$stop = Join-Path $PSScriptRoot "stop-hermodr.ps1"
$start = Join-Path $PSScriptRoot "start-hermodr.ps1"
if (Test-Path -LiteralPath $stop) {
& $stop
}
& $start -HostAddress $HostAddress -Port $Port -OdinCultMeshUri $OdinCultMeshUri -IdunnRudpHealth $IdunnRudpHealth -IdunnDaemon $IdunnDaemon -IdunnHealthContract $IdunnHealthContract -NoWindow

57
scripts/start-hermodr.ps1 Normal file
View file

@ -0,0 +1,57 @@
param(
[string] $HostAddress = $(if ($env:HERMODR_BIND_HOST) { $env:HERMODR_BIND_HOST } else { "127.0.0.1" }),
[int] $Port = $(if ($env:HERMODR_PORT) { [int]$env:HERMODR_PORT } else { 8798 }),
[string] $OdinCultMeshUri = $(if ($env:HERMODR_ODIN_CULTMESH_URI) { $env:HERMODR_ODIN_CULTMESH_URI } elseif ($env:ODIN_CULTMESH_URI) { $env:ODIN_CULTMESH_URI } else { "cultmesh://odin/rendezvous/provider-catalog" }),
[string] $IdunnRudpHealth = $(if ($env:HERMODR_IDUNN_RUDP_HEALTH) { $env:HERMODR_IDUNN_RUDP_HEALTH } else { $env:IDUNN_RUDP_HEALTH }),
[string] $IdunnDaemon = "hermodr",
[string] $IdunnHealthContract = "hermodr.cultnet-rudp-browser-lowering-health",
[string] $StateDir = $(Join-Path $PSScriptRoot "..\scratch\Hermodr"),
[switch] $NoWindow
)
$ErrorActionPreference = "Stop"
foreach ($name in @(
"HERMODR_ODIN_HTTP_BASE",
"HERMODR_ODIN_WS_BASE",
"HERMODR_ODIN_STATE_PATH",
"HERMODR_SLEIPNIR_COMMAND_RUDP",
"HERMODR_SLEIPNIR_COMMAND_ENDPOINT",
"HERMODR_MUNINN_RUDP",
"HERMODR_AETHERIA_COMMAND_RUDP",
"HERMODR_ODIN_CULTMESH_STORE",
"ODIN_CULTMESH_STORE"
)) {
if (-not [string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($name))) {
throw "$name was removed. Hermodr lowers Odin/CultMesh state for browsers and may only publish typed CultMesh command documents."
}
}
if (-not [string]::IsNullOrWhiteSpace($env:HERMODR_COMMAND_STORE)) {
throw "HERMODR_COMMAND_STORE was removed. Hermodr publishes typed commands through provider-advertised CultMesh routes and records visible witnesses in Odin's CultMesh cache."
}
$node = "node"
$Hermodr = Join-Path $PSScriptRoot "..\src\hermodr-daemon.cjs"
$arguments = @(
$Hermodr,
"--host", $HostAddress,
"--port", $Port,
"--odin-cultmesh-uri", $OdinCultMeshUri
)
if (-not [string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
$arguments += @(
"--idunn-rudp-health", $IdunnRudpHealth,
"--idunn-daemon", $IdunnDaemon,
"--idunn-health-contract", $IdunnHealthContract
)
}
if ($NoWindow) {
New-Item -ItemType Directory -Force -Path $StateDir | Out-Null
$proc = Start-Process -FilePath $node -ArgumentList $arguments -WindowStyle Hidden -PassThru
$proc.Id | Set-Content -Encoding ASCII -LiteralPath (Join-Path $StateDir "hermodr.pid")
Write-Host "Started Hermodr browser lowering at http://${HostAddress}:${Port}/"
return
}
& $node @arguments

22
scripts/stop-hermodr.ps1 Normal file
View file

@ -0,0 +1,22 @@
param(
[string] $StateDir = (Join-Path (Split-Path -Parent $PSScriptRoot) "scratch\Hermodr")
)
$ErrorActionPreference = "Stop"
$pidPath = Join-Path $StateDir "hermodr.pid"
if (-not (Test-Path $pidPath)) {
Write-Host "No Hermodr PID file found at $pidPath."
exit 0
}
$HermodrPid = (Get-Content -Raw $pidPath).Trim()
if ($HermodrPid -match "^\d+$") {
$process = Get-Process -Id ([int] $HermodrPid) -ErrorAction SilentlyContinue
if ($process) {
Stop-Process -Id $process.Id
Write-Host "Stopped Hermodr PID $HermodrPid."
}
}
Remove-Item -LiteralPath $pidPath -Force