--- phase: 18-google-feed-permutation-url-fix plan: 01 subsystem: feed/routing tags: [google-merchant, pp_routes, permutation, regex, php74] requires: - phase: prior-architecture provides: ProductRepository, Helpers::htacces, LayoutEngine, frontAttributePartial provides: - Separator URL permutacji `_` zamiast `/` w feedzie Google - Wzorzec routingu pp_routes obejmujący `[0-9_-]+` - Konwersja `_` → `|` po stronie front przed `findCached` - Preselekcja wartości atrybutu z `permutation_hash` w partialu affects: [google-feed, pp_routes, frontend-product-attributes] tech-stack: added: [] patterns: - "URL feedu: jeden segment z `_` zamiast wielu segmentów ze `/`" - "DB format `|`, URL format `_`, konwersja w warstwie front" key-files: created: - tests/Unit/Shared/Helpers/HelpersRoutingTest.php - tests/Unit/Domain/Product/ProductFeedLinkTest.php modified: - autoload/Domain/Product/ProductRepository.php - autoload/Shared/Helpers/Helpers.php - autoload/front/LayoutEngine.php - templates/shop-product/_partial/product-attribute.php key-decisions: - "Separator URL `_` zamiast `/` (one segment dopasowywalny przez pp_routes)" - "Konwersja `_` → `|` w LayoutEngine, format DB pozostaje `|`" - "Brak redirectów 301 — Google sam zaktualizuje feed" - "Brak automatycznych akcji post-deploy — udokumentowane jako manual steps" - "Override /feature-dev (hotfix z konkretną instrukcją)" patterns-established: - "Forced value via URL parameters w partialach (preselekcja zamiast is_default)" - "Reflection-based test prywatnych metod XML feedu" duration: ~25min completed: 2026-04-30 --- # Phase 18 Plan 01: Google feed permutation URL fix — Summary **Linki produktów z permutacją w feedzie Google używają teraz `_` jako separatora par `attr-val`, routing `pp_routes` matchuje takie URL-e, a partial atrybutu preselectuje wartości na podstawie `permutation_hash` z URL.** ## Performance | Metric | Value | |--------|-------| | Duration | ~25 min | | Started | 2026-04-30 | | Completed | 2026-04-30 | | Tasks | 3 / 3 | | Files modified | 6 (4 silnik + 2 testy) | | Tests | 834 → 841 (+7) | ## Acceptance Criteria Results | Criterion | Status | Notes | |-----------|--------|-------| | AC-1: Generator linku w feedzie używa `_` | Pass | ProductFeedLinkTest.testCombinationLinkUsesUnderscoreInSeoLinkBranch + fallback + single-pair | | AC-2: Routing `pp_routes` matchuje URL z `_` | Pass | HelpersRoutingTest weryfikuje obecność `[0-9_-]+` w generatorze + preg_match na nowym wzorcu | | AC-3: Front konwertuje `_` z URL na `|` przed zapytaniem | Pass | LayoutEngine.php:196 — zmienna `$permutation_hash` z `str_replace('_','|',...)` | | AC-4: Partial preselectuje wartość z URL | Pass | `$forced_value_id` + `$is_active` używane w `checked` i `