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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: explain intentionally stopped tasks in Eidoverse (#11360)
[._.]/ Adam Eivy5eabea998557
diff --git a/docs/features/eidoverse.md b/docs/features/eidoverse.mdindex 2f1828c581..e0773faf57 100644--- a/docs/features/eidoverse.md+++ b/docs/features/eidoverse.md@@ -1259,8 +1259,19 @@ crash. Nexus can report `runtime_data_disk_pressure` or`runtime_data_disk_critical` (capacity of the filesystem holding runtime data),`memory_pressure` or `memory_critical`, `backup_failure`, `review_alerts`, and`cos_paused`. These come from the same predicates that determine source status;-health does not alarm on not-started apps, while App Arcade does. Other sources-and older reason-less inputs use `source_attention` or `source_error`: these+health does not alarm on not-started apps, while App Arcade does.++Agent Foundry task errors mean **blocked internal CoS queue entries**, not+necessarily failed executions. `task_user_terminated` means the entry records+intentional user termination; `task_blocked` covers every other block category,+including absent or unknown categories. Each task row represents one entry, so+these reason counts aggregate entries. Recorded user intent does not authorize+retrying, restarting or mutating stopped work. Ordinary pending work stays+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.++Other sources and older reason-less inputs use `source_attention` or `source_error`: thesesay only that a coarse source status requires attention, without inventing acause. Error sources remain identifiable even though district status is attention.diff --git a/server/lib/eidoverseObservation.test.js b/server/lib/eidoverseObservation.test.jsindex 92e005c99b..ef0226d331 100644--- a/server/lib/eidoverseObservation.test.js+++ b/server/lib/eidoverseObservation.test.js@@ -386,7 +386,9 @@ describe('bounded attention projection', () => {const rows = ['error', 'attention'].map((status) => ({ status,name: 'Example Secret App', path: '/invented/private/path', error: 'invented-error-token',attentionReasons: [- ...EIDOVERSE_ATTENTION_REASON_CODES.map((code) => ({ code, affectedCount: 2, secret: 'invented-token' })),+ // Keep each contributor below the cap so truncation crosses sources,+ // independently of future additions to the closed reason vocabulary.+ ...EIDOVERSE_ATTENTION_REASON_CODES.slice(0, 10).map((code) => ({ code, affectedCount: 2, secret: 'invented-token' })),{ code: 'invented-secret-reason', affectedCount: 42 },],}));diff --git a/server/lib/eidoverseWorldSignals.js b/server/lib/eidoverseWorldSignals.jsindex 78a05201e6..8f04b2d98a 100644--- a/server/lib/eidoverseWorldSignals.js+++ b/server/lib/eidoverseWorldSignals.js@@ -30,6 +30,7 @@ export const EIDOVERSE_ATTENTION_REASON_CODES = Object.freeze(['backup_failure', 'review_alerts', 'cos_paused','runtime_data_disk_pressure', 'runtime_data_disk_critical','memory_pressure', 'memory_critical',+ 'task_user_terminated', 'task_blocked',]);const coarseStatus = (value) => {@@ -415,9 +416,16 @@ export function buildEidoverseWorldSignals({const projectedTasks = Array.isArray(taskState?.tasks)? taskState.tasks.filter((task) => !['completed', 'done', 'archived'].includes(String(task?.status || '').toLowerCase()))- .map((task, index) => ({- id: opaqueId('task', task.id, `task-${index}`), label: 'Active task', status: taskSignalStatus(task),- }))+ .map((task, index) => {+ const status = taskSignalStatus(task);+ return {+ id: opaqueId('task', task.id, `task-${index}`), label: 'Active task', status,+ ...(includeAttentionReasons && status === 'error' ? { attentionReasons: [{+ code: task.metadata?.blockedCategory === 'user-terminated' ? 'task_user_terminated' : 'task_blocked',+ affectedCount: 1,+ }] } : {}),+ };+ }): null;const projectedFeatures = Array.isArray(featuresState?.features)? featuresState.features.map((feature) => ({diff --git a/server/lib/eidoverseWorldSignals.test.js b/server/lib/eidoverseWorldSignals.test.jsindex 26cbbaf11a..a4f285e0a6 100644--- a/server/lib/eidoverseWorldSignals.test.js+++ b/server/lib/eidoverseWorldSignals.test.js@@ -101,6 +101,55 @@ describe('local attention reasons through builder-to-observation', () => {const project = (input) => buildEidoverseWorldSignals(input, { includeAttentionReasons: true });const place = (source, id) => buildEidoverseObservation({ source }).report.places.find((row) => row.id === id);+ it('distinguishes blocked task categories without changing status, exposing private data or retaining stale reasons', () => {+ const tasks = [+ { id: 'invented-private-id', status: 'blocked', name: 'Invented private task',+ description: 'invented-secret-token', metadata: { blockedCategory: 'user-terminated',+ blockedReason: '/invented/private/path', hostname: 'host-XXXX' } },+ { status: 'BLOCKED', metadata: { blockedCategory: 'provider-config' } },+ { status: 'blocked', metadata: { blockedCategory: 'invented-private-category' } },+ { status: 'blocked' },+ { status: 'blocked', metadata: { blockedCategory: 'USER-TERMINATED' } },+ { status: 'pending', metadata: { blockedCategory: 'user-terminated' } },+ { status: 'pending', approvalRequired: true },+ { status: 'challenged' },+ { status: 'in_progress' },+ ...['completed', 'done', 'archived'].map((status) => ({ status,+ metadata: { blockedCategory: 'user-terminated' } })),+ ];+ const input = { taskState: { tasks }, agents: [] };+ const source = project(input);+ expect(source.tasks.map((task) => task.status)).toEqual([+ 'error', 'error', 'error', 'error', 'error', 'steady', 'attention', 'attention', 'active',+ ]);+ expect(place(source, 'agents').attentionSignals).toEqual([+ { source: 'tasks', severity: 'error', signalCount: 5, reasons: [+ { code: 'task_blocked', affectedCount: 4 }, { code: 'task_user_terminated', affectedCount: 1 },+ ] },+ { source: 'tasks', severity: 'attention', signalCount: 2,+ reasons: [{ code: 'source_attention', affectedCount: null }] },+ ]);+ const serialized = JSON.stringify(place(source, 'agents'));+ for (const secret of ['invented-private', 'Invented private task', 'invented-secret-token',+ '/invented/private/path', 'host-XXXX', 'provider-config', 'USER-TERMINATED']) {+ expect(serialized).not.toContain(secret);+ }+ const normal = buildEidoverseWorldSignals(input);+ expect(normal.tasks).toEqual(source.tasks.map(({ attentionReasons, ...row }) => row));+ expect(JSON.stringify(normal)).not.toContain('attentionReasons');+ expect(place(normal, 'agents').attentionSignals[0].reasons).toEqual([+ { code: 'source_error', affectedCount: null },+ ]);+ const disabled = buildEidoverseObservation({ source, includes: { tasks: false } }).report.places+ .find((row) => row.id === 'agents');+ expect(disabled.attentionSignals).toEqual([]);+ expect(disabled.disabledSources).toContain('tasks');+ expect(place(project({ agents: [], taskState: { tasks: null } }), 'agents'))+ .toMatchObject({ attentionSignals: [], unreadableSources: ['tasks'] });+ expect(place(project({ agents: [], taskState: { tasks: [] } }), 'agents'))+ .toMatchObject({ attentionSignals: [], unreadableSources: [], status: 'quiet' });+ });+it.each(['not_started', 'stopped', 'unknown'])('explains %s while preserving district totals and status', (status) => {const input = snapshots(status);const source = project(input);diff --git a/server/services/cosToolRegistry.js b/server/services/cosToolRegistry.jsindex 181462c3ef..5baaea887b 100644--- a/server/services/cosToolRegistry.js+++ b/server/services/cosToolRegistry.js@@ -492,7 +492,7 @@ const eidoverseObserveTool = Object.freeze({version: COS_TOOL_SCHEMA_VERSION,providerName: providerToolName('eidoverse.observe'),aliases: [providerToolName('eidoverse.observe')],- description: 'Tour this install\'s own Eidoverse and see what is already standing — start here, before eidoverse.say, eidoverse.chat, or a peer visit. Returns `places` (the eight districts: what feeds each, how many live PortOS signals it currently reports, and whether any want attention), `peers` (opaque travel ids usable with eidoverse.visit, each with how many foundations this install inherited through it), `foundations.inherited` (a peer\'s contributions, newest first, with the peer they arrived through and the instance that authored them), `controllers.needsAttention` (only installs that are disarmed or failing — a controller that has never ticked yet is not an alarm), and `changes` (what is new since you last observed). `signalCount` counts what a district\'s sources report, not placed entities: the world holds a capped sample of them. Each place also returns local-only `attentionSignals`: contributing source, actual severity (`error` or `attention`), contributing signal-row count, and allowlisted reason codes with `affectedCount` (null when unknown). Use these to choose a diagnostic action: app_not_started is not proof of a crash; runtime_data_disk_pressure/critical concern the runtime-data filesystem; review_alerts concern pending review alerts. Other codes cover app_stopped, app_unknown, backup_failure, cos_paused and memory_pressure/critical; source_attention/error are explicitly coarse fallbacks. District totals are not fault counts. At most 24 reason entries per district are returned; `attentionTruncated` indicates omissions. A null section means that source could not be read, which is NOT the same as empty. Observing STAMPS a visit marker, so it is not idempotent — the next call\'s `changes` is measured from this one, and your first ever observation reports `firstObservation: true` with no new items rather than calling a settled world new.',+ description: 'Tour this install\'s own Eidoverse and see what is already standing — start here, before eidoverse.say, eidoverse.chat, or a peer visit. Returns `places` (the eight districts: what feeds each, how many live PortOS signals it currently reports, and whether any want attention), `peers` (opaque travel ids usable with eidoverse.visit, each with how many foundations this install inherited through it), `foundations.inherited` (a peer\'s contributions, newest first, with the peer they arrived through and the instance that authored them), `controllers.needsAttention` (only installs that are disarmed or failing — a controller that has never ticked yet is not an alarm), and `changes` (what is new since you last observed). `signalCount` counts what a district\'s sources report, not placed entities: the world holds a capped sample of them. Each place also returns local-only `attentionSignals`: contributing source, actual severity (`error` or `attention`), contributing signal-row count, and allowlisted reason codes with `affectedCount` (null when unknown). Use these to choose a diagnostic action: app_not_started is not proof of a crash; runtime_data_disk_pressure/critical concern the runtime-data filesystem; review_alerts concern pending review alerts. Other codes cover app_stopped, app_unknown, backup_failure, cos_paused and memory_pressure/critical; source_attention/error are explicitly coarse fallbacks. Task error rows describe blocked internal queue entries, not necessarily failed executions: task_user_terminated records intentional user termination; task_blocked covers other or unknown block categories. Each task reason counts one entry. Recorded user intent does not authorize restarting or mutating stopped work. District totals are not fault counts. At most 24 reason entries per district are returned; `attentionTruncated` indicates omissions. A null section means that source could not be read, which is NOT the same as empty. Observing STAMPS a visit marker, so it is not idempotent — the next call\'s `changes` is measured from this one, and your first ever observation reports `firstObservation: true` with no new items rather than calling a settled world new.',input_schema: zodToOpenApiSchema(z.object({}).strict()),output_schema: objectOutputSchema,policy: {diff --git a/server/services/cosToolRegistry.test.js b/server/services/cosToolRegistry.test.jsindex 92beb2bbd4..6f1cbe4243 100644--- a/server/services/cosToolRegistry.test.js+++ b/server/services/cosToolRegistry.test.js@@ -11,6 +11,7 @@ const mocks = vi.hoisted(() => ({worldProject: vi.fn(),worldAugment: vi.fn(),worldSay: vi.fn(),+ observeWorld: vi.fn(),listUserActions: vi.fn(),fileIssue: vi.fn(),listIssues: vi.fn(),@@ -70,6 +71,9 @@ vi.mock('./persistentMindContext.js', () => ({ choosePersistentMindName: (...argvi.mock('./persistentMindMaintenance.js', () => ({cleanupPersistentMind: (...args) => mocks.cleanupMind(...args),}));+vi.mock('./eidoverseObservationLedger.js', () => ({+ observeEidoverseWorld: (...args) => mocks.observeWorld(...args),+}));vi.mock('./eidoverseWorld.js', () => ({getEidoverseWorldStatus: (...args) => mocks.worldStatus(...args),projectEidoverseWorld: (...args) => mocks.worldProject(...args),@@ -99,6 +103,8 @@ vi.mock('./cosState.js', () => ({withStateLock: vi.fn(async (fn) => fn()),}));+import { buildEidoverseWorldSignals } from '../lib/eidoverseWorldSignals.js';+import { buildEidoverseObservation } from '../lib/eidoverseObservation.js';import { DEFAULT_TOOL_ACTIVATION_RETENTION_TURNS } from '../lib/persistentMindToolActivation.js';import {__testing,@@ -123,6 +129,27 @@ beforeEach(() => {});describe('cosToolRegistry', () => {+ it('delivers bounded stopped-task reasons under the observation grant without enabling reports', async () => {+ const tasks = Array.from({ length: 2 }, (_, index) => ({ id: `invented-task-${index}`,+ status: 'blocked', metadata: { blockedCategory: 'user-terminated' } }));+ mocks.observeWorld.mockImplementation(async () => buildEidoverseObservation({+ source: buildEidoverseWorldSignals({ agents: [], taskState: { tasks } }, { includeAttentionReasons: true }),+ }).report);+ const call = { requestId: 'observe-stopped-tasks', name: 'eidoverse.observe', arguments: {} };+ await expect(executeCosToolCall({ call, authority: { scope: 'mind', capabilities: {} } }))+ .rejects.toMatchObject({ code: 'TOOL_CAPABILITY_DENIED' });+ expect(mocks.observeWorld).not.toHaveBeenCalled();+ const authority = { scope: 'mind', capabilities: { manageEidoverse: true }, reportAccess: false };+ const observed = await executeCosToolCall({ call, authority });+ expect(observed.result.places.find((place) => place.id === 'agents').attentionSignals).toEqual([+ { source: 'tasks', severity: 'error', signalCount: 2,+ reasons: [{ code: 'task_user_terminated', affectedCount: 2 }] },+ ]);+ await expect(executeCosToolCall({ call: { requestId: 'report-still-disabled', name: 'reports.read',+ arguments: {} }, authority })).rejects.toMatchObject({ code: 'TOOL_CAPABILITY_DENIED' });+ expect(tasks.every((task) => task.status === 'blocked')).toBe(true);+ });+it('requires the independent delegation grant, validates the packet, and replays one accepted proposal', async () => {const call = { requestId: 'sandbox-1', name: 'sandbox.delegate', arguments: {providerId: 'free-api', model: 'openrouter/free', kind: 'text', task: 'Write a greeting',