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
security: redact instance host identifiers from changelog and plan docs
[._.]/ Adam Eivye7de0955dd48
diff --git a/.changelog/v1.44.1.md b/.changelog/v1.44.1.mdindex 4303a2ac9b..bd2a4e4641 100644--- a/.changelog/v1.44.1.md+++ b/.changelog/v1.44.1.md@@ -19,7 +19,7 @@ Released: 2026-04-22- **Cyber Muse CoS avatar — GLB-backed holographic head** — new `muse` option in Settings → CoS → Appearance. Rather than assembling sphere primitives into a face (uncanny) or displacing a sphere point cloud (unreadable silhouette), the avatar loads a user-supplied `data/avatar/model.glb` through a new `/api/avatar/model.glb` route (`server/routes/avatar.js`, HEAD + GET, 404 when missing, `model/gltf-binary` when present) and renders it with a holographic material treatment: dark base + state-colored emissive glow that pulses per CoS state (sleeping/thinking/coding/investigating/ideating) and sync-bobs when the CoS is speaking. Bounding-box auto-fit means any model scale/origin works — drop in a ~4MB Ready Player Me export, a Sketchfab head bust, or a Mixamo-rigged character and it centers + sizes itself. When no GLB is present, renders a clean empty-state card pointing at the target path. Piggybacks on `useGLTF` (drei) and reuses the existing Sparkles/halo/ground-glow chrome. Zod enum for `avatarStyle` gained `'muse'` in `server/routes/cosStatusRoutes.js`.- **Loopback HTTP mirror on port 5553 when HTTPS is active** — Tailscale's Let's Encrypt cert only covers `<machine>.<tailnet>.ts.net`, so `https://localhost:5555` always tripped a cert warning. When HTTPS is active the server now also spins up a plain HTTP listener bound to `127.0.0.1:5553` that attaches to the same Express app and Socket.IO instance — `http://localhost:5553` works without cert warnings and Chrome still treats it as a secure context (so getUserMedia / mic access continues to work). Override the port via `PORTOS_HTTP_PORT`. Documented in `docs/PORTS.md`.- **Voice agent — universal accessibility-mode DOM driving** — the voice Chief-of-Staff can now navigate to any page and operate any control by voice. New `ui_navigate` tool with a 100+ entry named-page enum ("take me to tasks" / "chief of staff agents" / "calendar" all route correctly instead of defaulting to Daily Log). New accessibility layer: a client-side DOM indexer (`client/src/services/domIndex.js`) walks `<main>` for interactable elements (tabs, buttons, links, inputs, selects, textareas, checkboxes, radios), resolves labels via the standard aria → `<label for>` → wrapping label → text → placeholder → title chain, stamps stable `data-voice-ref` refs, and caps at 200 elements. `useVoiceUiSync` hook (debounced MutationObserver scoped to `<main>`, change-detection via content signature) pushes the index to the server whenever it actually changes. Server stores the index on per-socket state and — for UI-driving user turns (verb-gated by regex to keep the 80% of turns that don't need it cheap) — injects a compact page summary into the LLM's system prompt. New tools: `ui_click` (tab/button/link by label with optional kind hint), `ui_fill` (text inputs + textareas, uses React-safe native value setter so `onChange` fires), `ui_select` (dropdowns with fuzzy option matching), `ui_check` (checkboxes + radios), `ui_list_interactables` (deep-dive fallback). Misses return a helpful `available` list to the LLM so it can self-correct instead of silently failing. **In-turn chained flows**: after a ui_* action fires, the server pauses briefly for the client to push the post-action DOM index, then attaches the fresh summary to the tool result — so multi-step flows like "create a task named Foo with description Bar" can complete in a single turn (ui_click New Task → see the modal → ui_fill Name → ui_fill Description → ui_click Save).-- **Per-peer DNS override on the Instances page** — peer cards now expose an "edit host" control that lets you swap the raw Tailscale IP (`http://100.83.147.46:5555`) for a trusted HTTPS DNS name (`https://void.taile8179.ts.net:5555`). Once set, the server's probe, socket relay, sync orchestrator, and query proxy all route through `https://<host>` instead of `http://<ip>` — so app links in `PeerAppsList` also upgrade to HTTPS automatically. New `GET /api/instances/tailnet-suffix` endpoint shells out to the local `tailscale status --json` and returns the MagicDNS suffix + the full peer map, which the Instances UI uses to auto-suggest DNS names: match by Tailscale IP first (authoritative), fall back to `<peer.hostname>.<suffix>` composition. The UI's "use `<suggested>`" button applies the suggestion in one click. `updatePeer` now accepts an optional `host` field (validated as a DNS name; empty string clears); invalid hosts return 400 instead of silent no-ops. `addPeer` also accepts `host` for direct-DNS registration. Vite dev proxy auto-detects `data/certs/cert.pem` and flips its target to `https://localhost:5555` with `secure: false` when HTTPS is active, fixing "socket hang up" errors in dev mode. 44 tests (3 new) cover valid/invalid/cleared host handling.+- **Per-peer DNS override on the Instances page** — peer cards now expose an "edit host" control that lets you swap the raw Tailscale IP (`http://100.64.0.99:5555`) for a trusted HTTPS DNS name (`https://host-alpha.example-tailnet.ts.net:5555`). Once set, the server's probe, socket relay, sync orchestrator, and query proxy all route through `https://<host>` instead of `http://<ip>` — so app links in `PeerAppsList` also upgrade to HTTPS automatically. New `GET /api/instances/tailnet-suffix` endpoint shells out to the local `tailscale status --json` and returns the MagicDNS suffix + the full peer map, which the Instances UI uses to auto-suggest DNS names: match by Tailscale IP first (authoritative), fall back to `<peer.hostname>.<suffix>` composition. The UI's "use `<suggested>`" button applies the suggestion in one click. `updatePeer` now accepts an optional `host` field (validated as a DNS name; empty string clears); invalid hosts return 400 instead of silent no-ops. `addPeer` also accepts `host` for direct-DNS registration. Vite dev proxy auto-detects `data/certs/cert.pem` and flips its target to `https://localhost:5555` with `secure: false` when HTTPS is active, fixing "socket hang up" errors in dev mode. 44 tests (3 new) cover valid/invalid/cleared host handling.- **HTTPS with auto-renewing Let's Encrypt cert via Tailscale (self-signed fallback)** — Chrome refuses `getUserMedia` (mic) access over plain HTTP on a `100.x.x.x` Tailscale IP because the origin isn't a secure context. New `scripts/setup-cert.js` prefers a real Let's Encrypt cert via `tailscale cert <machine>.<tailnet>.ts.net` (Tailscale owns `ts.net` and solves the DNS-01 challenge for you — browsers trust the cert with zero click-through) and drops it into `data/certs/{cert,key}.pem`. If the Tailscale CLI is missing, the machine isn't logged in, or HTTPS Certificates aren't enabled in the tailnet admin, the script falls back to a self-signed cert with SANs for `localhost`, `127.0.0.1`, and every non-internal IPv4 (including the Tailscale IP). `server/index.js` picks `https.createServer` whenever `data/certs/{cert,key}.pem` exist and falls back to HTTP with a warning otherwise. New `server/services/certRenewer.js` runs daily on the server process, calls `tailscale cert` (no-op unless the LE cert is <2/3 lifetime remaining), and hot-swaps the live HTTPS server's `SecureContext` with the renewed cert — no restart needed. `npm start` runs the cert script before PM2 boot so fresh installs come up with HTTPS out of the box; `npm run setup:cert --force` regenerates on demand. Socket.IO auto-upgrades to WSS (same-origin relative paths). Access via `https://<machine>.<tailnet>.ts.net:5555` to get the trusted cert; the Tailscale IP still works but will show a cert mismatch.- **Blood Pressure tracking in MeatSpace → Body** — feature parity with the MortalLoom iOS/macOS companion app. New Blood Pressure card on the Body tab shows a systolic/diastolic trend chart (with AHA/ACC 2017 guideline reference lines), the latest reading, and its category + estimated life-expectancy impact. Readings are date-upserted so a HealthKit sync on the phone and a manual entry in PortOS on the same day merge into one row. Storage routes through the new `mlUpsertHealthMetricByDate` into MortalLoom's `healthMetrics[]` array when iCloud sync is enabled (same `bloodPressureSystolic`/`bloodPressureDiastolic` keys the Swift app writes), else falls back to `data/meatspace/health-metrics.json`. New endpoints: `GET /api/meatspace/blood-pressure`, `POST /api/meatspace/blood-pressure`. Apple Health XML ingest now maps `HKQuantityTypeIdentifierBloodPressureSystolic`/`Diastolic` → `blood_pressure_systolic`/`diastolic`, and those metrics are registered in the Core Vitals section of the Health tab so exported HK data shows trend lines there too. BP classification (normal / elevated / stage-1 / stage-2 / crisis) is ported from `CardioFitnessEngine.classifyBP` into `client/src/components/meatspace/bpClassification.js` so both sides report identical categories for the same reading.- **Hide voice widget per-browser** — the floating voice widget can now be dismissed entirely by clicking the new eye-off icon (next to the mobile FAB or in the desktop controls bar). The preference persists in `localStorage` under `portos.voice.hidden`, so iPhones/Safari sessions where the mic APIs don't work can stay clean while the desktop keeps the widget. Re-enable via **Settings → Voice → "Show floating voice widget"**; a custom `portos:voice:visibility` DOM event syncs the change live without a reload.diff --git a/.changelog/v2.16.0.md b/.changelog/v2.16.0.mdindex 1de85d298f..a2faf0e987 100644--- a/.changelog/v2.16.0.md+++ b/.changelog/v2.16.0.md@@ -63,7 +63,7 @@ Released: 2026-06-05- **[issue-934] City archive district no longer overlaps the AI Core on sparse installs** — On installs with few or no active apps, the archived-apps "warehouse" district (and its ARCHIVE DISTRICT sign) sat right on top of the central AI Core landmark — most visibly on an all-archived install with no active apps, where the sign landed on the monument. The district is now floored to always sit clear of the core. Installs with several active apps are unaffected — their layout is unchanged.- **[issue-894] Numeric edge-case hardening** — Task-learning duration stats can no longer go negative when resetting a task type against an older or hand-edited store, goal velocity reports no trend (instead of a garbage value) when a progress entry has a malformed date, and a stray non-numeric music gain falls back to the default instead of breaking an audio render.- **Federated peers with PortOS password auth now connect** — If a remote PortOS instance has its built-in password enabled (Settings → Security), peer probes were always returning 401 even with the correct credential set in the Instances UI. The root cause: PortOS's auth gate only accepted session cookies and `Authorization: Bearer` tokens; peer probes send `Authorization: Basic <base64>`, which was silently ignored. The auth gate now also validates HTTP Basic credentials against the stored password hash, so federated probes, syncs, and the live socket relay all authenticate correctly. The backoff-reset fix is bundled: if a peer was deep in exponential backoff (up to 24 h) from prior 401 failures, re-saving the credential in the Instances UI immediately clears the backoff and re-probes without waiting.-- **Autofixer dashboard now loads over Tailscale HTTPS** — On installs with a Tailscale TLS cert, the main app is served over HTTPS, so the sidebar's "Autofixer" link points at `https://<host>:5560`. The standalone Autofixer UI server was hard-coded to plain HTTP, so that HTTPS request hit an HTTP-only listener and failed to connect (e.g. `https://void.taile8179.ts.net:5560/` wouldn't load). The Autofixer UI now serves HTTPS with the same shared `data/certs/` cert when one is present (and hot-reloads it on renewal), falling back to plain HTTP when no cert exists — so its scheme always matches the link the sidebar generates.+- **Autofixer dashboard now loads over Tailscale HTTPS** — On installs with a Tailscale TLS cert, the main app is served over HTTPS, so the sidebar's "Autofixer" link points at `https://<host>:5560`. The standalone Autofixer UI server was hard-coded to plain HTTP, so that HTTPS request hit an HTTP-only listener and failed to connect (e.g. `https://host-alpha.example-tailnet.ts.net:5560/` wouldn't load). The Autofixer UI now serves HTTPS with the same shared `data/certs/` cert when one is present (and hot-reloads it on renewal), falling back to plain HTTP when no cert exists — so its scheme always matches the link the sidebar generates.- **City daytime sky no longer washes out to white; night reads as a galaxy backdrop** — The bright-day sky and pavement were tuned so light, so the dome and ground turned into a near-white fog sheet over the city; daytime now keeps real blue in the horizon bands and a muted blue-gray street so the city stays legible in full sun. At night the galaxy map is the backdrop, the shader sky-dome gets out of the way, and the moon is a smaller, softer disc instead of an over-bright bloom. The experimental "Dreamworld" sky-theme picker (and its drifting clouds) has been removed — the City now has one canonical look that follows your theme's day/night mode; any previously-saved Dreamworld setting falls back to it automatically.- **City night sky is a real environment map (the galaxy now also lights the scene)** — The night galaxy was a pair of hand-placed meshes that frequently didn't show and contributed no light. It's now wired through three.js's environment system the way an HDRI is: the equirectangular panorama is assigned to `scene.background` (a true 360° spheremap, visible in every camera direction) and, via `PMREMGenerator`, to `scene.environment` — so the galaxy also tints reflections and lighting on the metallic building/ground materials. The low-resolution (1774×887) AI-generated panorama that read as pixelated was replaced with a crisp 8192×4096 Milky Way (Solar System Scope, CC BY 4.0), brightness/saturation graded for the stylized night. Day is unchanged.- **City no longer flashes a blank white scene when the GPU drops the WebGL context** — Heavy post-processing plus an always-on frame-readback buffer made Chromium lose the City's WebGL context easily, leaving a white canvas with no recovery. The readback buffer is now only enabled while taking a postcard, the render resolution is capped to keep the context stable, and a lost context is detected and either recovered on restore or surfaced over the page background instead of a white void. Known THREE.js deprecation and expected context-loss console messages are also filtered out so the browser console stays usable. With the post-processing pass gone, the City settings panel drops the now-inert Bloom, Film Grain, Chromatic Aberration, Color Grading, and Exposure controls so nothing toggles an effect that no longer renders.diff --git a/docs/plans/2026-05-30-importer-derive-manuscript.md b/docs/plans/2026-05-30-importer-derive-manuscript.mdindex 054e8ee3fd..f99e60149c 100644--- a/docs/plans/2026-05-30-importer-derive-manuscript.md+++ b/docs/plans/2026-05-30-importer-derive-manuscript.md@@ -62,7 +62,7 @@ No one-off script needed — Workstream 2 *is* the repair tool. On the existing3. Delete the now-empty V2/V3/V4 if `commitSeasonsWithRemap` leaves any (the existing `deletePipelineSeason(seriesId, seasonId, { reassignTo })` wrapper at `apiPipeline.js:344` handles reassign-then-delete).4. Optionally re-split into 3–4 acts using the editable issue mapping in the preview.-Verify end-to-end on `https://null.taile8179.ts.net:5555/pipeline/series/ser-c22c6c9e-...` after implementing.+Verify end-to-end on `https://host-beta.example-tailnet.ts.net:5555/pipeline/series/ser-c22c6c9e-...` after implementing.## Workstream 4 — Manuscript-completeness ("finish the draft") editor actiondiff --git a/docs/plans/2026-06-16-series-autopilot.md b/docs/plans/2026-06-16-series-autopilot.mdindex ac0c82307a..0803a25d87 100644--- a/docs/plans/2026-06-16-series-autopilot.md+++ b/docs/plans/2026-06-16-series-autopilot.md@@ -15,7 +15,7 @@ re-implementation of generation logic.Two hard constraints from the user:1. **Never undo in-progress work.** The real test series- `https://null.taile8179.ts.net:5555/pipeline/series/ser-b74601a3-221d-4491-b037-bad51df8460a` already has a+ `https://host-beta.example-tailnet.ts.net:5555/pipeline/series/ser-b74601a3-221d-4491-b037-bad51df8460a` already has apartially-generated arc and a partially-built first issue. Autopilot must inspect current state and resumefrom the first *missing* step, never regenerate what exists.2. **Arc verification may never fully converge** — re-running verify surfaces *new* findings even after