Recipe: declare every name loadConfig reads, and the state slot where the code writes it

The recipe left eight names undeclared (GitHub and Spotify client ids,
the StreamPixels and Repixelizer callback lists and runtime ids, the
Bifrost runtime ids, the refresh TTL), so a binding could never set them:
Idunn refuses an undeclared name. The state slot said heimdall.service.cc
at the state root while the code writes cultcache/heimdall.service.cc.

A new test reads the names loadConfig looks up (the existing recorder) and
fails on any that is neither declared, Idunn-owned, nor listed as never
bound with its reason.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-17 00:00:45 +00:00
commit 2f0dd0c3a7
2 changed files with 35 additions and 1 deletions

View file

@ -138,11 +138,16 @@ route_required = true
optional_environment = [
"CULTMESH_URI_ODIN_RUDP",
"GC_ACCESS_APP_BIFROST_BACKEND_CALLBACK_URLS",
"GC_ACCESS_APP_BIFROST_RUNTIME_IDS",
"GC_ACCESS_APP_BIFROST_SHARED_SECRET_FILE",
"GC_ACCESS_APP_GHOSTLIGHT_BACKEND_CALLBACK_URLS",
"GC_ACCESS_APP_GHOSTLIGHT_RUNTIME_IDS",
"GC_ACCESS_APP_GHOSTLIGHT_SHARED_SECRET_FILE",
"GC_ACCESS_APP_REPIXELIZER_BACKEND_CALLBACK_URLS",
"GC_ACCESS_APP_REPIXELIZER_RUNTIME_IDS",
"GC_ACCESS_APP_REPIXELIZER_SHARED_SECRET_FILE",
"GC_ACCESS_APP_STREAMPIXELS_BACKEND_CALLBACK_URLS",
"GC_ACCESS_APP_STREAMPIXELS_RUNTIME_IDS",
"GC_ACCESS_APP_STREAMPIXELS_SHARED_SECRET_FILE",
"GC_ACCESS_APPLY_SCHEMA_ON_STARTUP",
"GC_ACCESS_BIFROST_PATRON_SUPPORT_ENDPOINT",
@ -156,6 +161,7 @@ optional_environment = [
"GC_ACCESS_PRIVATE_COMMAND_PORT",
"GC_ACCESS_PROVIDER_DISCORD_CLIENT_ID",
"GC_ACCESS_PROVIDER_DISCORD_CLIENT_SECRET_FILE",
"GC_ACCESS_PROVIDER_GITHUB_CLIENT_ID",
"GC_ACCESS_PROVIDER_GITHUB_CLIENT_SECRET_FILE",
"GC_ACCESS_PROVIDER_GOOGLE_CLIENT_ID",
"GC_ACCESS_PROVIDER_GOOGLE_CLIENT_SECRET_FILE",
@ -163,11 +169,13 @@ optional_environment = [
"GC_ACCESS_PROVIDER_JOYSTICK_CLIENT_SECRET_FILE",
"GC_ACCESS_PROVIDER_PATREON_CLIENT_ID",
"GC_ACCESS_PROVIDER_PATREON_CLIENT_SECRET_FILE",
"GC_ACCESS_PROVIDER_SPOTIFY_CLIENT_ID",
"GC_ACCESS_PROVIDER_SPOTIFY_CLIENT_SECRET_FILE",
"GC_ACCESS_PROVIDER_TWITCH_CLIENT_ID",
"GC_ACCESS_PROVIDER_TWITCH_CLIENT_SECRET_FILE",
"GC_ACCESS_PROVIDER_YOUTUBE_CLIENT_ID",
"GC_ACCESS_PROVIDER_YOUTUBE_CLIENT_SECRET_FILE",
"GC_ACCESS_REFRESH_TTL_SECONDS",
"GC_ACCESS_SESSION_TTL_SECONDS",
"GC_ACCESS_SIGNING_KEY_ID",
"GC_ACCESS_SIGNING_PRIVATE_KEY_BOOTSTRAP",
@ -192,7 +200,7 @@ schema_generation = "heimdall-v1"
[[state.slots]]
id = "service"
relative_path = "heimdall.service.cc"
relative_path = "cultcache/heimdall.service.cc"
kind = "cultcache-file"
schema = "heimdall.service_state.v1"
writer = "process-bound-single-writer"

View file

@ -225,4 +225,30 @@ describe("Idunn recipe secret declarations", () => {
expect(serviceNames).toContain(`${name}_FILE`);
}
});
it("declares every other name loadConfig reads, or says why a binding never sets it", () => {
// Idunn refuses a binding that sets an undeclared name, so an undeclared
// name is a setting no Idunn-admitted generation can ever change.
const idunnOwned = new Set([
"GAMECULT_IDUNN_RUNTIME_BUNDLE",
"GAMECULT_IDUNN_CANDIDATE_BIND",
"GAMECULT_IDUNN_PROCESS_WRITE_LEASE",
]);
const neverBound = new Set([
// The listen socket is the candidate bind under Idunn, and the command port follows it.
"HOST",
"PORT",
// The state root is the --state-root argument; the paths below it are Heimdall's own layout.
"GC_ACCESS_DATA_ROOT",
"GC_ACCESS_CULTCACHE_PATH",
"GC_ACCESS_PROVIDER_HEALTH_IDENTITY_PATH",
// The daemon id is the host's name for this process, fixed by the code's default.
"GC_ACCESS_IDUNN_DAEMON",
]);
const declared = new Set(everyDeclaredName);
const unreachable = [...explored.names]
.filter((name) => !secretNames.includes(name) && !name.endsWith("_FILE"))
.filter((name) => !declared.has(name) && !idunnOwned.has(name) && !neverBound.has(name));
expect(unreachable).toEqual([]);
});
});