Skip to content

feat(content-editor): give a product page its Product schema with the price it states (CE-053, part a) - #1497

Merged
gkhngyk merged 127 commits into
ansvisor:mainfrom
cihan-gyk:feature/quality-product-schema
Oct 25, 2026
Merged

gkhngyk merged 127 commits into
ansvisor:mainfrom
cihan-gyk:feature/quality-product-schema

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Quality Phase 3, CE-053, part a: a product page's Product schema with the price it states.

Stacked on #1496 (CE-052 part d) → #1495 → #1494 → #1491. This PR's own change is the last five commits. Everything is behind NEXT_PUBLIC_CONTENT_QUALITY_PHASE=3.

Spec §11, product pages: "Schema: Product + Offer (price, availability)". Before you publish gave articles their Article JSON-LD (CE-041). A product page got nothing to paste. Now it gets its Product.

What the Product has (web/src/lib/content/page-schema.ts). Nothing in it is made up:

  • name: the title. Without a name there's no code and no Copy. A row says "Product schema needs the product's name". A placeholder in the title counts as no name, the same rule as an article's headline.
  • description: the opening paragraph, past a byline, up to 500 characters. It's left out while a placeholder is in it.
  • image: the person's own images on the page (CE-049), otherwise its first https image.
  • brand: the brand's name.
  • offers: an Offer with the page's price, or an AggregateOffer (low and high) for a range the page writes as one ("$119–$139"). With no price there's no code. A row says "Product schema needs the price" and asks to add it or connect a product feed.
  • Availability, SKU, GTIN and reviews are left out. They come from a product feed and connected reviews, which aren't connected yet (CE-053b is next).

How the price is read (pageOffer). The price is pasted as the product's, so nothing is guessed.

  • Each amount is judged by the words just before and after it, not by its whole sentence, so a sentence keeps its price beside one that isn't the product's:
    • a sale: "$129 (was $159)", "Regular price $159.00 Sale price $129.00", "Au lieu de 159 €, 129 €";
    • a threshold or shipping: "ships free on orders over $50", "Shipping: $5.99", "+ $9.95 shipping", "zzgl. 4,95 € Versand";
    • financing: "4 interest-free payments of $32.25 with Klarna", "$12/mo with Affirm";
    • a unit price ("$0.50/oz"), a bundle ("2 for $239"), an add-on ("Add a rain cover for $19", "$19, sold separately");
    • a saving, a worth or a reward: "save up to $30", "worth $30", "$13 in rewards";
    • Turkish "₺1.299 yerine ₺999" and "500 TL üzeri".
  • What is the price stays the price:
    • a tax-inclusive price ("129 € inkl. MwSt.", "KDV dahil");
    • "Extra large: $139", "over-ear headphones", "a 2-person tent";
    • "Ridge 28 $129" and "Ridge 28 – $129" both give $129;
    • free shipping is no bill.
  • An old price ("Regular price", "reg.", "compare at") is dropped only beside one lower price in its block that reads as its sale. Otherwise it is a price like the others, so "Regular price $129" alone is the price. "Regular" alone is a size.
  • A member's, a subscriber's or a code's price, a unit price ("Grundpreis", "/ per 100g"), a deposit's balance and PayPal's Pay in 4 aren't the price.
  • Currencies: "CAD $129", "$129.00 CAD", "MX$1,299", "CHF 1'299.–". A bare "$" reads as US dollars, and the note says so.
  • A price by the month or the year is a plan's, not a product's.
  • Prices that differ ("Small: $119", "Large: $139", two currencies, or an amount this reading missed), a from-price ("From $119", "As low as", "A partir de"), a loosely written range ("119 – 139 €") and an amount a number may be written onto ("PlayStation 5 549,99 €", "Ridge 28 € 129") are not guessed. Before you publish lists them under "Product schema needs one price" and asks for the price once, or the range written as one, or a connected product feed. No code is offered.
  • brand-facts.ts:
    • new priceRanges. A range with one currency needs a dash and no space ("$119–139"), and nothing joined to its end, so "$19 - 100% cotton" isn't a range.
    • pagePrices reads "Ridge 28 $129" as $129 (not "28 $"), and takes { rangeEnds } for priceRanges' readers.
    • Trust's brand facts are otherwise unchanged.

Where it shows

  • Before you publish, on a product page, has the Product row, which names the price it read ("Price read from the page: $129. Check it's the product's."), and its JSON-LD to copy. The note says to check the price, its currency and the images against the shop; a "$" reads as US dollars.
  • Export's Before you publish line names the Product schema.

Pre-push review fixes (the last two commits):

  • no Product without a name;
  • each amount read by its own words, not its sentence;
  • prices that differ are asked about, not guessed;
  • explicit ranges only;
  • from-prices, loose ranges and numbers written onto a price are asked about;
  • currency codes and Swiss apostrophes;
  • the price shown in the row;
  • no offerCount, since one price can stand for several offers;
  • the description's placeholder;
  • the currency note;
  • the Export line only where there's code.

