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

fold the lane fallback into mediaJobLane and key video labels off the server enum

[._.]/ Adam Eivy1035a2365aa1
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index 3e4257d243..12c3c628fc 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -84,7 +84,7 @@ grep -i "what you want to do" client/src/lib/README.md
| `reverseOutlineGrid.js` | `buildPlotlineGrid` (reverse-outline scenes + plotlines → plotline-by-sequence grid rows/cells) + `sceneComponentCount`. Used by the Reverse Outline page. |
| `wrImageDefaults.js` | Writers Room per-scene image-gen defaults + style discriminators. |
| `imageGenBackends.js` | Icon metadata, `deriveAvailableBackends`, and `imageGenReadiness(status)` — a compatibility-safe `ready` / `unavailable` / `unknown` read of image-gen status responses; re-exports everything from `imageGenModes.js` so consumers keep one import site. |
-| `imageGenModes.js` | Node-safe image/video backend constants + pure helpers. The backend / render-target / execution-lane alphabets (`IMAGE_GEN_MODE`, `CLOUD_IMAGE_GEN_MODES`, `RENDER_TARGET`, `VIDEO_RENDER_MODES`, `MEDIA_JOB_LANES`, `normalizeRenderPinValue`) are re-exported from the dependency-free server leaves `server/lib/generationModes.js` + `server/lib/renderTargets.js`, never copied. Adds the Settings rows (`RENDER_TARGET_OPTIONS`), `applyRecordRenderPin` (fold a record's `imageMode`/`imageModelId` pin over a settings-derived cfg), `isCloudVideoMode`, `modeLabel`, `mediaJobLane` (a projected media job's scheduler lane, with a `fallbackExecutionLane` read for responses predating the server's `executionLane` field), and the cloud/model-override/i2i capability mirrors of the server service specs. Imported by the server-side parity suite — must stay importable without client packages. |
+| `imageGenModes.js` | Node-safe image/video backend constants + pure helpers. Re-exports the backend / render-target / lane alphabets from the server leaves `server/lib/generationModes.js` + `server/lib/renderTargets.js` (see its header for why nothing is copied); adds the Settings rows (`RENDER_TARGET_OPTIONS`), `applyRecordRenderPin` (fold a record's `imageMode`/`imageModelId` pin over a settings-derived cfg), `isCloudCliMode`/`isCloudVideoMode`, `modeLabel`, `mediaJobLane` (a projected media job's scheduler lane, re-derived for responses predating the server's `executionLane` field), and the cloud/model-override/i2i capability mirrors of the server service specs. Imported by the server-side parity suite — must stay importable without client packages. |
| `imageGenDefaults.js` | Shared `DEFAULT_NEGATIVE_PROMPT` used by the Image Gen form and quick-submit entry points. Mirrors server-side default. |
| `imageGenResolutions.js` | Shared resolution presets for image generation. |
| `imageTo3dReasons.js` | Client mirror of the image-to-3D unavailable-reason labels in `server/services/imageTo3d/targets.js`: `UNAVAILABLE_REASONS` (reason code → user-facing label), `UNAVAILABLE_REASON_FALLBACK`, and `unavailableReasonLabel(code, fallback?)`, plus `isTargetReady(target)` — the shared readiness predicate (`installed` is tri-state: `null` = a hosted lane with no install concept, ready as soon as it is available). Use these anywhere a target's `unavailableReason` or readiness is rendered — never re-declare the codes or re-derive readiness from `target.installed` truthiness. Parity + code coverage enforced by `server/services/imageTo3d/unavailableReasons.parity.test.js`. |
diff --git a/client/src/lib/imageGenModes.js b/client/src/lib/imageGenModes.js
index 65599c42ae..715f7dd433 100644
--- a/client/src/lib/imageGenModes.js
+++ b/client/src/lib/imageGenModes.js
@@ -16,8 +16,10 @@
* hand-copied alphabet is how fal.ai and Reactor video renders came to be
* filed under "Local machine" (#6292). What remains a mirror is only what
* lives in server SERVICE modules the browser bundle cannot load (per-provider
- * capability specs, shipped default models) — each is labeled below and bound
- * to its server value by the parity suite.
+ * capability specs, shipped default models) — each is labeled below. The
+ * parity suite binds `I2I_CAPABLE_MODES`, `MAX_INPUT_IMAGES` and
+ * `cloudPromptRequired`; the shipped defaults and `GROK_ASPECT_RATIOS` are
+ * unbound copies.
*/
import {
@@ -25,6 +27,7 @@ import {
CLOUD_VIDEO_GEN_MODES,
IMAGE_GEN_MODE,
MEDIA_JOB_EXECUTION_LANES,
+ VIDEO_GEN_MODE,
VIDEO_GEN_MODES,
mediaJobExecutionLane,
} from '../../../server/lib/generationModes.js';
@@ -39,6 +42,9 @@ export {
IMAGE_GEN_MODE,
RENDER_TARGET,
RENDER_TARGET_BACKEND_AUTO,
+ // The backend alphabet for the video pin controls and the install-wide
+ // `settings.videoGen.mode` pin, under the name the pickers already use.
+ VIDEO_GEN_MODES as VIDEO_RENDER_MODES,
normalizeRenderPinValue,
};
@@ -86,18 +92,9 @@ export const RENDER_TARGET_OPTIONS = Object.freeze([
{ id: RENDER_TARGET.CREATIVE_AGENT, label: 'Creative agent renders', video: true },
]);
-// The server's VIDEO_GEN_MODES — the backend alphabet for the video pin
-// controls above and the install-wide `settings.videoGen.mode` pin.
-export const VIDEO_RENDER_MODES = VIDEO_GEN_MODES;
-
-// The server's CLOUD_VIDEO_GEN_MODES — the video backends that render in a
-// provider's cloud rather than on the local accelerator.
-export const CLOUD_VIDEO_RENDER_MODES = CLOUD_VIDEO_GEN_MODES;
-export const isCloudVideoMode = (mode) => CLOUD_VIDEO_RENDER_MODES.includes(mode);
-
-// The server's MEDIA_JOB_EXECUTION_LANES — the lanes the media-job scheduler
-// runs in.
-export const MEDIA_JOB_LANES = MEDIA_JOB_EXECUTION_LANES;
+// True when a video backend renders in a provider's cloud rather than on the
+// local accelerator.
+export const isCloudVideoMode = (mode) => CLOUD_VIDEO_GEN_MODES.includes(mode);
// Client mirror of the server's GROK_ASPECT_RATIOS (imageGen/grok.js) — the
// aspect ratios grok's image_gen/image_edit tools accept, offered as the
@@ -112,15 +109,14 @@ export const MODE_LABELS = Object.freeze({
[IMAGE_GEN_MODE.GROK]: 'Grok',
[IMAGE_GEN_MODE.AGY]: 'Agy',
[IMAGE_GEN_MODE.EXTERNAL]: 'External',
- fal: 'fal.ai',
- reactor: 'Reactor.inc',
+ [VIDEO_GEN_MODE.FAL]: 'fal.ai',
+ [VIDEO_GEN_MODE.REACTOR]: 'Reactor.inc',
});
-// The server's CLOUD_IMAGE_GEN_MODES (re-exported above) — cloud-CLI backends
-// that pick model/steps/seed internally, run through the media queue's
-// parallel cloud lane, and need a prompt for text-to-image. Use
-// `isCloudCliMode` instead of hand-rolled `mode === CODEX || mode === GROK`
-// disjunctions.
+// True for a cloud-CLI backend: one that picks model/steps/seed internally,
+// runs through the media queue's parallel cloud lane, and needs a prompt for
+// text-to-image. Use this instead of hand-rolled `mode === CODEX || mode ===
+// GROK` disjunctions.
export const isCloudCliMode = (mode) => CLOUD_IMAGE_GEN_MODES.includes(mode);
// Client mirror of the server's `supportsModelOverride` spec flag
@@ -227,25 +223,17 @@ export const I2I_CAPABLE_MODES = Object.freeze([
// True when a mode can run image-to-image.
export const isI2iCapableMode = (mode) => I2I_CAPABLE_MODES.includes(mode);
-// Backward-compatibility read of a media job's execution lane for a queue
-// response carrying no `executionLane`. The bundle is served by the same
-// install whose API it calls, so this is not routine version skew — it covers
-// the window where a rebuilt client is already being served by a server
-// process that has not restarted yet, and a replayed/hand-edited response. The
-// classification itself is the scheduler's own `mediaJobExecutionLane`; the
-// only client-side work is reading "federated" off the projected `renderer`
-// field. Never call this when `executionLane` is present: the server's own
-// classification is authoritative.
-export const fallbackExecutionLane = ({ kind, mode, renderer } = {}) => (
- mediaJobExecutionLane({ kind, mode, remote: renderer === 'remote' })
-);
-
-// THE one lane read for a projected media job: the server's classification when
-// it is there, the compatibility derivation when it isn't.
+// THE one lane read for a projected media job: the server's classification
+// when it is there, and otherwise the scheduler's own `mediaJobExecutionLane`
+// re-run over the projection — the only client-side work is reading
+// "federated" off the projected `renderer` field. The fallback is not routine
+// version skew (the bundle is served by the install whose API it calls): it
+// covers the window where a rebuilt client is already being served by a server
+// process that has not restarted yet, and a replayed/hand-edited response.
export const mediaJobLane = (job) => (
- MEDIA_JOB_LANES.includes(job?.executionLane)
+ MEDIA_JOB_EXECUTION_LANES.includes(job?.executionLane)
? job.executionLane
- : fallbackExecutionLane({ kind: job?.kind, mode: job?.params?.mode, renderer: job?.renderer })
+ : mediaJobExecutionLane({ kind: job?.kind, mode: job?.params?.mode, remote: job?.renderer === 'remote' })
);
// Pick the best available i2i backend from a list of `{ id }` backends,
diff --git a/server/lib/renderTargets.parity.test.js b/server/lib/renderTargets.parity.test.js
index b05264becf..7fb411287a 100644
--- a/server/lib/renderTargets.parity.test.js
+++ b/server/lib/renderTargets.parity.test.js
@@ -13,10 +13,7 @@
* complement of `EDIT_INCAPABLE_IMAGE_MODES`, and the one presentation
* decision the Settings tab owns — which render targets get a Defaults row.
* Drift there is invisible to either suite alone: the client tests assert the
- * client's own literals, and the server never loads the client mirror. A
- * typo'd id in the Settings rows would make the strict
- * `renderDefaultsSettingsSchema` 400 the ENTIRE settings PUT while the
- * client test (which mocks updateSettings) stayed green.
+ * client's own literals, and the server never loads the client mirror.
*
* Lives server-side because the server runner loads the pure client lib fine,
* while the client (happy-dom) runner can't load service modules.
diff --git a/server/lib/validation.js b/server/lib/validation.js
index 646f648476..91ae169a40 100644
--- a/server/lib/validation.js
+++ b/server/lib/validation.js
@@ -1780,8 +1780,8 @@ const agyImageModelSchema = z.preprocess(
// route makes for catalogUserTypes. The route persists the raw body, so a
// newer build's pins survive the round-trip intact rather than being dropped.
// Known fields keep full enum/charset enforcement (that's what stops a bad
-// model id reaching a CLI argv); the client mirror's parity test guards the
-// known-key alphabet.
+// model id reaching a CLI argv); the known-key alphabet is RENDER_TARGETS from
+// lib/renderTargets.js, which the client re-exports rather than mirrors.
const renderTargetModelSchema = z.preprocess(
(v) => (v === '' ? null : v),
cloudModelIdString('model must be a valid model id').nullable().optional(),