Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix stale comments and misplaced version entries from the prompt-freeze fix
[._.]/ Adam Eivy0f53cbfc089b
diff --git a/server/services/taskPromptDefaults.js b/server/services/taskPromptDefaults.jsindex 68c291234e..654a011c18 100644--- a/server/services/taskPromptDefaults.js+++ b/server/services/taskPromptDefaults.js@@ -11,8 +11,9 @@* The content lives in ./taskPromptDefaults/ — prompts.js (current defaults),* versions.js (PROMPT_VERSIONS + audit anchor), previousDefaults.js (prior* shipped defaults), shippedPrompts.js (the shared "is this a shipped default?"- * check) — and this barrel re-exports it so existing imports keep working. taskPromptDefaults.test.js pins the exported values against a hash- * snapshot so a split/refactor can't silently alter the upgrade contract.+ * check) — and this barrel re-exports it so existing imports keep working.+ * taskPromptDefaults.test.js pins the exported values against a hash snapshot+ * so a split/refactor can't silently alter the upgrade contract.** Distribution-model machinery (see AGENTS.md "Distribution model"):* - PROMPT_VERSIONS — bumped when a default prompt changes so existing installs auto-upgrade.diff --git a/server/services/taskPromptDefaults/integrityHash.js b/server/services/taskPromptDefaults/integrityHash.jsindex d319f5d528..7a4545362f 100644--- a/server/services/taskPromptDefaults/integrityHash.js+++ b/server/services/taskPromptDefaults/integrityHash.js@@ -13,27 +13,28 @@ import { PORTOS_API_URL } from '../../lib/ports.js';const API_URL_PLACEHOLDER = '{{PORTOS_API_URL}}';-// Prompt bodies embed the install's API origin two different ways:+// Prompt bodies embed an install origin three different ways://// 1. Current defaults interpolate PORTOS_API_URL at module load, so the body// text varies with PORTOS_API_URL / PORTOS_HOST / PORT.// 2. Preserved historical defaults (pre-genericization) hardcode-// `http://localhost:5555` — the origin that WAS the default when they-// shipped. Those bytes are frozen history and never change again, so the-// literal is pinned here rather than derived from PORTS.API.+// `http://localhost:5555` — the API origin that WAS the default when they+// shipped.+// 3. Preserved pre-unification self-improvement defaults drove the UI with+// Playwright, so they hardcode the *UI* origin, `http://localhost:5554`.//-// Both collapse to the same placeholder so a body hashes identically on every-// install. Normalizing only (1) made the snapshot reproducible solely on a-// machine whose PORTOS_API_URL happened to equal the legacy origin: anywhere-// else — a custom PORTOS_HOST, or simply a shell with PORT set, as inside a CoS-// agent — the five bodies carrying the literal hashed differently and the-// integrity test failed while nothing had actually drifted (issue #3359).+// (2) and (3) are frozen history and never change again, so both literals are+// pinned here rather than derived from PORTS. Each collapses to a placeholder so+// a body hashes identically on every install — (1) and (2) share one, since they+// name the same origin, while (3) gets its own so a body carrying the UI origin+// never hashes the same as one carrying the API origin.+//+// Normalizing only (1) made the snapshot reproducible solely on a machine whose+// PORTOS_API_URL happened to equal the legacy origin: anywhere else — a custom+// PORTOS_HOST, or simply a shell with PORT set, as inside a CoS agent — the five+// bodies carrying the literal hashed differently and the integrity test failed+// while nothing had actually drifted (issue #3359).const LEGACY_API_ORIGIN = 'http://localhost:5555';--// The pre-unification self-improvement defaults drove the UI with Playwright and-// so hardcode the *UI* origin instead. Same reasoning as (2) above: frozen bytes,-// pinned rather than derived, and given their own placeholder so a body carrying-// the UI origin never hashes the same as one carrying the API origin.const LEGACY_UI_ORIGIN = 'http://localhost:5554';const UI_URL_PLACEHOLDER = '{{PORTOS_UI_URL}}';diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.jsindex b338d673e0..55acb6cd6a 100644--- a/server/services/taskPromptDefaults/versions.js+++ b/server/services/taskPromptDefaults/versions.js@@ -38,18 +38,6 @@ export const PROMPT_VERSIONS = {'console-errors': 2, // v2: unified `[Improvement: {appName}]` body (pre-unification defaults shipped separate self- and app-improvement bodies)'error-handling': 2, // v2: unified `[Improvement: {appName}]` body (older default used the `[App Improvement: {appName}]` header)'typing': 2, // v2: unified `[Improvement: {appName}]` body (older default used the `[App Improvement: {appName}]` header)-- // A SCHEDULE task type absent from this map is silently exempt from- // auto-upgrade forever: taskScheduleStore's upgrade block is gated on- // `PROMPT_VERSIONS[taskType] && …`, so a body change ships and no install- // ever receives it. The three types above were frozen that way for months.- // Every schedule key therefore carries an entry, v1 meaning "shipped once,- // never revised" — taskPromptDefaults.test.js enforces the parity so the next- // new scheduled prompt cannot repeat it. (Pipeline STAGE bodies stay- // unversioned on purpose: they are read live from the catalog and never- // persisted, so an edit reaches every install on the next dispatch.)- 'jira-sprint-manager': 1,- 'jira-status-report': 1,'dependency-updates': 4, // v4: the Phase 1 GitLab MR listing gains `--output json` — without it glab answers with the human table, which carries the head branch but NOT the author, while the classification right below it reads both. The same bump drops `--state` from the MR-list recipes — that flag does not exist (MR state is selected by presence flags `--merged`/`--closed`/`--all`, and OPEN is the default), so `--state opened` exited 1 with `Unknown flag: --state` and Phase 1 skipped its bot-PR triage entirely on GitLab repos. v3: Phase 1 triages open Dependabot/Renovate PRs first (evidence → MERGE / FIX-THEN-MERGE / CLOSE / LEAVE, including conflict + CI-failure repair on the bot branch) before Phase 2 updates anything the bots didn't cover — an agent that bumped packages itself was duplicating and conflicting with open bot PRs. v2: generic {appName} body (older default hardcoded "PortOS")'documentation': 6, // v6: the changelog step names `AGENTS.md` (or `CLAUDE.md`) as the file carrying the repo's documented convention — #4852 made AGENTS.md the canonical cross-vendor agent-instructions filename, and a managed app that adopted it would otherwise be told to read a file it no longer has. v5: the changelog step defers to the convention the repo documents (some repos collect per-branch fragments in a directory so parallel agents don't conflict) instead of prescribing an append to `.changelog/NEXT.md`. v4: generic {appName} body (v1 hardcoded "PortOS"; v2/v3 retired DONE.md wording)'ui-bugs': 2, // v2: generic {appName} + the app UI (older default hardcoded "PortOS" + http://localhost:5555)@@ -64,6 +52,19 @@ export const PROMPT_VERSIONS = {'stash-cleanup': 2, // v2: the STALE/ABANDONED heuristic names `AGENTS.md` (or `CLAUDE.md`) as the policy file to check before assuming a stash contradicts current architecture (#4852). v1: triage git stash list — supersession check against main, drop superseded/stale entries, leave real unlanded work in place. Net-new type (no PREVIOUS_DEFAULT_PROMPTS entry needed).'repo-sync': 1, // v1: verify + finish the deterministic install-wide origin-sync sweep (services/repoSync.js) — resolve mid-flight merges/rebases, decide what to do with uncommitted work, land or report unpushed branches, triage the stashes it could not prove redundant. Net-new type (no PREVIOUS_DEFAULT_PROMPTS entry needed).'release-check': 12, // v12: code review is advisory and only CI gates release progress; v11: delegate release mechanics to bundled slashdo release and pin PortOS-configured reviewers. v10: the release-documentation search names the `AGENTS.md` (or `CLAUDE.md`) context instead of CLAUDE.md alone (#4852). v9: Step 1 reconciles missing GitHub Releases against git release tags (publishing any missing tag with .changelog/vX.Y.Z.md as body and --latest=false when a newer version exists) BEFORE evaluating if enough unreleased work has accumulated; v8: database-backed release tests are provisioned and run using the repo's documented isolated test database before the release PR gate; v7: Step 1 also reads the UNCOLLECTED changelog fragments (the fragment dir, plus whatever preview command that repo documents — release-check is a generic {appName} prompt, so it never names a PortOS script to run) and counts substantive entries across the assembled notes — reading only the staged `.changelog/NEXT.md` under-counts a release whose entries are still per-branch fragments, so a ready release reported as "not enough work". v6: generic {appName} body (older defaults hardcoded "PortOS")++ // A SCHEDULE task type absent from this map is silently exempt from+ // auto-upgrade forever: taskScheduleStore's upgrade block is gated on+ // `PROMPT_VERSIONS[taskType] && …`, so a body change ships and no install+ // ever receives it. console-errors, error-handling and typing were frozen+ // that way for months. Every schedule key therefore carries an entry, v1+ // meaning "shipped once, never revised" — taskPromptDefaults.test.js enforces+ // the parity so the next new scheduled prompt cannot repeat it. (Pipeline+ // STAGE bodies stay unversioned on purpose: they are read live from the+ // catalog and never persisted, so an edit reaches every install on the next+ // dispatch.)+ 'jira-sprint-manager': 1,+ 'jira-status-report': 1,};// Audit anchor for reference-watch's read/write coupling.diff --git a/server/services/taskScheduleStore.js b/server/services/taskScheduleStore.jsindex d0c47a9082..4ac02b5c4a 100644--- a/server/services/taskScheduleStore.js+++ b/server/services/taskScheduleStore.js@@ -212,8 +212,7 @@ async function readSchedule() {config.promptVersion = PROMPT_VERSIONS[taskType] || 1;needsSave = true;} else if (promptMatchesShippedDefault(config.prompt, taskType)) {- // Matches a shipped default — a prior one, or the current one under- // the retired header. Assign version 1 so auto-upgrade triggers.+ // Matches a known previous default — assign version 1 so auto-upgrade triggersconfig.promptVersion = 1;needsSave = true;} else {