Related issue

Quality spec (Drive), Phase 3, CE-053 (part a). Stacked on #1496.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Use phase 3. Open a draft with page type Product page, titled e.g. "Ridge 28 daypack", with "It costs $129, or 4 payments of $32.25 with Klarna. Free shipping on orders over $50."
  2. Open Before you publish. "Product schema with its price" is shown, and the JSON-LD has the name, the opening paragraph, the images, the brand and "price": "129.00", "priceCurrency": "USD".
  3. Add "Large: $139". The code is replaced by "Product schema needs one price ($129, $139)". Change the prices to "Sizes run $129–$139." to get an AggregateOffer from 129.00 to 139.00.
  4. Remove the prices: "Product schema needs the price", with no code. Put "[model name]" in the title: "Product schema needs the product's name".
  5. On a blog post, the Article schema is as before.

The browser check (both themes, 1024 px) is still owed, batched with the Quality PRs.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Web: yarn test (3,838 passed) and yarn build pass.

🤖 Generated with Claude Code

cihan-gyk and others added 30 commits October 24, 2026 13:18
…he weak ones (CE-046, part a)

Quality phase 2 (NEXT_PUBLIC_CONTENT_QUALITY_PHASE=2), by rules only:

- sourceClass(): primary (official, research, standards), secondary (news,
  reviews, Wikipedia), weak (forums, social posts, uploaded papers), a
  competitor's page (primary on a comparison) or the brand's own; an
  address the rules can't place is left out (an AI read comes in part b)
- Trust's primarySources (15) and noWeakSources (10); two placed sources
  score Trust on their own
- Quality suggests replacing weak sources (Show, Keep) and adding a
  primary one, once Trust is scored; the editor underlines weak sources
  in amber (a decoration: never exported)
- 00263: content_drafts.kept_sources (≤ 50) and content_draft_keep_source()
- byUrl keeps a link's first place, so Show goes there

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… with AI (CE-046, part b)

Quality phase 2 (web NEXT_PUBLIC_CONTENT_QUALITY_PHASE and server
CONTENT_QUALITY_PHASE at 2):

- POST /api/content-pages/source-classes reads the sites a draft links
  (as saved) that the editor's rules can't place: the model sees each
  site's address alone and answers primary, secondary or weak; each read
  is kept for every workspace 90 days (00264 content_source_classes); 20
  sites a read, 30 reads a draft a day, its own rate limit
- the reads draw on the AI budget as their own feature, "quality" (00264
  widens prompt_improve_usage.feature): a small hold (holdUsd), left out
  of the median that sizes other calls' holds and the Improve tab's
  estimate; a read cut off by its timeout keeps its hold; Billing lists it
- the editor asks 3 s after a save (useSourceClasses), Trust takes the
  reads for sites the rules can't place, the weak-sources suggestion is
  tagged "AI check", and a spent budget pauses the reads with a note

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rce-classes-ai

# Conflicts:
#	supabase/schema.sql
#	web/messages/en.json
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.test.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.tsx
#	web/src/lib/actions/content-drafts.test.ts
#	web/src/lib/content/quality-checks.test.ts
#	web/src/lib/content/quality-checks.ts
#	web/src/lib/content/source-class.ts
#	web/src/types/supabase.ts
…a day, and skip kept sources (CE-046, part b review)

- SITE_NAME (LDH, a dot, a letter TLD; no IP, no single label) in
  keptSite/linkedSites, the editor's unplacedSites and 00264's check; a
  label that reads as words isn't asked about either
- the model may answer unknown, which Trust leaves out; it, and a site
  the model left out, is kept a day, so it isn't asked again (and
  charged) after every save
- a site whose every link the person kept isn't asked about (route and
  editor); a kept link counts in Trust with or without a read
- a failed classifyDraftSources call lets its sites go (.catch/.finally)
- .env.example: phase 2 turns the AI source reads on, from the AI budget

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rce-classes-ai

# Conflicts:
#	supabase/schema.sql
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
…ept by the paragraph (CE-045, part a)

Quality phase 2 (CONTENT_QUALITY_PHASE at 2), server side:

- POST /api/content-pages/claims reads the draft as saved: each paragraph
  and list item long enough to hold a claim; the model finds what a reader
  would want a source for (number, stat, superlative, fact), each claim in
  the paragraph's own words or dropped, five a paragraph at most
- 00266 content_quality_claims keeps the reads by draft and paragraph
  hash: an unchanged paragraph isn't read again, a removed one's row goes;
  the paragraph being written (skip) waits; 12 paragraphs a call, 2 calls
  an ask, one after the other
- the calls draw on the AI budget as "quality" (holdUsd 0.004), and share
  one day's cap per draft with the source kinds' reads
  (content-quality-calls.js, QUALITY_CALLS_PER_DAY 60)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s too, and keep a missed answer as read (CE-045, part a review)

