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
address review (codex): drop the legacy-default migration, keep only the empty seed
[._.]/ Adam Eivy078658a16173
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 113c50ccb1..1336c1379c 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -20,7 +20,7 @@## Changed-- [issue-2677] **Your Character page is now about you, not a generic adventurer.** The page centers on the human who owns the install — your name, your avatar, your age-based level, and the skills, goals, and metrics derived from how you actually use PortOS — with the old D&D combat mechanics moved out of the way. Damage, rest, dice rolls, manual XP, the JIRA/task XP sync, and the event log now live in a collapsed "RPG mechanics" section that's closed by default; nothing was removed, so those buttons and endpoints still work and existing character files keep their history. When you haven't set a birth date yet there's no age to turn into a level, so instead of a blank badge the page prompts you to "set your birth date" and links straight to the age editor where that field lives. Your name and title now read as human placeholders ("Your name", "Add a title") instead of the old generic "Adventurer" / "Developer": a fresh install starts blank, and an existing install that never personalized those fields has them cleared automatically so it, too, prompts for your real name.+- [issue-2677] **Your Character page is now about you, not a generic adventurer.** The page centers on the human who owns the install — your name, your avatar, your age-based level, and the skills, goals, and metrics derived from how you actually use PortOS — with the old D&D combat mechanics moved out of the way. Damage, rest, dice rolls, manual XP, the JIRA/task XP sync, and the event log now live in a collapsed "RPG mechanics" section that's closed by default; nothing was removed, so those buttons and endpoints still work and existing character files keep their history. When you haven't set a birth date yet there's no age to turn into a level, so instead of a blank badge the page prompts you to "set your birth date" and links straight to the age editor where that field lives. Your name and title now read as human placeholders ("Your name", "Add a title") instead of the old generic "Adventurer" / "Developer": a fresh install starts blank so it prompts for your real name (an existing install keeps whatever name is on record — edit it inline to make it yours).- **Clicking a Creative Commission now opens its own page showing every render it has made.** A commission used to open a sidebar edit form; it now navigates to a routed detail page (`/creative-commission/:id`) that leads with a gallery of every render the commission has produced — each run's final video (with an inline play badge), rendered scene, or produced image, newest first — above the full editable brief/schedule/generation config. Rate a render 👍/👎 and add a note right on its card to steer the next run, run the commission now, pause it, or delete it from the header. The render, its Creative Director output, and the open commission are all directly shareable and bookmarkable (the URL is the source of truth), and a notification about a scheduled run deep-links straight to the render. Creating a new commission still uses the quick "New Commission" drawer on the index; a run whose project was pruned degrades to a status-only card with its output link intact.diff --git a/client/src/pages/CharacterSheet.framing.test.jsx b/client/src/pages/CharacterSheet.framing.test.jsxindex bfcc26f360..dbe40e0d89 100644--- a/client/src/pages/CharacterSheet.framing.test.jsx+++ b/client/src/pages/CharacterSheet.framing.test.jsx@@ -80,9 +80,8 @@ describe('human-centered framing', () => {});it('falls back to human-centered placeholders for an unnamed person', async () => {- // The server seeds an empty name/class on a fresh install (createDefaultCharacter), and- // migration 198 clears the legacy 'Adventurer'/'Developer' defaults on existing installs —- // so the page only ever sees an empty value for "unset" and renders the placeholder.+ // The server seeds an empty name/class on a fresh install (createDefaultCharacter), so the+ // page renders the placeholder for an unset (empty) value.await renderChar({ name: '', class: '' });expect(screen.getByText('Your name')).toBeInTheDocument();expect(screen.getByText('Add a title')).toBeInTheDocument();diff --git a/scripts/migrations/198-character-clear-legacy-rpg-defaults.js b/scripts/migrations/198-character-clear-legacy-rpg-defaults.jsdeleted file mode 100644index f8cdff7f5f..0000000000--- a/scripts/migrations/198-character-clear-legacy-rpg-defaults.js+++ /dev/null@@ -1,77 +0,0 @@-/**- * Clear the legacy generic RPG identity from an existing character.json.- *- * Background:- * The Character page used to seed `createDefaultCharacter()` with- * `name: 'Adventurer'`, `class: 'Developer'` — a generic D&D adventurer. The- * human-centered reframe (#2677, epic #2672) changes the seed to empty strings- * so a fresh install renders the "Your name" / "Add a title" placeholders and- * never presents a generic adventurer.- *- * That seed change is prospective only: an install created before #2677 still- * has `name: 'Adventurer'` / `class: 'Developer'` persisted, so it would keep- * showing the old identity forever. This migration converges those installs on- * the new behavior by clearing the fields to '' — but ONLY when they exactly- * match the old shipped defaults, so a user who deliberately typed either word- * (or has already personalized their name/title) is left untouched.- *- * Approach:- * - Per-field, exact-match only: `name === 'Adventurer'` → '' and- * `class === 'Developer'` → '' independently. Any other value is a- * deliberate choice and is preserved.- * - Rewrites the file only when something actually changed — a no-op by- * construction on the common case (already personalized, or already blank),- * and on a fresh post-#2677 install (blank seed) there is nothing to match.- * - Preserves every other field and stamps `updatedAt` when it does change.- */--import { readFile, writeFile } from 'fs/promises';-import { join } from 'path';--const CHARACTER_REL = 'data/character.json';--const LEGACY_DEFAULT_NAME = 'Adventurer';-const LEGACY_DEFAULT_CLASS = 'Developer';--export default {- async up({ rootDir }) {- const path = join(rootDir, CHARACTER_REL);- const raw = await readFile(path, 'utf-8').catch((err) => {- if (err.code === 'ENOENT') return null;- throw err;- });- if (raw == null) {- console.log('✅ Character: no character.json — nothing to clear');- return { cleared: false, reason: 'no-file' };- }-- let character;- try {- character = JSON.parse(raw);- } catch {- // A corrupt character.json is not this migration's problem to fix, and- // rewriting it would risk destroying recoverable data.- console.warn('⚠️ Character: character.json is not valid JSON — skipping');- return { cleared: false, reason: 'unparseable' };- }- if (character == null || typeof character !== 'object' || Array.isArray(character)) {- console.warn('⚠️ Character: character.json is not an object — skipping');- return { cleared: false, reason: 'unexpected-shape' };- }-- const next = { ...character };- let changed = false;- if (next.name === LEGACY_DEFAULT_NAME) { next.name = ''; changed = true; }- if (next.class === LEGACY_DEFAULT_CLASS) { next.class = ''; changed = true; }-- if (!changed) {- console.log('✅ Character: no legacy RPG defaults to clear — no changes');- return { cleared: false };- }-- next.updatedAt = new Date().toISOString();- await writeFile(path, JSON.stringify(next, null, 2) + '\n');- console.log('🧹 Character: cleared legacy "Adventurer" / "Developer" defaults');- return { cleared: true };- },-};diff --git a/scripts/migrations/198-character-clear-legacy-rpg-defaults.test.js b/scripts/migrations/198-character-clear-legacy-rpg-defaults.test.jsdeleted file mode 100644index 42e8841c57..0000000000--- a/scripts/migrations/198-character-clear-legacy-rpg-defaults.test.js+++ /dev/null@@ -1,97 +0,0 @@-import { describe, it, expect, beforeEach, afterEach } from 'vitest';-import { mkdtemp, mkdir, rm, readFile, writeFile } from 'fs/promises';-import { tmpdir } from 'os';-import { join } from 'path';--import migration from './198-character-clear-legacy-rpg-defaults.js';--let rootDir;--const CHARACTER_REL = 'data/character.json';--async function seed(character) {- await mkdir(join(rootDir, 'data'), { recursive: true });- await writeFile(join(rootDir, CHARACTER_REL), JSON.stringify(character, null, 2));-}--async function readCharacter() {- return JSON.parse(await readFile(join(rootDir, CHARACTER_REL), 'utf-8'));-}--const character = (overrides = {}) => ({- name: 'Adventurer',- class: 'Developer',- xp: 100,- hp: 15,- maxHp: 15,- events: [],- createdAt: '2020-01-01T00:00:00.000Z',- updatedAt: '2020-01-01T00:00:00.000Z',- ...overrides,-});--beforeEach(async () => {- rootDir = await mkdtemp(join(tmpdir(), 'portos-mig198-'));-});--afterEach(async () => {- await rm(rootDir, { recursive: true, force: true });-});--describe('198-character-clear-legacy-rpg-defaults', () => {- it('clears the exact legacy name and class, preserving other fields', async () => {- await seed(character());-- const result = await migration.up({ rootDir });-- expect(result.cleared).toBe(true);- const out = await readCharacter();- expect(out.name).toBe('');- expect(out.class).toBe('');- // Everything else is preserved.- expect(out.xp).toBe(100);- expect(out.events).toEqual([]);- // updatedAt is refreshed since a change landed.- expect(out.updatedAt).not.toBe('2020-01-01T00:00:00.000Z');- });-- it('clears each legacy default independently', async () => {- await seed(character({ name: 'Alice', class: 'Developer' }));- expect((await migration.up({ rootDir })).cleared).toBe(true);- const out = await readCharacter();- expect(out.name).toBe('Alice'); // a deliberate name is kept- expect(out.class).toBe(''); // the legacy class is cleared- });-- it('leaves a personalized name/class untouched (no rewrite)', async () => {- await seed(character({ name: 'Alice', class: 'Explorer' }));- const before = await readFile(join(rootDir, CHARACTER_REL), 'utf-8');-- const result = await migration.up({ rootDir });-- expect(result.cleared).toBe(false);- expect(await readFile(join(rootDir, CHARACTER_REL), 'utf-8')).toBe(before);- });-- it('is a no-op on a fresh post-#2677 install (already-blank seed)', async () => {- await seed(character({ name: '', class: '' }));- const before = await readFile(join(rootDir, CHARACTER_REL), 'utf-8');-- expect((await migration.up({ rootDir })).cleared).toBe(false);- expect(await readFile(join(rootDir, CHARACTER_REL), 'utf-8')).toBe(before);- });-- it('tolerates a missing character.json', async () => {- expect(await migration.up({ rootDir })).toEqual({ cleared: false, reason: 'no-file' });- });-- it('skips an unparseable or unexpectedly-shaped file rather than destroying it', async () => {- await mkdir(join(rootDir, 'data'), { recursive: true });- await writeFile(join(rootDir, CHARACTER_REL), '{not json');- expect((await migration.up({ rootDir })).reason).toBe('unparseable');- expect(await readFile(join(rootDir, CHARACTER_REL), 'utf-8')).toBe('{not json');-- await writeFile(join(rootDir, CHARACTER_REL), '[]');- expect((await migration.up({ rootDir })).reason).toBe('unexpected-shape');- });-});diff --git a/server/services/character.js b/server/services/character.jsindex 9034a69368..1b5dc4d187 100644--- a/server/services/character.js+++ b/server/services/character.js@@ -120,8 +120,9 @@ export function createDefaultCharacter() {// Empty = unset. The human-centered Character page (#2677) renders "Your name" / "Add a// title" placeholders for an empty name/class, so a fresh install starts blank rather than// presenting the old generic "Adventurer" / "Developer" identity (epic #2672). Existing- // installs whose character.json still carries those legacy defaults are cleared by- // migration 198.+ // installs keep whatever name/class is already persisted — it's the user's own data, edited+ // inline; deliberately NOT migrated, since character.json carries no "was this the untouched+ // seed?" provenance and a text-only match would erase a user who genuinely chose either word.name: '',class: '',xp: 0,