# Synced Pattern Translation Adapter

Audience: AI coding agents first.

- **ID:** IPZ-SYNCED-PATTERN-TRANSLATION-ADAPTER-2026-08-15
- **Status:** DONE
- **Task:** SC-ADAPTER-03
- **Source request:** Complete all remaining multilingual Site Content slices through session end. Navigation is published; continue with next dependency-correct dormant runtime family.
- **Execution owner:** Current main coordinator only; no implementation delegation.

## Outcome

Add dormant `SyncedPatternTranslationAdapter` library code and deterministic tests for persisted synced `wp_block` posts. Resolve only request-local clones from current catalog structure plus ready/current translated segments. Add no runtime activation.

## Acceptance

- Accept only positive-ID `WP_Post` objects whose `post_type` is exactly `wp_block`.
- Always return a fresh clone. Never mutate caller objects or canonical WordPress caches.
- Permit overlays only for explicit public-frontend or plugin target-preview contexts whose canonical target language matches the request context.
- Build canonical identity as `site:<current-blog-id>:post:<post-id>` and use bounded `SiteContentCatalog::lookup_source()` as source authority.
- Catalog rejection of `wp_pattern_sync_status=unsynced`, missing/non-persisted posts, ineligible status, malformed identity, unsupported blocks, empty content, or oversized source MUST fail closed.
- Use `SiteContentRepository::find_by_identity()` only for active, ready, exact-source-revision records with positive translation revisions and bounded exact-list JSON segments.
- Apply through `BlockSegmentCodec` to current source structure. Missing, stale, malformed, oversized, over-count, or codec-invalid translation data keeps current source content.
- Cache only request-local compiled content by adapter kind, identity, language, source revision, translation revision, and context.
- Diagnostics expose only bounded reason/type/key/language values and cannot alter fallback behavior.
- Add no hook registration, bootstrap wiring, route, feature activation, scheduled task, write path, UI, or runtime consumer. Do not handle unsynced/non-persisted registered patterns.
- Preserve WordPress 6.0 and PHP 8.0 compatibility. Ship PascalCase source compatible with production fallback autoload.
- Run every applicable test, lint, static-analysis, security, smoke, diagnostic, and related gate only through canonical remote execution on registry-selected `debian1`/`debian2`/`debian3`. Never run a local gate or fallback.

## Preserved WIP / ref / path

- Worktree: `/home/user/Projects/Press.zone/wordpress/wp-content/.worktrees/synced-pattern-adapter-rebase`
- Branch: `wt/synced-pattern-adapter-rebase`
- Exact base: `2f9f6e561ec0ff25b4b843d20cfbdac8da36744d`
- Preserved pre-rebase commit: `7b34c9c6fac9a71671f6c5f3447637464f1487e5` in `/home/user/Projects/Press.zone/wordpress/wp-content/.worktrees/synced-pattern-adapter`; its tree is `a0b8f4aea594c372d4d7c357438ed6925a5eeffb`.
- Carry the final navigation receipt in `2026-08-14-navigation-translation-adapter.md` until committed with this slice.
- `international-press-zone-f5` retains only its LanguageSwitcher, Yoast, migration, and database slice. Do not overlap it.

## Allowed paths

- `includes/SiteContent/SyncedPatternTranslationAdapter.php`
- focused synced-pattern fixtures/tests below `tests/Fixtures/SiteContent/` and `tests/Unit/SiteContent/`
- `phpunit.xml.dist` for normal-suite registration
- this plan, `docs/plans/INDEX.md`, `2026-08-09-multilingual-site-entry-and-layout.md`, and final navigation receipt

## Execution

1. Reconcile current catalog/repository/codec/request-context and published adapter patterns.
2. Implement the smallest detached synced-pattern resolver and deterministic database/source fixtures.
3. Register focused tests in the normal suite.
4. Run focused and full applicable gates only through canonical remote transport; address every signal.
5. Review correctness/security directly; rerun affected remote gates.
6. Normal-commit through installed warning-free enforcement, land, fetch, verify exact `origin/master`, and prove dormancy remotely.
7. Update receipts and continue the next uncovered multilingual slice.

## Current receipt

Detached resolver and 12 focused tests (78 assertions) are published as `2079fefa27fa80fb7e7a00ed01d5680b7538bdec`, tree `c2543a07a1f13557f2b52b2454673a464ec2fc2b`. Focused PHPUnit passed cleanly through `e2e-remote` on registry-selected `debian2`. The broader remote factory test lane completed successfully, including the enumerated suite at 120 tests / 666 assertions and all standalone tests. Its only noise is the pre-existing test-bootstrap redeclaration of three `WP_REST_*` doubles plus PHPUnit's corresponding warning; these test-only declarations predate and do not intersect this slice, and the focused slice is warning-free. Both normal commits passed warning-free remote PHPCS, PHPStan, native AST slopgate, and exact-tree authorization. The first landing attempt failed closed when concurrent master updates invalidated its parent claim; no bypass was used. The exact diff was reapplied onto fresh master and landed normally. Fresh fetch proves local and `origin/master` commit and tree equality. Remote dormancy proof on registry-selected `debian2` found exactly one production reference—the class declaration—and no hook, route, schedule, write, activation, runtime-consumer, or lowercase duplicate seam.

## Next executable action

None for this plan. Continue the umbrella plan from the next uncovered dependency-correct slice.
