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
address review (claude): correct the changelog claim, a wrong test comment, and make the migration's tally assertable
[._.]/ Adam Eivyb5e01dd57513
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 5aeb359dc5..4c75dc52f6 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -25,7 +25,7 @@## Sprite Manager-- **[issue-2984] Imported walk cycles now bring their source clip along, so they can be re-derived at a new frame count** — importing a character used to copy the finished walk strips but leave behind the video clip each one was extracted from. Since the packer can only ever resample *down*, that permanently froze every imported direction at the frame count it arrived with: a character imported at 8 frames could never be brought up to 12 to match a direction generated here, and PortOS couldn't compile its atlas at all while the two disagreed. The importer now copies each run's source clip (resolving it whichever folder layout the source tree uses), so the material re-derivation needs is finally on disk — while the bulky extracted frame folders are still skipped, since they're re-extracted from the clip on demand. A clip whose contents don't match the checksum its manifest declares is refused with a message naming the run rather than silently imported. Characters imported before this upgrade are checked on startup and healed where the clip is already somewhere in their folder; where it isn't, PortOS logs plainly that re-running the import against the original source tree is what brings it across. (Actually re-deriving an imported direction at a new frame count also needs the imported-walk-set lock lifted — that lands next.)+- **[issue-2984] Imported walk cycles now bring their source clip along** — importing a character used to copy the finished walk strips but leave behind the video clip each one was extracted from. Since the packer can only ever resample *down*, that permanently froze every imported direction at the frame count it arrived with — the frames needed to run a cycle at a *higher* count only exist in the clip, and the clip stayed in the source tree. The importer now copies each run's source clip (resolving it whichever folder layout the source tree uses), so the material re-derivation needs is finally on disk — while the bulky extracted frame folders are still skipped, since they're re-extracted from the clip on demand. A clip whose contents don't match the checksum its manifest declares is refused with a message naming the run rather than silently imported. Characters imported before this upgrade are checked on startup and healed where the clip is already somewhere in their folder; where it isn't, PortOS logs plainly that re-running the import against the original source tree is what brings it across. (Actually re-deriving an imported direction at a new frame count also needs the imported-walk-set lock lifted — that lands next.)- **[issue-2978] Saving a loop trim now works on imported characters** — for a character whose walk cycles came in through the source-pipeline import, the Loop Trimmer would load, scrub, and play the animation perfectly, then fail on **Save trim** with "Packaged run manifest is missing or inconsistent" — after you'd already picked your frames, and with nothing saved. The imported artwork was never damaged; PortOS was simply looking for the packaged manifest under the wrong folder and giving up. Trims now save on imported characters, keep the real gait-phase labels (left-contact, left-passing, …) for each kept frame, and record the correct source strip. A run whose manifest went missing entirely now falls back to the strip's own geometry and still trims, while a manifest that's genuinely corrupt still refuses loudly instead of quietly guessing. The same lookup fixed approving an imported walk direction, which would have failed the same way.- **Steer a directional-anchor re-roll with a correction note** — when a directional anchor comes out wrong (say the north-east pose grew a pocket on the arm that has none in every other view), re-rolling it with the same inputs tended to just reproduce the same mistake. Each unlocked anchor tile now has a small **Correction (optional)** box: type what to fix ("no pocket on the right sleeve") and hit **Regenerate**, and the note is appended to that pose's prompt as an explicit override so the new render actually diverges. The button reads **Generate** on the first render and **Regenerate** once candidates exist, the correction is per-direction (so eight different fixes don't collide), and it rides into the candidate's saved prompt so the image preview shows exactly what was asked for. Main-reference iteration is unchanged — it already has its own design-prompt box.- **[issue-2964] The same correction note now steers a re-roll from the asset card too** — the correction box used to live only on the Reference Set's anchor grid, so re-rolling a directional-anchor candidate from its card in the Assets library ignored any fix you'd typed. Each anchor candidate card now carries the same correction affordance: click its note icon to type ("no pocket on the right sleeve") and hit **Regenerate**, and that guidance is appended to the pose's prompt exactly as it is from the grid. The two surfaces share one correction per direction, so a note you type in either place shows up in the other, and both re-rolls send the identical instruction.diff --git a/scripts/migrations/205-backfill-imported-walk-source-clips.js b/scripts/migrations/205-backfill-imported-walk-source-clips.jsindex 82cbd1e26b..2afe865684 100644--- a/scripts/migrations/205-backfill-imported-walk-source-clips.js+++ b/scripts/migrations/205-backfill-imported-walk-source-clips.js@@ -140,6 +140,8 @@ export default {if (missing > 0) {console.log(`🎞️ migration 205: ${missing} walk run(s) still have no source clip on disk — their clips only exist in the source tree they were imported from. Re-run the sprite import against that tree to bring them across (the importer now copies clips); until then those directions cannot be re-derived at a new frame count.`);}- return { ok: true, migrated: copied };+ // `missing` rides in the result (not just the log) so the imported-vs-native+ // classification above is assertable rather than log-only.+ return { ok: true, migrated: copied, missing };},};diff --git a/scripts/migrations/205-backfill-imported-walk-source-clips.test.js b/scripts/migrations/205-backfill-imported-walk-source-clips.test.jsindex ab9661cd95..7f69d36086 100644--- a/scripts/migrations/205-backfill-imported-walk-source-clips.test.js+++ b/scripts/migrations/205-backfill-imported-walk-source-clips.test.js@@ -23,14 +23,18 @@ const CLIP_BYTES = 'CLIP-BYTES';// One run record in the shape the importer leaves behind: no `id`, every// embedded path anchored at the SOURCE repo root.-async function writeRun(base, runId, { sourceVideoPath, clipAt } = {}) {+// `native: true` instead stamps the shape PortOS writes for its own runs — an+// `id` and a record-relative clip path — which the migration must NOT count as+// awaiting a re-import.+async function writeRun(base, runId, { sourceVideoPath, clipAt, native = false } = {}) {const runDir = join(sprites(), ID, base, runId);await mkdir(join(runDir, 'generated'), { recursive: true });await writeFile(join(runDir, 'animation-run.json'), JSON.stringify({kind: 'grok-walk-animation-run',- status: 'approved',+ status: native ? 'rendering' : 'approved',characterId: ID,direction: 'south',+ ...(native ? { id: runId } : {}),...(sourceVideoPath ? { sourceVideoPath } : {}),}));if (clipAt) {@@ -70,8 +74,13 @@ describe('migration 205 — backfill imported walk source clips', () => {clipAt: 'runs/walk-north-dddd4444/generated/source-video.mp4',});+ // Run E: a NATIVE run still rendering — no clip yet, and a re-import would+ // not produce one, so it must stay out of the "needs a re-import" tally.+ await writeRun('runs', 'walk-north-east-eeee5555', { native: true });+const result = await migration.up({ rootDir: ROOT });- expect(result).toEqual({ ok: true, migrated: 1 });+ // Only run C — the imported, clipless one — counts as missing.+ expect(result).toEqual({ ok: true, migrated: 1, missing: 1 });const clipA = join(sprites(), ID, 'runs/walk-south-aaaa1111/generated/source-video.mp4');expect(await readFile(clipA, 'utf8')).toBe(CLIP_BYTES);@@ -93,8 +102,8 @@ describe('migration 205 — backfill imported walk source clips', () => {await writeRun('runs', 'walk-south-aaaa1111', {clipAt: 'grok/walk-south-aaaa1111/generated/source-video.mp4',});- expect(await migration.up({ rootDir: ROOT })).toEqual({ ok: true, migrated: 1 });- expect(await migration.up({ rootDir: ROOT })).toEqual({ ok: true, migrated: 0 });+ expect(await migration.up({ rootDir: ROOT })).toEqual({ ok: true, migrated: 1, missing: 0 });+ expect(await migration.up({ rootDir: ROOT })).toEqual({ ok: true, migrated: 0, missing: 0 });});it('no-ops on an install with no sprites tree', async () => {diff --git a/server/services/sprites/importer.test.js b/server/services/sprites/importer.test.jsindex 2f04a573b8..ef8a906316 100644--- a/server/services/sprites/importer.test.js+++ b/server/services/sprites/importer.test.js@@ -387,13 +387,13 @@ describe('walk-run source clips', () => {// the manifest value that names it resolves after import.expect(readFileSync(join(drifterDir(), 'runs/run-a/generated/source-video.mp4'), 'utf8')).toBe(CLIP_BYTES);expect(existsSync(join(drifterDir(), 'runs/run-a/animation-run.json'))).toBe(true);- expect(existsSync(join(drifterDir(), 'runs/run-a/animation-run.json'))).toBe(true);expect(existsSync(join(drifterDir(), 'runs/run-a/generated/south-strip.png'))).toBe(true);expect(existsSync(join(drifterDir(), 'grok/run-a'))).toBe(false);// ~5× the clip's bytes and re-extractable on demand — still excluded.expect(existsSync(join(drifterDir(), 'runs/run-a/generated/raw/frame-000.png'))).toBe(false);- // south + west run records, the south clip, and the west clip verify; the- // east clip doesn't (its bytes disagree with the hash its manifest pins).+ // All three run records verify (each entry pins one) plus the south clip.+ // The east clip does NOT — its bytes disagree with the hash its manifest+ // pins — and the west manifest pins no clip hash at all.expect(drifter.verified).toBe(4);});