- draftParagraphs reads p, li, blockquote, td and th as trustBlocks does,
  with ownText's spacing (a line break, sibling paragraphs): the answer is
  { paragraphs: [{ text, claims }] }, so the editor knows each claim's block
- blocks from 12 characters ("Award-winning support"); a call takes 12
  paragraphs or 6,000 characters, whichever comes first
- an answer billed that missed the schema is charged and its paragraphs
  read with none (not sent, and charged, on every save); a kind the editor
  doesn't know drops that claim only; a paragraph answered twice keeps both
- claims leave 10 of the day's Quality calls to the sources' kinds, and the
  route has its own limiter; the reading's version is in the hash; logs
  carry no page words

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…underline the unsourced ones (CE-045, part b)

The editor asks the API for the claims a few seconds after a save (never
with changes to save), leaving the block being written until the person
leaves it. Trust counts each claim in its own block as a figure, the
draft underlines the unsourced ones in their blocks, and Quality's
suggestion gets Add source (link dialog on the claim's words) and Remove.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… per site (CE-046, part b review)

One generateObject per site the rules can't place, run together with
Promise.allSettled: no site's name reaches another's read, and a failed
site keeps the others' reads. Each read holds $0.0005; the day's cap
counts sites (SOURCE_READS_PER_DAY = 40). An answer off the schema is
charged and kept as unknown for a day. The route logs an error's name
and message only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-claims

# Conflicts:
#	server/src/lib/content-source-class.js
…tch claims across curly quotes, log no page words (CE-045, part a review)

- 00266 gets a `missed` column: an answer that missed the schema (cut
  short, or blocked by the provider's filter) keeps its paragraphs as read
  with no claims, and they're read again after MISSED_DAYS (1).
- keptClaims compares folded copies (’ ‘ → ', “ ” → ", ‐ ‑ – — → -),
  one character for one, and keeps the paragraph's own span.
- The claims route logs an error's name and message only: a provider's
  error carries the request, the page's paragraphs.
- QUALITY_CALLS_PER_DAY = 90, the claims leaving the sources'
  SOURCE_READS_PER_DAY (40) now that each site is a call: the claims keep
  their 50 calls a day.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d log no whole error (CE-046, part b review)

When no site is read, the error thrown is a spent budget's if any (429,
the editor pauses) rather than the first site's. An ask reads its sites
five at a time, so 20 holds and their queries don't go out at once. A
site's hold is $0.001 (the model's thinking is billed as output). The
route's error log keeps the stack, not the provider's request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-claims

# Conflicts:
#	server/src/lib/content-source-class.js
…er the new ones, and fold more quote and dash forms (CE-045, part a review)

A paragraph whose answer missed the schema is read again after a day in
a call of its own, after the paragraphs not read yet: one the provider's
filter blocks no longer keeps its neighbours unread every day. The fold
also covers low quotes, primes, figure and horizontal-bar dashes and the
minus sign. The claims route keeps the error's stack in its log. Tests
pin the select's columns, both fold directions and the route's log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…roduct pages, kept for approval (00269, CE-047, part a)

Quality phase 2, CE-047: the brand's prices and plans, trial, founding
year and claims, read from its own site for Trust's "consistent with
brand facts" check. The model finds the facts and copies each one's
words; a fact is kept only when its words are on the page as written,
and its value (amount, currency, period, days, year) is read from them
by rule. A person approves each one.

- 00269: brand_facts (members read, and change only the status, as
  themselves) and brand_fact_pages (server-only: a hash of each page's
  text, so an unchanged page isn't read by the model again; no text
  kept).
- brand-facts.js: findFactPages (page list, Site trust's About page,
  else probes on the main domain; never Scrape.do), factText, keptFacts,
  refreshBrandFacts (new values pending, approved ones gone from the
  site marked gone, pending ones dropped), readBrandFacts (first ask
  reads, asking again every 10 minutes at most), setFactStatus.
- GET /api/brand-facts, POST /fetch, PATCH /:id behind phase 2, with
  their own limiter; logs carry no page text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…47, part c)

Brand settings › Brand facts, with Quality's phase 2: the facts the API
read from the brand's own pricing, About and product pages, each with
its words on the page, where it was read and the approved value it would
replace ("Was $59"). A member approves or rejects each one (no approve
all: the spec has each approved); approved facts no longer on the site
say so. Each page's read is listed (read, not found, turned our reader
away, didn't answer); Read again reads the site again once the API
allows it, and a spent AI budget says so. `?tab=facts` opens the tab,
for the editor's to-do to link to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… still has, and store no wrong price (CE-047, part a review)

- factText walks the page once and stops near MAX_TEXT_CHARS: a page of
  100k blocks reads in well under a second (was quadratic). Struck-through
  old prices (del, s, strike) are left out.
