Repository navigation
refactor(content): compute the editor's Quality scores in one shared function - #1971
Merged
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]>
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 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.tsqualityState(reads)computes E-E-A-T, Trust and Readability, and what the editor shows beside them: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
noware given too._draft-editor.tsx: about 25useMemos become oneuseMemo(() => 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 featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
quality-inputs.test.tsholds the editor's code from before the move, aslegacy(). For each case below,qualityStateandlegacyaretoEqual:page.test.tsx(288 tests) passes unchanged.main.No visible change, no Help article.
Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(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 andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code