@decocms/parity 0.35.23 → 0.35.25

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/AGENTS.md CHANGED
@@ -159,7 +159,10 @@ Hard caps already in place:
159
159
  - **Live prod × cand side by side lives in `parity cockpit --prod <url> --cand <url>`**, not the HTML report; its proxy strips X-Frame-Options so any site renders.
160
160
  - **Cookies are isolated per run** — no shared session between prod and cand. If a flow needs auth, you'll need to handle that in `.parityrc.json` or extend the flow.
161
161
  - **Visual diff catches missing sections** via DOM (`data-section`); if the migrated site doesn't emit that attribute, the heatmap still shows the region but the section name is lost.
162
- - **A page whose height differs between prod and cand is `failed` (not compared)** — the pixel diff would only cover the intersection. Fix the height first (the first box-tree delta usually names why), or compare the section with `parity heatmap --selector`.
162
+ - **A page whose height differs between prod and cand is `failed` (not compared) *and* a real `visual:height:<page>` finding** — the pixel diff would only cover the intersection, but the height difference itself is measured and scored (low under 50 px and 2%, high from 10% of prod's height). Fix the height first (the finding names the first sections whose height differs; `parity section --box-tree` finds why), or compare the section with `parity heatmap --selector`. Different widths or a side that was never captured stay inconclusive; `visualDiff.results[].notComparedKind` and the summary line (`6 not compared (height differs: 4, not captured: 1, other: 1)`) say which.
163
+ - **A page that was never captured (status 0) is not a status divergence.** `http-status-parity` files one inconclusive `http-status:not-captured:<page>` finding, the run gets a `cand-pages-not-captured` (or `prod-…`) caveat listing the paths, and the check is `warn`. A real 404/500 stays critical. Re-run against a warm server before reading the score.
164
+ - **`[hydration]` console errors are React's own hydration messages only.** A section that threw and was caught by an error boundary is `[section-crash]` (same severity); its `file:line` positions come from the candidate's build at capture time and may be stale against the working tree.
165
+ - **`Issue.page` is the `path::viewport` key**, never a URL; the URL is in `details`.
163
166
  - **`parity run` doesn't apply schema changes from old runs** — if you change `src/types/schema.ts`, old `report.json` files won't parse. Delete `parity-output/` or re-run.
164
167
 
165
168
  ## Files agents should and should not write
package/CHANGELOG.md CHANGED
@@ -25,6 +25,74 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
25
25
  * **`src/checks/tolerances.ts`** — one table of the pass/fail tolerances that were file-local
26
26
  constants and inline literals across `src/checks` and `src/diff`, each with a unit, a basis
27
27
  (`measured` / `spec` / `assumed`) and a note. No value changed.
28
+ * **Route discovery without a sitemap.** With no usable `/sitemap.xml` and no
29
+ `--pages`, capture follows same-origin links (nav and footer first, then content,
30
+ two levels, `robots.txt`-respecting), groups them into templates and captures one
31
+ representative per template, capped. `migration-plan.json` gains `discovery`
32
+ (`sitemap` | `links` | `explicit`, profile + evidence, templates with example
33
+ URLs, what the cap left out). All plan additions are optional, so existing plans
34
+ still load and `parity plan merge` carries them.
35
+ * **`parity replay <dir>`** re-runs the checks on a `--record` recording with no browser and scores
36
+ them with the same code as `parity run`. `--expect` / `--update-expected` pin the outcome (check
37
+ statuses, issue ids, verdict status) in `<dir>/expected.json`; exit 2 means nothing could be
38
+ judged (never a pass). A request the recording never saw fails the check and is named. A corpus
39
+ suite (`tests/corpus/corpus.test.ts`, `PARITY_CORPUS_DIR`) replays a directory of reviewed
40
+ recordings kept in a separate private repository. See `docs/reports.md`.
41
+
42
+ ### Fixed
43
+
44
+ * **A candidate page that was never captured is no longer a status divergence.**
45
+ A capture that recorded no HTTP answer (status 0: timeout, refused connection)
46
+ made `http-status-parity` file a critical `prod=200 cand=0`. It is now one
47
+ inconclusive `http-status:not-captured:<page>` finding naming the side and the
48
+ capture's duration, the pair is not counted as compared and the check is `warn`.
49
+ Pair-diffing checks with no HTML guard (console, network summary, web vitals,
50
+ redirects, third-party scripts, analytics beacon) withhold such a pair through
51
+ `withCapturedPairs`. The run gains a `cand-pages-not-captured` /
52
+ `prod-pages-not-captured` caveat listing the paths. A real 404/500 is unchanged.
53
+ * **A section crash is no longer labelled `[hydration]`.** The console classifier
54
+ matched `/hydrat/` and the `useDevice`/`usePlatform` hook names anywhere in the
55
+ message. Hydration now means React's own messages (and minified #418/#423/#425);
56
+ an error-boundary crash is `[section-crash]`, same severity, with the section
57
+ and thrown error in the summary and a note that stack line numbers come from the
58
+ capture-time build. Issue ids are unchanged.
59
+ * **A page-height difference is a finding.** Same width, different height was an
60
+ inconclusive low issue that cost nothing, so a candidate missing half a page
61
+ could out-score one that matched. It is now `visual:height:<page>` (low under
62
+ 50 px and 2%, high from 10% of prod's height), still without a pixel diff, and
63
+ `visual:inconclusive:<page>` is no longer emitted for those pages. The run
64
+ summary splits not-compared pages (`height differs` / `not captured` / `other`).
65
+ Scores of runs with such pages go down; that is intended.
66
+ * **`Issue.page` is the `path::viewport` key everywhere.** plp-pagination,
67
+ plp-sorting, not-found-parity, pdp-breadcrumbs, pdp-gallery-related,
68
+ cookie-cep-modal-cls, footer-links-health and http-status orphans filed a full
69
+ URL; it moved to `details`.
70
+ * **`parity capture` no longer inventories placeholders as if they were the page.**
71
+ On a deco (Fresh + htmx) content site the plan listed 4 of the home page's 10
72
+ sections, 2 pages of a 13-route site, one section twice, and names that
73
+ contradicted the markup (an about-us block named `cta-banner`, video embeds
74
+ `testimonials-carousel`, a blog listing typed `plp`). Four causes, each fixed:
75
+ - Sections are found by what the page declares: `data-manifest-key` /
76
+ `data-section` give the component its name and a `liveType`, with
77
+ `nameFrom: "manifest"`; guessed names are `nameFrom: "heuristic"` and the LLM
78
+ relabel pass never touches a declared one.
79
+ - One component per live section: a lazy wrapper holding only the section is
80
+ recorded as `wrapperSelector`, and the list/slides inside a section become its
81
+ `children` rather than sibling rows.
82
+ - Deferred sections are resolved before inventory (scroll, then a direct request
83
+ of the `hx-get` URL, nested, depth-capped). Each component records
84
+ `deferred: rendered | fetched`; each page records a `deferral` with counts and
85
+ the unresolved selectors, and `complete: false` marks a partial inventory.
86
+ `parity html` resolves them too (`--no-resolve-deferred` opts out).
87
+ - Per-component screenshots cropped the shared full-page capture at
88
+ viewport-relative coordinates after scrolling the component into view, so every
89
+ component below the first screen showed the wrong region (a neighbouring
90
+ section). The crop now uses page coordinates.
91
+ * **Page kind has evidence.** A storefront kind (`plp`, `pdp`) is only assigned on
92
+ a `commerce` site profile; a content site's listing or about page is `other`.
93
+ `pages[].kindEvidence` records the decision. `category-auto` no longer hard-codes
94
+ `plp`.
95
+
28
96
 
29
97
  ### Changed
30
98