Repository navigation
feat(content): check a page's quality and brand facts on the server before an agent takes it live - #1979
Merged
Conversation
…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]>
…efore an agent takes it live AUTONOMOUS-GO-LIVE PR 2b-2. lib/content/go-live-gate.ts goLiveGate() gathers, with no one's session, every read the Content Editor's scores take (the draft, its authors, inputs, sources, rules, confirmations, own images and catalog product; its links, claims, page read, sources' kinds, brand facts and site trust from the server's go-live reads, made on the agent run's budget when none is kept) and scores the page with the editor's own qualityState. It holds the page for a click, with why: with Content Quality off, placeholders or fields a CMS won't take, suggestions waiting, a read that couldn't be made, a fact that differs from an approved one or one stated with none approved, a score under 60 or an average under 75. A score with nothing to judge is left out, as the editor's average leaves it. To read the page as the editor does on the server: the catalog match takes a client (catalog-match.ts), the editor's StarterKit options and the HTML block's node schema move to lib (the editor uses the same), and textRanges and openSpotPlaces move to lib/content/doc-text.ts with pageDoc(), which parses a page into the editor's document. Nothing calls the gate yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
8 of 13 tasks
# Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx # web/src/lib/content/quality-inputs.test.ts # web/src/lib/content/quality-inputs.ts
8 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AUTONOMOUS-GO-LIVE PR 2b-2: the server checks a page's quality and brand facts before an agent takes it live on its own (§6.2; main's decision A, the owner's 2026-11-02 decisions). Stacked on #1971 (
qualityState); it calls #GOLIVE2B1's endpoint by URL. No migration. Nothing calls the gate yet; PR 5's go-live step will.What changes
lib/content/go-live-gate.tsgoLiveGate(input)decides, with no one's session, whether a page passes. In order, the first that fails holds the page for a click, with why:quality_off: Content Quality isn't on.placeholders/fields: the page as Send to CMS would send it (getContentDraftPackageFor, i.e.bulkCmsItems' problem).suggestions: suggestions on the draft still wait for review (status = 'open').quality_unread: a read the scores need couldn't be made. That covers an AI read that failed or hit the run's cap or the month's budget, claims or sources' kinds not all read, a paused or limited page read, or a database read failure. What can't be counted never passes (main's rule).facts: a price, trial or founding year that differs from an approved brand fact.facts_unchecked: no approved facts, and the page states one of those (read wide, the safe side).qualityLow: E-E-A-T, Trust or Readability under 60 (the lowest is named).quality: their average under 75. A score with nothing to judge on the page (no check applies) is left out, as the editor's Quality average leaves it. No score at all can't pass.content_draft_sources, which allows the service role), My rules, confirmations, own images, the catalog product;qualityState.ruleSet,activeRules,checkRule), counted withpageTextLength(its type rules don't read the length).pageDoc()parses the page with the editor's StarterKit options, tables, images, JSON-LD and HTML block nodes.catalog-match.tscatalogMatchFor(client, …). The editor's action calls it with the person's session, the gate with the service role.EDITOR_STARTER_KIT) and the HTML block's node schema (HtmlBlockNode) move tolib, and the editor uses the same.textRangesandopenSpotPlacesmove tolib/content/doc-text.ts; the editor files re-export them.Related issue
None. AUTONOMOUS-GO-LIVE spec, PR 2 (2b, web part).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Unit tests:
go-live-gate(13):doc-text: the editor's nodes, and the open spots counted as the editor counts them.page.test.tsx.No visible change, no Help article, no AI call in tests.
Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)CI passed on this branch (fedd283), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41362908270): schema is up to date; web
format:check, lint, typecheck, all tests andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code