feat: store-scoped enrichment with locale-aware system prompts (#12)#62
Open
DavidLambauer wants to merge 9 commits intomage-os-lab:mainfrom
Open
feat: store-scoped enrichment with locale-aware system prompts (#12)#62DavidLambauer wants to merge 9 commits intomage-os-lab:mainfrom
DavidLambauer wants to merge 9 commits intomage-os-lab:mainfrom
Conversation
After Publisher::execute gained an optional $storeId parameter, every Request factory create() call includes 'storeId' => 0 by default. Align the three existing expectation arrays so the tests assert reality.
8 tasks
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
Fixes #12. Supersedes #53 (which was the Phase 2 bundle of locale + enrichment-flags; Ryan's #51 already covers the flags half, so this PR is just the locale half, cleanly rebased onto the post-merge main).
The enrichment pipeline now carries store context end-to-end, and the AI is automatically instructed to reply in the store's language.
Changes
Store context plumbing:
RequestDTO gains astoreIdfield (defaults to 0 for backward compatibility with in-flight queue messages)Publisher::executeaccepts and passesstoreIdto queue messagesConsumersets the correct store scope viaStoreManager::setCurrentStorebefore loading the productSaveAfterobserver forwards the product's store ID to the publisherMassEnrichcontroller forwards the current admin store scopeLocale-aware system prompt:
Config::getSystemPrompt()now queries withSCOPE_STORE, readsgeneral/locale/code, and prepends "Respond in {Language}. " for non-English localesLOCALE_LANGUAGE_MAPcovering 46 ISO language codesModule sequence: added
Magento_Storeso DI resolution is ordered correctly.Test plan
fr_FR), enrich a product: AI output should be in FrenchWhat changed vs the original #53
#48enrichment-flags commits (Ryan's Flag enriched product attributes on product edit (#48) #51 covers the UI and Add enrichment review, caching, and approval workflow (#28) #46 covers the log table)docs/plans/