From 351ea2ea25cc06fd8e174bd8db0358a0b29c83bd Mon Sep 17 00:00:00 2001 From: alex anikin <60673011+anikin-xyz@users.noreply.github.com> Date: Thu, 9 Jul 2026 21:54:14 -0700 Subject: [PATCH] fix(pulse): defer [da] identity to the user config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PULSE.toml ships a [da].primary value that could only be changed by editing the shipped system template — it was unoverridable from the user tier, so the DA name lived in two places (PULSE.toml and LIFEOS/USER/CONFIG/LIFEOS_CONFIG.toml [da].name) that could silently disagree. loadPulseConfig now defers [da].primary to LIFEOS_CONFIG.toml [da].name when present, via the existing LifeosConfig loader — converging the two identity configs on one source of truth rather than adding a third layer. Fresh installs without the user config keep the PULSE.toml value. --- LifeOS/install/LIFEOS/PULSE/pulse.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/LifeOS/install/LIFEOS/PULSE/pulse.ts b/LifeOS/install/LIFEOS/PULSE/pulse.ts index 1a7251df41..416af0c19f 100755 --- a/LifeOS/install/LIFEOS/PULSE/pulse.ts +++ b/LifeOS/install/LIFEOS/PULSE/pulse.ts @@ -17,6 +17,7 @@ import { join } from "path" import { readFileSync, existsSync } from "fs" import { parse } from "smol-toml" +import { loadLifeosConfig } from "../TOOLS/LifeosConfig" // ── Load .env before anything else ── @@ -231,6 +232,20 @@ async function loadPulseConfig(): Promise { const daemonConfig = await loadConfig(PULSE_DIR) + // Converge the DA identity on a single source of truth. PULSE.toml ships a + // placeholder [da].primary, but the DA's real name lives in the user config + // (LIFEOS/USER/CONFIG/LIFEOS_CONFIG.toml [da].name). Defer to it when present + // — via the existing LifeosConfig loader — rather than maintaining the DA + // name in two files. Fresh installs without the user config keep the + // PULSE.toml value. + const da = (parsed.da as PulseConfig["da"]) ?? { enabled: false } + try { + const daName = loadLifeosConfig().da.name + if (daName) da.primary = daName + } catch { + // LIFEOS_CONFIG.toml absent or invalid (e.g. fresh install) — keep PULSE.toml's value. + } + return { port: (parsed.port as number) ?? parseInt(process.env.PULSE_PORT || "31337", 10), tls: (parsed.tls as PulseConfig["tls"]) ?? undefined, @@ -243,7 +258,7 @@ async function loadPulseConfig(): Promise { work: (parsed.work as PulseConfig["work"]) ?? { enabled: true }, telos: (parsed.telos as PulseConfig["telos"]) ?? { enabled: true }, hooks: (parsed.hooks as PulseConfig["hooks"]) ?? { enabled: true }, - da: (parsed.da as PulseConfig["da"]) ?? { enabled: false }, + da, worker: parsed.worker as PulseConfig["worker"], jobs: daemonConfig.jobs, }