- A fact still on any page read (its words, a price's with its plan near
  them; across a card's lines too) stays; only facts whose page was read
  and has them no more are marked gone or dropped, written once.
- A plan's name is found on the folded text without lowering it (a
  Turkish "İ" lowers to two characters), and a quote only where it
  doesn't run into a number ("$49" in "$499", "$1,2").
- parsePrice reads one price only, no saving, discount or old price, a
  dollar named by its code after it ("$49 CAD"), and the period in the
  words right after it, the first named ("Lifetime access, monthly
  updates" is once). Magnitudes in any case; a trial needs a trial word,
  "started in" is no founding year.
- A page read after a wall or a failure says "ok" again; a missed
  answer's hash isn't kept past a failed read. A changed page goes to the
  model once an hour at most (MODEL_EVERY_MS). A page that failed (or a
  spent budget) is read again at the next ask after RECHECK_MS.
- Facts are written before the pages' hashes; source_url is cut to 2048.
- A listed page that no longer answers falls back to the usual
  addresses; a probe that is the home page again isn't read as one.
- readPage maps not-HTML, refused and redirect-loop reads to not_found;
  401/403/429 to blocked, 5xx to failed. setFactStatus answers 404 for a
  fact removed meanwhile.
- GET has no bucket of its own (the editor reads it as its tab comes
  back); POST /fetch keeps brandFactsLimiter.
- 00269: each kind's value checked (amount ≥ 0, currency, days, year),
  source_url http(s) only, a member's reviewed_at within a minute of now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Trust, with an Approve to-do (CE-047, part d)

Trust's "consistent with brand facts" (10 points, phase 2): the page's
prices, trial and founding year against the brand's approved facts still
on its site, read so as not to cry wolf: a price in its own currency
only, against a plan's prices (any of them: monthly and annual billing
both count) when the sentence names the plan, else only when it names
the brand (or "we") with a period; "from $29" against the lowest price;
no sentence naming a competitor; discounts, scales and ranges aren't
prices. Like a working link, it doesn't score Trust on its own.

- A mismatch is Quality's suggestion, "Price differs from brand facts ·
  Page $39 · pricing page $49", with Show on its sentence.
- "Approve {n} brand facts" is the person's to-do while facts wait, with
  Review linking to Brand settings › Brand facts (the to-do row and the
  next-step nudge, not Settings › Authors).
- useBrandFacts reads them once with phase 2 and again when the tab
  comes back from Brand settings; the next-step reads wait for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… after a review, and do one thing at a time (CE-047, part c review)

- settings/layout.tsx sets maxDuration 300: the first read and Read
  again wait while the API reads the site (pages, then the model).
- A review updates the list in place (no read that could read the whole
  site again); a failed one reads the list as kept, a fact a read
  removed meanwhile gone from it. Approve, Reject and Read again don't
  run at once; the row being saved says so (aria-busy).
- An API with brand facts off says they aren't available yet; a thrown
  action shows the failure instead of loading for ever.
- Page links read as the page's name; sections are labelled by their
  heading; the quote marks and the page status separator are messages;
  "missed" and the paused note say when the read comes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…after a price, and read brand facts once at a time (CE-047, part a review 2)

- A page under 200 characters (one its scripts write, a wall not told
  apart) leaves its facts as they are on every read, not only the first.
- A currency code or a scale right after a quote is read ("$49" then
  "CAD per month" is CAD; "$2" then "million" is no price); only "off"
  right after a price drops it (the next card's "Save 20%" doesn't). A
  period is named within 24 characters of the price, the first one
  named; "per active user" is per seat.
- A plan's name matches as whole words ("Pro" isn't in "Product"); a
  quote isn't taken inside another mark's dollar ("C$49") or a
  space-grouped number ("299 €" in "1 299 €").
- factText counts words toward its length, not indentation.
- A page whose model read failed waits MODEL_EVERY_MS like any other;
  a GET reads a failed page again behind its answer, not before it.
- New facts get the room the removed ones leave; a page whose new facts
  didn't fit keeps its old hash, to be read again. A kind no longer read
  (a shop's product page) loses its row.
- refreshOnce: one read per brand at a time, for the tab and the weekly
  read alike.
- 00269: a missing key is a check violation, and numbers compare as
  numeric (no cast error).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…de the price, the brand's own trial and founding year only (CE-047, part d review)

- A price is compared with the plan named nearest it, its name as the
  page writes it (case too); a plan that is an everyday word ("Pro",
  "Team", "Free", "Growth") only beside "plan"/"tier" or with the brand
  named. With no plan, only a sentence naming the brand and saying what
  it costs; no "we/our" path. Free ($0) is never compared; "from $19"
  matches any approved price.
- A sentence with an old price, a saving, a discount, credits, tax or a
  team's bill ("was $49", "incl. VAT", "5 users pay") isn't read for
  prices; "billed monthly/annually" narrows to that billing.
- Ranges need a number before the dash or word (French "à", Turkish
  "ile", "between … and"), so "Pro – $49" is a price again; an amount
  doesn't start inside a number.
- A trial is compared where it is the brand's ("your free trial",
  "every plan", its name), its days right beside the trial; a founding
  year right after "founded", with the brand named or "we were founded".
