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: finish full character cards on expand
[._.]/ Adam Eivy1904c60272f4
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex e55e1b1c60..804b682cfd 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -12,6 +12,7 @@- **A late structure-repair regression no longer erases an independently verified improvement.** The bounded correction sequence could shrink nine arc blockers to one, then let its final attempt trade that residual for five and restore the entire pre-repair plan—discarding the proven one-blocker checkpoint. It now restores the best verified intermediate state, sends that partial improvement through the harsh foundation re-judge, and leaves the full arc gate dirty so the residual must still clear before beats. Model evidence follows the same transaction boundary: the retained repair runs remain provisional, while the regressive run is immediately scored as rejected; a fully reverted repair is also a rejection rather than a schema-invalid response.- **Character-first planning now includes the cast's visual foundation.** The pre-arc character architect used to complete psychology and relationships while its response contract omitted physical description, silhouette, visual identity, and palette, so a graphic-novel series could settle its plot around characters the image pipeline still had to invent. Those identity-bearing fields now participate in completeness, prompt hashing, harsh foundation scoring, and repair; optional sheets such as props, expressions, gestures, and wardrobes are authored when the character's form supports them.- **Character-first planning now finishes supporting cast bible cards too.** A character minted by series extraction could be omitted from foundation repair until their name appeared in the synopsis, and the repair allowlist dropped otherwise-useful profile fields such as pronouns, age, accent, likes/dislikes, mannerisms, and skills. Explicit `sourceSeriesId` ownership now keeps every series-linked character in exhaustive batches, and full narrative/visual profiles participate in completeness, hashing, repair, and harsh judging instead of stopping when only the lead framework is ready.+- **AI character expansion now finishes the whole visible bible card.** The expand action previously omitted physical description, personality, background, and outfits from both its response contract and no-clobber merge allowlist, so a technically successful run still left major UI sections empty. Those fields now fill alongside identity, motivation, framework, visual details, palettes, props, expressions, and gestures while every authored value remains protected.- **Foundation judges now inspect the character designs they score.** Completed render fields were previously collapsed to the word `ready` in the judge context, so a harsh judge could only see that a value existed and then reasonably report that no anatomy, silhouette, palette, or visual grammar was available for comparison. The bounded context now carries the actual distinguishing details while still excluding unrelated universe assets.- **Series Autopilot can pause without killing productive work.** The live control used to offer only Stop, which terminates the active provider run even when a long foundation judgment is doing useful work. **Pause safely** now records a graceful request, lets the active step and any provisional repair-verification transaction settle, then persists a resumable manual pause; **Stop now** remains available as the immediate emergency control.- **Canon readiness now repairs manuscript-supported blanks before blocking art.** Autopilot's pre-render gate could identify a drawn character, place, or object with no description, but it immediately paused even though the Nouns workflow already had a safe fill-blanks-only service. The gate now runs that strict prose-grounded backfill for each affected issue, rechecks shared canon, and pauses only for locked nouns or visual facts the manuscript genuinely never established—never inventing unsupported design to force a pass.diff --git a/data.reference/prompts/stages/universe-character-expand.md b/data.reference/prompts/stages/universe-character-expand.mdindex e2fe1a02d1..4cd9f5e3b9 100644--- a/data.reference/prompts/stages/universe-character-expand.md+++ b/data.reference/prompts/stages/universe-character-expand.md@@ -35,6 +35,9 @@ For every BLANK field in the character JSON above, propose a value that:- `coreTheme` — the character's one-sentence thematic essence ("a cartographer of grief", "the city's last honest broker").- `speechAccent` — regional / cultural accent only ("clipped Edinburgh", "Brooklyn drawl", "off-world inflection — vowels stretch"). Keep narrow; the rhythm + lexicon goes in `speechPattern`.- `speechPattern` — written speech rhythm: sentence structure, cadence, vocabulary tics, recurring phrases ("rarely contracts; uses nautical metaphors; trails off into ellipses when uncertain; never swears, prefers archaic substitutes like 'damnation'"). Distinct from `voiceId` (the TTS engine pointer) — this drives how dialogue *reads* on the page, before any voice synth.+- `physicalDescription` — 50–100 words of stable, concrete image-generation identity: apparent age, scale/build or non-human form, surface/skin, hair and eyes when applicable, distinguishing marks, signature attire, and materials. Never substitute the character's name for visible detail.+- `personality` — specific contradictions and behavior under pressure, not a list of flattering adjectives.+- `background` — only the history that explains present choices, obligations, and blind spots.- `visualNotes` — 1–2 sentences capturing the at-a-glance silhouette and palette ("layered practical streetwear in faded mustard + charcoal; chunky boots; ever-present beanie").- `silhouetteNotes` — bulleted-as-prose distinctive shape features ("compact upper body; layered silhouette; tapered lower half; short hair adds 5cm height").- `postureNotes` — habitual posture cues ("slight forward lean; weight in left foot; shoulders loose; ready-to-move; eyes constantly scanning").@@ -60,6 +63,7 @@ For every BLANK field in the character JSON above, propose a value that:- `props` — 2–6 signature items the character carries or interacts with frequently. Each gets a `name`, `purpose`, `materials`, optional `notes`.- `expressions` — 7 named facial expressions covering the emotional range ("neutral", "curious", "worried", "surprised", "amused", "determined", "relaxed"). Each gets a 1-line `description`.- `handGestures` — 5 named hand gestures the character habitually uses ("relaxed hand", "pointing", "peace sign", "gripping radio", "adjusting earpiece"). Each gets a 1-line `description`.+- `wardrobes` — 1–4 recurring outfit/state variants with `name` and image-generation-ready `description`. For non-human characters use form-appropriate presentation or interface states instead of inventing clothing.## Output contract@@ -72,6 +76,9 @@ Return ONLY valid JSON, no markdown fence, no commentary. Include ONLY the keys"coreTheme": "string","speechAccent": "string","speechPattern": "string",+ "physicalDescription": "string",+ "personality": "string",+ "background": "string","visualNotes": "string","silhouetteNotes": "string","postureNotes": "string",@@ -96,6 +103,7 @@ Return ONLY valid JSON, no markdown fence, no commentary. Include ONLY the keys"props": [{"name": "string", "purpose": "string", "materials": "string", "notes": "string"}],"expressions": [{"name": "string", "description": "string"}],"handGestures": [{"name": "string", "description": "string"}],+ "wardrobes": [{"name": "string", "description": "string"}],"rationale": "1-sentence summary of the character direction you chose"}```diff --git a/scripts/migrations/257-complete-character-expand-fields.js b/scripts/migrations/257-complete-character-expand-fields.jsnew file mode 100644index 0000000000..a69b929a94--- /dev/null+++ b/scripts/migrations/257-complete-character-expand-fields.js@@ -0,0 +1,29 @@+/**+ * Let the visible "AI: expand character" action finish the whole bible card.+ *+ * The old response/merge contract excluded physical description, personality,+ * background, and wardrobes, so a successful expansion could still leave the+ * card visibly incomplete. Hash replacement preserves customized prompts.+ */++import { makePromptReplaceMigration } from './_lib.js';++export const ACCEPTED_OLD_MD5 = {+ 'universe-character-expand.md': ['177b6e4e8bdf445308cf8ac423cd5ad8'],+};++export const NEW_SHIPPED_MD5 = {+ 'universe-character-expand.md': '924fe8836f3014873d1789e98e997db2',+};++const { applyMigration, up } = makePromptReplaceMigration({+ accepted: ACCEPTED_OLD_MD5,+ current: NEW_SHIPPED_MD5,+ label: 'complete character expansion fields',+ customizedHint: (filename) =>+ ` To upgrade it manually, diff data.reference/prompts/stages/${filename}\n` ++ ` against data/prompts/stages/${filename} and add physical description, personality, background, and wardrobes.`,+});++export { applyMigration };+export default { up };diff --git a/scripts/migrations/257-complete-character-expand-fields.test.js b/scripts/migrations/257-complete-character-expand-fields.test.jsnew file mode 100644index 0000000000..1f96216ccf--- /dev/null+++ b/scripts/migrations/257-complete-character-expand-fields.test.js@@ -0,0 +1,31 @@+import { readFileSync } from 'fs';+import { describe, expect, it } from 'vitest';++import { repoRoot, runPromptMigrationTests } from './_testHelpers.js';+import migration, {+ ACCEPTED_OLD_MD5,+ NEW_SHIPPED_MD5,+ applyMigration,+} from './257-complete-character-expand-fields.js';++describe('migration 257 — complete character expansion fields', () => {+ runPromptMigrationTests({+ migration,+ applyMigration,+ ACCEPTED_OLD_MD5,+ NEW_SHIPPED_MD5,+ prefix: 'migration-257-complete-character-expand-fields-',+ });++ it('adds every formerly unwritable visible card section', () => {+ const prompt = readFileSync(+ `${repoRoot}/data.reference/prompts/stages/universe-character-expand.md`,+ 'utf8',+ );+ expect(prompt).toContain('`physicalDescription`');+ expect(prompt).toContain('`personality`');+ expect(prompt).toContain('`background`');+ expect(prompt).toContain('`wardrobes`');+ expect(prompt).toContain('"wardrobes"');+ });+});diff --git a/server/services/universeCharacterExpand.js b/server/services/universeCharacterExpand.jsindex dfe105a77f..313cea5941 100644--- a/server/services/universeCharacterExpand.js+++ b/server/services/universeCharacterExpand.js@@ -23,7 +23,8 @@ import { shortId } from '../lib/fileUtils.js';// vision-driven expand (`universeVisionExpand.js`) fills the SAME canonical set// of fields from one source of truth rather than a drifting second copy.export const STRING_FIELDS = Object.freeze([- 'pronouns', 'age', 'coreTheme', 'speechAccent', 'speechPattern', 'visualNotes',+ 'pronouns', 'age', 'coreTheme', 'speechAccent', 'speechPattern',+ 'physicalDescription', 'personality', 'background', 'visualNotes','silhouetteNotes', 'postureNotes', 'specialTraits', 'visualIdentity','motivations', 'likes', 'dislikes', 'mannerisms', 'relationships', 'skills',// Character framework (CWQE Phase 10, #2175) — the Ghost → Wound → Lie →@@ -33,6 +34,7 @@ export const STRING_FIELDS = Object.freeze([]);export const LIST_FIELDS = Object.freeze(['stats', 'colorPalette', 'props', 'expressions', 'handGestures',+ 'wardrobes',// Character framework — secrets are a plain string list (#2175).'secrets',]);@@ -203,4 +205,3 @@ export async function expandUniverseCharacter(universeId, entryId, options = {})console.log(`✨ Universe character expand — universe=${shortId(universeId)} entry=${shortId(entryId)} fields=${updatedFields.length} runId=${shortId(runId)}`);return { universe: updated, entry: latestEntry, rationale, runId, providerId, model, updatedFields };}-diff --git a/server/services/universeCharacterExpand.test.js b/server/services/universeCharacterExpand.test.jsindex d5735a1027..dd34345ba5 100644--- a/server/services/universeCharacterExpand.test.js+++ b/server/services/universeCharacterExpand.test.js@@ -5,13 +5,13 @@ describe('universeCharacterExpand — exported field lists', () => {// These are the single source of truth for both the text expand and the// vision-driven expand (universeVisionExpand.js). A drift here means one of// the two flows silently stops filling a field.- it('exports the 21 string fields + 6 list fields', () => {- // 16 original + 5 framework prose fields (ghost/wound/lie/want/need, #2175).- expect(STRING_FIELDS).toHaveLength(21);- expect(STRING_FIELDS).toEqual(expect.arrayContaining(['ghost', 'wound', 'lie', 'want', 'need']));- // 5 original + `secrets` (#2175).- expect(LIST_FIELDS).toHaveLength(6);- expect(LIST_FIELDS).toEqual(['stats', 'colorPalette', 'props', 'expressions', 'handGestures', 'secrets']);+ it('exports the complete string + list field contract', () => {+ expect(STRING_FIELDS).toHaveLength(24);+ expect(STRING_FIELDS).toEqual(expect.arrayContaining([+ 'physicalDescription', 'personality', 'background', 'ghost', 'wound', 'lie', 'want', 'need',+ ]));+ expect(LIST_FIELDS).toHaveLength(7);+ expect(LIST_FIELDS).toEqual(['stats', 'colorPalette', 'props', 'expressions', 'handGestures', 'wardrobes', 'secrets']);});});@@ -103,14 +103,16 @@ describe('universeCharacterExpand — applyExpansion (no-clobber merge semanticsit('respects the full extended-field set (smoke check the field list stays in sync)', () => {const target = {- name: 'Vale', pronouns: '', age: '', coreTheme: '', speechAccent: '', speechPattern: '', visualNotes: '',+ name: 'Vale', pronouns: '', age: '', coreTheme: '', speechAccent: '', speechPattern: '',+ physicalDescription: '', personality: '', background: '', visualNotes: '',silhouetteNotes: '', postureNotes: '', specialTraits: '', visualIdentity: '',motivations: '', likes: '', dislikes: '', mannerisms: '', relationships: '', skills: '',ghost: '', wound: '', lie: '', want: '', need: '',- stats: [], colorPalette: [], props: [], expressions: [], handGestures: [], secrets: [],+ stats: [], colorPalette: [], props: [], expressions: [], handGestures: [], wardrobes: [], secrets: [],};const content = {- pronouns: 'she/her', age: '27', coreTheme: 't', speechAccent: 'a', speechPattern: 'sp', visualNotes: 'v',+ pronouns: 'she/her', age: '27', coreTheme: 't', speechAccent: 'a', speechPattern: 'sp',+ physicalDescription: 'pd', personality: 'per', background: 'bg', visualNotes: 'v',silhouetteNotes: 's', postureNotes: 'p', specialTraits: 'st', visualIdentity: 'vi',motivations: 'm', likes: 'l', dislikes: 'd', mannerisms: 'mn', relationships: 'r', skills: 'sk',ghost: 'g', wound: 'w', lie: 'li', want: 'wa', need: 'ne',@@ -119,11 +121,12 @@ describe('universeCharacterExpand — applyExpansion (no-clobber merge semanticsprops: [{ name: 'n' }],expressions: [{ name: 'n' }],handGestures: [{ name: 'n' }],+ wardrobes: [{ name: 'fieldwear', description: 'patched coat', purpose: 'default' }],secrets: ['a hidden thing'],};const { updatedFields } = applyExpansion(target, content);- // 21 strings + 6 lists = 27 fields total in the expand contract.- expect(updatedFields).toHaveLength(27);+ // 24 strings + 7 lists = 31 fields total in the expand contract.+ expect(updatedFields).toHaveLength(31);expect(updatedFields).toContain('speechPattern');expect(updatedFields).toContain('lie');expect(updatedFields).toContain('secrets');