Repository navigation
Conversation
…sonalize build from its inventory detect-personalization finds what a source site personalizes before a migration: the agent loads each page as several visitors (curl for the server side, scripts/probe.mjs in a browser for the client side), subtracts noise, explains every difference (criterion, server/edge/client, vendor or site rule engine) and writes personalization-inventory.json with proposed Section Metadata rows, checked with personalize's own section-spec.js. personalize uses that inventory only when the project holds one (new reference/from-inventory.md); without one it behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
claude: approved on 6c5b6ba This is a second-round review of 6c5b6ba. The pull request adds a The fork's author has write access, so I reviewed the change itself. I read the code and ran none of it. The earlier rounds raised two kinds of issue: codex's denial that refusal handling failed open, and three drift comments from claude. All are fixed in the head:
Other checks:
Nothing new and serious turned up. Per the strict-review rules, there was no baseline probe and no test drive. |
| - **Record cookie names, never their values.** No values, tokens or personal data in any output. | ||
| Delete the curl cookie jars and Playwright storage-state files when the pass is done. | ||
| - Playwright is never installed into the site's repository. Install the pinned | ||
| `playwright@1.65.0` with `npm i --prefix ~/.cache/aem-eds-personalization/playwright` (a version |
There was a problem hiding this comment.
claude: This pins playwright@1.65.0, here and again in scripts/probe.mjs:172. The personalize skill in the same plugin installs into the same cache, ~/.cache/aem-eds-personalization/playwright. There the pin is PLAYWRIGHT_VERSION = '1.65.1', in personalize/scripts/lib.mjs, with a renovate: marker so Renovate updates it. The two skills will keep drifting apart, and whichever runs second reinstalls over the other's version. Use one version: for example, have probe.mjs import PLAYWRIGHT_INSTALL from ../../personalize/scripts/lib.mjs, or add the same Renovate marker and the same version here.
There was a problem hiding this comment.
Fixed in 6c5b6ba: probe.mjs now imports PLAYWRIGHT_CACHE and PLAYWRIGHT_INSTALL from personalize/scripts/lib.mjs, so the plugin has one Renovate-managed pin and one shared cache. SKILL.md no longer names a version: it says to run the install command the script prints.
|
|
||
| ## Reading decisions | ||
|
|
||
| Save the decision responses (`reference/probing.md` § Client-side, step 2), and read only the |
There was a problem hiding this comment.
claude: reference/probing.md § Client-side, step 2: the Client-side section of probing.md has no numbered steps. Point at the <visitor>-decision-<n>.json row of the table there instead.
There was a problem hiding this comment.
Fixed in 6c5b6ba: vendors.md now points at the files scripts/probe.mjs writes, <visitor>-decision-<n>.json, which are described in the table in probing.md § Client-side.
| - **server or edge**: the difference is already in the raw HTML `curl` receives; | ||
| - **client**: the raw HTML is the same, and the rendered DOM differs. | ||
|
|
||
| You drive the whole workflow; there is no detection script. `reference/probing.md` has the |
There was a problem hiding this comment.
claude: "there is no detection script" contradicts scripts/probe.mjs, which Step 3 tells the agent to run. Say what is meant, for example "no script compares or explains the differences: you do", so an agent doesn't look for a script or skip the probe.
There was a problem hiding this comment.
Fixed in 6c5b6ba: "You drive the whole workflow. scripts/probe.mjs only collects the browser captures; no script compares or explains the differences: you do."
|
codex: approved on 6c5b6ba The change adds source-site personalization detection and an inventory handoff to personalize, consistent with the description. Static review confirms that the previously reported browser and curl refusal paths now stop the probe, with browser regression coverage added. Changed JSON files parse successfully. No fork code, installs, tests, baseline probes or client evals were run, as required by the strict review rules. |
| await settle(page, wait); | ||
| if (spec.consent) { | ||
| meta.consentClicked = await acceptConsent(page); | ||
| await page.reload({ waitUntil: 'domcontentloaded' }).catch(() => {}); |
There was a problem hiding this comment.
codex: The refusal check covers only the initial page.goto. Both reload paths discard the response and swallow navigation errors, so a 403/429/503 or connection reset on the consent reload or --second-view reload is captured as successful evidence, and the probe continues with another visitor. This bypasses the promised stop-on-refusal guard. Apply the same refusal handling to every navigation and add tests proving that a refused reload stops subsequent visitors.
There was a problem hiding this comment.
Fixed in 6c5b6ba. Every navigation, the first load and both reloads (consent, and --second-view), goes through the same navigate() + refused() check. A 403, 429 or 503, or a navigation error, writes the visitor meta with blocked and refusedAt (load or reload), saves no capture, and stops all later visitors with exit 3. Regression tests: refused() unit cases, and a browser run against the fixture server with --refuse-after 1, where the consent reload gets 429 and the test asserts no capture and no later visitor. While writing that test I found and fixed return stop() inside the try: the finally closed the browser before stop() had finished, so it is now return await stop().
| E=personalization-detect/evidence/home; mkdir -p "$E" | ||
| fetch() { # fetch <visitor> <url> [curl options…] | ||
| local v=$1 u=$2; shift 2 | ||
| curl -sS -L --compressed --max-time 30 -A "$UA" -H 'Accept-Language: en-US,en;q=0.9' \ |
There was a problem hiding this comment.
codex: This fetch helper never checks the HTTP status or propagates curl failures: curl treats 403/429/503 as success here, and a transport failure is followed by perl and sleep, leaving the function successful. Consequently the supplied sequence continues through other visitors, including a different user agent, after refusal. Make the sequence terminate on refused responses or transport errors before sending another request, matching the skill's stated guard.
There was a problem hiding this comment.
Fixed in 6c5b6ba. fetch() now captures %{http_code}. A non-zero curl exit (reset, HTTP/2 error, timeout) or a 403, 429 or 503 prints REFUSED <visitor> … Stop the probe and returns 1. The visitor sequence is an && chain, so nothing after a refusal is requested, including the mobile-UA fetch. I ran the block as written, in bash and in zsh, against the fixture server with --refuse-after 2: the chain stopped at the first 429 with exit 1. Without refusals, all 7 visitors were fetched with exit 0, and cookie values were redacted.
…fusal and share personalize's Playwright pin - probe.mjs: the consent and --second-view reloads go through the same refusal check as the first load (403/429/503 or a navigation error stops every later visitor); regression test with a fixture server that refuses after n page requests - probing.md: the curl helper checks curl's exit code and the HTTP status, and the visitor sequence is an && chain, so a refusal ends it before another request - probe.mjs installs Playwright with personalize's PLAYWRIGHT_INSTALL (one Renovate-managed pin) - SKILL.md, vendors.md: no "no detection script" contradiction, no pointer to a missing step Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re the codex denial: both refusal paths now fail closed, and both are tested (6c5b6ba).
The three claude comments (Playwright pin, the missing step reference, the "no detection script" sentence) are fixed in the same commit. Checks: |
ramboz
left a comment
There was a problem hiding this comment.
Summary
This adds source-site detection and an inventory handoff to the existing DA/EDS personalize flow. The implementation from #577 landed through #702, so this is an incremental follow-up, not a replacement runtime. The direction is useful; I'd address the four capture and stopping cases inline before relying on the probe as migration evidence.
Strengths
- The producer checks proposed rows with personalize's own grammar. The consumer preserves authored defaults and converts captured copy into the migrated site's blocks instead of publishing source markup.
- The inventory explicitly cannot override consent, delivery confirmations or checks. Unknown copy stays a scaffold, and skipped regions remain visible in the summary.
- The reload refusal fixes and shared Playwright pin are present in this head. Those earlier threads are addressed; S3 has a different trigger.
Issues
Should Fix
- S1 / S2: Cookie values can remain in saved evidence through the curl failure path and supported Dynamic Yield response bodies.
- S3: Challenge responses outside the three listed HTTP statuses do not stop the probe.
- S4: The scroll pass has no bound when the page keeps growing.
The inline comments give the input, affected path and a focused regression case for each.
Out of Scope, Worth Tracking
- Shared runtime ownership and versioning can remain a follow-up, as in the earlier public review. This discovery slice doesn't need to add other AEM authoring models or extract a new execution layer.
Verdict
Ready to merge: With fixes
Reasoning: The remaining defects are in the new probe and its capture recipe. Q1 is a migration-ownership choice, not another runtime defect or a request to widen this PR.
Open questions
Q1 is inline on the vendor experiment mapping: preserve the native owner, or explicitly start a new local experiment?
Reviewed at 6c5b6ba. All 39 changed files and targeted base context were read; no PR code, installs, tests or evals were run. CI reports no failures, but the scenario-eval job is skipped. This is not live Target/OF1 qualification. No independent ticket or specification is linked; the helper's impact scan is not a complete call graph.
Reviewed with GitHub Copilot.
| local v=$1 u=$2 code rc; shift 2 | ||
| code=$(curl -sS -L --compressed --max-time 30 -A "$UA" -H 'Accept-Language: en-US,en;q=0.9' \ | ||
| -D "$E/$v.headers" -o "$E/$v.html" -w '%{http_code}' "$@" "$u") \ | ||
| || { rc=$?; echo "REFUSED $v: curl error $rc. Stop the probe: no other client or user agent" >&2; return 1; } |
There was a problem hiding this comment.
S1. Redact saved headers on the curl error path too.
-D can write Set-Cookie before the response body stalls or a followed redirect fails. In either case curl exits nonzero here, so this return skips the redaction on the next line. The saved <visitor>.headers then retains cookie values, contrary to the skill's names-only rule, precisely when the agent is told to stop.
Could we sanitize or remove the partial header file before either return, and clean the cookie jar on failure too? A fixture that sends Set-Cookie and then stalls its body would cover the path without calling a real site.
Perspective: SRE / Reliability, Security
| } | ||
| } else if (v && typeof v === 'object') { | ||
| Object.keys(v).forEach((k) => { | ||
| if (/^(ecid|mcid|tntid|tnt_?id|visitorid|marketingcloudvisitorid|identitymap|id5|uuid|sessionid)$/i.test(k)) delete v[k]; |
There was a problem hiding this comment.
S2. Remove cookie values from captured Dynamic Yield decisions.
Dynamic Yield is a supported decision source, and its documented Choose response includes cookies: [{ name, value, maxAge }] for _dyid_server and _dyjsession. None of those keys matches this filter. The response handler therefore keeps the visitor/session values and writes them into <visitor>-decision-<n>.json.
Please retain only cookie names, or allowlist the decision fields the inventory needs, before saving the response. A redaction test using that documented response shape would catch this alongside the existing Adobe identity test. This is a saved-evidence privacy issue; I'm not treating these probe-generated identifiers as account credentials.
Perspective: Security, QA / Testing
|
|
||
| /** True when a navigation was refused: an error (reset, HTTP/2, timeout) or 403, 429, 503. */ | ||
| export function refused({ status, error }) { | ||
| return !!error || [403, 429, 503].includes(status); |
There was a problem hiding this comment.
S3. Stop on challenge responses as well as the three status codes.
The reload fix is in place. The remaining gap is what counts as a refusal: AWS WAF documents 202 with x-amzn-waf-action: challenge, and 405 with x-amzn-waf-action: captcha. Both pass this check. navigate() keeps only the status, so the script can save the interstitial as page evidence and continue with later visitors, including a different user agent. The curl recipe has the same three-code check.
Please carry challenge signals into the refusal result and stop the whole site's pass when they are present. Recognized headers, including Cloudflare's documented cf-mitigated: challenge, are more precise than treating every 202 as a refusal. Cover a challenge on both the initial load and a reload, and the equivalent curl path.
Perspective: SRE / Reliability, Product / Consumer Impact
| await page.waitForLoadState('networkidle', { timeout: wait }).catch(() => {}); | ||
| await sleep(1500); | ||
| await page.evaluate(async () => { | ||
| for (let y = 0; y < document.body.scrollHeight; y += 800) { window.scrollTo(0, y); await new Promise((r) => { setTimeout(r, 120); }); } |
There was a problem hiding this comment.
S4. Bound the scroll pass independently of network idle.
This loop reads the current scrollHeight after every scroll. On an infinite-scroll page, newly appended content keeps moving the end of the loop. --wait only bounds the earlier networkidle wait, and this page.evaluate() has no execution deadline, so one visitor can prevent the run from finishing.
Please cap the scroll distance or iterations and add a wall-clock bound that also stops the page-side loop. Report a capped capture as incomplete. A fixture that appends content near the bottom can verify that the probe still returns and closes its browser.
Perspective: SRE / Reliability, LLM / AI Systems
| - Target's `trafficType`, an `experiment` in the activity type, or Optimizely or VWO, whose | ||
| activities are experiments unless the audience says otherwise. | ||
|
|
||
| That makes the region `split` (personalize's section A/B), or `target` for an Adobe A/B |
There was a problem hiding this comment.
Q1. Who owns a detected experiment after migration?
Should observing a vendor A/B activity keep that product as the default owner, or offer a new local experiment only after the owner explicitly chooses the replacement?
This mapping proposes split; plugins/aem/edge-delivery-services-personalization/skills/detect-personalization/reference/inventory-contract.md:75 makes unknown weights even, and plugins/aem/edge-delivery-services-personalization/skills/personalize/reference/from-inventory.md:25 builds medium/high-confidence proposals. Together with the hands-off defaults, an observation can become a new local allocation without a decision to replace the native activity. Seeing two experiences doesn't establish the original traffic weights or assignment continuity.
One option is target, keep-vendor or needs-owner-input until the owner chooses. The other is an explicit new local experiment, with its split supplied and the restart called out. Either fits this inventory workflow; I would keep the observation separate from that ownership choice.
Needs an answer: no
Perspective: Architecture, Product / Consumer Impact
What and why
New skill
detect-personalization. Before a migration to EDS, it finds what a source site personalizes:The agent drives the workflow from the instructions:
curlfor the raw HTML and headers, andscripts/probe.mjsin a browser.personalization-detect/personalization-inventory.json. Each region gets its proposedPersonalization …Section Metadata rows and the source copy of its variants.section-spec.js. Rows that wait for an owner's value (<…>) are reported, never guessed.personalizechange. It builds from such an inventory only when the project holds one, or the prompt names one. That's one paragraph in Step 2, and the procedure is in the newreference/from-inventory.md:TODO:in the fragments;Without an inventory, personalize works as it does today.
New script, network access and endpoints:
skills/detect-personalization/scripts/probe.mjs(Playwright).evals/detect-personalization/fixtures/serve.mjslistens on127.0.0.1only, and stops itself after a TTL.How I checked it
npm ci && npm run validate && node scripts/check-release-configs.mjs: pass.npm run plugins:check: only the generated manifests are behindplugin.json, which CI rebuilds.node scripts/check-skills.mjs --tokens plugins/aem/edge-delivery-services-personalization: detect-personalization is 3,126 of 5,000 tokens, personalize 4,284 of 5,000 (both have an eval).Tests:
node --test scripts/test/*.test.mjspasses 4 of 4, including a browser run against the fixture site.npm testpasses 515, with 3 skipped (unchanged).Real sites. Fresh agents ran the skill with nothing but the skill to follow. Their feedback is folded in.
/,/creativecloud.htmlgeo: AE, SA, …,!geo: US); mixed regions asapiwithtargetas the alternative. All 6 proposed sections pass the check/,/pricingx-matched-path): the hero by device, and pricing by company, which is an owner questionprobe.mjswas also run on frame.io. It reproduced the agent's finding: the Web SDK decision fires only on the second page view.personalize from an inventory. A fresh agent ran on the
personalize-from-inventoryscenario's project:<segment>value;aem up).New scenarios:
evals/detect-personalization(fixture site with server- and client-side regions, started bysetup.sh) andevals/personalize-from-inventory(migrated DA home page plus an inventory).Not yet run with
skill-eval.mjs. Run:Found by the personalize trial, but outside this PR (a follow-up
fix):--apply-hookimport lackseslint-disable import/no-cycle, so boilerplate lint fails;detect-projectreports OneTrust from a code comment;simulate.mjsprints no PASS/FAIL line.Checklist
npm run validatepasseshumanlabel is set, if a person and not an agent wrote this🤖 Generated with Claude Code