This commit is contained in:
greeneclipse committed 2026-10-27 14:53:19 +01:00
1 parent c347d2418f
commit 1ad180a052
49 files changed
+6339 -89

No files matched your search

+4 -8
View File
@@ -95,6 +95,7 @@ func (e *Engine) RunSteps(ctx context.Context, companyID string, in ProductInput
}
}
attrs = SanitizeProductAttributes(parsed)
in.FeedAttrKeys = attrKeySet(attrs)
// Map feed/spec labels onto category_attributes (formula) keys early.
if allowed := enhanceAllowedAttrKeys(in, out.Category); allowed != nil {
attrs = MapAttrsOntoAllowedKeys(attrs, allowed)
@@ -225,11 +226,8 @@ func (e *Engine) RunSteps(ctx context.Context, companyID string, in ProductInput
case StepCategorize:
// Vector (if enabled) then LLM taxonomy pick when category still empty.
// A category the model could not determine fails the product here, before
// enhance spends a call writing copy for the wrong category.
if err := runCategorizeStep(ctx, e, companyID, &out, in, categoryNames, policy); err != nil {
return out, err
}
// An undetermined category leaves the product uncategorized; it still processes.
runCategorizeStep(ctx, e, companyID, &out, in, categoryNames, policy)
case StepAIEnhance:
preservePriorEnhanceHash := func() {
@@ -569,9 +567,7 @@ func (e *Engine) RunSteps(ctx context.Context, companyID string, in ProductInput
// Pipelines without StepCategorize (normalize_only) still run vector + LLM
// categorize when category is empty so downstream steps are not fed a blank.
if !stepsContain(steps, StepCategorize) {
if err := runCategorizeStep(ctx, e, companyID, &out, in, categoryNames, policy); err != nil {
return out, err
}
runCategorizeStep(ctx, e, companyID, &out, in, categoryNames, policy)
}
// Record why category stayed empty for every pipeline, including the ones that
// now categorize inside the loop (enhance / title / description).