Fix/regeneration - #30
Conversation
Length caps are validated in code instead of JSON-schema maxLength (which caused constrained-decoding mid-word cuts). On an over-cap result, only the over-limit strings are re-generated with a concrete cut target, and code keeps the shorter string per position (monotonic merge) so passing items never regress. Route text + regeneration through the same gate; prefer providers that support structured tool calls. Revert job pipeline workflow id to "job-pipeline".
Gallery slot planning treated CI image_plan roles as the primary guide and demanded distinct claims per fixed slot, so SKUs with few real attributes got padded with fabricated features and non-existent variants. Add a FACT GROUNDING block that gates every depicted feature/variant/colour/size on PRODUCT DATA, reframe image_plan as a category-generic template usable only when the SKU supports it, and fill leftover slots with fact-safe composition roles instead of invented facts.
|
Dobby review · Based on my analysis of the diff and the checkout, here's my review. Dobby review
🚨
|
| Area | Result |
|---|---|
| Security | No issues found |
| Correctness | 2 Medium — brief/cache dropped on length retries; last-attempt fail-fast aborts whole job |
| Performance | 1 Medium — require_parameters can eliminate all qualifying providers on a call |
| Tests | No tests at all for the new submit_text_attribute / _merge_shorter / over_limit_report / regen-identical-retry logic |
❓ Questions
- In
_merge_shorterthe merge only keeps an item when the candidate is shorter. For list attributes the correction prompt says "copy every other item EXACTLY" — but a model that (harmlessly) rephrases a passing item shorter than the original silently replaces it, dropping original wording that was already compliant. Intentional? - For text regeneration,
previous_promptis the stored full generation brief (generation_parts.as_sent(), which still embeds the "call submit_text_attributes" tool instruction and RULES/product/brand). This whole brief is then re-sent insideregeneration_text_promptas "PREVIOUS PROMPT". Was that the intended "brief", as opposed to stripping the tool/rules scaffolding?
🧪 Tests to add
- Bounded length loop: over-limit input converges under cap within
_MAX_LENGTH_ATTEMPTS; a stubborn over-limit value raises the ValueError. _merge_shorter: over-limit items shrink, passing items stay unchanged even when the candidate differs; non-list/scalar behavior; malformed non-list candidate.- Text regeneration identical-retry: first result equal to CURRENT OUTPUT triggers exactly one retry and (if still identical) persists without an infinite loop.
prompt_with_user_edit/strip_user_editround-trip on a prompt that already contains a prior=== USER EDIT ===block.
No description provided.