# Release v0.12.48 - Changelog

Released: 2026-02-14

## Overview

This release adds branch management and automated release workflow capabilities to the DevTools Git page.

## Features

### DevTools Git — Branch Update, Comparison & Release PR Workflow
- **Update Branches button**: One-click fetch and fast-forward merge of `dev` and `main` from origin, with automatic stash/restore if the working tree is dirty
- **Branch Comparison panel**: Shows how many commits `dev` is ahead of `main`, with commit list, diff stats (+insertions/-deletions/files changed), displayed as a "Release Status" card
- **Automated Release PR**: "Create Release PR" button triggers a full CoS agent task that pushes commits, updates the changelog, creates a PR from dev to main, iterates with Copilot review feedback (up to 3 rounds), verifies CI, and merges when approved
- **Release Confirmation dialog**: Modal listing the exact steps the agent will perform, preventing accidental releases
- **Push endpoint**: New server endpoint for pushing branches to origin, used by the release workflow

**Server changes**:
- `server/services/git.js` — Added `fetchOrigin`, `updateBranches`, `getBranchComparison`, `push` functions
- `server/routes/git.js` — Added `/update-branches`, `/branch-comparison`, `/push` POST endpoints

**Client changes**:
- `client/src/services/api.js` — Added `updateBranches`, `getBranchComparison`, `pushBranch` API functions
- `client/src/pages/DevTools.jsx` — Expanded GitPage with Update button, Release Status panel, release confirmation dialog, and CoS task integration

### CoS — Productivity & Streaks Dashboard
- **New Productivity Tab**: Added a "Streaks" tab to the Chief of Staff page that tracks work patterns and productivity metrics
- **Work Streaks**: Tracks consecutive days and weeks with completed tasks, displaying current and best streaks with visual emphasis
- **Hourly & Daily Patterns**: Analyzes which hours and days of the week have the highest success rates for tasks
- **AI Insights**: Generates recommendations like "Peak Performance Hour" and "Most Productive Day" based on historical patterns
- **Milestones**: Tracks achievements like "Completed 100 tasks" or "7-day work streak"
- **Gamification**: Flame icon for active streaks, trophy icons for milestones, encouraging consistent productivity
- **Daily Task Trends Chart**: Visual bar chart showing daily task completions over the last 30 days with success rate color coding, rolling averages, and trend analysis (volume/success rate trending up/down/stable)

**Server changes**:
- `server/services/productivity.js` — New service with streak calculation, pattern analysis, milestone tracking, daily history tracking, and trend calculations
- `server/routes/cos.js` — Added `/productivity`, `/productivity/summary`, `/productivity/recalculate`, `/productivity/trends` endpoints

**Client changes**:
- `client/src/components/cos/tabs/ProductivityTab.jsx` — Full-featured productivity dashboard with collapsible sections
- `client/src/components/cos/DailyTrendsChart.jsx` — Interactive bar chart component showing 30-day task completion history with tooltips, trend indicators, and success rate legend
- `client/src/components/cos/constants.js` — Added "Streaks" tab with Flame icon
- `client/src/services/api.js` — Added `getCosProductivity`, `getCosProductivitySummary`, `recalculateCosProductivity` functions

### Media → Security Page Rename
- **Renamed** the "Media" page to "Security" to better reflect its purpose as a remote security camera and microphone
- Updated route from `/media` to `/security`
- Added descriptive subtitle explaining the page turns the PortOS host into a remote webcam and audio monitor accessible over Tailscale from a phone

### DevTools Git — Generic Git Management for All Managed Apps
- **Auto-detect branches**: Server now detects `main`/`master` and `dev`/`develop` branches per-repo instead of hardcoding `dev`/`main`
- **Changelog detection**: `getGitInfo()` returns whether a `.changelog/` directory exists, enabling conditional changelog steps in release prompts
- **Generalized Update**: `updateBranches()` auto-detects which branches to update instead of hardcoded `['dev', 'main']`
- **Generalized Release PR**: `buildReleasePrompt()` now uses the app name, detected branch names, and conditionally includes changelog management based on repo structure
- **App filtering**: Archived apps are filtered out of the Git page dropdown
- **Dynamic UI**: Branch comparison label, release button visibility, release dialog steps, and toast messages all adapt to detected branch names

### CoS — Completed Agent Timestamps
- **Completed timestamp display**: Completed agent cards now show the date and time they finished (e.g., "Feb 8 3:30 PM") next to the duration, with full timestamp on hover

### Agents — Tools Tab with AI Content Generation & Autonomous Engagement
- **Tools tab**: New tab in the Agents page for interactive Moltbook content creation and engagement
- **AI post generation**: Generate Moltbook posts in an agent's unique voice using their personality profile, topics, and style
- **AI comment generation**: Generate contextual replies to posts with awareness of existing comments and agent history
- **Feed browser**: Browse and sort the Moltbook feed, or use AI-powered relevance scoring to find posts matching an agent's topics
- **Post & Comment composer**: Preview, edit, and publish AI-generated content with one-click publishing
- **Autonomous engage**: One-click "Engage Now" button that finds relevant posts, upvotes them, and generates/posts AI comments
- **History-aware prompts**: Content generation includes recent agent activity to avoid repetitive posts and comments
- **`engage` action type**: New scheduled action type for autonomous agent engagement (browsing + voting + commenting)
- **AI-powered action executor**: Post and comment scheduled actions now auto-generate content via AI when params are empty

**Server changes**:
- `server/services/agentContentGenerator.js` — New service with `generatePost`, `generateComment`, `generateReply`, and shared prompt-building helpers
- `server/services/agentFeedFilter.js` — New service with `scorePosts`, `findRelevantPosts`, `findReplyOpportunities` for topic-based feed filtering
- `server/routes/agentTools.js` — 10 new endpoints for content generation, publishing, feed browsing, and engagement
- `server/services/agentActionExecutor.js` — Enhanced with AI content generation fallback and new `engage` compound action
- `server/lib/validation.js` — Added tool schemas and `engage` action type

**Client changes**:
- `client/src/components/agents/tabs/ToolsTab.jsx` — Full-featured tools UI with feed browser, post/comment composers, drafts panel, and engage button
- `client/src/services/api.js` — Added 11 new API functions for agent tools plus 4 for draft management
- `client/src/components/agents/constants.js` — Added Tools tab and Engage action type

### Agents — Draft Persistence for Generated Content
- **Auto-save drafts**: AI-generated posts and comments are automatically saved as drafts, so content isn't lost when navigating away
- **Drafts panel**: New section in the Tools tab listing all saved drafts per agent, sorted by newest first
- **Load into composer**: Click a draft to load it back into the post or comment composer for further editing
- **Auto-delete on publish**: Drafts are automatically removed when their content is published to Moltbook
- **Manual delete**: Remove unwanted drafts with the delete button

**Server changes**:
- `server/services/agentDrafts.js` — New service for draft CRUD operations, persisting to `data/agents/drafts/{agentId}.json`
- `server/routes/agentTools.js` — Added GET/POST/PUT/DELETE draft endpoints
- `server/lib/validation.js` — Added `createDraftSchema` and `updateDraftSchema`

### Agents — Published Content Tracking
- **Published content panel**: New section in Tools tab showing all posts and comments published by an agent
- **Live engagement metrics**: Displays current score and comment count fetched from Moltbook API
- **Direct links**: Each published item links directly to its page on Moltbook
- **Configurable timeframe**: View published content from the last 7, 14, or 30 days
- **Auto-refresh**: Published content list refreshes after publishing or engaging

**Server changes**:
- `server/routes/agentTools.js` — Added `GET /published` endpoint that aggregates activity logs across multiple days and enriches with live Moltbook data

**Client changes**:
- `client/src/services/api.js` — Added `getAgentPublished()` API function
- `client/src/components/agents/tabs/ToolsTab.jsx` — Published Content section with posts/comments tables, engagement stats, days selector, and auto-refresh on publish/engage

### Agents — Post Monitor & Engagement Response
- **Check Posts button**: One-click check of engagement on all published posts, with comment counts and scores
- **Auto-upvote**: Upvotes positive comments on the agent's posts (respects rate limits)
- **AI reply generation**: Generates and publishes contextual replies to comments using the agent's personality
- **`monitor` scheduled action**: New automation type for recurring post engagement checks
- **Engagement summary**: Results panel showing posts checked, comments found, upvotes given, and replies posted

**Server changes**:
- `server/services/agentPublished.js` — New shared service for collecting published posts from activity logs (extracted from route for DRY reuse)
- `server/routes/agentTools.js` — Added `POST /check-posts` endpoint, refactored `/published` to use shared helper
- `server/services/agentActionExecutor.js` — Added `executeMonitor` function and `monitor` case to action dispatch
- `server/lib/validation.js` — Added `monitor` to action types, added `checkPostsSchema`

