@decocms/parity 0.35.12 → 0.35.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +126 -173
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ Three providers, auto-detected in this order — **none required** if you have t
|
|
|
75
75
|
|
|
76
76
|
Force with `--llm <anthropic|openrouter|claude-code|none|auto>`. Override per-feature with `--llm-model visual-diff=claude-opus-5,explain=claude-opus-5`, or flatten everything to one tier with `--llm-tier-default <haiku|sonnet|opus>`. Default tiers: **Sonnet** for selector discovery / recovery / matching / vision / aggregation (the structural-reasoning calls), **Haiku** for short copy-list classification (`search-terms`), **Opus** for `explain`. Cost-conscious? Try `--llm-tier-default haiku` and bump features back to Sonnet selectively if you hit selector misses.
|
|
77
77
|
|
|
78
|
-
Without any provider, the CLI still runs and outputs raw check results
|
|
78
|
+
Without any provider, the CLI still runs and outputs raw check results.
|
|
79
79
|
|
|
80
80
|
## Output
|
|
81
81
|
|
package/dist/cli.js
CHANGED
|
@@ -91031,7 +91031,7 @@ var REPORT_CSS = `
|
|
|
91031
91031
|
.agentic-pillar { margin-top: 14px; }
|
|
91032
91032
|
.agentic-pillar-head { font-weight: 600; margin-bottom: 6px; }
|
|
91033
91033
|
|
|
91034
|
-
/*
|
|
91034
|
+
/* Markdown prompt toolbar + body (Visual Diff panel) */
|
|
91035
91035
|
.prompt-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
|
|
91036
91036
|
.prompt-toolbar button { background: var(--accent-action); color: var(--on-accent); border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
|
|
91037
91037
|
.prompt-toolbar button:hover { opacity: 0.9; }
|
|
@@ -92088,34 +92088,6 @@ var REPORT_JS = `
|
|
|
92088
92088
|
if (fCache) fCache.addEventListener('change', applyFilters);
|
|
92089
92089
|
})();
|
|
92090
92090
|
|
|
92091
|
-
// ---- LLM Prompt: copy + download ----
|
|
92092
|
-
var copyBtn = document.getElementById('prompt-copy');
|
|
92093
|
-
var dlBtn = document.getElementById('prompt-download');
|
|
92094
|
-
var promptEl = document.getElementById('prompt-md');
|
|
92095
|
-
var feedback = document.getElementById('prompt-feedback');
|
|
92096
|
-
if (copyBtn && promptEl) {
|
|
92097
|
-
copyBtn.addEventListener('click', function() {
|
|
92098
|
-
var text = promptEl.textContent || '';
|
|
92099
|
-
var done = function() {
|
|
92100
|
-
feedback.textContent = '✓ copiado!';
|
|
92101
|
-
feedback.classList.add('show');
|
|
92102
|
-
setTimeout(function() { feedback.classList.remove('show'); }, 2000);
|
|
92103
|
-
};
|
|
92104
|
-
if (navigator.clipboard) navigator.clipboard.writeText(text).then(done).catch(done);
|
|
92105
|
-
});
|
|
92106
|
-
}
|
|
92107
|
-
if (dlBtn && promptEl) {
|
|
92108
|
-
dlBtn.addEventListener('click', function() {
|
|
92109
|
-
var text = promptEl.textContent || '';
|
|
92110
|
-
var blob = new Blob([text], { type: 'text/markdown' });
|
|
92111
|
-
var a = document.createElement('a');
|
|
92112
|
-
a.href = URL.createObjectURL(blob);
|
|
92113
|
-
a.download = 'parity-prompt.md';
|
|
92114
|
-
a.click();
|
|
92115
|
-
setTimeout(function() { URL.revokeObjectURL(a.href); }, 1000);
|
|
92116
|
-
});
|
|
92117
|
-
}
|
|
92118
|
-
|
|
92119
92091
|
// ---- Visual Diff: prompt copy/download ----
|
|
92120
92092
|
(function() {
|
|
92121
92093
|
var vCopy = document.getElementById('vprompt-copy');
|
|
@@ -99178,118 +99150,9 @@ function groupIssues(issues) {
|
|
|
99178
99150
|
return [...groups.values()].sort((a, b) => SEVERITY_RANK3[a.severity] - SEVERITY_RANK3[b.severity] || b.count - a.count);
|
|
99179
99151
|
}
|
|
99180
99152
|
|
|
99181
|
-
// src/report/prompt-builder.ts
|
|
99182
|
-
var SEVERITY_ORDER2 = {
|
|
99183
|
-
critical: 0,
|
|
99184
|
-
high: 1,
|
|
99185
|
-
medium: 2,
|
|
99186
|
-
low: 3
|
|
99187
|
-
};
|
|
99188
|
-
var SEVERITY_EMOJI = {
|
|
99189
|
-
critical: "\uD83D\uDD34",
|
|
99190
|
-
high: "\uD83D\uDFE0",
|
|
99191
|
-
medium: "\uD83D\uDFE1",
|
|
99192
|
-
low: "⚪"
|
|
99193
|
-
};
|
|
99194
|
-
function buildLlmPrompt(run, opts = {}) {
|
|
99195
|
-
const minSev = opts.minSeverity ?? "low";
|
|
99196
|
-
const limit = opts.limit ?? 20;
|
|
99197
|
-
const baseIssues = run.topIssues.length > 0 ? run.topIssues : run.issues;
|
|
99198
|
-
const filtered = baseIssues.filter((i) => SEVERITY_ORDER2[i.severity] <= SEVERITY_ORDER2[minSev]).sort((a, b) => SEVERITY_ORDER2[a.severity] - SEVERITY_ORDER2[b.severity]).slice(0, limit);
|
|
99199
|
-
return buildPromptInner(run, filtered, baseIssues.length);
|
|
99200
|
-
}
|
|
99201
|
-
function buildPromptInner(run, issues, totalIssues) {
|
|
99202
|
-
const v = run.verdict;
|
|
99203
|
-
const sections = [];
|
|
99204
|
-
sections.push(`# Migration Parity Report — ${run.id}
|
|
99205
|
-
|
|
99206
|
-
You are reviewing the result of an automated E2E parity test between two versions of a site:
|
|
99207
|
-
|
|
99208
|
-
- **prod (source of truth):** ${run.prodUrl} — running the old framework (Deno Fresh + Preact)
|
|
99209
|
-
- **cand (candidate):** ${run.candUrl} — migrated version on the new stack (TanStack Start + React + Cloudflare Workers)
|
|
99210
|
-
|
|
99211
|
-
The test ran flows \`${run.flows.join(", ")}\` in viewports \`${run.viewports.join(", ")}\` using CEP \`${run.cep}\`. Total duration: ${(run.durationMs / 1000).toFixed(1)}s.
|
|
99212
|
-
|
|
99213
|
-
## Verdict
|
|
99214
|
-
|
|
99215
|
-
- **Status:** ${v.status.toUpperCase()}
|
|
99216
|
-
- **Parity score:** ${v.score}/100
|
|
99217
|
-
- **Issues:** ${v.critical} critical · ${v.high} high · ${v.medium} medium · ${v.low} low
|
|
99218
|
-
- **Checks:** ${v.checksRun} run (${v.checksPassed} pass · ${v.checksFailed} fail · ${v.checksSkipped} skipped)
|
|
99219
|
-
|
|
99220
|
-
The cand version must behave as close as possible to prod. Every divergence below is a regression unless explicitly intentional in the migration. Your job is to help me decide which to fix first and how.
|
|
99221
|
-
|
|
99222
|
-
---
|
|
99223
|
-
|
|
99224
|
-
## Top ${issues.length} of ${totalIssues} issues (ranked by severity)
|
|
99225
|
-
`);
|
|
99226
|
-
if (issues.length === 0) {
|
|
99227
|
-
sections.push(`
|
|
99228
|
-
_No issues at or above the requested severity._
|
|
99229
|
-
`);
|
|
99230
|
-
} else {
|
|
99231
|
-
for (const [idx, issue] of issues.entries()) {
|
|
99232
|
-
sections.push(renderIssueBlock(idx + 1, issue));
|
|
99233
|
-
}
|
|
99234
|
-
}
|
|
99235
|
-
sections.push(`
|
|
99236
|
-
---
|
|
99237
|
-
|
|
99238
|
-
## What I need from you
|
|
99239
|
-
|
|
99240
|
-
For each issue above, in order of severity:
|
|
99241
|
-
|
|
99242
|
-
1. **Diagnose** the most likely root cause specific to a Fresh → TanStack Start migration of a Deco storefront. Common patterns include:
|
|
99243
|
-
- \`useDevice\` / \`usePlatform\` hydration mismatch (server returns one, client another)
|
|
99244
|
-
- Section not registered in \`registerSections()\` in \`src/setup.ts\`
|
|
99245
|
-
- Loader returning a different shape (different VTEX/Shopify endpoint mapping in @decocms/apps-start)
|
|
99246
|
-
- Cache profile not covering this route type in \`@decocms/start\` (\`routeCacheDefaults\`)
|
|
99247
|
-
- VTEX cookies not propagating (\`vtexFetchWithCookies\` issue) — affects cart, shipping
|
|
99248
|
-
- Image helper or CDN URL drift, or lost \`preload\` on hero image
|
|
99249
|
-
- \`<head>\` meta tags hoist not running server-side
|
|
99250
|
-
2. **Propose a concrete fix** — file path, what to change, why. If two fixes are plausible, list both.
|
|
99251
|
-
3. **Flag dependencies** between issues (e.g. "fixing #2 will likely fix #5 too").
|
|
99252
|
-
4. **Rank execution order** for me: which fix unlocks the most other fixes? Which is cheapest?
|
|
99253
|
-
|
|
99254
|
-
Be terse. Skip preamble. If an issue is ambiguous, say what extra information you'd need from me (a HAR file, a specific page screenshot, a code path) and I'll fetch it.
|
|
99255
|
-
|
|
99256
|
-
Don't suggest generic best practices — only fixes tied to specific issues above.
|
|
99257
|
-
`);
|
|
99258
|
-
return sections.join(`
|
|
99259
|
-
`);
|
|
99260
|
-
}
|
|
99261
|
-
function renderIssueBlock(idx, issue) {
|
|
99262
|
-
const lines = [];
|
|
99263
|
-
const emoji = SEVERITY_EMOJI[issue.severity];
|
|
99264
|
-
lines.push(`### ${idx}. ${emoji} [${issue.severity.toUpperCase()}] ${issue.summary}`, "", `- **Category:** \`${issue.category}\` · **Check:** \`${issue.check}\`${issue.page ? ` · **Page:** \`${humanKey2(issue.page)}\`` : ""}`);
|
|
99265
|
-
if (issue.details) {
|
|
99266
|
-
lines.push("", "**Details:**", "", "```", issue.details, "```");
|
|
99267
|
-
}
|
|
99268
|
-
if (issue.reproduction) {
|
|
99269
|
-
lines.push("", "**Reproduction:**", "", issue.reproduction);
|
|
99270
|
-
}
|
|
99271
|
-
if (issue.suggestedFix) {
|
|
99272
|
-
lines.push("", "**Suggested fix (preliminary):**", "", issue.suggestedFix);
|
|
99273
|
-
}
|
|
99274
|
-
if (issue.evidence && issue.evidence.length > 0) {
|
|
99275
|
-
const refs = issue.evidence.map((e) => `\`${e.path}\`${e.label ? ` (${e.label})` : ""}`).join(", ");
|
|
99276
|
-
lines.push("", `**Evidence:** ${refs}`);
|
|
99277
|
-
}
|
|
99278
|
-
lines.push("", "");
|
|
99279
|
-
return lines.join(`
|
|
99280
|
-
`);
|
|
99281
|
-
}
|
|
99282
|
-
function humanKey2(key) {
|
|
99283
|
-
const parts = key.split("::");
|
|
99284
|
-
const path = parts[0] ?? key;
|
|
99285
|
-
const viewport = parts[1] ?? "";
|
|
99286
|
-
const niceName = path === "/" || path === "" ? "Home" : path;
|
|
99287
|
-
return viewport ? `${niceName} · ${viewport}` : niceName;
|
|
99288
|
-
}
|
|
99289
|
-
|
|
99290
99153
|
// src/report/visual-prompt-builder.ts
|
|
99291
99154
|
import { relative as relative4 } from "node:path";
|
|
99292
|
-
var
|
|
99155
|
+
var SEVERITY_ORDER2 = {
|
|
99293
99156
|
critical: 0,
|
|
99294
99157
|
high: 1,
|
|
99295
99158
|
medium: 2,
|
|
@@ -99312,7 +99175,7 @@ function pageMaxSeverity(page) {
|
|
|
99312
99175
|
const sevs = severities(page);
|
|
99313
99176
|
if (sevs.length === 0)
|
|
99314
99177
|
return null;
|
|
99315
|
-
return sevs.reduce((best, s) =>
|
|
99178
|
+
return sevs.reduce((best, s) => SEVERITY_ORDER2[s] < SEVERITY_ORDER2[best] ? s : best);
|
|
99316
99179
|
}
|
|
99317
99180
|
function buildVisualPrompt(run, runDir, opts = {}) {
|
|
99318
99181
|
const minSev = opts.minSeverity ?? "low";
|
|
@@ -99327,7 +99190,7 @@ function buildVisualPrompt(run, runDir, opts = {}) {
|
|
|
99327
99190
|
}
|
|
99328
99191
|
const rank = (p) => {
|
|
99329
99192
|
const sev = pageMaxSeverity(p);
|
|
99330
|
-
return sev ?
|
|
99193
|
+
return sev ? SEVERITY_ORDER2[sev] : p.verdict === "failed" ? 4 : 99;
|
|
99331
99194
|
};
|
|
99332
99195
|
const pages = summary.results.filter((p) => {
|
|
99333
99196
|
if (includePassed)
|
|
@@ -99335,7 +99198,7 @@ function buildVisualPrompt(run, runDir, opts = {}) {
|
|
|
99335
99198
|
if (p.verdict === "failed")
|
|
99336
99199
|
return true;
|
|
99337
99200
|
const sev = pageMaxSeverity(p);
|
|
99338
|
-
return sev !== null &&
|
|
99201
|
+
return sev !== null && SEVERITY_ORDER2[sev] <= SEVERITY_ORDER2[minSev];
|
|
99339
99202
|
}).sort((a, b) => rank(a) - rank(b));
|
|
99340
99203
|
if (pages.length === 0) {
|
|
99341
99204
|
sections.push(`_All ${summary.pagesChecked} compared pages are identical to prod._`);
|
|
@@ -99514,7 +99377,6 @@ var TAB_HELP = {
|
|
|
99514
99377
|
vitals: "Web Vitals (LCP / FCP / TTFB / INP / CLS) per page, prod vs cand. Δ green = cand better; Δ red = regression. Mobile is the default measurement viewport.",
|
|
99515
99378
|
cache: "Cache hit rate and missed opportunities on cand. Opportunities = static assets with hashed URLs returning MISS — adding a cache rule for them is usually free perf.",
|
|
99516
99379
|
checks: "Every check that ran in this run, with pass/fail status, duration, and one-line summary. Useful for narrowing down which check produced a confusing issue.",
|
|
99517
|
-
prompt: "Copy-pasteable Markdown prompt that you can drop into any LLM (Claude, ChatGPT, etc.) to get a prioritized fix list. Includes issue context + migration-specific hints.",
|
|
99518
99380
|
pages: "Every URL parity actually captured during the run, with status code and viewport. Use this to confirm coverage when a check reports something unexpected.",
|
|
99519
99381
|
console: "JS console errors and network failures that fired on cand but not on prod. New errors are usually hydration mismatches, missing API endpoints, or broken third-party scripts.",
|
|
99520
99382
|
network: "Every request captured on cand: type, status, size, cache decision. Sortable + filterable. Use this to spot bundle bloat or unexpected third-party calls.",
|
|
@@ -100742,22 +100604,6 @@ function renderSeoIssuesCard(issues, runDir) {
|
|
|
100742
100604
|
${issues.map((i) => renderIssue2(i, runDir)).join("")}
|
|
100743
100605
|
</div>`;
|
|
100744
100606
|
}
|
|
100745
|
-
function renderPromptPanel(run) {
|
|
100746
|
-
const md = buildLlmPrompt(run, { limit: 20 });
|
|
100747
|
-
const charCount = md.length;
|
|
100748
|
-
return `
|
|
100749
|
-
<div class="card">
|
|
100750
|
-
<h2>LLM prompt</h2>
|
|
100751
|
-
<div class="hint">Ready to paste into Claude / ChatGPT / any chat. Lists ranked issues + migration context + specific diagnose-and-fix instructions.</div>
|
|
100752
|
-
<div class="prompt-toolbar">
|
|
100753
|
-
<button id="prompt-copy">\uD83D\uDCCB Copy markdown</button>
|
|
100754
|
-
<button class="secondary" id="prompt-download">⬇ Download .md</button>
|
|
100755
|
-
<span class="feedback" id="prompt-feedback"></span>
|
|
100756
|
-
<div class="right">${charCount.toLocaleString("en-US")} chars · ${(charCount / 1024).toFixed(1)} KB</div>
|
|
100757
|
-
</div>
|
|
100758
|
-
<div class="prompt-md" id="prompt-md">${escapeHtml(md)}</div>
|
|
100759
|
-
</div>`;
|
|
100760
|
-
}
|
|
100761
100607
|
function buildNav(run) {
|
|
100762
100608
|
const vd = run.visualDiff;
|
|
100763
100609
|
const entries = [
|
|
@@ -100786,7 +100632,6 @@ function buildNav(run) {
|
|
|
100786
100632
|
{ tab: "vitals", label: "Vitals", icon: "\uD83D\uDCCA" },
|
|
100787
100633
|
{ tab: "cache", label: "Cache", icon: "\uD83D\uDCBE" },
|
|
100788
100634
|
{ tab: "checks", label: "Checks", icon: "✓", count: run.checks.length },
|
|
100789
|
-
{ tab: "prompt", label: "Prompt LLM", icon: "\uD83E\uDD16" },
|
|
100790
100635
|
{ tab: "pages", label: "Pages", icon: "\uD83D\uDCC4" },
|
|
100791
100636
|
{ tab: "console", label: "Console", icon: "\uD83D\uDD27" },
|
|
100792
100637
|
{ tab: "network", label: "Network", icon: "\uD83C\uDF10" }
|
|
@@ -100871,7 +100716,6 @@ function renderHtmlReport(run, runDir) {
|
|
|
100871
100716
|
${tabHelp(TAB_HELP.checks)}
|
|
100872
100717
|
${renderChecksTable(run)}
|
|
100873
100718
|
</section>
|
|
100874
|
-
<section class="panel" data-panel="prompt">${tabHelp(TAB_HELP.prompt)}${renderPromptPanel(run)}</section>
|
|
100875
100719
|
<section class="panel" data-panel="pages">
|
|
100876
100720
|
${tabHelp(TAB_HELP.pages)}
|
|
100877
100721
|
${renderPagesTable2(run)}
|
|
@@ -117742,7 +117586,7 @@ function printSummary8(run, htmlPath, meta) {
|
|
|
117742
117586
|
}
|
|
117743
117587
|
|
|
117744
117588
|
// src/commands/pr.ts
|
|
117745
|
-
var
|
|
117589
|
+
var SEVERITY_EMOJI = {
|
|
117746
117590
|
critical: "\uD83D\uDD34",
|
|
117747
117591
|
high: "\uD83D\uDFE0",
|
|
117748
117592
|
medium: "\uD83D\uDFE1",
|
|
@@ -117839,7 +117683,7 @@ function buildPrComment(run, opts) {
|
|
|
117839
117683
|
for (const g of topGroups) {
|
|
117840
117684
|
const i = g.sample;
|
|
117841
117685
|
const where = g.pages.length > 1 ? ` · ${g.pages.length} pages` : i.page ? ` · page: \`${i.page}\`` : "";
|
|
117842
|
-
lines.push(`- ${
|
|
117686
|
+
lines.push(`- ${SEVERITY_EMOJI[i.severity]} \`${i.category}\` · **${i.summary}** _(check: \`${i.check}\`${where})_`);
|
|
117843
117687
|
}
|
|
117844
117688
|
}
|
|
117845
117689
|
lines.push("");
|
|
@@ -117852,6 +117696,117 @@ function buildPrComment(run, opts) {
|
|
|
117852
117696
|
// src/commands/prompt.ts
|
|
117853
117697
|
import { existsSync as existsSync31, writeFileSync as writeFileSync33 } from "node:fs";
|
|
117854
117698
|
import chalk36 from "chalk";
|
|
117699
|
+
|
|
117700
|
+
// src/report/prompt-builder.ts
|
|
117701
|
+
var SEVERITY_ORDER3 = {
|
|
117702
|
+
critical: 0,
|
|
117703
|
+
high: 1,
|
|
117704
|
+
medium: 2,
|
|
117705
|
+
low: 3
|
|
117706
|
+
};
|
|
117707
|
+
var SEVERITY_EMOJI2 = {
|
|
117708
|
+
critical: "\uD83D\uDD34",
|
|
117709
|
+
high: "\uD83D\uDFE0",
|
|
117710
|
+
medium: "\uD83D\uDFE1",
|
|
117711
|
+
low: "⚪"
|
|
117712
|
+
};
|
|
117713
|
+
function buildLlmPrompt(run, opts = {}) {
|
|
117714
|
+
const minSev = opts.minSeverity ?? "low";
|
|
117715
|
+
const limit = opts.limit ?? 20;
|
|
117716
|
+
const baseIssues = run.topIssues.length > 0 ? run.topIssues : run.issues;
|
|
117717
|
+
const filtered = baseIssues.filter((i) => SEVERITY_ORDER3[i.severity] <= SEVERITY_ORDER3[minSev]).sort((a, b) => SEVERITY_ORDER3[a.severity] - SEVERITY_ORDER3[b.severity]).slice(0, limit);
|
|
117718
|
+
return buildPromptInner(run, filtered, baseIssues.length);
|
|
117719
|
+
}
|
|
117720
|
+
function buildPromptInner(run, issues, totalIssues) {
|
|
117721
|
+
const v = run.verdict;
|
|
117722
|
+
const sections = [];
|
|
117723
|
+
sections.push(`# Migration Parity Report — ${run.id}
|
|
117724
|
+
|
|
117725
|
+
You are reviewing the result of an automated E2E parity test between two versions of a site:
|
|
117726
|
+
|
|
117727
|
+
- **prod (source of truth):** ${run.prodUrl} — running the old framework (Deno Fresh + Preact)
|
|
117728
|
+
- **cand (candidate):** ${run.candUrl} — migrated version on the new stack (TanStack Start + React + Cloudflare Workers)
|
|
117729
|
+
|
|
117730
|
+
The test ran flows \`${run.flows.join(", ")}\` in viewports \`${run.viewports.join(", ")}\` using CEP \`${run.cep}\`. Total duration: ${(run.durationMs / 1000).toFixed(1)}s.
|
|
117731
|
+
|
|
117732
|
+
## Verdict
|
|
117733
|
+
|
|
117734
|
+
- **Status:** ${v.status.toUpperCase()}
|
|
117735
|
+
- **Parity score:** ${v.score}/100
|
|
117736
|
+
- **Issues:** ${v.critical} critical · ${v.high} high · ${v.medium} medium · ${v.low} low
|
|
117737
|
+
- **Checks:** ${v.checksRun} run (${v.checksPassed} pass · ${v.checksFailed} fail · ${v.checksSkipped} skipped)
|
|
117738
|
+
|
|
117739
|
+
The cand version must behave as close as possible to prod. Every divergence below is a regression unless explicitly intentional in the migration. Your job is to help me decide which to fix first and how.
|
|
117740
|
+
|
|
117741
|
+
---
|
|
117742
|
+
|
|
117743
|
+
## Top ${issues.length} of ${totalIssues} issues (ranked by severity)
|
|
117744
|
+
`);
|
|
117745
|
+
if (issues.length === 0) {
|
|
117746
|
+
sections.push(`
|
|
117747
|
+
_No issues at or above the requested severity._
|
|
117748
|
+
`);
|
|
117749
|
+
} else {
|
|
117750
|
+
for (const [idx, issue] of issues.entries()) {
|
|
117751
|
+
sections.push(renderIssueBlock(idx + 1, issue));
|
|
117752
|
+
}
|
|
117753
|
+
}
|
|
117754
|
+
sections.push(`
|
|
117755
|
+
---
|
|
117756
|
+
|
|
117757
|
+
## What I need from you
|
|
117758
|
+
|
|
117759
|
+
For each issue above, in order of severity:
|
|
117760
|
+
|
|
117761
|
+
1. **Diagnose** the most likely root cause specific to a Fresh → TanStack Start migration of a Deco storefront. Common patterns include:
|
|
117762
|
+
- \`useDevice\` / \`usePlatform\` hydration mismatch (server returns one, client another)
|
|
117763
|
+
- Section not registered in \`registerSections()\` in \`src/setup.ts\`
|
|
117764
|
+
- Loader returning a different shape (different VTEX/Shopify endpoint mapping in @decocms/apps-start)
|
|
117765
|
+
- Cache profile not covering this route type in \`@decocms/start\` (\`routeCacheDefaults\`)
|
|
117766
|
+
- VTEX cookies not propagating (\`vtexFetchWithCookies\` issue) — affects cart, shipping
|
|
117767
|
+
- Image helper or CDN URL drift, or lost \`preload\` on hero image
|
|
117768
|
+
- \`<head>\` meta tags hoist not running server-side
|
|
117769
|
+
2. **Propose a concrete fix** — file path, what to change, why. If two fixes are plausible, list both.
|
|
117770
|
+
3. **Flag dependencies** between issues (e.g. "fixing #2 will likely fix #5 too").
|
|
117771
|
+
4. **Rank execution order** for me: which fix unlocks the most other fixes? Which is cheapest?
|
|
117772
|
+
|
|
117773
|
+
Be terse. Skip preamble. If an issue is ambiguous, say what extra information you'd need from me (a HAR file, a specific page screenshot, a code path) and I'll fetch it.
|
|
117774
|
+
|
|
117775
|
+
Don't suggest generic best practices — only fixes tied to specific issues above.
|
|
117776
|
+
`);
|
|
117777
|
+
return sections.join(`
|
|
117778
|
+
`);
|
|
117779
|
+
}
|
|
117780
|
+
function renderIssueBlock(idx, issue) {
|
|
117781
|
+
const lines = [];
|
|
117782
|
+
const emoji = SEVERITY_EMOJI2[issue.severity];
|
|
117783
|
+
lines.push(`### ${idx}. ${emoji} [${issue.severity.toUpperCase()}] ${issue.summary}`, "", `- **Category:** \`${issue.category}\` · **Check:** \`${issue.check}\`${issue.page ? ` · **Page:** \`${humanKey2(issue.page)}\`` : ""}`);
|
|
117784
|
+
if (issue.details) {
|
|
117785
|
+
lines.push("", "**Details:**", "", "```", issue.details, "```");
|
|
117786
|
+
}
|
|
117787
|
+
if (issue.reproduction) {
|
|
117788
|
+
lines.push("", "**Reproduction:**", "", issue.reproduction);
|
|
117789
|
+
}
|
|
117790
|
+
if (issue.suggestedFix) {
|
|
117791
|
+
lines.push("", "**Suggested fix (preliminary):**", "", issue.suggestedFix);
|
|
117792
|
+
}
|
|
117793
|
+
if (issue.evidence && issue.evidence.length > 0) {
|
|
117794
|
+
const refs = issue.evidence.map((e) => `\`${e.path}\`${e.label ? ` (${e.label})` : ""}`).join(", ");
|
|
117795
|
+
lines.push("", `**Evidence:** ${refs}`);
|
|
117796
|
+
}
|
|
117797
|
+
lines.push("", "");
|
|
117798
|
+
return lines.join(`
|
|
117799
|
+
`);
|
|
117800
|
+
}
|
|
117801
|
+
function humanKey2(key) {
|
|
117802
|
+
const parts = key.split("::");
|
|
117803
|
+
const path = parts[0] ?? key;
|
|
117804
|
+
const viewport = parts[1] ?? "";
|
|
117805
|
+
const niceName = path === "/" || path === "" ? "Home" : path;
|
|
117806
|
+
return viewport ? `${niceName} · ${viewport}` : niceName;
|
|
117807
|
+
}
|
|
117808
|
+
|
|
117809
|
+
// src/commands/prompt.ts
|
|
117855
117810
|
function promptCommand(runId, opts) {
|
|
117856
117811
|
let run;
|
|
117857
117812
|
try {
|
|
@@ -119972,7 +119927,6 @@ var ALL_REPORT_SECTIONS = [
|
|
|
119972
119927
|
"vitals",
|
|
119973
119928
|
"cache",
|
|
119974
119929
|
"checks",
|
|
119975
|
-
"prompt",
|
|
119976
119930
|
"pages",
|
|
119977
119931
|
"console",
|
|
119978
119932
|
"network",
|
|
@@ -120029,12 +119983,6 @@ function extractJsonSection(run, section) {
|
|
|
120029
119983
|
return extractPagesSlice(run);
|
|
120030
119984
|
case "console":
|
|
120031
119985
|
return run.checks.filter((c) => c.name === "console-errors-baseline").flatMap((c) => c.issues);
|
|
120032
|
-
case "prompt":
|
|
120033
|
-
return {
|
|
120034
|
-
runId: run.id,
|
|
120035
|
-
topIssuesCount: run.topIssues.length,
|
|
120036
|
-
hint: "Use `parity prompt <runId>` to materialize the LLM-ready Markdown."
|
|
120037
|
-
};
|
|
120038
119986
|
case "diff":
|
|
120039
119987
|
return run.baseline?.delta ?? null;
|
|
120040
119988
|
}
|
|
@@ -120094,6 +120042,10 @@ function pathOf7(url) {
|
|
|
120094
120042
|
}
|
|
120095
120043
|
|
|
120096
120044
|
// src/commands/report.ts
|
|
120045
|
+
var REMOVED_SECTIONS = {
|
|
120046
|
+
sidebyside: "use `parity cockpit --prod <url> --cand <url>` for the live prod × cand view.",
|
|
120047
|
+
prompt: "use `parity prompt <runId>` for the LLM-ready Markdown."
|
|
120048
|
+
};
|
|
120097
120049
|
async function reportCommand(runId, opts) {
|
|
120098
120050
|
const paths = getRunPaths(opts.output, runId);
|
|
120099
120051
|
if (opts.deck) {
|
|
@@ -120129,8 +120081,9 @@ async function reportCommand(runId, opts) {
|
|
|
120129
120081
|
return 0;
|
|
120130
120082
|
}
|
|
120131
120083
|
if (opts.section) {
|
|
120132
|
-
|
|
120133
|
-
|
|
120084
|
+
const movedTo = REMOVED_SECTIONS[opts.section];
|
|
120085
|
+
if (movedTo) {
|
|
120086
|
+
console.error(chalk39.yellow(`⚠ section \`${opts.section}\` was removed from the report — ${movedTo}`));
|
|
120134
120087
|
return 1;
|
|
120135
120088
|
}
|
|
120136
120089
|
if (!ALL_REPORT_SECTIONS.includes(opts.section)) {
|
|
@@ -122220,7 +122173,7 @@ program.command("serve").argument("<runId>", "Run ID to serve").description("[de
|
|
|
122220
122173
|
program.command("event").argument("<type>", "Event type: phase-change | dispatch | bench | score | note | …").description("Record a migration event into <dir>/events.jsonl — the sanctioned emission path for hooks and the orchestrator. The cockpit daemon tails this file into its live activity feed.").option("--dir <dir>", "Directory holding events.jsonl (the target's .parity/)", ".parity").option("--data <json>", `JSON object of event fields, e.g. '{"agent":"porter","component":"hero"}'`).action((type, opts) => {
|
|
122221
122174
|
process.exit(eventCommand(type, opts));
|
|
122222
122175
|
});
|
|
122223
|
-
program.command("report").argument("<runId>", "Run ID to open").description("Open the HTML report for a run in the default browser. With --section, extract a single tab to stdout instead — useful for agents that need just the SEO/Network/Vitals slice without parsing the whole report. Issue #74.").option("--output <dir>", "Output directory", "./parity-output").option("--section <name>", "Extract one tab to stdout instead of opening the report. Valid names: summary, visualdiff, seo, issues, vitals, cache, checks,
|
|
122176
|
+
program.command("report").argument("<runId>", "Run ID to open").description("Open the HTML report for a run in the default browser. With --section, extract a single tab to stdout instead — useful for agents that need just the SEO/Network/Vitals slice without parsing the whole report. Issue #74.").option("--output <dir>", "Output directory", "./parity-output").option("--section <name>", "Extract one tab to stdout instead of opening the report. Valid names: summary, visualdiff, seo, issues, vitals, cache, checks, pages, console, network, diff.").option("--json", "Pair with --section to emit a normalized JSON projection of the section (from report.json) instead of the raw HTML slice.").option("--deck", "Render the presentation deck instead: one topic per full-viewport page, advanced sideways, in a single self-contained HTML file. For showing the result to someone rather than debugging it. Issue #290.", false).option("--out <path>", "Where to write the deck (default: deck.html in the run dir)").option("--lang <pt|en>", "Initial deck language; the in-page toggle still switches live", "en").option("--open", "Open the rendered deck in the browser", false).option("--plan-dir <dir>", "With --deck: dir holding migration-plan.json. Adds the component heat map (grouped by page, plus global) and the block-by-block table. Without it those pages are omitted, not drawn empty. Issue #291.").action(async (runId, opts) => {
|
|
122224
122177
|
process.exit(await reportCommand(runId, {
|
|
122225
122178
|
output: opts.output,
|
|
122226
122179
|
section: opts.section,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/parity",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.13",
|
|
4
4
|
"description": "E2E parity validator for site migrations. Compares prod vs cand and reports UI, functional, SEO, visual, and Web Vitals deltas with an LLM-ranked HTML report.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|