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

address review (codex): normalize regenMethod + regenPixelDeltaPct so the lineage labels render

[._.]/ Adam Eivycc3caf50301c
diff --git a/client/src/components/media/normalize.js b/client/src/components/media/normalize.js
index 05ea8849b2..a4481596a4 100644
--- a/client/src/components/media/normalize.js
+++ b/client/src/components/media/normalize.js
@@ -78,6 +78,13 @@ export function normalizeImage(i) {
regenStrength: typeof i.regenStrength === 'number' ? i.regenStrength : null,
regenSteps: typeof i.regenSteps === 'number' ? i.regenSteps : null,
regenModelId: i.regenModelId || null,
+ // 'flux' (GPU round-trip) | 'light-spatial' (CPU pass). Drives the "(light)"
+ // lineage label — must survive normalization or the label never renders.
+ regenMethod: i.regenMethod || null,
+ // Realized fidelity stamped by the server (% the pixels actually changed +
+ // PSNR); surfaced in the lightbox lineage row, so it must be lifted here too.
+ regenPixelDeltaPct: typeof i.regenPixelDeltaPct === 'number' ? i.regenPixelDeltaPct : null,
+ regenPsnr: typeof i.regenPsnr === 'number' ? i.regenPsnr : null,
raw: i,
};
}
diff --git a/client/src/components/media/normalize.test.js b/client/src/components/media/normalize.test.js
index 3713d0eb74..ccae260afc 100644
--- a/client/src/components/media/normalize.test.js
+++ b/client/src/components/media/normalize.test.js
@@ -124,21 +124,40 @@ describe('normalizeImage - regen lineage (issue #912)', () => {
regenStrength: 0.4,
regenSteps: 8,
regenModelId: 'flux2-klein-9b',
+ regenMethod: 'flux',
+ regenPixelDeltaPct: 7.3,
+ regenPsnr: 31.2,
});
// These MUST survive normalization — computeImageVariantGroup reads
- // `regenerated` off normalized items to label the variant "Regenerated".
+ // `regenerated` off normalized items to label the variant "Regenerated",
+ // and describeCleanedLineage reads regenMethod/regenPixelDeltaPct off the
+ // NORMALIZED item to render the "(light)" + "% changed" lineage row.
expect(n.regenerated).toBe(true);
expect(n.regenStrength).toBe(0.4);
expect(n.regenSteps).toBe(8);
expect(n.regenModelId).toBe('flux2-klein-9b');
+ expect(n.regenMethod).toBe('flux');
+ expect(n.regenPixelDeltaPct).toBe(7.3);
+ expect(n.regenPsnr).toBe(31.2);
expect(n.cleanedFrom).toBe('src.png');
});
+ it('carries the light-spatial method + fidelity for a CPU light regen', () => {
+ const n = normalizeImage({
+ filename: 'r_regen-light.png', cleanedFrom: 'src.png', regenerated: true,
+ regenMethod: 'light-spatial', regenPixelDeltaPct: 4.1,
+ });
+ expect(n.regenMethod).toBe('light-spatial');
+ expect(n.regenPixelDeltaPct).toBe(4.1);
+ });
+
it('defaults regen fields off for a normal (non-regen) image', () => {
const n = normalizeImage({ filename: 'a.png' });
expect(n.regenerated).toBe(false);
expect(n.regenStrength).toBeNull();
expect(n.regenModelId).toBeNull();
+ expect(n.regenMethod).toBeNull();
+ expect(n.regenPixelDeltaPct).toBeNull();
});
});