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
docs([issue-5423]): decide against an H3 draft-decoder asset, and record why
[._.]/ Adam Eivy15445ac08dbc
diff --git a/docs/README.md b/docs/README.mdindex 08e012ecdd..645e969add 100644--- a/docs/README.md+++ b/docs/README.md@@ -51,7 +51,7 @@ Comms & voice: [openclaw-operator-chat](./features/openclaw-operator-chat.md) ([## Point-in-time records- **[plans/](./plans/README.md)** — dated design plans (`YYYY-MM-DD-<slug>.md`), archived on approval before implementation. Historical records, not living docs.-- **decisions/** — ADRs (`YYYY-MM-DD-<slug>.md`), e.g. the [Postgres-as-primary-datastore decision](./decisions/2026-06-07-postgres-as-primary-datastore.md) and what may cross the federation layer ([privacy records machine-local](./decisions/2026-08-08-privacy-records-machine-local.md), [federated visual prompts](./decisions/2026-08-20-federated-visual-prompts.md), [conditioning crosses to an allowlisted peer](./decisions/2026-08-22-federated-media-input-assets.md)).+- **decisions/** — ADRs (`YYYY-MM-DD-<slug>.md`), e.g. the [Postgres-as-primary-datastore decision](./decisions/2026-06-07-postgres-as-primary-datastore.md) and what may cross the federation layer ([privacy records machine-local](./decisions/2026-08-08-privacy-records-machine-local.md), [federated visual prompts](./decisions/2026-08-20-federated-visual-prompts.md), [conditioning crosses to an allowlisted peer](./decisions/2026-08-22-federated-media-input-assets.md)), and why H3 [ships the draft-decode gates without an asset](./decisions/2026-08-30-h3-draft-decoder-asset.md).- **research/** — dated investigation and incident write-ups (e.g. the [mflux GPU-watchdog panic](./research/2026-06-13-mflux-training-watchdog-panic.md) and the [local LLM performance audit](./research/2026-08-22-local-llm-performance-audit.md)).- **superpowers/** — plan/spec pairs from superpowers-driven builds: `specs/<date>-<slug>-design.md` (design) + `plans/<date>-<slug>.md` (implementation plan).diff --git a/docs/decisions/2026-08-30-h3-draft-decoder-asset.md b/docs/decisions/2026-08-30-h3-draft-decoder-asset.mdnew file mode 100644index 0000000000..a4f6c81f67--- /dev/null+++ b/docs/decisions/2026-08-30-h3-draft-decoder-asset.md@@ -0,0 +1,93 @@+# ADR: The H3 Draft-Decode Gates Ship Without an Asset, and Stay That Way Until a Full-VAE-Shaped Candidate Exists++- **Date:** 2026-08-30+- **Status:** Accepted — `VIDEO_DRAFT_DECODERS` stays empty; the mechanism stays shipped+- **Related:** issue #5423,+ [`server/lib/videoDraftDecoders.js`](../../server/lib/videoDraftDecoders.js),+ `build_draft_decoder_shim` in+ [`scripts/generate_minimax_h3.py`](../../scripts/generate_minimax_h3.py),+ [`server/services/videoGen/generateVideo.js`](../../server/services/videoGen/generateVideo.js)++## Decision++PortOS keeps the draft-decode mechanism it already ships — declaration, runtime-revision+check, asset-readiness check, delivery-intent override, the `DRAFTDECODE:` outcome line,+and the Video Gen control — and **declares no draft-decoder asset for MiniMax H3.**++The blocking constraint is **PortOS's own substitution shape, not the availability of+cheap decoders.** `build_draft_decoder_shim` composes a checkpoint root whose+`video_vae/source/model.safetensors` is the substitute and whose configs stay upstream's,+and the pinned MLX port's `load_video_vae` (`PipeNetwork/minimax-h3-mlx`+@ `fcd9e9b79a1d6018d91ac477c0968de1fa067e49`) then does a **strict** key match against the+whole `VideoVAE` parameter tree. A qualifying asset must therefore be a **complete,+unquantized, full-`VideoVAE`-shaped checkpoint carrying upstream's exact key set.**++Every published way of making a video decode cheap fails that shape by construction:+a tiny autoencoder is a different module tree, a quantized repack carries+`.scales`/`.biases` the strict check rejects as unexpected, and a decoder-only head is+missing every encoder key. What survives the shape check — a full-size re-trained VAE —+saves no resources, which is the entire point of the feature.++**Adding an asset is therefore not a table row.** It requires runner-side support for an+alternate decoder module, i.e. a fork of the pinned runner. PortOS deliberately pins+upstream rather than forking it, so that is a separate decision, not a follow-up task.++## Why this came up++Issue #5423 came out of a `reference-watch` review of Phosphene (commit `d4c6ac55`,+v3.7.0), which added "TAE fast decode on every Draft tier" and reported a 640×384 5 s+draft in about a minute.++## What Phosphene is actually using++Confirmed still true at Phosphene HEAD (`f97ea3c`, v4.8.0, 2026-08-29):++- The asset is **`madebyollin/taeh3` → `taeh3.safetensors`**, about 23 MB, downloaded+ through `huggingface_hub` at install time and copied beside the other H3 models as+ `models/tae/taeh3.safetensors`.+- It is a **Tiny AutoEncoder** — a separate, much smaller module tree, not a re-trained+ H3 `VideoVAE`. That is exactly what makes it 23 MB instead of gigabytes.+- It is offered only when **both** halves are present: a runner checkout that accepts+ `--draft-decode`, and the weight on disk. The render then gets+ `--draft-decode tae --tae-checkpoint <path>`.+- Those flags exist because Phosphene pins its **own runner fork** (`codex/h3-engine-v2`)+ which implements the TAE decoder. They are not upstream flags.++So Phosphene's gating discipline matches PortOS's (probe the installed runner, never+assume; withhold the control rather than dying on an argparse error mid-render), and the+approach is sound — but it rests on a forked runner that PortOS does not have.++## Candidates surveyed (2026-08-30)++| Candidate | Size | Verdict |+|---|---|---|+| `madebyollin/taeh3` | ~23 MB | **Not publicly resolvable.** The HF API returns 401 for it, and the author's public model list (`taesd`, `taesdxl`, `taesd3`, `taef1`, `taef2`, …) contains no `taeh3`. Fails "publicly verifiable". Even if it resolved, a TAE cannot load through the pinned `load_video_vae`. |+| `Vayden/MiniMax-H3-Video-VAE-MLX-Q8` | 2.94 GB | **Gated** — reads return "Access to model … is restricted", so the pin cannot be reviewed rather than trusted. Its MLX affine-q8 keys would also fail the strict load. |+| `Mamad8/MiniMax-H3-Image-VAE` | 5.21 GB | Loads (it is a merged full-VAE checkpoint), but its own README says in bold not to use it as the video VAE, and an image-specialized decoder "materially regresses multi-frame video reconstruction". At full-VAE size it saves nothing either. Fails preview-honesty and the point of the feature. |+| `iamkaikai/MiniMax-H3-Single-Frame-VAE-500K` | 9.69 GB | Decoder-only (585 tensors, `decoder.*` + `post_quant_conv.*`), so the strict load is missing every encoder key. Its README says not to treat it as a replacement decoder for H3 video, naming grid artifacts, flicker and texture drift in a full-sequence decode. Larger than the decoder it would replace. |++## Consequences++- The Video Gen draft control stays hidden for H3: `publicVideoDraftDecodeOptions` is+ empty for a model with no declared decoder, so users see no knob rather than a knob+ that declines.+- Every gate stays covered by tests, so the day a qualifying asset appears the work is a+ table row plus a migration — as originally designed.+- **Re-entry condition.** Reconsider only on a complete, unquantized, full-`VideoVAE`+ checkpoint with upstream's key set, published ungated, whose own documentation endorses+ video decode — or on a decision to stop pinning the upstream runner. A new+ `reference-watch` proposal that simply re-points at a TAE does not clear either bar.++## Alternatives rejected++- **Loosen the strict load** (`load_video_vae(..., strict=False)`) so a partial checkpoint+ loads. That is the "plausible-looking pixels that are wrong in a way no test can catch"+ failure the checklist exists to prevent; a half-loaded decoder produces output nobody+ can distinguish from a legitimately rough draft.+- **Ship the gated Q8 repack behind an HF token.** Draft decode is a convenience; making+ it depend on a credential the user must obtain inverts its cost/benefit, and an+ unreviewable pin is exactly what the checklist forbids.+- **Fork the pinned runner to add a TAE module.** The right shape, and what Phosphene+ did — but it converts a pinned upstream dependency into a maintained fork of a+ multi-hour render path. That is its own decision with its own risk, not a step inside+ this issue.diff --git a/server/lib/README.md b/server/lib/README.mdindex a5975a901e..ed1b034d15 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -151,7 +151,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `minimaxH3Memory.js` | The declared weight-placement table for the two MiniMax H3 entries (#5420) — H3 is the one video model whose components fit nowhere unassisted, so "does this box have enough" is a render gate, not a UI fact. `MINIMAX_H3_MEMORY_PROFILES` maps entry id → `{ shippedRepo, shippedRevision, profiles }`, each profile carrying an honest `minMemoryGb` host floor and (CUDA only) a `minVramGb` device floor, ordered best-first. Every capacity number is HOISTED from what already existed — the CUDA tiers are `resolve_offload_profile()`'s own thresholds in `scripts/generate_minimax_h3_cuda.py`, the host floors are the entries' `memoryGb` — the sole new number being `MINIMAX_H3_HOST_RESERVE_GB`, a policy reserve held back for the OS. `applyMiniMaxH3MemoryProfiles(list)` is the load-time backfill (twin of migration 317) and guards BOTH `repo` and `revision`, like the speed-profile decorator. `selectMiniMaxH3MemoryProfile({ model, totalMemoryGb })` picks the best profile the HOST can hold (VRAM is the runner's call — the server has no synchronous device view); `miniMaxH3MemoryDeclineReason()` RETURNS the fail-closed reason so the render path can 400 it and a status surface can show it, and returns `null` on an UNMEASURED host — "not measured" is a deferral to the runner, never the same as zero. `validateMiniMaxH3MemoryProfileTable` / `sanitizeMiniMaxH3MemoryProfiles` warn + strip a hand-edited table (NaN floor, duplicate/reserved id, mis-ordered tiers) at load. || `videoContinuity.js` | How chunk N+1 of a chained video render is conditioned on chunk N. `resolveContextFrames(requested)` normalizes the tail-window size (absent → `DEFAULT_CONTEXT_FRAMES` = 22 ≈ 1s @ 24fps; an explicit `0` is preserved as "last frame only", NOT collapsed into the default) and clamps to `MIN_CONTEXT_FRAMES`..`MAX_CONTEXT_FRAMES`. `resolveContinuityStrategy({model, contextFrames})` picks `'window'` (LTX-2 `extend_from_video` conditioned on the prior chunk's last N frames — motion, not just a pose) or `'frame'` (extract the last frame, run i2v), degrading to `'frame'` on any runtime outside `CONTEXT_WINDOW_RUNTIMES` rather than rejecting. `extendLatentFrames` / `extendedPixelFrames` convert across the VAE's `LATENT_FRAME_STRIDE` (8 pixel frames per latent), `contextPrefixFrames({totalFrames, extendLatents})` measures how much of an extend render is echoed context to trim back off before stitching (0 = leave it alone), and `tailWindowStartFrame` gives the cut index for the window itself. Pure — importable from `prepareParams.js` without dragging in `local.js`. Mirrored for the picker in `client/src/lib/videoGenParams.js`, pinned by `videoContinuity.parity.test.js`. || `videoDisclosure.js` | Video Gen provenance/licensing + backend policy-scope facts (#3674). `VIDEO_MODEL_DISCLOSURES` maps each shipped video model id to `{ shippedRepo, disclosure }` (model card URL, weights license, runtime license, pinned-snapshot download size in decimal GB, review date) — every value checked against a primary upstream source, and any fact that could not be established is OMITTED so the UI renders "Unknown" instead of guessing. `applyVideoDisclosures(list)` is the load-time backfill (twin of migration 237) with the same preservation guards: an existing `disclosure` key wins, a custom id is skipped, and a `repo` pointed at a fork keeps Unknown. `VIDEO_BACKEND_DISCLOSURES` / `videoBackendDisclosure(id)` state where inference runs (`execution: local or hosted`) and whose policy applies — execution facts only, never a restrictiveness ranking. `APACHE_2` / `GEMMA_TERMS` are the shared license descriptors `videoTextEncoders.js` reuses, so a license-text correction reaches both tables from one edit. |-| `videoDraftDecoders.js` | Preview-fidelity ("draft") video decode (#5423). `VIDEO_DRAFT_DECODERS` declares each entry id → a separately downloaded decoder asset, pin-guarded on repo AND revision; `applyVideoDraftDecoders(list)` is the load-time backfill and `validateDraftDecoderTable` / `sanitizeDraftDecoders` warn + strip a hand-edited row (missing pin, a multi-shard or path-traversing file list, a runtime whose builder emits no draft flags) so a full decode can never report itself as a draft one. `DRAFT_DECODE_FULL` (`'full'`) is a deliberate NO-OP — `isFullDecode(id)` makes absence and that sentinel the same request, so a full-decode render builds byte-identical spawn args. `draftDecodeDeclineReason({ model, decodeId, models, runtimeRevision, assetCached })` RETURNS (never throws) the reason a draft decode does not apply — the model is a delivery target in the finish graph (`isDeliveryVideoModel`), it declares no decoder, the installed runner checkout is not the revision the asset was verified against, or the weights are not downloaded — because a knob that only makes a render cheaper must degrade rather than 400 a submitted job; `resolveVideoDraftDecoder()` returns the concrete asset or `null`. `publicVideoDraftDecodeOptions(model)` is the picker payload (empty for a model with no decoder, so the client renders no control) and `downloadableVideoDraftDecoders(list)` the download targets. The table ships NO entry yet — its header carries the four-point checklist a candidate asset must pass first. |+| `videoDraftDecoders.js` | Preview-fidelity ("draft") video decode (#5423). `VIDEO_DRAFT_DECODERS` declares each entry id → a separately downloaded decoder asset, pin-guarded on repo AND revision; `applyVideoDraftDecoders(list)` is the load-time backfill and `validateDraftDecoderTable` / `sanitizeDraftDecoders` warn + strip a hand-edited row (missing pin, a multi-shard or path-traversing file list, a runtime whose builder emits no draft flags) so a full decode can never report itself as a draft one. `DRAFT_DECODE_FULL` (`'full'`) is a deliberate NO-OP — `isFullDecode(id)` makes absence and that sentinel the same request, so a full-decode render builds byte-identical spawn args. `draftDecodeDeclineReason({ model, decodeId, models, runtimeRevision, assetCached })` RETURNS (never throws) the reason a draft decode does not apply — the model is a delivery target in the finish graph (`isDeliveryVideoModel`), it declares no decoder, the installed runner checkout is not the revision the asset was verified against, or the weights are not downloaded — because a knob that only makes a render cheaper must degrade rather than 400 a submitted job; `resolveVideoDraftDecoder()` returns the concrete asset or `null`. `publicVideoDraftDecodeOptions(model)` is the picker payload (empty for a model with no decoder, so the client renders no control) and `downloadableVideoDraftDecoders(list)` the download targets. The table ships NO entry, and as of 2026-08-30 that is a decision rather than a gap ([ADR](../../docs/decisions/2026-08-30-h3-draft-decoder-asset.md)): the shim substitutes one file into upstream’s checkpoint root under a STRICT key match, so a candidate must be a complete unquantized full-`VideoVAE` checkpoint — which every genuinely light decoder (TAE, quantized repack, decoder-only head) is not. || `videoFinishProfiles.js` | Draft → delivery ("Finish") relationships between video models (#3696). `VIDEO_FINISH_PROFILES` declares each fast draft entry id → `{ shippedRepo, finishModelId }`, only for pairs that share a runtime, base repo and supported modes (the same weights at a different step budget), so re-rendering the draft's seed reproduces its composition instead of re-rolling it. `applyVideoFinishProfiles(list)` is the load-time backfill (twin of migration 238) with the usual preservation guards (existing key wins, custom id skipped, forked `repo` skipped); `validateFinishProfileGraph(list)` returns the graph problems (missing / self-referencing / chained target, runtime / repo / supportedModes mismatch) and `sanitizeFinishProfiles(list)` warns + strips them at load so a typo can never surface a Finish button targeting nothing. `finishTargetForModel(model, availableModels)` resolves the delivery entry scoped to what this install can run. || `videoSpeedProfiles.js` | Named, pre-validated sampler schedules a user can pick instead of hand-tuning steps/CFG (#4875). `VIDEO_SPEED_PROFILES` declares each entry id → `{ shippedRepo, shippedRevision, profiles }`; `applyVideoSpeedProfiles(list)` is the load-time backfill (twin of migration 295) and guards BOTH `repo` and `revision` — unlike the finish-profile decorator, because a sampler schedule is revision-sensitive in a way a draft→delivery edge is not. `SPEED_PROFILE_DEFAULT_ID` (`'quality'`) is a deliberate NO-OP so a default render builds byte-identical spawn args and stamps no extra history fields; `isDefaultSpeedProfile(id)` makes absence and that sentinel the same request. `speedProfileDeclineReason({ model, profileId, mode })` RETURNS (never throws) the reason a profile does not apply — wrong mode, unpinned weights, `samplerLocked` model, unknown id — so a knob that only makes a render faster degrades instead of 400ing a submitted job, and `resolveVideoSpeedProfile()` returns the concrete override or `null`. `resolveVideoSpeedProfileForModes({ model, profileId, modes })` lifts that decline check to a CHAINED render — a chain is one clip whose chunks run in different modes (chunk 0 the request's, chunks 1+ `extend` on a window-continuity chain or `image` on a frame hop), so the profile applies to every chunk or to none rather than seaming a fast chunk onto quality ones. `resolveVideoSampler({ model, steps, guidanceScale, speedProfile })` is the SINGLE precedence rule (samplerLocked > profile > explicit request > registry default), shared by the render path and the chained-render ETA so the two cannot drift. `validateSpeedProfileTable(list)` / `sanitizeSpeedProfiles(list)` warn + strip a hand-edited profile (NaN steps, duplicate/reserved id, samplerLocked collision) at load rather than letting it spawn a broken render. What the RUNNER could actually apply — is the pinned pipeline new enough for `enable_teacache`, is the distilled adapter in the pack — is probed by `scripts/generate_ltx2.py` and reported back on a `SPEEDPROFILE:` line. || `videoModeProfiles.js` | The shipped `supportedModes` fact per video runtime (#3737), so "which modes does this model support?" has one answer on the registry entry instead of 25+ `runtime === '…'` comparisons. `VIDEO_RUNTIME_MODES` maps each runtime to the base semantic modes its helper's argv can actually render (`mlx_video`/`ltx2` text+image+fflf+extend, `wan22`/`fastvideo` text+image, `minimax_h3` / `minimax_h3_cuda` text+image+fflf off one shared array — also the mode ceiling in `videoGen/modeContract.js`); `VIDEO_BASE_MODES` is the fallback for an unknown (user-added or peer-synced) runtime, deliberately the full base set so a custom model doesn't vanish from every picker. `resolveVideoSupportedModes(entry)` (declared non-empty list always wins) and `applyVideoSupportedModes(list)` — the read-time decoration `mediaModels.js#getVideoModels` applies, so the derived list never lands in `data/media-models.json` where it would read back as a *declared* list no later correction could reach. a2v and the IC-LoRA remix ids are NOT enumerated here: they're ltx2 pipeline capabilities, gated by runtime (`A2V_REQUIRES_LTX2` / `IC_LORA_REQUIRES_LTX2`). |diff --git a/server/lib/videoDraftDecoders.js b/server/lib/videoDraftDecoders.jsindex a7b5f8851f..4b8bcd52ef 100644--- a/server/lib/videoDraftDecoders.js+++ b/server/lib/videoDraftDecoders.js@@ -49,11 +49,23 @@** ## Why `VIDEO_DRAFT_DECODERS` currently ships no entry*- * The mechanism is declared and wired; the ASSET is not, because none of the- * published candidates clears this repo's own bar for a pinned weight (see the- * table below for the checklist a candidate must pass). Shipping the gates- * first is deliberate: the day an asset is verified, it is one table row plus a- * migration, and every fallback path it depends on is already covered by tests.+ * The mechanism is declared and wired; the ASSET is not — and as of 2026-08-30+ * that is a decision, not a gap. The survey is in ADR+ * docs/decisions/2026-08-30-h3-draft-decoder-asset.md.+ *+ * The short version: the shape this shim can host and the shape that makes a+ * decode cheap are mutually exclusive. Everything published that would actually+ * be light — a tiny autoencoder, a quantized repack, a decoder-only head —+ * cannot load through the pinned strict loader, and everything that CAN load is+ * a full-size VAE that saves nothing. Phosphene, the reference install that+ * prompted issue #5423, gets its ~23 MB TAE only by pinning its OWN runner fork+ * that implements a TAE decoder module and takes `--draft-decode tae`. PortOS+ * pins upstream instead, so an asset here would not be a table row — it would+ * be a fork of a multi-hour render path, which is its own decision.+ *+ * Shipping the gates first is still the right call: the day a qualifying asset+ * appears it is one table row plus a migration, and every fallback path it+ * depends on is already covered by tests.** Pure module: no I/O, and the one import is a sibling lib predicate.*/@@ -116,10 +128,14 @@ export const DRAFT_DECODE_RUNTIMES = Object.freeze(['minimax_h3']);* decoder that fails any of them produces plausible-looking pixels that are* wrong in a way no test can catch:*- * - **Key contract.** Its tensor names load into the pinned runner's decoder- * module tree under that loader's STRICT check. A quantized repack whose- * keys carry `.scales`/`.biases` needs loader support first; it is not a- * drop-in.+ * - **Key contract — check this one FIRST, it disqualifies most candidates.**+ * `build_draft_decoder_shim` swaps exactly ONE file into upstream's+ * checkpoint root, and the pinned `load_video_vae` STRICT-matches it+ * against the WHOLE `VideoVAE` parameter tree. A candidate therefore has+ * to be a COMPLETE, UNQUANTIZED, full-`VideoVAE`-shaped checkpoint+ * carrying upstream's exact key set. A tiny autoencoder is a different+ * module tree; a quantized repack's `.scales`/`.biases` read as unexpected+ * keys; a decoder-only head is missing every encoder key.* - **Latent contract.** It decodes the SAME latent space — channel count,* `latents_mean`/`latents_std`, and spatial/temporal compression ratios* identical to the model's own decoder.diff --git a/server/lib/videoDraftDecoders.test.js b/server/lib/videoDraftDecoders.test.jsindex 0e0c58c45c..d1fcaec777 100644--- a/server/lib/videoDraftDecoders.test.js+++ b/server/lib/videoDraftDecoders.test.js@@ -51,9 +51,11 @@ const applies = (over = {}) => ({afterEach(() => { vi.restoreAllMocks(); });describe('the shipped table', () => {- // Guards the module header's own claim: no asset has cleared the- // verification checklist yet, so a row added without updating that header- // (and without a migration) fails here rather than shipping an unverified pin.+ // Guards the module header's own claim, which is a DECISION and not a+ // placeholder: docs/decisions/2026-08-30-h3-draft-decoder-asset.md records+ // why every published candidate fails, and the shape a future one must have.+ // A row added without revisiting that ADR (and without a migration) fails+ // here rather than shipping an unverified pin.it('declares no decoder until an asset passes the checklist', () => {expect(Object.keys(VIDEO_DRAFT_DECODERS)).toEqual([]);});