**Client changes**:
- `client/src/services/api.js` — Added `checkAgentPosts()` API function
- `client/src/components/agents/tabs/ToolsTab.jsx` — Added Check Posts button, loading spinner, and engagement results panel
- `client/src/components/agents/constants.js` — Added `monitor` action type

### Agents — Agent-Centric Drill-Down Redesign
- **Agent list view**: Top-level grid of agent cards with aggregate stats, replacing the flat tab layout
- **Agent detail view**: Drill into any agent to see all its data: personality, accounts, tools, published content, schedules, and activity
- **Merged Overview tab**: Personality editing and account management unified in a single view per agent
- **Published content tab**: Promoted from a section in Tools to its own dedicated tab with engagement metrics
- **Scoped sub-tabs**: All sub-tabs (Tools, Published, Schedules, Activity) are automatically filtered to the selected agent — no more redundant agent selectors
- **Deep-linkable URLs**: Every view has a unique URL (e.g., `/agents/:id/tools`, `/agents/:id/published`)
- **Simplified sidebar**: Agents section collapsed from a 5-item expandable menu to a single link

### App Icon & Favicon
- **Custom app icon**: New SVG favicon and PNG icons matching the PortOS portal logo design with blue accent on dark background
- **iOS Home Screen support**: Added `apple-touch-icon.png` (180x180) so the app looks great when added to iOS Home Screen
- **PWA manifest**: Added `manifest.json` with 192px and 512px icons, enabling proper Add to Home Screen on Android
- **Multi-format favicon**: SVG for modern browsers, ICO fallback for legacy browsers
- **Theme color**: Added `theme-color` meta tag matching PortOS dark background (#0f0f0f)

### Dashboard — Archived App Styling
- **Greyed-out cards**: Archived apps on the main dashboard now render with reduced opacity, dimmed icon/title colors, and a subtle "Archived" badge next to the app name
- **Sorted to bottom**: Archived apps are sorted after active apps in the grid so they don't intermix with actively managed services
- **Excluded from stats**: The Quick Stats cards (Total, Online, Stopped, Not Started) now count only active apps; the header shows an "(N archived)" count when archived apps exist

### CyberCity 3D Dashboard
- **Immersive 3D city visualization**: Navigate an interactive cyberpunk cityscape where each managed app is a neon-lit building, providing a spatial overview of your entire infrastructure
- **Status-driven buildings**: Building height and neon edge color reflect app status — tall cyan for online, amber for stopped, dim indigo for not started, and muted slate in the warehouse district for archived apps
- **Live AI agent entities**: Active CoS agents appear as floating, rotating diamond wireframes above the building they're working on, with sparkle trails and state-based coloring
- **Tron-style ground grid**: Infinite cyan grid with fog depth fade creates cyberpunk atmosphere
- **Real-time HUD overlay**: Clock, connection status, CoS activity indicator, scrolling activity log from `cos:log` events, and an agent status bar at the bottom
- **Full orbit controls**: Mouse drag to rotate, scroll to zoom, right-click to pan around the city
- **Lazy-loaded**: CyberCity bundle only loads when navigating to `/city`, keeping the main bundle lean
- **Real-time updates**: Buildings update live via WebSocket when apps start/stop, agents appear/complete via CoS socket events
- **Twinkling starfield**: Enhanced sky with 1500 color-varied stars using a custom shader — soft circular points, per-star twinkle animation, and fog-immune rendering so stars are visible through the atmospheric haze
- **Full building names**: App names display in full on building facades using intelligent word-wrapping — hyphens, underscores, and dots are replaced with spaces (e.g., "void-server" renders as "VOID SERVER" across two lines)
- **Visible archive district**: Archived buildings are taller, brighter, and closer to the main city — upgraded from near-invisible to a clearly distinguishable warehouse district with brighter slate wireframes and always-on holographic labels
- **Pixel art window murals**: Each building displays a unique pixel art icon (heart, server rack, lightning, star, shield, gear, globe, terminal) rendered as lit office windows on the building face — deterministic per app via name hash
- **Floating holographic decorations**: Animated 3D wireframe shapes hover above each building rooftop — diamonds, inverted pyramids, Saturn spheres, stacked rings, cubes, and beacon orbs — slowly rotating and bobbing with accent-colored glow

**Client changes**:
- `client/src/pages/CyberCity.jsx` — Page component with data hook integration and HUD overlay
- `client/src/hooks/useCityData.js` — Data hook fetching apps, agents, CoS status with socket subscriptions
- `client/src/components/city/CityScene.jsx` — React Three Fiber Canvas with orbit controls
- `client/src/components/city/CityGround.jsx` — drei Grid with Tron-style cyan lines
- `client/src/components/city/CityLights.jsx` — Ambient, point lights, and fog for atmosphere
- `client/src/components/city/Building.jsx` — App building mesh with neon wireframe edges, pixel art window murals, and hover glow
- `client/src/components/city/BuildingHologram.jsx` — Animated rooftop holographic decorations (6 shape types)
- `client/src/components/city/BuildingCluster.jsx` — Positions all buildings via layout algorithm with archive district
- `client/src/components/city/AgentEntity.jsx` — Floating octahedron agent with bob animation and sparkles
- `client/src/components/city/HolographicPanel.jsx` — drei Html floating status label per building
- `client/src/components/city/CityParticles.jsx` — Ambient sparkle particles across the scene
- `client/src/components/city/CityHud.jsx` — HTML overlay with clock, status, activity log, agent bar
- `client/src/components/city/CityActivityLog.jsx` — Scrolling cos:log event feed
- `client/src/components/city/CityAgentBar.jsx` — Bottom bar showing active agent pills
- `client/src/components/city/cityLayout.js` — Pure layout function: downtown grid + warehouse district
- `client/src/components/city/cityConstants.js` — Colors, dimensions, district parameters
- `client/src/App.jsx` — Added lazy-loaded `/city` route
- `client/src/components/Layout.jsx` — Added CyberCity nav item and full-bleed layout support

### CyberCity — Dynamic City Life Enhancements
- **Animated data streams**: Glowing data packets fly between connected downtown buildings as light trails, visualizing network connectivity between apps — packets travel both directions at varying speeds with sine-arc trajectories and faint connection lines
- **Hover traffic**: Flying hover vehicles cruise around the city at multiple altitudes — perimeter patrol cars circle the downtown district while cross-city lanes slice through at higher elevations, each with engine glow, tail lights, and tilting turns
- **Neon road grid**: Animated road network with dark tarmac strips, glowing edge lines, and traveling light pulses laid out between building rows and columns — distinct neon accent colors per road segment
- **CRT scanline overlay**: Subtle retro-futuristic CRT effect layered over the entire view — horizontal scanlines, radial vignette darkening at edges, and faint chromatic aberration glow for maximum cyberpunk atmosphere
- **Building click navigation**: Clicking any building in the 3D city navigates to the Apps page for quick management access

**Client changes**:
- `client/src/components/city/CityDataStreams.jsx` — Animated data packet trails between connected buildings
- `client/src/components/city/CityTraffic.jsx` — Flying hover vehicles with perimeter and cross-city flight paths
- `client/src/components/city/CityRoads.jsx` — Neon-lit road grid with animated light pulses
- `client/src/components/city/CityScanlines.jsx` — CSS-based CRT scanline, vignette, and chromatic aberration overlay
- `client/src/components/city/CityScene.jsx` — Integrated new scene layers with position data flow
- `client/src/components/city/BuildingCluster.jsx` — Added position callback for data stream/traffic/road coordination
- `client/src/pages/CyberCity.jsx` — Added scanline overlay, building click navigation via React Router

### CyberCity — Immersive Atmosphere & Live Intel
- **Dynamic weather system**: Rain particles and lightning flashes respond to system health — clear skies when all apps are online, increasing rain intensity as more systems go down, with dramatic lightning flashes during critical states. Rain uses custom GPU shaders for elongated drop effects with depth-aware sizing
- **Shooting stars**: Occasional bright meteors streak across the sky with glowing heads and fading trails — 3 staggered slots spawn at random intervals with randomized colors (white, blue-white, golden, cyan), directions, and speeds for a living sky that rewards idle watching
- **Holographic billboards**: Floating neon-framed displays positioned around the downtown perimeter showing rotating real-time system data — online/total counts, uptime percentage, CoS engine status, today's completed tasks, and active work streak. Messages cycle every 6 seconds with gentle bobbing animation
- **Enhanced HUD vitals panel**: New "VITALS" section below the clock showing session uptime, weather status (derived from system health ratio: CLEAR/FAIR/OVERCAST/RAIN/STORM), active agent count, stopped/archived counts, today's task completions, and work streak — all updating in real-time with color-coded status indicators
- **Productivity data integration**: CyberCity now fetches CoS quick-summary data (refreshed every 60s) and flows it through to billboards and HUD, making the city a live operational dashboard

**Client changes**:
- `client/src/components/city/CityWeather.jsx` — GPU shader rain particles with health-reactive intensity + lightning flash system
- `client/src/components/city/CityShootingStars.jsx` — Staggered shooting star spawner with glowing head meshes and shader trail lines
- `client/src/components/city/CityBillboards.jsx` — Floating holographic billboards with neon frames, cycling messages, and support poles
- `client/src/components/city/CityHud.jsx` — Added VITALS panel with uptime, weather, agents, stopped, archived, tasks, and streak stats
- `client/src/components/city/CityScene.jsx` — Integrated weather, billboards, and shooting stars into the 3D scene
- `client/src/pages/CyberCity.jsx` — Added productivity data fetching and prop threading to scene and HUD

### Digital Twin — Genome Section
- **Genome tab**: New "Genome" tab on the Digital Twin page for uploading and analyzing 23andMe raw genome data
- **File upload**: Drag-and-drop or file picker for 23andMe TSV exports (~600K SNPs), parsed and indexed locally with 1-hour in-memory cache for O(1) rsid lookups
- **34 curated health markers** across 13 categories: longevity (FOXO3A, IGF1R, CETP, IPMK, FTO), cardiovascular (Factor V Leiden, 9p21, Lp(a), Prothrombin), tumor suppression (TP53), iron metabolism (HFE H63D, C282Y), methylation (MTHFR C677T/A1298C, COMT, AHCY), nutrients (VDR, BCMO1, FUT2, VDBP), cognitive (BDNF), caffeine (ADA, CYP1A2), sleep (CLOCK, DEC2), athletic (ACTN3, ACE), detoxification (CYP2B6, SOD2, CYP2C19, NQO1), inflammation (IL-6, TNF-alpha), and skin (MC1R)
- **Genotype classification**: Each marker's genotype is automatically classified as beneficial, typical, concern, or major_concern with evidence-based implications
- **Category-grouped grid display**: Markers displayed as compact tiles in a responsive grid (1/2/3 columns) within collapsible category cards, each with emoji category headers, color-coded status dots, and click-to-expand detail panels with implications, notes, and location info
- **SNP search**: Look up any rsid in your genome data with instant results and optional save-to-markers
- **Full CRUD**: Save custom markers, edit notes (with debounced auto-save), delete individual markers, or wipe all genome data with confirmation
- **ClinVar database integration**: One-click sync downloads NCBI's ClinVar variant database (~3M variants), stream-parses it to extract clinically significant SNPs (pathogenic, risk factors, drug response, protective), and builds a local search index. Scanning your genome against ClinVar surfaces hundreds of clinically annotated findings with severity levels, associated conditions, and ClinVar review star ratings
- **ClinVar results browser**: Filterable results view with severity tabs (Pathogenic, Risk Factor, Drug Response, Protective), minimum star filter, expandable details with conditions/classification/review status, and a 200-result paginated view
- **Privacy-first**: All data stored locally on the server — genome file never leaves the machine

**Server changes**:
- `server/lib/curatedGenomeMarkers.js` — Curated SNP database with 34 markers across 13 categories, `classifyGenotype()` and `formatGenotype()` functions
- `server/lib/genomeValidation.js` — Zod schemas for upload, search, save, and notes update
- `server/services/genome.js` — Core service with lazy-loaded in-memory Map index, upload/scan/search/CRUD/delete operations
- `server/services/clinvar.js` — ClinVar sync pipeline: streaming download of variant_summary.txt.gz from NCBI, gunzip + line-by-line parse, filtered index of actionable SNPs, genome cross-reference scan
- `server/routes/genome.js` — 12 REST endpoints mounted at `/api/digital-twin/genome` (including 4 ClinVar endpoints)

**Client changes**:
- `client/src/components/digital-twin/tabs/GenomeTab.jsx` — Main tab with upload drop-zone, stats bar, curated markers view, SNP search, and delete confirmation
- `client/src/components/digital-twin/GenomeCategoryCard.jsx` — Reusable collapsible card for marker category groups with status summary
- `client/src/components/digital-twin/constants.js` — Added Genome tab with Dna icon
- `client/src/services/api.js` — Added 8 genome API functions

### CyberCity — Dynamic Sky & Time-of-Day System
- **Time-of-day presets**: New "Time of Day" setting with 4 presets — Sunrise, Noon, Sunset, Midnight — each with unique sky colors, sun/moon position, and scene lighting intensity
- **Overhead sun arc**: Sun traces a proper arc from east horizon (sunrise) through zenith (noon) to west horizon (sunset) and below (midnight), computed from hour-based sinusoidal elevation + azimuth sweep
- **Cyberpunk sky dome**: Custom GLSL gradient shader on an inverted sphere — deep indigo zenith, purple mid-sky, warm magenta/orange horizon at sunset; brighter blue tones at noon; near-black at midnight — with animated noise ripple for living atmosphere
- **Moon at midnight**: Smaller, dimmer celestial body with cool silver/blue glow replaces the warm sun, with matching blue-tinted sky dome colors
- **Smooth preset transitions**: Switching time-of-day smoothly lerps sky colors, celestial body position/scale/colors, and directional light along the shortest path on the 24h clock
- **Daylight-reactive scene lighting**: All scene lights (ambient, point, animated, searchlight) multiply by the preset's `daylightFactor` — noon is bright (1.8x), sunset/sunrise are moderate (0.6x), midnight is dim (0.3x)
- **Fixed ambient brightness slider**: Slider now visibly changes scene brightness in real-time — all lights use refs + `useFrame` to read brightness every frame, combined with daylight factor for immediate response
- **Removed fog**: Fog feature removed entirely — Three.js fog approaches didn't produce the desired visual effect

**New files**:
- `client/src/components/city/CitySky.jsx` — Sky dome gradient shader + celestial body mesh + directional light with hour-based arc

**Modified files**:
- `client/src/components/city/CityLights.jsx` — Rewritten with refs + useFrame, daylight factor from timeOfDay presets
- `client/src/components/city/CityEffects.jsx` — Removed depth fog shader, simplified pipeline
- `client/src/components/city/CityScene.jsx` — Removed fog, added CitySky
- `client/src/components/city/cityConstants.js` — Added timeOfDay presets with sky colors, hours, daylight factors
- `client/src/components/city/CitySettingsPanel.jsx` — Replaced fog slider with time-of-day preset buttons
- `client/src/hooks/useCitySettings.js` — Removed fogDensity, added timeOfDay setting


### Brain — Mark Inbox Items as Done
- **Done status**: Inbox items can now be marked as "done" from both the Filed and Needs Review sections, adding a new terminal state for processed thoughts
- **API endpoint**: `POST /api/brain/inbox/:id/done` sets status to `done` with a `doneAt` timestamp, usable by both the UI and the CoS agent
- **Done section**: Collapsed "Done" section at the bottom of the inbox shows completed items with strikethrough text, destination badges, and memory links
- **Needs Review done**: Items in Needs Review can be marked done without filing — useful for fleeting thoughts that don't need to be stored

**Server changes**:
- `server/lib/brainValidation.js` — Added `done` to `inboxStatusEnum`
- `server/services/brainStorage.js` — Added `done` count to `getInboxLogCounts()`
- `server/services/brain.js` — Added `markInboxDone()` function
- `server/routes/brain.js` — Added `POST /inbox/:id/done` endpoint

**Client changes**:
- `client/src/services/api.js` — Added `markBrainInboxDone()` API function
- `client/src/components/brain/constants.js` — Added `done` status color
- `client/src/components/brain/tabs/InboxTab.jsx` — Done buttons on Filed and Needs Review entries, collapsible Done section

## Fixes

### ClinVar Header Parsing — Zero Variants Parsed
- **Fix**: ClinVar variant_summary.txt.gz header parsing stripped `#` from all column names, turning `RS# (dbSNP)` into `RS (dbSNP)`, so the rsid column lookup was always undefined — resulting in 0 matches from 8.6M lines
- **Solution**: Strip only the leading `#` from the header line (it's a comment prefix on `#AlleleID`) instead of from individual column names, preserving `RS# (dbSNP)` intact

### Codex CLI Provider — Wrong Argument Convention
- **Fix**: The CLI runner hardcoded `-p -` (Claude's "print, read from stdin" flag) for all CLI providers, but Codex CLI interprets `-p` as `--profile`, causing `Error loading configuration: config profile '-' not found` and immediate exit code 1
- **Solution**: Added `buildCliArgs()` function that constructs provider-specific arguments — Codex uses `exec --model <model> -` (stdin marker), Gemini uses bare args, and Claude retains `-p -`

### Managed App Port Conflict — ENV Leak & Detection
- **Fix**: When PortOS started managed apps via `startFromEcosystem()`, the PortOS server's own `PORT=5554` env var leaked into child processes. Apps with `process.env.PORT || fallback` in their ecosystem configs would bind to 5554 instead of their intended port, crashing portos-server on restart.
- **Fix**: Port detection regex in `parseEcosystemConfig()` couldn't parse `process.env.PORT || 4420` expressions — it only captured `process.env.PORT` and failed to resolve it. Now extracts the `|| fallback` value.
- **Solution**: `startFromEcosystem()` now strips `PORT` and `HOST` from the inherited env before spawning PM2, and `resolvePortValue()` handles `expr || fallback` patterns

### CoS Runner State File Corruption
- **Fix**: `loadState()` in `cos-runner/index.js` used heuristic `isValidJSON()` checks that rejected valid nested JSON (e.g., objects ending with `}}`) and missed actual corruption (extra `}` on a separate line). A concurrent `saveState()` race condition could produce partial writes, corrupting the state file.
- **Solution**: Replaced heuristic validation with direct `JSON.parse`, added atomic writes (temp file + rename) to prevent partial-write corruption, and serialized `saveState()` calls through a promise chain to eliminate race conditions

### Runner Config Access Crash
- **Fix**: `server/services/runner.js` was accessing `aiToolkitInstance.config.dataDir` and `aiToolkitInstance.config.hooks`, but the AI Toolkit object returned by `createAIToolkit()` has no `.config` property (config is internal to service closures). This caused a `TypeError: Cannot read properties of undefined (reading 'dataDir')` whenever the PortOS runner shim's `executeCliRun` was invoked.
- **Solution**: Pass `dataDir` and `hooks` explicitly to the runner shim via `setAIToolkit(toolkit, config)` and store them in a local `runnerConfig` variable

### AI Toolkit — Provider/Model Logging on Run Creation
- **Run creation log**: The AI toolkit now logs the provider name and model at the start of every AI run (e.g., `🤖 AI run [agent-content-post]: LM Studio/openai/gpt-oss-20b`), making it easy to trace which provider handled each generation in server logs

**Toolkit changes**:
- `portos-ai-toolkit/src/server/runner.js` — Added `console.log` in `createRun()` after provider resolution

### Autonomous Jobs — Daily Briefing Not Running at Scheduled Time
- **Fix**: Autonomous jobs used a simple 24-hour interval from `lastRun` with no concept of time-of-day scheduling — the daily briefing would run whenever 24 hours elapsed, not at a specific morning hour
- **Solution**: Added `scheduledTime` field (HH:MM format) to autonomous jobs. `getDueJobs()` now checks both interval elapsed AND whether the current local time has passed the scheduled time. Daily briefing defaults to `05:00`
- **UI**: Job cards display scheduled time next to interval, edit/create forms include a time picker

## Improvements

### CoS — Learning Health Summary on Dashboard
- **Learning stat card**: Added a 5th stat card to the CoS main page showing overall task learning success rate with visual health indicators
- **Quick access**: Clicking the Learning card navigates directly to the Learning tab for detailed analytics
- **Skipped task alerts**: Shows a warning count when task types have been auto-skipped due to poor performance (<30% success after 5+ attempts)
- **Status indicators**: Card border changes color based on health — purple for good, yellow for warning states, red for critical (skipped tasks)
- **Mobile support**: Learning summary displayed as a full-width card at the bottom of the mobile stats grid

**Server changes**:
- `server/services/taskLearning.js` — Added `getLearningSummary()` function returning lightweight health metrics (healthy/warning/critical/skipped counts, overall success rate)
- `server/routes/cos.js` — Added `/learning/summary` endpoint

**Client changes**:
- `client/src/services/api.js` — Added `getCosLearningSummary()` API function
- `client/src/pages/ChiefOfStaff.jsx` — Added learning summary state, fetches summary with page data, renders clickable Learning stat card in both desktop (5-column grid) and mobile layouts

### Agents — Moltbook Account Suspension Detection & Early Termination
- **Suspension detection**: API client now attaches HTTP status codes and a `suspended` flag to errors, with `isAccountSuspended()` helper for easy detection
- **Early loop termination**: Monitor (check-posts), engage, and scheduled executor loops all detect 403 "account suspended" responses and immediately halt — preventing wasted AI generation calls and failing API requests
- **Automatic account status update**: When suspension is detected, the account is automatically marked as `suspended` in the database, preventing further scheduled actions from running
- **Activity logging**: Suspended monitors log as `failed` with the suspension reason instead of `completed`

**Server changes**:
- `server/integrations/moltbook/api.js` — Enriched error objects with `.status` and `.suspended` properties, added `isAccountSuspended()` helper
- `server/routes/agentTools.js` — Check-posts endpoint detects suspension mid-loop, halts immediately, marks account suspended
- `server/services/agentActionExecutor.js` — Monitor and engage actions detect suspension and break early

### Agents — Moltbook Verification Challenge Auto-Solver
- **Challenge detection**: API responses with `verification_required: true` are automatically intercepted and solved
- **AI-powered solver**: Uses the active AI provider to interpret obfuscated math word problems (e.g., `"LoOoBbSsTtEeR cLlAaW FoOrRcCeE"` = "lobster claw force") and compute the answer
- **Regex fallback**: Word-to-number parser handles simpler challenges when AI is unavailable
- **Auto-submission**: Solved answers are submitted to `POST /api/v1/verify` with the verification code, all within the 5-minute challenge window
- **Probe script**: `server/scripts/moltbook-probe.mjs` polls suspended accounts and exercises all API endpoints to capture challenge formats

**Server changes**:
- `server/integrations/moltbook/challengeSolver.js` — New module with `solveChallenge()`, `cleanChallengeText()`, AI and regex solvers
- `server/integrations/moltbook/api.js` — Replaced speculative HMAC handler with `handleVerification()` that detects and auto-solves challenges
- `server/scripts/moltbook-probe.mjs` — New standalone probe script for challenge format discovery

### CoS — Quick Summary Widget
- **At-a-glance dashboard**: New compact status bar on the Tasks tab showing today's work, streak status, pending items, and next scheduled job
- **Today's progress**: Displays tasks completed/failed, active running count, and total time worked today
- **Streak visualization**: Shows current daily streak with fire icon that lights up orange when 3+ day streaks are active
- **Pending queue**: Highlights pending user tasks and system tasks awaiting approval
- **Next job countdown**: Shows the next scheduled autonomous job with time until due (e.g., "git-maintenance in 2h 15m")
- **Smart visibility**: Widget only appears when there's meaningful data to display, staying hidden during first-run or idle states

**Server changes**:
- `server/routes/cos.js` — Added `GET /quick-summary` endpoint that aggregates today's activity, streak data, job schedule, and pending approvals in a single efficient call

**Client changes**:
- `client/src/components/cos/QuickSummary.jsx` — New component with responsive layout, auto-refresh every 30 seconds
- `client/src/components/cos/index.js` — Exported QuickSummary component
- `client/src/services/api.js` — Added `getCosQuickSummary()` API function
- `client/src/pages/ChiefOfStaff.jsx` — Renders QuickSummary widget on the Tasks tab

### CoS — Markdown Preview for Agent Output
- **Rendered markdown**: Agent run output in the "Show" expanded panel is now rendered as styled markdown instead of raw text
- **Rich formatting**: Headings, tables, bold text, code blocks, lists, horizontal rules, and blockquotes are all properly styled with the PortOS dark theme
- **Tool line preservation**: Operational log lines (tool invocations, arrows, stderr) remain in monospace format for readability while content blocks render as markdown
- **New dependency**: Added `react-markdown` for reliable markdown parsing

**Client changes**:
- `client/src/components/cos/MarkdownOutput.jsx` — New reusable markdown rendering component with custom Tailwind-styled element mappings
- `client/src/components/cos/tabs/AgentCard.jsx` — Expanded output section now groups lines into tool blocks (monospace) and content blocks (markdown), rendered via `OutputBlocks` component

### CoS — Daily Briefing Page
- **Briefing tab**: New "Briefing" tab in the Chief of Staff page displaying daily briefings generated by the autonomous Daily Briefing job
- **Date selector**: Browse historical briefings via a dropdown showing all available dates
- **Structured display**: Briefing markdown is parsed into collapsible sections with contextual icons (tasks, agents, brain, system, focus areas)
- **Inline formatting**: Renders bold text, code snippets, bullet lists, and numbered lists from briefing markdown
- **Notification integration**: A notification is automatically created when a daily briefing completes, linking directly to `/cos/briefing`
- **Sidebar navigation**: Briefing link added to the CoS sidebar section for quick access

**Server changes**:
- `server/services/cos.js` — Added `listBriefings()`, `getBriefing(date)`, `getLatestBriefing()` functions; briefing notification on agent completion
- `server/services/notifications.js` — Added `BRIEFING_READY` notification type
- `server/routes/cos.js` — Added `GET /briefings`, `GET /briefings/latest`, `GET /briefings/:date` endpoints

**Client changes**:
- `client/src/components/cos/tabs/BriefingTab.jsx` — New tab component with markdown parsing, collapsible sections, and date navigation
- `client/src/components/cos/constants.js` — Added "Briefing" tab with Newspaper icon (first position)
- `client/src/components/cos/index.js` — Exported BriefingTab component
- `client/src/services/api.js` — Added `getCosBriefings()`, `getCosLatestBriefing()`, `getCosBriefing(date)` functions
- `client/src/components/Layout.jsx` — Added Briefing link to CoS sidebar navigation
- `client/src/pages/ChiefOfStaff.jsx` — Imported and rendered BriefingTab

### CoS — Actionable Insights Banner
- **Priority action surfacing**: New banner at the top of the Tasks tab that surfaces the single most important thing requiring user attention
- **Multi-source intelligence**: Aggregates insights from pending approvals, blocked tasks, health issues, learning failures, and unread notifications
- **Priority ranking**: Insights are sorted by priority (critical → high → medium → low → info), showing the most urgent item first
- **One-click actions**: Each insight has a labeled action button that navigates directly to the relevant page to address the item
- **Dismissible**: Insights can be dismissed for the session to focus on remaining items
- **Compact design**: Gradient-styled banner with priority-based coloring (red pulse for critical, orange for high priority) that doesn't overwhelm the UI
- **Remaining count**: Shows "+N more actions available" when multiple insights exist

**Server changes**:
- `server/routes/cos.js` — Added `GET /actionable-insights` endpoint that aggregates pending approvals, blocked tasks, health issues, learning failures, and notifications into prioritized actionable items

**Client changes**:
- `client/src/components/cos/ActionableInsightsBanner.jsx` — New component with priority-based styling, action buttons, dismiss functionality, and auto-refresh every 60 seconds
- `client/src/components/cos/index.js` — Exported ActionableInsightsBanner component
- `client/src/services/api.js` — Added `getCosActionableInsights()` API function
- `client/src/pages/ChiefOfStaff.jsx` — Renders ActionableInsightsBanner above QuickSummary on the Tasks tab

### Agents — Overview Quick Actions & Compact Layout
- **Quick Actions card**: One-click Engage Now and Check Posts directly from the Overview tab — no more navigating to Tools, selecting an account, and finding the button
- **Auto-select account**: When an agent has exactly one active platform account, it's automatically selected for quick actions (Overview) and tools (Tools tab)
- **Two-column layout**: Overview now uses a responsive 3/2 grid — personality form on the left, quick actions + AI providers + accounts on the right
- **Compact personality form**: Tone + Avatar (emoji/color) on same row, Topics + Quirks on same row, saving vertical space
- **Rate limit badges**: Quick Actions card shows remaining rate limits per action type with color-coded indicators
- **Removed AI regeneration block**: The rarely-used "Regenerate with AI" section (provider/model pickers + Generate button) removed from prime Overview real estate
- **Generate Post shortcut**: Button navigates to `/agents/:id/tools` where the full post composer lives, with account pre-selected

**Client changes**:
- `client/src/components/agents/tabs/OverviewTab.jsx` — Major rewrite: removed AI regen section, added 2-column grid layout, Quick Actions card with engage/check/generate buttons, compact form fields, rate limit display
- `client/src/components/agents/tabs/ToolsTab.jsx` — Auto-select first active account on mount

### Agents — Per-Function AI Provider/Model Configuration
- **Per-function AI config**: Each agent can now configure separate AI providers for **Content Generation** (posts/comments), **Engagement** (autonomous interactions), and **Challenge Solving** (verification)
- **Overview tab UI**: Replaced single "Default AI Provider" selector with 3 function-specific rows, each with provider + model dropdowns
- **Backward compatible**: Agents with the old `{ providerId, model }` format continue to work — per-function overrides take precedence when set
- **CLI provider fix**: Challenge solver now correctly dispatches to CLI providers (was hardcoding API-only execution, causing "API error: 0" for CLI providers like Claude Code CLI)
- **Removed dead code**: Removed regex-based challenge solver fallback that didn't work reliably with obfuscated text

**Server changes**:
- `server/lib/validation.js` — Expanded `agentAiConfigSchema` with optional `content`, `engagement`, `challenge` sub-objects
- `server/services/agentActionExecutor.js` — `executePost`/`executeComment` use `aiConfig.content`, `executeEngage`/`executeMonitor` use `aiConfig.engagement`
- `server/routes/agentTools.js` — Publish routes pass `aiConfig.challenge` to client, engage/check-posts use `aiConfig.engagement`
- `server/integrations/moltbook/challengeSolver.js` — Added CLI provider dispatch (same pattern as `agentContentGenerator.js`), removed regex fallback

**Client changes**:
- `client/src/components/agents/tabs/OverviewTab.jsx` — 3-row per-function AI provider/model selector UI
- `client/src/components/agents/tabs/ToolsTab.jsx` — Generate Post/Comment use `aiConfig.content` config

### Dashboard — CoS Productivity Widget
- **At-a-glance CoS status**: New widget on the main Dashboard showing Chief of Staff productivity metrics without navigating to the CoS page
- **Today's progress**: Displays succeeded/failed task counts and time worked
- **Activity streak**: Shows current daily streak with fire icon that lights up when 3+ day streaks are active
- **Pending queue**: Highlights pending tasks and system tasks awaiting approval
- **Learning health**: Shows overall task learning success rate with visual indicators for health status (green for good, yellow for warning, red for critical/skipped tasks)
- **Smart visibility**: Widget only appears when there's meaningful data to display (running agents, completed tasks, active streak, pending work, or learning history)
- **Quick navigation**: "View Details" link navigates directly to the CoS Tasks tab; clicking the Learning card navigates to the Learning tab

**Client changes**:
- `client/src/components/CosDashboardWidget.jsx` — New widget component with 4-stat grid (Today, Streak, Pending, Learning), leverages existing `getCosQuickSummary()` and `getCosLearningSummary()` APIs
- `client/src/pages/Dashboard.jsx` — Imported and rendered CosDashboardWidget above the app grid

### Dashboard — Recent Tasks Panel
- **Recent task history**: Collapsible panel in the Dashboard CoS widget showing the 5 most recent completed tasks across all days
- **At-a-glance indicators**: When collapsed, shows a row of color-coded dots (green=success, red=failed) for quick pattern recognition
- **Expanded details**: When expanded, shows each task with description, type, app name, duration, and relative time (e.g., "2h ago", "yesterday")
- **Success/fail breakdown**: Header shows ratio of succeeded to total tasks (e.g., "3/5 succeeded")
- **Quick navigation**: Clicking any task row navigates to the Agents tab for detailed output review
- **Relative timestamps**: Shows human-friendly relative times ("just now", "2h ago", "yesterday", "Feb 8") instead of absolute timestamps

**Server changes**:
- `server/services/cos.js` — Added `getRecentTasks(limit)` function that returns completed tasks sorted by completion time with formatted durations and relative timestamps
- `server/routes/cos.js` — Added `GET /api/cos/recent-tasks` endpoint with optional `?limit=N` query parameter

**Client changes**:
- `client/src/services/api.js` — Added `getCosRecentTasks(limit)` API function
- `client/src/components/CosDashboardWidget.jsx` — Added collapsible Recent Tasks section with expanded/collapsed states, task list with status icons, and summary dot indicators

### CyberCity — Daytime/Nighttime Lighting Awareness
- **`daylightFactor` preset system**: Each time-of-day preset now includes a `daylightFactor` (0.0–1.0) and `groundColor` that drives all daylight-reactive scene behavior — midnight=0.0, sunrise=0.3, sunset=0.2, noon=1.0
- **Star fade**: Starfield fragment shader multiplies alpha by `(1 - daylightFactor)`, smoothly fading 1500 stars to invisible at noon
- **Celestial fade**: Planet, ring, orbital paths, and moons lerp material opacity toward zero during daytime via shared `nightFactorRef`
- **Shooting star suppression**: New stars blocked from spawning when `daylightFactor > 0.5`; in-flight stars scale head and trail opacity by `nightFactor`
- **Ground illumination**: Ground plane material color lerps per-frame from dark night (`#0a0a20`) to illuminated day (`#3a4055`) using preset's `groundColor`
- **Neon light dimming**: All 9 neon point lights, animated accent lights, and searchlight scale by `neonScaleRef` = `1 - daylight * 0.7` — cyberpunk neon stays visible at 30% during noon, full intensity at night
- **Smooth transitions**: All components use the existing `delta * 3` lerp pattern for seamless preset-to-preset transitions with no visual popping

### CyberCity — Billboard Text Fix & Visual Polish
- **Fixed mirrored billboard text**: All holographic billboards and neon street signs had text facing inward toward city center, causing mirrored/backward text when viewed from the default camera position outside the city. Flipped rotations to face outward and added solid back-blocker planes to prevent text bleed-through from any viewing angle
- **Bloom post-processing**: Added `@react-three/postprocessing` with subtle bloom effect (intensity 0.8, luminance threshold 0.3) that makes all neon elements, emissive materials, and light sources glow realistically — the single biggest visual upgrade for the cyberpunk aesthetic
- **Atmospheric fog**: Added distance-based fog (near: 30, far: 90) that fades distant elements into the dark sky, adding depth and atmospheric perspective to the cityscape
- **Holographic scan line effect**: Billboards now have an animated GPU shader overlay with horizontal scan lines, a sweeping beam that scrolls vertically, and edge vignette glow — giving them a proper holographic display look
- **Billboard glow halos**: Each billboard emits a soft neon-colored glow halo that pulses gently, enhancing visibility and adding atmosphere

### CyberCity — High-Def Cyberpunk Overhaul
- **Distant skyline backdrop**: 60 procedurally generated skyscraper silhouettes form a ring around the city perimeter at varying heights (5-30 units), each with shader-based lit windows and neon roof trim for a sprawling Blade Runner-esque horizon
- **Volumetric light beams**: Five upward-pointing volumetric light cones at city corners and center with GPU shader-based fade, shimmer, and ground glow discs — plus horizontal scan beams that sweep across the city at different altitudes
- **Matrix-style data rain**: 40 columns of cascading data glyphs fall from the sky with per-column phase offsets, atmospheric distance fade, and additive blending for a digital rain effect visible across the entire skybox
- **Rising ember particles**: 120 spark/ember particles float upward from street level with wind drift, multi-color palette (orange, cyan, pink, blue), hot white cores, and smooth fade transitions for a city-that-never-sleeps ambiance
- **Neon street signs**: Floating pixel-font signs positioned around the downtown perimeter reading PORTOS, SYSTEM ONLINE, CYBER, DIGITAL, NEURAL NET, DATA CORE — some with realistic neon flicker effects, all with glow halos and point lights that illuminate nearby geometry
- **Rooftop antenna arrays**: Every active building now has a rooftop antenna with one of 4 types (spire, dish, cross-bar, rotating array), each with a blinking red or accent-colored tip light — adds vertical detail and makes the skyline feel like a real communications hub
- **Vertical neon edge strips**: Animated neon bars on all 4 building corners pulse in and out of phase, adding depth and making buildings glow more dynamically when viewed from the side
- **Enhanced building windows**: More windows lit (50% vs 40%), brighter accent windows at 70% opacity, edge strips and top accent lines on the window texture itself for denser visual detail
- **Wet street puddles**: 20 scattered reflective patches on the ground with subtle ripple animations, colored with neon accent hues, creating a rain-slick street aesthetic
- **Ground fog layer**: Subtle cyan additive-blended fog plane hovering just above ground level for atmospheric haze
- **Enhanced lighting**: Stronger neon point lights with 2 additional accent lights (green and rose), extended fog distance (30-80), and brighter emissive building materials
- **Enhanced particles**: Doubled sparkle counts (120 cyan, 50 pink, 35 purple), added orange ground-level dust and blue high-altitude sparkles — 5 particle layers total
- **Cyberpunk HUD upgrade**: Glitching CYBERCITY title with chromatic aberration effect, system health bar under the clock, animated scan line in the vitals panel, corner bracket decorations on all HUD panels, neon text shadows, weather icons, agent pulse indicators, status footer, and decorative boot-sequence text
- **Enhanced CRT overlay**: CRT brightness flicker, stronger vignette (40% vs 50% transparent center), chromatic aberration with 3 color channels, and neon edge glow lines along top and bottom of screen
- **Extended orbit range**: maxDistance increased from 60 to 80, allowing the camera to pull back and take in the full skyline panorama

**Client changes**:
- `client/src/components/city/CityVolumetricLights.jsx` — New volumetric light beam cones + horizontal scan beams with GPU shaders
- `client/src/components/city/CitySkyline.jsx` — New distant skyline with 60 shader-lit buildings around the perimeter
- `client/src/components/city/CityDataRain.jsx` — New Matrix-style cascading data glyph columns
- `client/src/components/city/CityEmbers.jsx` — New rising ember/spark particles with wind drift
- `client/src/components/city/CityNeonSigns.jsx` — New neon street signs with flicker effects and glow halos
- `client/src/components/city/Building.jsx` — Added rooftop antennas (4 types), vertical neon edge strips, enhanced window textures
- `client/src/components/city/CityGround.jsx` — Added wet puddle patches and ground fog layer
- `client/src/components/city/CityLights.jsx` — Stronger lights, 2 additional accent lights, extended fog range
- `client/src/components/city/CityParticles.jsx` — Doubled counts, added 2 new particle layers
- `client/src/components/city/CityHud.jsx` — Glitch title, health bar, scan line, corner decorations, neon shadows
- `client/src/components/city/CityScanlines.jsx` — CRT flicker, stronger vignette, edge glow lines
- `client/src/components/city/CityScene.jsx` — Integrated all 5 new scene layers, extended orbit range

### M40: Agent Skill System — In Progress
- **Task-type-specific prompt templates** ✅: New `data/prompts/skills/` directory with 6 specialized agent briefings per task category (bug-fix, feature, security-audit, refactor, documentation, mobile-responsive) — each with routing descriptions, embedded examples, and task-specific guidelines. `buildAgentPrompt()` now detects skill type via keyword matching and injects the matched template into the agent briefing. Templates only load when matched to avoid token inflation.
- **Agent context compaction** ✅: Context-limit and output-limit error patterns now include compaction metadata (output size, retry hints) that propagates through task retry metadata. When an agent retries after a context-limit failure, the briefing prompt includes a "Context Compaction Required" section with mandatory output constraints. Agent briefing template updated with task-type-specific output format constraints for documentation, refactors, security audits, and bug fixes.
- **Negative example routing** ✅: Anti-pattern recording in task learning — every task completion now records a `routingAccuracy` cross-reference (taskType × modelTier) with success/failure counts. `suggestModelTier()` enhanced to avoid tiers with <40% success and prefer proven-successful tiers. New "Routing Accuracy" section in Learning tab shows misroutes, tier overview cards, and a full task-type × tier matrix table. New `GET /api/cos/learning/routing` endpoint. Reset also cleans up routing data.
- **Deterministic workflow skills** ✅: Recurring autonomous jobs (daily briefing, git maintenance, brain processing, project review) converted from inline prompt strings to versioned skill templates in `data/prompts/skills/jobs/`. Each template defines structured sections (Steps, Expected Outputs, Success Criteria) that `generateTaskFromJob()` assembles into effective prompts. New API routes (`GET/PUT /api/prompts/skills/jobs/:name`, preview endpoint) and a "Job Skills" tab in the Prompt Manager UI for editing templates without touching code.

### CoS — GitHub Repo Maintenance Scheduler
- **New autonomous job**: `job-github-repo-maintenance` — a weekly recurring CoS job that audits all GitHub repos via `gh` CLI
- **5-point health check**: Lists all repos, flags stale repos (90+ days no commits with staleness tiers), counts Dependabot/security alerts, identifies repos missing CI/README/license, and generates a severity-grouped maintenance report
- **Actionable task creation**: Creates prioritized CoS tasks for high-priority repos (5+ security alerts), batch license updates, and dormant repo reviews — not one giant "fix everything" task
- **Skill template**: Full structured skill template at `data/prompts/skills/jobs/github-repo-maintenance.md` with Steps, Expected Outputs, and Success Criteria sections
- **Default disabled**: Ships disabled like other default jobs — enable via the CoS Jobs UI or API

**Server changes**:
- `server/services/autonomousJobs.js` — Added `job-github-repo-maintenance` to `DEFAULT_JOBS` and `JOB_SKILL_MAP`
- `data/prompts/skills/jobs/github-repo-maintenance.md` — New skill template with 7-step workflow
- `data/cos/autonomous-jobs.json` — Added job entry to persistent data

### CyberCity — Immersive Audio & Visual Overhaul
- **Procedural synthwave music**: Web Audio API synthesizer generating ambient cyberpunk music with bass drone, arpeggiated lead, detuned pad layer, LFO filter sweeps, reverb, and delay — chord progression (Am → Em → F → C) at 100BPM, all procedurally generated with zero audio files
- **Spatial sound effects**: 5 synthesized SFX types — building hover (sine sweep), building click (noise burst + ping), lightning thunder (distorted noise), shooting star whoosh (panned noise sweep), and data pulse chirp — all generated in real-time from Web Audio oscillators
- **Enhanced post-processing**: 3 new GPU shader passes on top of existing bloom — chromatic aberration (R/B channel offset at screen edges), animated film grain (noise overlay), and cinematic color grading (shadows → deep blue, midtones → cyan, highlights → warm white)
- **Reflective wet-street ground**: Dark metallic ground plane (metalness 0.9, roughness 0.15) beneath the grid for natural light reflections, doubled puddle count (20 → 40), rolling fog layer at street level with animated opacity
- **Settings system**: localStorage-persisted settings with quality presets (Low/Medium/High/Ultra) controlling DPR, bloom, chromatic aberration, film grain, color grading, particle density, and scanline overlay — all toggleable individually via HUD panel at `/city/settings`
- **Animated lighting**: Magenta and blue accent lights now slowly oscillate in intensity, plus a sweeping cyan searchlight that rotates around the city perimeter
- **Enhanced buildings**: Online buildings get reflective glass roof caps (MeshPhysicalMaterial), glow halo wireframes pulse on hover, buildings emit SFX on pointer interaction
- **FogExp2 depth**: Switched from linear fog to exponential fog for more natural depth falloff
- **Configurable particles**: Particle counts scale with the `particleDensity` setting (0.25x to 2x multiplier)
- **Scanline toggle**: CRT scanline overlay can be independently toggled while preserving vignette and edge glow effects

**New files**:
- `client/src/hooks/useCitySettings.js` — localStorage-persisted settings hook with quality presets
- `client/src/hooks/useCityAudio.js` — React lifecycle bridge for Web Audio engine
- `client/src/components/city/CitySettingsContext.jsx` — React context provider for settings
- `client/src/components/city/CitySettingsPanel.jsx` — HUD-style settings panel with toggles and sliders
- `client/src/components/city/audio/cityAudioEngine.js` — Singleton Web Audio API manager with master/music/sfx gain buses
- `client/src/components/city/audio/citySynthMusic.js` — Procedural synthwave generator (bass, arp, pad, reverb, delay)
- `client/src/components/city/audio/citySoundEffects.js` — 5 procedural SFX functions

**Modified files**:
- `client/src/pages/CyberCity.jsx` — Settings provider, audio hook, settings panel integration
- `client/src/App.jsx` — Added `/city/settings` route
- `client/src/components/city/CityScene.jsx` — FogExp2, DPR from settings, playSfx prop threading
- `client/src/components/city/CityEffects.jsx` — 3 new ShaderPass effects (chromatic aberration, film grain, color grading)
- `client/src/components/city/CityGround.jsx` — Reflective ground plane, more puddles, rolling fog
- `client/src/components/city/CityLights.jsx` — Animated lights, sweeping searchlight, removed duplicate fog
- `client/src/components/city/CityHud.jsx` — Settings gear icon button
- `client/src/components/city/Building.jsx` — Glass roof, glow halo, SFX on hover/click
- `client/src/components/city/CityWeather.jsx` — Lightning SFX trigger
- `client/src/components/city/CityShootingStars.jsx` — Star spawn SFX trigger
- `client/src/components/city/CityParticles.jsx` — Density multiplier from settings
- `client/src/components/city/CityScanlines.jsx` — Settings toggle
- `client/src/components/city/BuildingCluster.jsx` — playSfx prop threading
- `client/src/components/city/Borough.jsx` — playSfx prop threading

### CyberCity — Borough Layout Redesign
- **Borough neighborhoods**: Each app is now its own borough — a main skyscraper surrounded by smaller process buildings in a ring, creating distinct neighborhoods with organic spacing
- **Process buildings**: Lightweight neon-lit buildings representing each PM2 process an app runs, with status-colored wireframe edges (cyan=online, amber=stopped, indigo=not found), process name labels, blinking tip lights, and base glow circles
- **Ring layout**: Process buildings are evenly distributed in a circle (3.0 unit radius) around the main building, each rotated to face the center
- **Wider city grid**: Building spacing increased from 4.0 to 12.0 units to accommodate borough footprints, with all dependent systems (billboards, neon signs, data streams, traffic, roads) auto-adapting via the positions Map
- **Wider roads**: Road surfaces doubled in width (0.3→0.6) with wider edge line offsets (0.15→0.3) and more padding (0.5→1.5) to match the expanded grid
- **Extended camera**: Camera pulled back (18→25 Y, 30→45 Z), fog far distance extended (90→130), orbit max distance increased (80→120) to accommodate the larger city

**Client changes**:
- `client/src/components/city/ProcessBuilding.jsx` — New lightweight process building component (~8 Three.js objects)
- `client/src/components/city/Borough.jsx` — New wrapper rendering main Building + ProcessBuilding ring + AgentEntity instances
- `client/src/components/city/BuildingCluster.jsx` — Simplified to render Borough per app instead of Building + AgentEntity inline
- `client/src/components/city/cityConstants.js` — Added `BOROUGH_PARAMS` and `PROCESS_BUILDING_PARAMS`, increased spacing to 12.0
- `client/src/components/city/CityScene.jsx` — Adjusted camera position, fog distance, and orbit controls for larger city
- `client/src/components/city/CityRoads.jsx` — Wider road surfaces, edge lines, and padding for larger grid spacing

### Agents — Graceful Moltbook Unavailability Handling
- **Network failure handling**: When Moltbook is completely unreachable (DNS failure, connection refused, timeout), the API client now returns a structured `503 PLATFORM_UNAVAILABLE` error instead of crashing with a raw `TypeError`
- **Upstream 5xx remapping**: Moltbook 500 errors are remapped to `503 PLATFORM_UNAVAILABLE` on our side, so PortOS doesn't appear to have internal errors when the upstream platform is down
- **Warning-level logging**: Platform unavailability logs as `⚠️` warnings instead of `❌` errors with full stack traces, reducing log noise during outages
- **UI warning toasts**: Client shows platform unavailability as a `⚠️` warning toast instead of a red error toast, making it clear the issue is upstream

### Agents — Moltbook Rate Limit Cooldown Timer & 429 Sync
- **Cooldown countdown timer**: Rate limit pills in ToolsTab and OverviewTab now show a live mm:ss countdown when a cooldown is active (e.g., `post: 24:35`), pulsing with `animate-pulse` for visibility. Timer auto-refreshes rate limits from the server when it reaches zero.
- **Publish button cooldown**: The Publish button disables during post cooldown and shows "Wait mm:ss" instead of "Publish", preventing wasted API calls
- **429 rate limit sync**: When Moltbook returns HTTP 429 (e.g., "You can only post once every 30 minutes"), the server now syncs local in-memory rate limit state to match platform enforcement — fixing the desync that occurs after PM2 restarts when in-memory counters reset to zero
- **Publish error recovery**: Fixed stuck "Publishing..." button state when API calls fail — publish handlers now catch errors gracefully and reset loading state

**Server changes**:
- `server/integrations/moltbook/rateLimits.js` — Added `syncFromExternal()` to update lastAction from external 429 responses
- `server/integrations/moltbook/api.js` — Added `inferActionFromEndpoint()` and 429 detection in `request()` that auto-syncs rate limit state

**Client changes**:
- `client/src/components/agents/tabs/ToolsTab.jsx` — Cooldown timer state, interval tick, formatted countdown in rate limit pills and Publish button, `.catch()` on publish handlers
- `client/src/components/agents/tabs/OverviewTab.jsx` — Matching cooldown timer state and countdown display in Quick Actions rate limit pills

### Brain — Scheduler Initialization & First-Run Catch-Up
- **Scheduler activation**: Brain scheduler (`startBrainScheduler()`) was defined but never called on server startup — daily digests and weekly reviews would never run automatically. Added initialization call in `server/index.js` alongside other service initializers.
- **First-run catch-up fix**: When `lastDailyDigest` or `lastWeeklyReview` was `null` (never run before), the catch-up logic returned `false`, meaning the scheduler would only trigger if the server happened to be running at the exact scheduled minute. Now treats `null` as "never run" and catches up immediately if past the scheduled time.

## Fixes

### Digital Twin — Aesthetic Taste Questionnaire
- **New "Taste" tab**: Dedicated tab on the Digital Twin page for building an aesthetic taste profile through a conversational Q&A flow
- **5 taste domains**: Movies & Film, Music & Sound, Visual Art & Design, Architecture & Spaces, Food & Culinary — each with 3 core questions and conditional follow-up questions
- **Branching follow-ups**: When answers mention specific topics (e.g., "cinematography", "minimalist", "spice"), targeted follow-up questions automatically trigger to dig deeper into those preferences
- **Per-section progress tracking**: Each section tracks core/follow-up question counts, completion status, and progress percentage
- **Response review**: View all answers for any section, with follow-up questions labeled distinctly
- **AI-powered summaries**: Generate per-section summaries or a unified taste profile using any configured AI provider — extracts core preferences, anti-preferences, key patterns, and representative quotes
- **Profile persistence**: Responses stored in `data/digital-twin/taste-profile.json`, also appended to `AESTHETICS.md` for digital twin context injection
- **Section reset**: Clear and re-answer any section without affecting others

**Server changes**:
- `server/services/taste-questionnaire.js` — New service with question definitions (5 sections × 3 core + follow-ups), branching logic, answer persistence, and AI summary generation
- `server/routes/digital-twin.js` — 7 new endpoints under `/api/digital-twin/taste/*` (profile, sections, next question, answer, responses, summary, reset)
- `server/lib/digitalTwinValidation.js` — Added `tasteSectionEnum`, `tasteAnswerInputSchema`, `tasteSummaryInputSchema`

**Client changes**:
- `client/src/components/digital-twin/tabs/TasteTab.jsx` — Full conversational Q&A UI with section grid, question flow, review mode, summary generation, and provider selection
- `client/src/components/digital-twin/constants.js` — Added Taste tab with Palette icon
- `client/src/pages/DigitalTwin.jsx` — Imported and rendered TasteTab
- `client/src/services/api.js` — Added 7 taste questionnaire API functions

### Digital Twin — Continuation Prompts for Exhausted Enrichment Dimensions
- **Fix**: When all enrichment questions for a personality dimension were answered, the Overview banner showed a dead-end "Run an interview" link even if the user had already done an interview
- **Solution**: The banner now generates a dimension-specific continuation prompt (seeded with the gap's suggested questions) that the user can copy into ChatGPT or Claude. Includes a copy button with confirmation feedback and a link to Interview Import for pasting results back
- **Applies to**: Both single-dimension exhaustion (inline Q&A fallback) and all-dimensions-exhausted states

### Digital Twin — Missing Stage Config for Soul/Twin Prompt Templates
- **Fix**: 9 prompt templates (`soul-contradiction-detector`, `soul-enrichment`, `soul-enrichment-process`, `soul-test-generator`, `soul-test-scorer`, `soul-writing-analyzer`, `twin-trait-extractor`, `twin-confidence-analyzer`, `twin-import-analyzer`) had `.md` template files in `data/prompts/stages/` but were missing entries in `stage-config.json`. The toolkit's `buildPrompt()` requires both a config entry and a template file — without the config entry, all calls returned "not found" errors.
- **Solution**: Added all 9 missing stage entries to both `data/prompts/stage-config.json` and `data.sample/prompts/stage-config.json`

### Digital Twin — Cognitive Decline & Dementia Risk Genetic Panel
- **11 new SNP markers** in a dedicated "Cognitive Decline & Dementia Risk" category covering the most well-replicated Alzheimer's disease risk loci
  - **APOE ε4 (rs429358)**: The strongest common genetic risk factor — 3x risk per allele, 12x for homozygous
  - **APOE ε2 (rs7412)**: Protective counterpart — 40% reduced risk for carriers
  - **BIN1 (rs744373)**: Second strongest AD risk locus after APOE — tau pathology and synaptic function
  - **CD33 (rs3865444)**: Microglial amyloid clearance efficiency
  - **ABCA7 (rs3764650)**: Lipid transport and amyloid processing (1.8x risk)
  - **CR1 (rs6656401)**: Complement receptor 1 — neuroinflammation
  - **CLU (rs11136000)**: Clusterin/apolipoprotein J — amyloid clearance across BBB
  - **PICALM (rs9349407, rs3851179)**: Endocytic clearance and autophagy/tau clearance
  - **CD2AP (rs10948363)**: Blood-brain barrier integrity
  - **MS4A6A (rs983392)**: Microglial activation and TREM2 levels
- **Category card**: Rose-colored category with elderly person emoji, sorted after cardiovascular and tumor suppression

### Digital Twin — Composite APOE Haplotype Determination
- **APOE haplotype resolution**: Genome scan now combines rs429358 (ε4) and rs7412 (ε2) to determine the actual APOE diploid genotype (ε2/ε2, ε2/ε3, ε3/ε3, ε2/ε4, ε3/ε4, ε4/ε4) with accurate risk multipliers and population frequencies
- **Composite marker**: A synthetic "APOE Haplotype" marker appears in the Cognitive Decline category showing the resolved genotype, risk level, and actionable recommendations
- **ε2/ε4 detection**: Properly identifies the rare ε2/ε4 combination (both SNPs heterozygous) where risk and protection partially counteract (~2.6x risk), which individual SNP analysis cannot distinguish
- **ε3 baseline**: Identifies ε3/ε3 carriers (~60% of population) as the reference baseline with standard age-related risk
- **Updated cross-references**: Individual rs429358 and rs7412 marker descriptions now reference each other and the composite haplotype for complete interpretation

### Digital Twin — Genome Dashboard UI Polish
- **Masonry grid layout**: Curated marker category cards now flow in a responsive 1/2/3/4-column masonry grid (via CSS `columns`) instead of a vertical stack, making better use of screen width
- **Wider marker tiles**: Inner marker grid uses 1-2 columns instead of 1-2-3, giving marker names more room to display without truncation
- **Richer category backgrounds**: Category cards use distinct 950-shade backgrounds at 40% opacity (e.g., `bg-purple-950/40`) for clear visual differentiation between categories
- **Softer text contrast**: Marker names and category labels use `text-gray-200` instead of pure white, and genotype badges use `text-gray-300`, reducing eye strain on dark backgrounds
- **Status tags in Markers card**: Moved the beneficial/typical/concern/not-found status breakdown from a standalone row into the Markers metric card, cleaning up the header area

### Digital Twin — Epigenetic Lifestyle Tracking & Neuroprotective Recommendations
- **Curated intervention database**: 12 evidence-based neuroprotective interventions with mechanisms, dosage ranges, evidence levels, and research references — creatine, omega-3 DHA, aerobic exercise, sleep optimization, vitamin D, meditation, B-vitamins, curcumin, cognitive training, social engagement, magnesium L-threonate, and lion's mane
- **Personalized recommendations**: Interventions are filtered by the user's detected genetic marker categories — if you have cognitive_decline markers scanned, you'll see interventions targeting those pathways
- **Daily logging**: Track intake/activity amounts with per-intervention log entries, deduplication by date, and sorted log history
- **Compliance dashboard**: 30-day compliance percentage per intervention with progress bars, streak tracking (consecutive days), and color-coded health indicators
- **Custom interventions**: Add your own supplements or lifestyle practices beyond the curated list with custom units, categories, and frequency
- **Pause/resume/delete**: Toggle interventions active/inactive without losing log history, or remove entirely

**Server changes**:
- `server/services/epigenetic.js` — New service with curated interventions database, CRUD for tracked interventions, daily logging with date dedup, compliance/streak calculation
- `server/lib/genomeValidation.js` — Added Zod schemas for intervention add/update/log
- `server/routes/genome.js` — 7 new REST endpoints for epigenetic tracking (interventions CRUD, logging, recommendations, compliance)

**Client changes**:
- `client/src/components/digital-twin/EpigeneticTracker.jsx` — Full-featured tracking UI with compliance bars, daily logging, curated recommendations with expandable details, custom intervention form
- `client/src/components/digital-twin/tabs/GenomeTab.jsx` — Integrated EpigeneticTracker component between curated markers and ClinVar sections
- `client/src/services/api.js` — Added 7 epigenetic API functions

### Digital Twin — Expanded Curated Genome Marker Database
- **33 new SNP markers** added across 12 new categories and 6 expanded existing categories, bringing the curated database from ~46 to ~79 well-established, GWAS-replicated markers
- **12 new health categories**: Blood Sugar & Diabetes, Gut Health & Digestion, Autoimmune Risk, Thyroid & Hormones, Eye Health, Mental Health, Bone Health, Pharmacogenomics, Cancer Predisposition, Hair Loss, Hearing, Pain Sensitivity
- **6 expanded categories**: Cardiovascular (+PCSK9), Nutrient Metabolism (+FADS1), Inflammation (+CRP), Longevity (+TERC), Sleep & Circadian (+MTNR1B), Skin & UV Response (+TYK2, IL23R)
- **New category colors**: 7 additional Tailwind color variants (teal, pink, fuchsia, lime, slate, stone, zinc) for visual differentiation of the expanded category set

### Digital Twin — Chronotype Gene Markers & Cross-Project Linking
- **2 new chronotype SNP markers** added to the Sleep & Circadian category in the curated genome marker set:
  - **PER2 (rs35333999)**: Core circadian clock gene driving the negative feedback loop; variants affect morning/evening preference and are linked to Familial Advanced Sleep Phase Syndrome
  - **CRY1 (rs2287161)**: Circadian feedback loop repressor; gain-of-function variant lengthens circadian period and is strongly associated with Delayed Sleep Phase Disorder
- **Brain project cross-links**: Genome Section project now documents connections to Chronotype Trait idea (chronotype markers feed chronotype derivation) and Goal Tracker project (longevity/cardiovascular markers feed life-expectancy estimates)
- **Goal Tracker upstream dependency**: Goal Tracker project notes now reference specific genome longevity and cardiovascular markers that will feed adjusted life-expectancy modeling

### Digital Twin — CLI Provider Support for All AI Functions
- **Unified provider dispatch**: Refactored 8 functions in `digital-twin.js` that had direct `fetch()` calls to `provider.endpoint` (API-only) to use the existing `callProviderAI()` helper which supports both API and CLI providers
- **Affected functions**: `runSingleTest`, `scoreTestResponse`, `generateEnrichmentQuestion`, `analyzeEnrichmentList`, `detectContradictions`, `generateDynamicTests`, `analyzeWritingSamples`, `extractTraits`, `calculateConfidence`, `analyzeWithPrompt`
- **Root cause**: These functions only worked with API providers (like LM Studio) — CLI providers (like Claude Code CLI) would silently fail, returning fallback values or errors like "Provider type not supported"
- **Fix**: All functions now route through `callProviderAI()` which properly handles both `provider.type === 'api'` (HTTP fetch) and CLI (stdin-based subprocess spawn)
