Skip to content

feat(image-gen): add multi-provider fallback chain + north-star onboa… - #12

Open
Clover-ASH wants to merge 1 commit into
BeAChanger:mainfrom
CosmicLinks:feat/image-gen-and-strategy
Open

feat(image-gen): add multi-provider fallback chain + north-star onboa…#12
Clover-ASH wants to merge 1 commit into
BeAChanger:mainfrom
CosmicLinks:feat/image-gen-and-strategy

Conversation

@Clover-ASH

Copy link
Copy Markdown

…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

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant