Repository navigation
feat(content): estimate a draft's Site Audit score in the editor, free, with AI checks on request (item 9) - #1955
Conversation
…d then the page in one run (item 9) Customer priorities item 9: an opportunity to a draft written from a brief took six clicks. Write this, in a row's menu and as the panel's main button, does it in one: a dialog says what happens and about how much of the month's AI usage it takes, then the draft starts as Start opens it and the Content Agent builds its brief (the editor's Build brief, holding the draft's claim so Stop lets go of it) and writes the page from it, or suggests changes to the existing page an opportunity names. A brief that can't be built leaves the page written from what there is. The AI usage answer adds what Write this typically takes, as a share of the budget (ai-estimates.js); the editor's wait screen shows the brief's run first. Help: opportunity details and content opportunities. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e, with AI checks on request (item 9) Customer priorities item 9: no Site Audit score of a draft existed before it was published. An Audit chip in the editor's header, there whatever Quality's phase, and a card in Quality now estimate it: the audit's own checks run on the page as Export's HTML file has it, read again once typing pauses, for free; the checks of the whole site (robots.txt, llms.txt, HTTPS, the theme's tags and links) come from the brand's latest completed audit, and are left out without one, as leaving them out alone ran 17 points under the full audit on the dev audits against about 6. Estimate AI checks runs the 13 checks AI reads on Quality's AI usage; the verdicts come back with each later reading, so the score keeps them. Server: POST /api/content-drafts/:id/audit-estimate (draft-estimate.js, its own rate limit), evaluateLlmSignals reports its tokens for charging, and the AI usage answer adds what the AI checks typically take. Write this's dialog names the estimate. Help: Content Editor, page quality, opportunity details. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # web/src/lib/help/approved-articles.json
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # server/src/lib/audit/llm-signals.js
|
This conflicts with main in |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…om since ansvisor#1944 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reworked on top of #1919's On the cache, yes, that's intended: the estimate reads and writes the verdict cache through |
… keep its verdicts' ref out of render The estimate's route is open to the demo brand's sample drafts (its page checks are free and write nothing), and its AI checks, which spend, refuse the demo brand in the route itself (402 demo_brand). The hook keeps the latest AI verdicts in its ref from an effect, not while rendering. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
CI fixes (b98311f):
Locally: full server tests, web |
# Conflicts: # help/content/opportunity-details.md # server/src/lib/ai-estimates.js # server/src/lib/ai-estimates.test.js # server/src/routes/billing.js # server/src/routes/billing.test.js # web/messages/en.json # web/src/components/content/write-this-dialog.test.tsx # web/src/lib/billing/ai-usage.ts # web/src/lib/help/approved-articles.json
Summary
Customer priorities, item 9, part 2: the Content Editor estimates the draft's Site Audit score, for free, before it is published. Stacked on #1954. No migration.
What changes
server/src/lib/audit/draft-estimate.js):reserveAiBudget, its share shown). The verdicts come back with each later reading, so the score keeps them.POST /api/content-drafts/:id/audit-estimate, with its own rate limit.evaluateLlmSignalsreports its tokens for charging.Related issue
None. Customer priorities plan, item 9.
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
draft-estimate, the route (free, AI charged, verdicts kept, refusals),ai-estimates, the client, the hook and card, the editor page.Checked in the browser at 1024px, light and dark, with the estimate served by a local stand-in running this branch's code; its AI checks were sample verdicts, with no AI call. The owner approved the screens.
Checklist
yarn lintpasses (0 errors; 7 old warnings in files this PR doesn't touch)yarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)Full checks: CI passed on this PR (b98311f): schema is up to date; web
format:check, lint, typecheck, tests andyarn buildpass; server lint,format:checkand tests pass.🤖 Generated with Claude Code