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

fix(video-gen): make generate_fastvideo importable on Python 3.9, and report what migration 334 actually did

[._.]/ Adam Eivy70df8468498b
diff --git a/scripts/generate_fastvideo.py b/scripts/generate_fastvideo.py
index 4dc7dba3af..d6f58afdb8 100755
--- a/scripts/generate_fastvideo.py
+++ b/scripts/generate_fastvideo.py
@@ -18,6 +18,8 @@ from the checkpoint, so a mis-tagged registry row fails on an argument the
entry script rejects instead of silently rendering through the wrong pipeline.
"""
+from __future__ import annotations
+
import argparse
import hashlib
import os
@@ -283,9 +285,11 @@ def resolve_prompt_cache_dir(args) -> Path:
def run_child(cmd: list, env: dict, cwd: Path, transform) -> int:
"""Spawn a child, stream its merged output through `transform`, return its code.
- Shared by the conversion child and the inference child so their stream
- handling cannot drift: both fold stderr into stdout and re-emit line by
- line on THIS process's stderr, which is the channel PortOS parses.
+ For the CONVERSION child only. The inference child in main() runs its own
+ loop because it also drives a heartbeat thread and a phase state machine,
+ and shares stderr with that thread — it needs one write per line, which
+ print() does not give. Conversion finishes before the heartbeat starts, so
+ there is no concurrent writer here.
"""
proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,
diff --git a/scripts/migrations/334-fasth3-upstream-source-mlx.js b/scripts/migrations/334-fasth3-upstream-source-mlx.js
index 801007a08d..3bb67339f0 100644
--- a/scripts/migrations/334-fasth3-upstream-source-mlx.js
+++ b/scripts/migrations/334-fasth3-upstream-source-mlx.js
@@ -65,13 +65,14 @@ export default {
const { ok, config, entries: mlxEntries, path } = await readMediaRegistry({ rootDir, bucket: VIDEO_BUCKET_MLX });
if (!ok) return;
- let changed = false;
+ let added = 0;
+ let repaired = false;
const present = new Set(mlxEntries.map((entry) => entry?.id));
for (const entry of NEW_ENTRIES) {
if (present.has(entry.id)) continue;
mlxEntries.push(structuredClone(entry));
present.add(entry.id);
- changed = true;
+ added += 1;
}
// Repair the row 333 shipped, but only while it still holds 333's exact
// list — a user who edited their own frame options keeps them.
@@ -80,7 +81,7 @@ export default {
&& repack.frameOptions.length === MIGRATION_333_FRAME_OPTIONS.length
&& repack.frameOptions.every((frames, i) => frames === MIGRATION_333_FRAME_OPTIONS[i])) {
repack.frameOptions = [...FRAME_OPTIONS];
- changed = true;
+ repaired = true;
}
const shipped = readVideoBucket(config?._shippedDefaults?.video, VIDEO_BUCKET_MLX);
@@ -88,13 +89,19 @@ export default {
for (const entry of NEW_ENTRIES) {
if (!shipped.includes(entry.id)) {
shipped.push(entry.id);
- changed = true;
+ added = Math.max(added, 1);
}
}
}
- if (changed) {
+ if (added > 0 || repaired) {
await writeMediaRegistry(path, config);
- console.log('📝 data/media-models.json: added the upstream FastH3 Dense Data-Free MLX models');
+ // Say which of the two things actually happened — an upgrade that only
+ // repaired the frame grid did not add anything.
+ const what = [
+ added > 0 ? `added ${added} upstream FastH3 Dense Data-Free MLX model(s)` : null,
+ repaired ? 'repaired the FastH3 repack frame options' : null,
+ ].filter(Boolean).join('; ');
+ console.log(`📝 data/media-models.json: ${what}`);
}
},
};