feat(image-gen): add multi-provider fallback chain + north-star onboa… - #12
Open
Clover-ASH wants to merge 1 commit into
Open
feat(image-gen): add multi-provider fallback chain + north-star onboa…#12Clover-ASH wants to merge 1 commit into
Clover-ASH wants to merge 1 commit into
Conversation
…rding + body-fat ensemble
This PR consolidates the image-generation pipeline and the supporting
body-fat assessment upgrades that drive it:
- backend/src/image-gen/image-gen.module.ts
* Add L0 (image2) -> L1 (nano-banana-2) ordered fallback chain
* Persist resultImageUrl on success (fixes stage0 preview lookup)
* Per-provider proxyUrl override (kept IMAGE_GEN_PROXY_URL for back-compat)
* Image-edit retry: drop the optional reference image and retry once
* Tag generations with provider label (L0:image2 / L1:nano-banana-2)
- backend/src/evolution-stage/evolution-stage.service.ts
* New generateNorthStar(userId, startImageUrl): onboarding north-star
pipeline (vision body-fat estimate -> persist onboarding record ->
initialize 7-stage deceleration curve -> generate stage6 image)
* Updated STAGE_TITLES/STAGE_PROGRESS to the deceleration curve from
docs/evolution-image-strategy.md sec 2.1
* generateNextStagePreview now passes the start photo as a reference
* Records multi-model body-fat detail (breakdown / kept count / spread)
- backend/src/ai/
* Split body-fat estimation into a multi-model ensemble
(body-fat-ensemble.service.ts + body-fat-aggregator.ts)
* ai.service.ts.estimateBodyFatFromImage now returns
{ value, aggregate } instead of a raw number — required by the
evolution-stage updates above
* Adds aggregator unit spec (body-fat-aggregator.spec.ts)
* ai.module.ts wires in the ensemble service
- backend/prisma/schema.prisma
* EvolutionAssessment += { multiModelDetail, modelCount, modelSpread }
so the ensemble breakdown is persisted alongside each assessment
- docs/evolution-image-strategy.md (NEW)
* Single source of truth for the body-fat -> image-generation system
* Frozen prompt templates (A/B/D), variable dictionary, fallback chain,
and a file:line code-integration map for implementers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…rding + body-fat ensemble
This PR consolidates the image-generation pipeline and the supporting body-fat assessment upgrades that drive it:
backend/src/image-gen/image-gen.module.ts
backend/src/evolution-stage/evolution-stage.service.ts
backend/src/ai/
backend/prisma/schema.prisma
docs/evolution-image-strategy.md (NEW)