- Each sentence once. The to-do is last (the brand's, no points of the
  page's), "Review your brand facts" at 0 and "reviewed" when done.
- useBrandFacts fails instead of loading for ever when the action throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk and others added 13 commits October 25, 2026 11:54
…nd tell the agent each type rule's aim (CE-052)

- shippingOnPage reads the page's HTML, headings too, for a policy's
  terms ("free shipping", "delivery in 2 days", "30-day returns",
  "iade"), not "ships with a cable", "in return" or "return on
  investment"; Turkish capitals ("İade") and links like
  /shipping_policy, #versandkosten, /reembolso count.
- The type rules check carries each rule's aim and how the page reads now
  (shared with Fix open rules: aimAndNow), so Hand off tells the agent
  what to meet; a table of facts gets only the facts given, placeholders
  for the rest.
- Fit questions are read in English only: another language's page isn't
  scored on them (the Rules tab says so, as for the definition rule).
- The product and category lines name what they count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-type-weights

# Conflicts:
#	supabase/schema.sql
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.test.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_side-panel.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
#	web/src/lib/content/quality-checks.ts
#	web/src/lib/content/quality-todos.test.ts
#	web/src/lib/content/quality-todos.ts
…ed, with Add line (CE-052, part c)

Spec §11 wants a comparison's check date visible. E-E-A-T reads one on the
page (a "checked/tested/updated" word with a year from the last two, in
the nine languages the disclosure has) as its own check, weighed on
comparisons (20). Only the person knows when they checked, so it's a
to-do: "Show when you last checked", whose Add line (in Quality and the
nudge) puts "Last checked: {Month YYYY}." in the page's language under
the opening paragraph, where the disclosure goes (addLineUnderAnswer). A
language without a line asks the person to write it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…stale one (CE-052)

- The check date is read as a verb or a label ("Last update", "Son
  güncelleme", "Letzte Aktualisierung", "Dernière mise à jour"), each word
  at a word's start ("areas of", "untested" aren't one), Turkish capitals
  too; in a block longer than a label, the year must be near the word.
- Add line replaces a check date the page has already (an old one) rather
  than adding a second, and isn't offered while the HTML view is open.
- The line has no full stop, so Answer first reads past it as a date.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ust link it (00279, CE-052, part d)

Spec §11: what Quality can't verify becomes a confirm step, never a pass;
customer logos and cases need the customer's permission to publish, which
only the person knows.

- 00279 content_draft_confirmations: what a member confirmed that only
  they can (a customer case; category intro facts next, CE-054), by kind
  and key, with who and when; members read their drafts' and insert as
  themselves, now; 50 a draft; no update or delete.
- In Phase 3, a proof ask of a customer case is that confirm ("Confirm you
  may publish the customer case …", Confirm in Quality and the nudge),
  done once confirmed, linked or not.
- E-E-A-T counts the share of the page's customer cases confirmed
  (customerCase), weighed on feature pages (25); E-E-A-T waits for the
  confirms' read in Phase 3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…keep its sentence the person's (CE-052)

- A confirm is keyed by the case's claim alone (caseKey), so fixing a typo
  in its paragraph keeps it, and re-confirms don't fill the 50.
- A customer case's sentence, confirmed or not, stays out of Trust's
  agent-fixable suggestions: Hand off never sources or removes a case the
  person confirms (QualityRead.caseSentences).
- A case's to-do waits for the confirms' read (casesRead), so one
  confirmed before doesn't show open; E-E-A-T waits for it too, and a
  failed read counts the confirms made so far.
- The feature line names the customer cases it counts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… price it states (CE-053, part a)

Spec §11 (Phase 3): a product page's schema is Product + Offer. Before you
publish gives it on product pages, from the page as written:

- name from the title (left out while it has a placeholder), description
  from the opening paragraph (past a byline, up to 500 characters), the
  person's own images (CE-049) else the first, the brand;
- the price the page states (pageOffer): one price is an Offer, several in
  one currency an AggregateOffer; an old price, a saving, an add-on, a
  shipping threshold or a minimum order isn't one.
- A page that states no price (or prices in more than one currency) gets
  no code: the row asks for the price, or a product feed. Availability,
  SKU, GTIN and reviews wait for a connected feed and reviews; none is
  made up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…amount, and give no Product without its name (CE-053)

- Product needs a name: no code or Copy without one, and a row saying so.
- Each amount is judged by the words just before and after it, not the
  whole sentence: a sale keeps its price ("$129 (was $159)"), a threshold,
  shipping, financing, a unit price, a bundle or an add-on drop only their
  own amount, and a tax-inclusive price or "Extra large" stays a price.
- A range ("$119–$139", "119–139 €") gives low and high (priceRanges);
  no offerCount, as a price can stand for several offers.
- A placeholder in the opening paragraph leaves the description out.
- Export's Before you publish line names the Product schema; the note
  says a "$" reads as US dollars.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s one, and ask which where prices differ (CE-053)

A price in the Product schema is pasted as the product's, so nothing is
guessed:
- Prices that differ (sizes, or an amount the reading missed) are no
  range: Before you publish lists them and asks for the price once, or
  as a range written as one ("$119–$139").
- An old price ("Regular price", "Original price", "reg.") counts only
  where the page gives no other; "au lieu de", "antes", "bisher",
  "eski fiyat" are old prices too.
- An amount added to the price ("+ $9.95 shipping", "zzgl. 4,95 €
  Versand", "$4 tax"), a saving, a worth or a reward ("save up to",
  "worth", "$30 value", "in rewards", "trade-in") and a threshold
  ("Versand ab 50 €", "Min. order") aren't the price.
- Free shipping is no bill ("with free shipping costs $129").
- "Ridge 28 $129" is $129, not 28 $; "Ridge 28 – $129" is a price.
- A range with one currency needs a dash and no space ("$119–139"), and
  no word joined to its end ("$19 - 100% cotton", "$25-30-day").
- A range by the month ("10–20 € pro Monat", "monthly") is a plan's.
- Export names the Product schema only where Before you publish has its
  code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ask about "from" prices and loose ranges (CE-053)

- A currency after an amount stays with it unless a digit follows at
  once: "129,00 € 159,00 €", "999 TL 3 taksit" and "Pro 49 € 10 Nutzer"
  read the right amount (Trust's brand facts too).
- "$129.00 CAD": a code after a sign says whose dollar it is.
- A range with one currency and a spaced dash or a word ("119 – 139 €",
  "$119 to 139") is no longer read as one of its ends: it, "From $119"
  and other prices the page gives are listed for the person to settle.
  "$129 – 150 reviews" and "€20 – 30 Tage" stay one price.
- "Regular" or "Original" alone is a size; "Regular price" is an old
  price only beside a lower one in its block.
- "S24+: $999.99" keeps its price; "3 min. $129" isn't a minimum order.
- Thresholds and savings in more languages ("über", "superiores a",
  "supérieure à", "orders $50+", "Sie sparen", "Économisez", "3 Raten à",
  "3 plazos de").
- Prices that differ are listed once each ("$129" and "$129.00"), five
  at most.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and show the price read for the person to check (CE-053)

- A space between digits ("PlayStation 5 549,99 €") or a sign after a
  whole amount with a number next ("Ridge 28 € 129") may be another
  number's: the price is listed for the person, not guessed. Cents tie a
  sign to its amount ("129,00 € 2 Jahre Garantie" is 129 €).
- "CAD $129", "MX$1,299": a code before a dollar sign says whose;
  "CHF 1'299.–": an apostrophe groups thousands.
- "From just", "As low as", "begins at", "A partir de", "A partire da",
  "Vanaf", "Ab nur", "'den başlıyor" are from-prices: asked about.
- An old price is dropped only beside one lower price in its block, at
  least 40% of it ("Regular price $129 Unit price $12.90" keeps $129).
- A member's, a subscriber's or a code's price, a unit price ("Grundpreis",
  "/ per 100g"), PayPal's Pay in 4, a balance and an "indirim" amount
  aren't the price.
- A price beside a range must be one of its ends: another product's range
  isn't the product's.
- Before you publish names the price it read ("Price read from the page:
  $129. Check it's the product's.").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 25, 2026
cihan-gyk and others added 9 commits October 25, 2026 13:44
…compared price, and wait for the site before a category's E-E-A-T (CE-052)

Review on ansvisor#1491:
- Where brand facts weigh as much as sourced claims (product and
  category pages), a price compared with them scores Trust: a page with
  every price wrong no longer reads "Not scored yet" and passes Before you
  publish's gate. weighedTrust scores by the weighed checks (trust()
  leaves it unscored by its own). The article (10 to 30) is as it was.
- A category page's E-E-A-T waits for the site's trust, its 40 points of
  the brand's own information (waitsForSiteTrust), so it doesn't jump.
- Copy: a page type under the brand "goes out under {byline}" (Ansvisor
  gives no schema for it); the category line names the brand's own
  information and no longer promises an intro check.
- QUALITY_WEIGHTS_VERSION is gone until calibration reads it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-type-checks

# Conflicts:
#	web/messages/en.json
…eturns in the page's language, and ask for fit only where there are sizes (CE-052)

Review on ansvisor#1494:
- The buying FAQ (and the FAQ rule) is found under its heading in German,
  French, Spanish, Turkish (lowercased the Turkish way), Italian,
  Portuguese and Dutch; another language's page isn't told its FAQ is
  missing (English only), so Hand off never adds one it has.
- shippingOnPage reads the ways shops state their terms: a heading that
  names the policy with text under it ("Delivery & Returns", "Returns &
  Exchanges"), delivery with a time or a cost ("Standard delivery 3–5
  working days", "Free UK delivery on orders over £50"), "Returns are
  accepted", "Expédition sous 24h", "Entrega en 24/48 horas", "Reembolso",
  "Retoure", "Umtausch", "satisfait ou remboursé", "teslim edilir",
  "değişim". Not a bare "shipping" ("Shipping weight"), a product's link
  ("/collections/delivery-bags") or a product named for it ("kargo
  pantolon"). A page in a language the words aren't written for is read
  by its links, and isn't asked without one.
- Answer fit and sizing questions counts only where the page has sizes or
  asks about them ("No sizes" for a coffee grinder).
- Hand off: an answer the page and the data don't give (fit, sizes,
  shipping, returns, prices) is a placeholder, never made up.
- Product Trust weighs brand facts 30 and sourced claims 25 (was 25 and
  30), so a compared price scores a product page's Trust as ansvisor#1491 makes it.
- The feature and comparison lines name their type rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-date

# Conflicts:
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
…read a check date in the words that mean it (CE-052)

Review on ansvisor#1495:
- Add line replaces only its own line from before: a top-level paragraph
  that is one of the nine labels, a month and a year, and nothing else
  (isCheckDateLine). A byline ("By Jane Doe · Updated March 2023"), the
  answer ("We tested 9 CRMs in 2024; …"), a body paragraph or a list item
  stay the person's; the line goes under the answer instead.
- The check date's words in the forms that mean checked: "verification",
  "updates" and "kontrolü" aren't one; "Letzte Prüfung", "Actualisé le",
  "Testato", "Last modified", "Verificado" are.
- The to-do says when the page's date is over a year old ("Update when
  you last checked"), and whether Add line replaces it or the person's
  old date needs updating too (checkDateOnPage).
- The nudge says to check the products first ("show when you last
  checked, once you've checked the products").
- The comparison line names the check date.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er-case

# Conflicts:
#	supabase/schema.sql
#	web/messages/en.json
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
…ep its Trust share in sight, and hand off around it; move the migration to 00280 (CE-052)

Review on ansvisor#1496:
- 00279 is ansvisor#1493's (the catalog's sources): the confirmations migration is
  00280 now (file, header, table comment, schema.sql, comments). Its header
  says the key is the claim's words.
- A confirm counts for its case by its words, not the exact slice the page
  read picked (caseConfirmed): a confirmed claim's words in the case's
  sentence, or the case's claim in a confirmed one's (12 letters at least,
  so a name alone isn't a case). Used by the to-dos and the editor's count
  and open cases alike: a second read picking a longer slice keeps the
  confirm, and spends no other row of the 50.
- A case's to-do says when linking the published case still raises Trust
  (+N Trust), confirmed or not: its sentence is an unsourced claim until
  it's linked.
- Hand off sends the cases' paragraphs as locked passages: the server
  already drops any suggestion that changes one (keepSuggestions), so the
  agent never sources, softens or removes a case the person vouches for.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, with follow-ups to fix before phase 3 goes on.

What I checked:

  • Below phase 3. productSchema (_draft-editor.tsx:963-974) is null unless profileFor returns product, and that needs phase 3. With product null, Before you publish takes today's branches: article, its rows, the Article code and datesNote. Export's product is false, so its line still reads quiet or quietOther. In phase 3, the other page types don't change either.

  • Trust's brand facts. factMismatches is the only other caller of pagePrices. It runs from phase 2 on (useBrandFacts(…, sourcesOn)) and calls pagePrices without rangeEnds, so ranges are still skipped. It doesn't read from or loose. At phase 2, three readings change, and each now reads what the page says:

    • "Ridge 28 $129" is $129 (it was $28);
    • "$129.00 CAD" and "CAD $129" are in CAD;
    • "CHF 1'299" is 1,299.

    When a page's currency no longer matches an approved fact's, that comparison is skipped. It isn't flagged.

  • The JSON-LD. It's built with JSON.stringify, and jsonLdScript escapes every "<", so "</script>" or "<!--" in a title or description can't end the tag.

    • Images are https only: the person's own images filtered to https:// (:966), or else what firstImage finds.
    • There's no code without a name (a placeholder in the title counts as no name) and one price.
    • A placeholder leaves the description out. Availability, SKU, GTIN and reviews are never added.
    • The row names the price it read, and Export names the Product schema only when there's code.
  • The price reader, tried on shop copy in five languages. These come out right:

    • sale and old prices: "Regular price $159.00 Sale price $129.00", "List Price: $159.00 Price: $129.00 You Save: $30.00", "UVP 159,00 € 129,00 €", "Antes 159 €, ahora 129 €", and "₺1.299" before the Turkish "instead of" "₺999";
    • thresholds: "orders over $50", "Livraison offerte dès 50 €", "versandkostenfrei ab 50 €";
    • financing: "4 interest-free payments of $32.25", "12 x 108,25 TL", "3 Raten à 43 €", "$12/mo with Affirm";
    • unit prices ("€12,90 / 100 g") and bundles ("2 for $239");
    • thousand separators: "$1,299.99", "1.299,00 €", "₺1.299", "CHF 1'299.–";
    • a model number before a price: "iPhone 15 $799", "Galaxy S24 €899".

    From-prices, prices that differ, two currencies, loosely written ranges and "PlayStation 5 549,99 €" are asked about. Items 1, 2, 4 and 5 are the gaps.

  • Merge commit f98a503 changes nothing beyond merging its parents. The PR's own change is web only, with no migration.

Medium, follow-up (please fix before phase 3 goes on):

  1. web/src/lib/content/page-schema.ts:264-285: when the page has only one amount, it's taken as the price, whatever it's said of.

    • A shop's theme usually shows the price outside the description, so a product page in the editor often states none. Then "Pair it with our $19 rain cover." gives "price": "19.00", and "Unlike $200 shells, …" gives 200.
    • The sale rule has the same gap. It drops an old price next to any one lower amount in its block, so "Regular price $129. Matching rain cover, $69." gives $69.
    • The row shows the price and asks the person to check it, but this is a guess, which the reader is meant to avoid.

    Fixes:

    • Count an amount as the product's price only when the page says it is: alone in its block or cell ("$129.00", "129,00 € inkl. MwSt."), or right after a price word or the product's name ("Price:", "costs", "now", "only", "Preis", "prix", "precio", "kostet", "coûte", "cuesta", and the Turkish ones). Ask about any other amount.
    • Drop an old price only for the amount right after it, or one after a sale word ("Sale price", "Now", "jetzt", "ahora").
    • Add both example lines to the tests.
  2. web/src/lib/content/brand-facts.ts:225 and page-schema.ts:297-308: a bare "$" goes into the code as USD, and the row hides that.

    • On a Spanish page from Mexico, Argentina, Chile or Colombia, "$1.299" or "$12.990" is in pesos.
    • On a Canadian or Australian shop, "$129" is in local dollars. "CA $129" and "AU $129" (with a space) aren't read as codes either, because CODE_BEFORE (brand-facts.ts:144) has no CA, AU, NZ or S.
    • The code says "priceCurrency": "USD", but the row says "Price read from the page: $1,299", because offerText writes USD as "$". The note under the code mentions this only in passing.

    Fixes:

    • Show the code in the row, e.g. "USD 1,299" (currencyDisplay: 'code').
    • Pass the draft's language to pageOffer. On a page that isn't in English, treat a bare "$" as unsure, so it's asked about.

Low, follow-up (please fix before phase 3 goes on):

  1. page-schema.ts:353: brand is the shop's own name. That's wrong on a retailer's page, where the product's brand is whoever makes it. Put the shop in offers.seller ({"@type": "Organization", "name": …}), which is right either way. Give brand only when the title names the brand, until the product feed supplies the maker (CE-053b).

  2. _before-publish.tsx:250-266, en.json:4623: a single price the reader isn't sure of is reported as "more than one price".

    • "From $119." alone reads "The page states more than one price ($119)".
    • "999 TL" followed by a number, as in the Turkish "3 installments" line, reads the same way.
    • So does any French or Polish price over 1,000 written the usual local way ("Prix : 1 299,00 €"). The space marks it loose (brand-facts.ts:237), and the only way to clear the row is to write "1299 €".

    Fixes:

    • Give a single unsure price its own row that says why it's asked about (a starting price, or a number that may run into the price).
    • On a French or Polish page, read a space-grouped amount as sure, unless a capitalized word or a model number comes right before it ("PlayStation 5 549,99 €").
    • "Or connect your product feed" (:4621, :4623) points to a fix that nothing uses yet. Leave it out until CE-053b reads the feed.
  3. page-schema.ts:141-174: Turkish written in capitals. The patterns use /iu, which doesn't match the dotted capital I to "i". So in capitals, the Turkish words for "instead of", "over", "free" and "old price" aren't recognized, and words spelled with the dotless i are missed as well. Most such pages end with "Product schema needs one price". When the page states no price of its own, the threshold amount becomes the price (item 1). On a Turkish page, match against a toLocaleLowerCase('tr') copy, as #1494's shipping check does. That copy keeps every character in place, so at stays right.

@github-actions github-actions Bot removed the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 25, 2026
@gkhngyk
gkhngyk merged commit 8f72a8e into ansvisor:main Oct 25, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants