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
docs(issue-2424): record cold-first-visit route gap as an accepted SW trade-off
[._.]/ Adam Eivy8851f6816592
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 9657a657ba..0662cf4707 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,8 @@## Changes+- **The offline service worker's cold-first-visit route gap is now a documented, accepted trade-off rather than an open question (#2424).** A route visited *only* during the very first page load (before the SW registers at `window.load`) has an uncached chunk, so an offline reload of exactly that route boots the shell but can't render until the route is visited online once more. Fully closing this would require a build-time precache manifest (workbox / vite-plugin-pwa or an emitted asset-manifest) that precaches *every* build chunk upfront — which spends first-visit bandwidth on routes the user may never open, directly against this SW's low-bandwidth goal. For a single-user app the mitigation is a one-time online load per route, so the limitation is deliberately left in place; the reasoning is now recorded inline in `client/public/sw.js` so it doesn't dangle-point at a closed issue. No behavior change.+- **CoS task-learning success rates now decay via a recency window, so a since-resolved failure burst stops signaling Layered Intelligence that work is needed (#2460).** The `byTaskType` counters in `data/cos/learning.json` are lifetime-cumulative and never age out — a provider misconfig or PTY-capture artifacts recorded as failures on a now-retired task type permanently depressed the success rate the LI reasoner reads via its `cosMetrics` source (default-on for PortOS), long after the root cause was fixed. Each task-type bucket now also carries a bounded `recentOutcomes` ring (`{ t, s }`, cap 50, mirroring the `failureSignatures.recent` precedent) that `recordTaskCompletion` appends to; a new pure `computeWindowedStats` derives a `recentSuccessRate` windowed by BOTH count and age (defaults: last 30 runs / 30 days, configurable), exposed via `getWindowedStats(taskType, { maxCount, maxAgeMs })`. The LI `cosMetrics` source now surfaces lifetime and windowed rates labeled distinctly, so a resolved failure burst self-heals without a manual `resetTaskTypeLearning`, while the lifetime counters stay intact for the dashboard/telemetry views. `recentSuccessRate` uses a `null` sentinel (never a fabricated `0%`) when the window has no samples, so the reasoner falls back to the lifetime rate. Store version bumped 1→2 with an idempotent migration (188) that initializes an EMPTY ring per task type — deliberately not backfilled from failure-only history, which would fabricate an all-failure window.- **The inline-claim task prompts now name `grok` as a local-CLI reviewer (#2453).** After Grok became a selectable Review Loop reviewer, the four inline-claim prompt defaults (`plan-task`, `claim-issue`, `claim-issue-gitlab`, `claim-issue-jira`) still enumerated only `` `claude` / `codex` / `antigravity` `` in their per-kind reviewer-handling bullets, leaving grok un-categorized as a CLI reviewer when a user set it as their default. All seven bullet sites now list `` `grok` `` alongside the other coding-agent CLIs. Following the cross-install prompt-upgrade contract, each of the four task types gets a `PROMPT_VERSIONS` bump with the entire prior default preserved in `PREVIOUS_DEFAULT_PROMPTS`, so non-customized installs auto-upgrade; the integrity snapshot is regenerated. Text-only change.diff --git a/client/public/sw.js b/client/public/sw.jsindex 5d23e06b40..9162602eac 100644--- a/client/public/sw.js+++ b/client/public/sw.js@@ -23,17 +23,26 @@* change). Changing this file's bytes is itself what triggers the browser to* install the updated worker.*- * Offline scope (known limitation): the install/navigation precache covers the- * app shell + its ENTRY assets (the boot chunk, its modulepreload deps, CSS).- * Lazy route chunks are cached on demand the first time they load through the- * controlling SW (cache-first), so a route the user has visited online works- * offline afterward — but a route visited ONLY during the very first,- * pre-registration page load (before window.load registered the SW) has an- * uncached chunk, so an offline reload of exactly that route boots the shell- * but can't render the route until it's visited online once more. Fully- * offline-ing every route from a cold first visit needs a build-time precache- * manifest (workbox / vite-plugin-pwa), deliberately out of scope for this- * dependency-free shell cache. See issue #2424.+ * Offline scope (accepted limitation, by design): the install/navigation+ * precache covers the app shell + its ENTRY assets (the boot chunk, its+ * modulepreload deps, CSS). Lazy route chunks are cached on demand the first+ * time they load through the controlling SW (cache-first), so a route the user+ * has visited online works offline afterward — but a route visited ONLY during+ * the very first, pre-registration page load (before window.load registered the+ * SW) has an uncached chunk, so an offline reload of exactly that route boots+ * the shell but can't render the route until it's visited online once more.+ *+ * Closing this fully would need a build-time precache manifest (workbox /+ * vite-plugin-pwa) that enumerates every dist chunk and precaches them at+ * install. That is deliberately NOT done, because:+ * - Precaching all chunks upfront spends first-visit bandwidth on routes the+ * user may never open — directly contrary to this SW's low-bandwidth goal.+ * - PortOS is single-user; the mitigation ("visit each route online once")+ * costs the one user a single online load, not a support burden.+ * - It would replace the dependency-free hand-rolled shell cache with a build+ * plugin, or add a build step to emit an asset-manifest — cost the payoff+ * doesn't justify for a one-online-load-per-route gap.+ * If the gap ever bites in practice, revisit the asset-manifest option then.*/const CACHE_VERSION = 'v1';