Skip to content

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

docs([issue-2979]): update the module headers the reordered workflow invalidated

[._.]/ Adam Eivy57958348a2c0
diff --git a/client/src/lib/spriteFacets.js b/client/src/lib/spriteFacets.js
index 50604f2e0d..7866586007 100644
--- a/client/src/lib/spriteFacets.js
+++ b/client/src/lib/spriteFacets.js
@@ -10,8 +10,10 @@
* round-trip buys nothing, and the path grammar is stable enough to mirror.
*
* Pure module — no I/O, no React. The path grammar it decodes is written by:
+ * reference/<id>-turnaround-vN.png locked turnaround sheet (#2979)
* reference/<id>-walk-<dir>-vN.png locked reference / anchor
* reference/candidates/walk-<dir>-candidate-N.png
+ * reference/candidates/turnaround-candidate-N.png
* reference/uploads/<file> user-supplied design image
* grok|runs/<runId>/generated/frames/NN-<phase>.png
* grok|runs/<runId>/generated/<id>-walk-<dir>-strip.png
diff --git a/server/routes/sprites.js b/server/routes/sprites.js
index 2476893597..7ea9a95e7f 100644
--- a/server/routes/sprites.js
+++ b/server/routes/sprites.js
@@ -2,11 +2,11 @@
* Sprites Routes — REST surface for the Sprite Manager.
*
* Phase 1 (#2895): library list/get, source-tree importer, record patch.
- * Phase 2 (#2896): character create + the reference workflow — generate
- * main/anchor candidates through the shared image-gen queue, review, then
- * lock (normalize + dynamic chroma-key selection). Generation is strictly
- * user-triggered per the AI-provider policy; locked artifacts are immutable
- * (409 on regenerate/relock).
+ * Phase 2 (#2896, reordered turnaround-first in #2979): character create + the
+ * reference workflow — generate turnaround/main/anchor candidates through the
+ * shared image-gen queue, review, then lock (normalize + dynamic chroma-key
+ * selection). Generation is strictly user-triggered per the AI-provider policy;
+ * locked artifacts are immutable (409 on regenerate/relock).
*/
import { Router } from 'express';
diff --git a/server/services/sprites/assetPrompt.js b/server/services/sprites/assetPrompt.js
index 1c608d6718..b3bc0040fb 100644
--- a/server/services/sprites/assetPrompt.js
+++ b/server/services/sprites/assetPrompt.js
@@ -11,10 +11,12 @@
* sidecar (attach hook); older ones predate that capture, so the prompt is
* reconstructed deterministically from the sidecar's designPrompt/direction
* /chromaKey via the same builders that generated it.
+ * - reference/<id>-turnaround-vN.png — the locked turnaround sheet (#2979),
+ * the identity root every other render descends from.
* - reference/<id>-walk-<dir>-vN.png — the locked main + directional anchors.
- * Resolved through the manifest: prefer the frozen candidate's literal
+ * Both resolved through the manifest: prefer the frozen candidate's literal
* prompt (`lockedFrom`), else rebuild from the manifest's own designPrompt/
- * chromaKey.
+ * chromaKey — using the sheet-aware copy for anything derived from it.
* - grok|runs/<run>/… — walk-animation assets, rebuilt from the run record's
* direction + chromaKey (the i2v motion prompt is a pure function of those).
*
diff --git a/server/services/sprites/reference.js b/server/services/sprites/reference.js
index 3c2afbf903..14cd8b32ae 100644
--- a/server/services/sprites/reference.js
+++ b/server/services/sprites/reference.js
@@ -1,10 +1,14 @@
/**
* Sprites — reference workflow orchestration (issue #2896, phase 2).
*
- * Ports the source pipeline's stage 1–2: create a character, generate main-
- * reference candidates (text and/or an uploaded visual reference), freeze the
- * approved main as the immutable identity root, then derive and lock the 8
- * directional anchors from it. Generation rides the shared media-job queue
+ * Ports the source pipeline's stage 1–2, reordered turnaround-first (#2979):
+ * create a character, generate turnaround-sheet candidates (text and/or an
+ * uploaded visual reference), freeze the approved sheet as the immutable
+ * identity root, then derive the main (walk-south) from its front panel and
+ * each of the 7 remaining directional anchors from the panel showing that
+ * side. A character created before #2979 is main-first (manifest
+ * `schemaVersion` 1) and backfills a sheet from its locked main before it can
+ * derive further anchors. Generation rides the shared media-job queue
* (`enqueueJob` kind:'image' with a `spriteRef` destination tag — the
* completion hook in services/spriteReferenceImageHook.js files finished
* renders into reference/candidates/); locking is deterministic sharp work
@@ -255,7 +259,8 @@ export async function getReferenceSet(recordId) {
* User-triggered only (route-invoked); never called at boot.
*
* `upload` is an optional `{ tempPath, originalname }` from the route's
- * multipart parse (main target only) — copied into the record's
+ * multipart parse — a design image seeding the identity root (the turnaround
+ * sheet, or a legacy record's main), never an anchor. Copied into the record's
* reference/uploads/ so provenance survives the temp-file sweep.
*/
export function startReferenceGeneration(recordId, body, upload = null) {
@@ -266,9 +271,10 @@ async function startReferenceGenerationImpl(recordId, body, upload = null) {
const record = await requireCharacter(recordId);
const manifest = (await loadManifest(recordId)) || seedManifest(recordId);
const target = body.target;
- // Once the main is locked, the manifest's key is canonical (set at lock —
- // possibly auto-selected); a later record-level repin must not fork
- // subsequent anchors onto a different background than the frozen set.
+ // Once either identity artifact is locked — the sheet on a turnaround-first
+ // record, the main on a legacy one — the manifest's key is canonical (set at
+ // that lock, possibly auto-selected); a later record-level repin must not
+ // fork subsequent renders onto a different background than the frozen set.
const genKey = manifest.chromaKey || record.chromaKey || DEFAULT_CHROMA_KEY;
const settings = await getSettings();
const mode = resolveQueueImageMode(body.mode, settings);