fix(pulse): Arbol scanners are configured by their worker keys, not by config.yaml existing - #2112
Open
pai-scaffolde wants to merge 1 commit into
Open
pai-scaffolde wants to merge 1 commit into
pai-scaffolde wants to merge 1 commit into
Conversation
…y config.yaml existing bunker.ts arbolConfig() treated the presence of ~/.config/arbol/config.yaml (subdomain + auth_token — Arbol's general config) as proof that a security scanner and a site-health worker exist, defaulting their names when security_worker / site_health_worker were absent. fetchArbol() then hit https://infra-security.<subdomain>.workers.dev/report, got a 404, and reported the scanner as `unreachable`: /api/bunker/arbol and /sitehealth answered 502, /critical said configured:true reachable:false, and the panel rendered a red "scanner unreachable" face on installs that simply have no scanner. The module already has the right state for that — `{ state: "not-configured" }` — it just could not reach it. A worker exists only when its key is set: drop the name defaults, make the two fields optional, and gate fetchArbol()/siteHealthReport() on the key (503 "not configured", the same shape arbolReport already used for a missing config). Installs with the keys set take exactly the old path; monitorWorkersRe() already filtered undefined names. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reproduced on a LifeOS 7.40.4 install (macOS, Claude Code in the Claude desktop app) that has Arbol configured for other uses; the fix was applied to that install and run there before filing.
Observed
With
~/.config/arbol/config.yamlcarrying onlysubdomainandauth_token:and
/api/bunkerfoldssecurity_source: { state: "unreachable" }into every app card — a red "scanner unreachable" face on an install that has no scanner.Root cause
LIFEOS/PULSE/modules/bunker.tsarbolConfig()treats the mere existence of Arbol's general config file as "a security scanner and a site-health worker exist": whensecurity_worker/site_health_workerare absent it substitutes default names (infra-security,site-health) andfetchArbol()/siteHealthReport()go fetchhttps://<default>.<subdomain>.workers.dev/.... The 404 that comes back is then classifiedunreachable. The module's ownArbolFetchtype already has the state for this —{ state: "not-configured" }— but only a missing file could reach it.Fix
A worker exists only when its key is set.
arbolConfig()returnssecurityWorker/siteHealthWorkeras optional with no defaults;fetchArbol()returnsnot-configuredwhensecurity_workeris unset (so/criticalreportsconfigured:false,/arbol503 "security scanner not configured", and the app cards getsecurity_source: not-configured, which renders silent by design);siteHealthReport()returns 503 "site-health worker not configured" whensite_health_workeris unset. Installs with the keys set take exactly the old path.monitorWorkersRe()already filtered undefined names, so the cost card is unaffected.Behavior change to disclose: an install whose workers really are named
infra-security/site-healthand that never set the two keys (the original comment implies such installs exist) now readsnot-configureduntil it addssecurity_worker:andsite_health_worker:to config.yaml. That is deliberate — the dropped defaults were the mechanism of the bug: a default name is a claim that a worker exists, and on any Arbol install without one it is false.How tested
Probe through
handleRequestwithHOMEpointed at a temp dir whose.config/arbol/config.yamlholdssubdomain+auth_tokenonly (the probe's fetches went to a non-existent*.workers.devhost and got Cloudflare's 404, which is the real-world failure):/arbol/sitehealth/criticalWith both keys added to the same file the patched module behaves exactly as before (attempts the fetch → unreachable on 404). Transpiles. On the live install the bunker tab's security source now reads not-configured instead of unreachable.
🤖 Generated with Claude Code