Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: explain peer observation failures with private-safe reasons (#11390)

[._.]/ Adam Eivy218ddf119634
diff --git a/docs/features/eidoverse.md b/docs/features/eidoverse.md
index e0773faf57..7e8ef79495 100644
--- a/docs/features/eidoverse.md
+++ b/docs/features/eidoverse.md
@@ -1271,6 +1271,16 @@ steady, approval-gated and challenged work stays attention, in-progress work
stays active, and terminal entries are excluded. No task names, raw block
reasons or arbitrary category strings enter the observation.
+Federation Terminal counts errored peer records with structured failed-probe
+reasons: `peer_connection_refused`, `peer_transport_failure`, `peer_probe_timeout`,
+`peer_auth_required`, `peer_dns_failure`, `peer_host_unreachable`, and
+`peer_health_http_failure`. Use these to select a bounded connection or credential
+diagnostic, without retrying peers or changing admission. `peer_failure_unknown`
+means the errored peer has no recognized failed-probe evidence (including legacy
+records); neither `status:error` nor unavailable travel proves a configuration,
+guest-admission or sync failure. Successful/healthy peers ignore old failure
+metadata. Probe messages, HTTP response bodies and network identities stay private.
+
Other sources and older reason-less inputs use `source_attention` or `source_error`: these
say only that a coarse source status requires attention, without inventing a
cause. Error sources remain identifiable even though district status is attention.
diff --git a/server/lib/eidoverseWorldSignals.js b/server/lib/eidoverseWorldSignals.js
index 8f04b2d98a..ba952ad603 100644
--- a/server/lib/eidoverseWorldSignals.js
+++ b/server/lib/eidoverseWorldSignals.js
@@ -31,8 +31,27 @@ export const EIDOVERSE_ATTENTION_REASON_CODES = Object.freeze([
'runtime_data_disk_pressure', 'runtime_data_disk_critical',
'memory_pressure', 'memory_critical',
'task_user_terminated', 'task_blocked',
+ 'peer_connection_refused', 'peer_transport_failure', 'peer_probe_timeout',
+ 'peer_auth_required', 'peer_dns_failure', 'peer_host_unreachable',
+ 'peer_health_http_failure', 'peer_failure_unknown',
]);
+// Read only structured evidence from the failed probe, never its free-text message.
+const PEER_PROBE_REASONS = new Map([
+ ['local_refused', 'peer_connection_refused'],
+ ['tunnel_dial', 'peer_transport_failure'],
+ ['probe_timeout', 'peer_probe_timeout'],
+ ['auth_required', 'peer_auth_required'],
+ ['dns', 'peer_dns_failure'],
+ ['host_unreachable', 'peer_host_unreachable'],
+ ['probe_http', 'peer_health_http_failure'],
+]);
+
+const peerAttentionReasons = (peer) => [{
+ code: (peer.lastProbe?.ok === false && PEER_PROBE_REASONS.get(peer.lastProbe.class)) || 'peer_failure_unknown',
+ affectedCount: 1,
+}];
+
const coarseStatus = (value) => {
const status = String(value || '').toLowerCase();
if (/error|failed|unhealthy|offline|crash|blocked/.test(status)) return 'error';
@@ -440,6 +459,8 @@ export function buildEidoverseWorldSignals({
enabled: peer.enabled !== false,
fullSync: peer.fullSync === true,
status: coarseStatus(peer.status),
+ ...(includeAttentionReasons && coarseStatus(peer.status) === 'error'
+ ? { attentionReasons: peerAttentionReasons(peer) } : {}),
}))
: null;
const health = healthSnapshot({ apps, cosStatus, review, backupState, notifications, character, voiceConfig, memory, diskPercent }, includeAttentionReasons);
diff --git a/server/services/eidoverseWorldSources.test.js b/server/services/eidoverseWorldSources.test.js
index cd8177fc0a..629d83ae0c 100644
--- a/server/services/eidoverseWorldSources.test.js
+++ b/server/services/eidoverseWorldSources.test.js
@@ -2,7 +2,7 @@ import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest';
import { statfs } from 'node:fs/promises';
import { PATHS } from '../lib/paths.js';
-import { readFileSync } from 'node:fs';
+import { readFileSync, rmSync } from 'node:fs';
import { join } from 'node:path';
import { cleanupTempDataRoots, lazyTempDataRoot, makePathsProxy } from '../lib/mockPathsDataRoot.js';
@@ -75,6 +75,7 @@ vi.mock('./jira.js', () => ({
const { collectEidoverseWorldSources } = await import('./eidoverseWorldSources.js');
beforeEach(() => {
+ rmSync(join(dataRoot(), 'eidoverse', 'observation.json'), { force: true });
Object.assign(sources, {
apps: [{ id: 'app-example', overallStatus: 'online', managed: true }],
appConfig: [],
@@ -235,6 +236,48 @@ describe('Eidoverse world source aggregation', () => {
describe('semantic observation authority and marker workflow', () => {
+ it('exposes only evidenced peer failures through observation, with unknown and recovery semantics', async () => {
+ const { executeCosToolCall } = await import('./cosToolRegistry.js');
+ const authority = { scope: 'mind', capabilities: { manageEidoverse: true, toolExposureAllSchemas: true } };
+ const observe = (requestId) => executeCosToolCall({
+ call: { requestId, name: 'eidoverse.observe', arguments: {} }, authority,
+ });
+ const classes = ['local_refused', 'tunnel_dial', 'probe_timeout', 'auth_required', 'dns', 'host_unreachable', 'probe_http'];
+ sources.peers = classes.map((code, i) => ({
+ id: `invented-peer-${i}`, status: 'offline', address: 'private-host.example.com',
+ password: 'invented-peer-secret', lastProbe: { ok: false, class: code, message: 'invented-private-exception' },
+ }));
+ sources.peers.push(
+ { id: 'legacy-peer', status: 'error' },
+ { id: 'unknown-peer', status: 'error', lastProbe: { ok: false, class: 'invented-private-exception' } },
+ { id: 'inconsistent-peer', status: 'error', lastProbe: { ok: true, class: 'dns' } },
+ { id: 'recovered-peer', status: 'online', lastProbe: { ok: false, class: 'dns' } },
+ );
+ const first = await observe('peer-reasons-first');
+ const terminal = first.result.places.find((place) => place.sources.includes('peers'));
+ expect(terminal.attentionSignals).toEqual([{
+ source: 'peers', severity: 'error', signalCount: 10, reasons: [
+ { code: 'peer_auth_required', affectedCount: 1 },
+ { code: 'peer_connection_refused', affectedCount: 1 },
+ { code: 'peer_dns_failure', affectedCount: 1 },
+ { code: 'peer_failure_unknown', affectedCount: 3 },
+ { code: 'peer_health_http_failure', affectedCount: 1 },
+ { code: 'peer_host_unreachable', affectedCount: 1 },
+ { code: 'peer_probe_timeout', affectedCount: 1 },
+ { code: 'peer_transport_failure', affectedCount: 1 },
+ ],
+ }]);
+ for (const secret of ['private-host.example.com', 'invented-peer-secret', 'invented-private-exception', 'legacy-peer']) {
+ expect(JSON.stringify(first.result)).not.toContain(secret);
+ }
+ expect((await collectEidoverseWorldSources()).peers.every((peer) => !('attentionReasons' in peer))).toBe(true);
+ sources.peers = sources.peers.map((peer) => ({ ...peer, status: 'online' }));
+ expect((await observe('peer-reasons-recovered')).result.places.find((place) => place.sources.includes('peers')).attentionSignals).toEqual([]);
+ sources.peers = null;
+ expect((await observe('peer-reasons-unreadable')).result.places.find((place) => place.sources.includes('peers')))
+ .toMatchObject({ attentionSignals: [], unreadableSources: ['peers'] });
+ });
+
it('delivers fresh bounded collector reasons only to a granted mind and preserves the observation delta', async () => {
const { executeCosToolCall } = await import('./cosToolRegistry.js');
const { observeEidoverseWorld } = await import('./eidoverseObservationLedger.js');