Repository navigation
fix(build): independent style/mood rotation for auto-media prompts (#1018) - #1028
Merged
Merged
Conversation
…1018) buildBrandPrompt sent one fixed, generic style phrase ("modern, clean, professional photography or illustration, high visual quality") for every company, every run — a fintech company and a children's toy company got identical style language. Subject grounding and the composition/framing variation axis (#909) were already real and working; this was the remaining gap. Adds STYLE_DESCRIPTORS, a second rotating style/mood axis analogous to VARIATION_DESCRIPTORS but independently indexed (styleIndex vs variantIndex) so a company can land on, say, composition-variant 2 + style-variant 0 rather than one combined rotation of fixed pairs. Threaded the same way lastVariant already is: MediaRoutine gains lastStyleVariant, coerceRoutine/saveRoutine persist it, and runMediaRoutines picks the next style index via the existing pickNextVariant helper and advances it forward alongside (not conflated with) the composition index.
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.
Summary
buildBrandPrompt()sent one fixed, generic style phrase for every company, every run:'Style: modern, clean, professional photography or illustration, high visual quality.'A fintech company and a children's toy company got identical style instructions, so even with [BUG] Recurring auto-media generation produces the same image every time — buildBrandPrompt() is fully deterministic #909's composition variation and the existing subject-matter grounding, every company's generated asset read as "the same overarching theme."STYLE_DESCRIPTORS, a second rotating style/mood axis analogous toVARIATION_DESCRIPTORS([BUG] Recurring auto-media generation produces the same image every time — buildBrandPrompt() is fully deterministic #909) but independently indexed —styleIndexvsvariantIndex— so a company can land on, say, composition-variant 2 + style-variant 0, rather than one combined rotation of fixed pairs.buildBrandPrompt(mediaKind, brand, variantIndex?, styleIndex?)gains a 4th optional param. The old static style line is replaced (not just appended to) by the rotating descriptor, since it was never a grounding instruction, just inert filler. Both axes still layer on top of (never weaken) the existing "ground in what this company does" and "no on-image text" instructions.MediaRoutine.lastStyleVariantpersists the style rotation state the same waylastVariantalready does;coerceRoutine/saveRoutinecarry it;runMediaRoutinespicks the next style index via the existingpickNextVarianthelper and advances it forward independently of the composition index.Test plan
__tests__/lib/build/media-schedule.test.tscovering:STYLE_DESCRIPTORSshape, different style indices producing different prompt text, defensive out-of-range/missing index handling (neverundefined/throws), grounding/no-text instructions preserved across every style variant, independence from the composition axis, and back-compat for 3-arg callers.__tests__/lib/build/media-routine.test.tscovering the nightly-loop runner picking + persisting an independentlastStyleVariant, and baking it into the actual prompt sent to core.npx vitest run— full suite: 530 passed / 3 failed files (6847 passed / 10 failed tests), identical failing files to a cleanmainbaseline (BuildApp-protected-screens.test.ts,agent-runtime.test.ts,agent-test-runner-341.test.ts— all pre-existing, unrelated to this change; verified via git stash against main).npx tsc --noEmit— clean, no errors.core-staging(Railway auto-deploy) before any production promotion, per repo policy.