Skip to content

refactor(content): compute the editor's Quality scores in one shared function - #1971

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:refactor/content-quality-inputs
Nov 2, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:refactor/content-quality-inputs

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

AUTONOMOUS-GO-LIVE PR 2a: the Content Editor's Quality scores move into one shared, pure function, so PR 2b's server gate for an agent going live on its own computes them exactly as the editor does (§6.2; main's decision A). No visible change: the scores are the same, shown by test.

What changes

  • lib/content/quality-inputs.ts qualityState(reads) computes E-E-A-T, Trust and Readability, and what the editor shows beside them:

    • the inputs used;
    • the fact check;
    • proof asks;
    • the page read's AI checks;
    • check date, shipping;
    • customer cases, intro facts;
    • visual proof;
    • Product schema, feed check;
    • the source read.

    Every read is given, null while it isn't in (the score waits, as before) or doesn't apply. The page's language, type, phase and now are given too.

  • _draft-editor.tsx: about 25 useMemos become one useMemo(() => qualityState({...})) after its reads (scores), destructured into the same names. The reads and their hooks don't change, nor does any UI.

Related issue

None. AUTONOMOUS-GO-LIVE spec, PR 2 (split into 2a and 2b).

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

  • quality-inputs.test.ts holds the editor's code from before the move, as legacy(). For each case below, qualityState and legacy are toEqual:
    • four sample pages (article, product page, category page, comparison) in phases 1, 2 and 3;
    • each read still pending (authors, inputs, brand domains, own images, cases, the page read, site trust, facts);
    • a product page with a feed product;
    • Quality off.
  • The editor's own page.test.tsx (288 tests) passes unchanged.
  • Open a draft in the Content Editor: the Quality chip and tab show the same scores as on main.

No visible change, no Help article.

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • yarn lint passes
  • yarn typecheck passes
  • yarn format:check passes
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change)

CI passed on this branch (ee6ced6), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41358861217): schema is up to date; web format:check, lint, typecheck, all tests and yarn build pass; server lint, format:check and all tests pass.

🤖 Generated with Claude Code

…function

AUTONOMOUS-GO-LIVE PR 2a. lib/content/quality-inputs.ts qualityState()
computes E-E-A-T, Trust and Readability and what the editor shows beside
them from the reads the editor holds, so PR 2b's server gate for an agent
going live on its own computes them exactly as the editor does. The
editor's two dozen memos become one call after its reads; nothing on
screen changes. quality-inputs.test.ts keeps the editor's code from before
the move and shows both give the same values for four page types in each
phase, for every read still pending, and with Quality off.

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.

LGTM

@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.

LGTM

@gkhngyk
gkhngyk merged commit 2c0bcab into ansvisor:main Nov 2, 2026
6 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