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
fix: address follow-up streak cleanup review
[._.]/ Adam Eivy8e6ada1d1a1b
diff --git a/docs/features/openworld.md b/docs/features/openworld.mdindex e4aa9f5210..ee1f3d1055 100644--- a/docs/features/openworld.md+++ b/docs/features/openworld.md@@ -139,7 +139,7 @@ what's healthy, what's not, find a specific app, and take action.| **1.9** | **Status filter chips in HUD** — All / Online / Stopped / Errored / Has-Agent / Has-Pending-Review pill row above legend. Persists per-session. | S || **1.10** | **Hover preview card with quick actions** — show status / uptime / CPU / MEM / err / recent log line, with **Logs / Restart / Deploy / Open** buttons. Restart and Deploy POST to existing endpoints with explicit confirmation. | M || **1.11** | **Clickable HUD stats** — every count routes somewhere: PENDING REVIEWS → `/review`, AGENTS → `/cos`, NODES → `/instances`, etc. | XS |-| **1.12** | **Richer billboards** — rotate today's briefing headline, productivity streak, top actionable insight, recent agent completion summary, goal progress. | S |+| **1.12** | **Richer billboards** — rotate today's briefing headline, top actionable insight, recent agent completion summary, goal progress. | S || **1.13** | **Agent → building tether** — visible light from `AgentEntity` to its assigned building; color = agent state. Plus window-pulse animation on the building. | M || **1.14** | **Mobile / touch support** — `pointer: coarse` detection, single-finger orbit, two-finger pinch zoom, tap-to-select. Below 640px collapse HUD into a bottom sheet with search + filters + needs-attention. WASD exploration disables. AGENTS.md mandate. | M || **1.15** | **Adaptive render budget** — the scene selects an internal detail tier from sustained frame time; player settings do not expose renderer knobs. | XS |@@ -155,7 +155,7 @@ Goal: every major system PortOS tracks has a place in the city.| **2.3** | **Backup vault landmark** — pulses on `backup:started/completed`, label shows time-since-last-snapshot, goes red when stale. | S || **2.4** | **Voice agent district marker** — small area whose lighting mirrors voice-agent state (idle / dictating / error). | S || **2.5** | **Federation horizon** — peers as distant skyline silhouettes; opacity = reachability, bridge condition = sync state. Even with one instance the void zone stays visible. | M |-| **2.6** | **Productivity district** — streak monument, activity heatmap ground tiles, task flow river. Driven by `/api/cos/productivity/*`. | L |+| **2.6** | **Productivity district** — throughput monument, activity heatmap ground tiles, task flow river. Driven by `/api/cos/productivity/*`. | L || **2.7** | **Goal monuments** — active goals as construction sites; completed goals as polished monuments; stalled goals dimmed. Driven by `/api/digital-twin/identity/goals`. | L || **2.8** | **Mini-map overlay** — top-down map in HUD corner with click-to-teleport. | M || **2.9** | **Health vitals tower** — biometric tower in a wellness district visualizing heart rate / steps / sleep / calories from `/api/meatspace/apple-health/metrics/latest`. | M |@@ -172,7 +172,7 @@ Goal: the city feels alive, distinctive, and earned.| **3.2** | **Memory / knowledge district** — categories as crystal clusters, graph edges as light bridges, brain inbox as a glowing well. Driven by `/api/memory/graph`. | L || **3.3** | **Photo mode / cinematic camera** — pause animations, cinematic presets, depth-of-field, vignette, high-res screenshots, "city postcard" with stats overlay. | M || **3.4** | **Ambient soundscape tied to data** — base key/tempo follows system health; agent activity adds rhythmic voices; completed tasks chime. Extends existing synth music. | L |-| **3.5** | **Earned artifacts & achievements** — milestone statues, streak trophies, easter eggs. | M |+| **3.5** | **Earned artifacts & achievements** — milestone statues and easter eggs. | M || **3.6** | **Historical timeline scrubber** — scrub back to past city states; buildings appear/disappear via construction animations. Requires snapshot data. | L || **3.7** | **JIRA sprint district** — current sprint tickets as crates / under-construction / completed structures. | M || **3.8** | **Throttle expensive socket-driven repaints** — coalesce noisy event bursts into a 100ms tick. Becomes load-bearing once Phase 2's beams/vehicles ship. | S |@@ -267,7 +267,7 @@ styles so a status means the same thing in either world.| `/api/cos/queue` (or `/api/cos`) | 1.7, 2.2 | task queue depth || `/api/instances/peers` | 1.7, 2.5 | sync failures, peer rendering || `/api/cos/briefings/latest` | 1.12 | billboard headline |-| `/api/cos/productivity/summary` | 1.12, 2.6 | streak, throughput |+| `/api/cos/productivity/summary` | 1.12, 2.6 | throughput, pace || `/api/cos/productivity/trends` | 2.6 | activity heatmap || `/api/digital-twin/identity/goals` | 2.7 | goal monuments || `/api/digital-twin/identity/chronotype/energy-schedule` | 3.1 | energy overlay |diff --git a/server/routes/cosInsightRoutes.js b/server/routes/cosInsightRoutes.jsindex ce8c30555a..8b3df7ca53 100644--- a/server/routes/cosInsightRoutes.js+++ b/server/routes/cosInsightRoutes.js@@ -5,7 +5,6 @@import { Router } from 'express';import * as cos from '../services/cos.js';import * as taskLearning from '../services/taskLearning.js';-import * as autonomousJobs from '../services/autonomousJobs.js';import * as productivity from '../services/productivity.js';import * as goalProgress from '../services/goalProgress.js';import * as decisionLog from '../services/decisionLog.js';@@ -210,15 +209,12 @@ router.get('/recent-tasks', asyncHandler(async (req, res) => {}));// GET /api/cos/quick-summary - Get at-a-glance dashboard summary-// Combines today's activity, next job, and pending approvals into one efficient call+// Combines today's activity, queue counts, and velocity into one efficient call.router.get('/quick-summary', asyncHandler(async (req, res) => {- const [todayActivity, tasksData, jobStats, velocityData, weekData, optimalTime] = await Promise.all([+ const [todayActivity, tasksData, velocityData] = await Promise.all([cos.getTodayActivity(),cos.getAllTasks(),- autonomousJobs.getJobStats(),- productivity.getVelocityMetrics(),- productivity.getWeekComparison(),- productivity.getOptimalTimeInfo()+ productivity.getVelocityMetrics()]);// Count pending approvals from system tasks@@ -227,18 +223,6 @@ router.get('/quick-summary', asyncHandler(async (req, res) => {// Count pending user tasksconst pendingUserTasks = tasksData.user?.grouped?.pending?.length || 0;- // Combine all pending tasks for queue estimate- const allPendingTasks = [- ...(tasksData.user?.grouped?.pending || []),- ...(tasksData.cos?.grouped?.pending || [])- ];-- // Get queue completion estimate- const queueEstimate = await taskLearning.estimateQueueCompletion(- allPendingTasks,- todayActivity.stats.running- );-res.json({today: {completed: todayActivity.stats.completed,@@ -246,8 +230,7 @@ router.get('/quick-summary', asyncHandler(async (req, res) => {failed: todayActivity.stats.failed,running: todayActivity.stats.running,successRate: todayActivity.stats.successRate,- timeWorked: todayActivity.time.combined,- accomplishments: todayActivity.accomplishments || []+ timeWorked: todayActivity.time.combined},velocity: {percentage: velocityData.velocity,@@ -255,20 +238,16 @@ router.get('/quick-summary', asyncHandler(async (req, res) => {avgPerDay: velocityData.avgPerDay,historicalDays: velocityData.historicalDays},- nextJob: jobStats.nextDue,queue: {pendingApprovals,pendingUserTasks,- total: pendingApprovals + pendingUserTasks,- estimate: queueEstimate+ total: pendingApprovals + pendingUserTasks},status: {running: todayActivity.isRunning,paused: todayActivity.isPaused,lastEvaluation: todayActivity.lastEvaluation- },- weekComparison: weekData,- optimalTime+ }});}));diff --git a/server/routes/cosInsightRoutes.test.js b/server/routes/cosInsightRoutes.test.jsindex 1a9b18d614..023eb84aba 100644--- a/server/routes/cosInsightRoutes.test.js+++ b/server/routes/cosInsightRoutes.test.js@@ -12,12 +12,7 @@ vi.mock('../services/cos.js', () => ({}));vi.mock('../services/taskLearning.js', () => ({- getLearningInsights: vi.fn(),- estimateQueueCompletion: vi.fn()-}));--vi.mock('../services/autonomousJobs.js', () => ({- getJobStats: vi.fn()+ getLearningInsights: vi.fn()}));vi.mock('../services/productivity.js', () => ({@@ -48,7 +43,6 @@ vi.mock('../services/notifications.js', () => ({import * as cos from '../services/cos.js';import * as taskLearning from '../services/taskLearning.js';-import * as autonomousJobs from '../services/autonomousJobs.js';import * as productivity from '../services/productivity.js';import * as goalProgress from '../services/goalProgress.js';import * as decisionLog from '../services/decisionLog.js';@@ -281,19 +275,20 @@ describe('CoS Insight Routes', () => {user: { grouped: { pending: [] } },cos: { awaitingApproval: [], grouped: { pending: [] } }});- autonomousJobs.getJobStats.mockResolvedValue({ nextDue: null });productivity.getVelocityMetrics.mockResolvedValue({velocity: 120, velocityLabel: 'Above average', avgPerDay: 3, historicalDays: 30});- productivity.getWeekComparison.mockResolvedValue({ delta: 2 });- productivity.getOptimalTimeInfo.mockResolvedValue({ hasData: false });- taskLearning.estimateQueueCompletion.mockResolvedValue({ eta: null });const response = await request(app).get('/api/cos/quick-summary');expect(response.status).toBe(200);expect(response.body.today.completed).toBe(3);expect(response.body).not.toHaveProperty('streak');+ expect(response.body).not.toHaveProperty('nextJob');+ expect(response.body).not.toHaveProperty('weekComparison');+ expect(response.body).not.toHaveProperty('optimalTime');+ expect(response.body.today).not.toHaveProperty('accomplishments');+ expect(response.body.queue).not.toHaveProperty('estimate');expect(response.body.velocity.percentage).toBe(120);});});diff --git a/server/services/productivity.js b/server/services/productivity.jsindex fff242d4ea..8345fdabc2 100644--- a/server/services/productivity.js+++ b/server/services/productivity.js@@ -47,6 +47,9 @@ export async function loadProductivity() {// normal write removes it from disk without needing a destructive migration.const currentData = { ...data };delete currentData.streaks;+ if (Array.isArray(currentData.milestones)) {+ currentData.milestones = currentData.milestones.filter((milestone) => milestone?.type !== 'streak');+ }// Merge with defaults to ensure all current fields exist.return {...defaults,diff --git a/server/services/productivity.test.js b/server/services/productivity.test.jsindex cb2677dec6..3cbc785fd2 100644--- a/server/services/productivity.test.js+++ b/server/services/productivity.test.js@@ -310,6 +310,7 @@ describe('getProductivitySummary', () => {hourlyPatterns: {}, dailyPatterns: {}, dailyHistory: {},totals: { totalTasks: 20, successfulTasks: 18, successRate: 90, activeDays: 11, activeWeeks: 3 },milestones: [+ { type: 'streak', value: 30, description: '30-day work streak' },{ type: 'tasks', value: 10, description: 'Completed 10 tasks' },{ type: 'tasks', value: 25, description: 'Completed 25 tasks' },],