Repository navigation
feat(action-center): judge a Site Audit fix by its pages audited again since it closed (learning A2) - #1689
Merged
Conversation
… measured result Learning phase A, A3 (the agentic learning report, gaps 2 and 4). An action's result compared its metrics before and after, but never asked the question closest to its own aim: did the signals that raised it end? Signals close as resolved (the condition gone) or resolved with `supersededBy` (still there, as another kind), and that never reached the outcome. - validate.js: when an action is measured, signalOutcome reads its signals through action_signals and keeps the counts in `validation.signals`: total, ended, replaced, dismissed, open. An action with no metric to measure keeps them too (its validation was null). An action no signal raised (sent from Content, Insights…) has none. - History's drawer says it under Result: "Of the 4 signals that raised it, when measured: 2 ended, 1 turned into another, 1 still open." - The Action Center guide says so. The outcome itself is unchanged; A4 decides what counts as improved. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…pages it names, brand-wide beside
Learning phase A, A1 (the report's gap 2). The night engine's actions
were measured on the whole brand's figures, so "recover 6 prompts" was
judged by every prompt the brand tracks, and a small real effect drowned
in the rest. Their targets are in the payload already.
- validate.js: an action whose payload's targetEntity is 'prompts' or
'pages' (targetScope) is measured on those targets with the basket
measure the actions sent from Content use: every target it counts
(targetIds, else targets), prompt ids as uuids, a page written as a
path read on the brand's primary domain. The metrics are its basket
KPIs that the action names (all six when it names none). The brand-wide
figures over the same windows are kept as `brandWide`, and
`scope: { kind: 'targets', entity, prompts, pages }` says what it was.
- A basket that measured nothing (no answers in either window) leaves the
action to the brand-wide measure, as before; so does any other target
(competitors, sources…).
- History's drawer: "Measured on the 2 prompts it named." under Result, and
"Brand-wide over the same days: Citations 100 → 104" under the cards.
- The guide says so.
Stacked on feature/outcome-signals-resolved (A3): both change
validateAction.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n since it closed
Learning phase A, A2 (the report's gap 3). F01, F03 and F10 had no metric
to measure (their signals name none), so their result always read "could
not be measured", and the audit's own answer was never asked: does the
page pass now? (A1 already measures them on their pages' citations and AI
sessions, which rarely move in a week for a technical fix.)
- audit-recheck.js: for each page target that names the checks that
raised it (F03, F10…), the latest audit of the page since the action
closed, by the address asked for or ended at; it passes when every named
check does (validity's warn still fails, as the page check reads it). A
low-scored page (F01) passes once its score is past the line its signal
is raised under. `{ pages, audited, passed }`, kept as validation.audit.
- validate.js: a fix with pages audited again is judged by them: all or
some passing reads improved, none no meaningful change (A4 will say
mixed for some). With none audited again, the metrics judge, as before.
validateAction's four writes now go through one `finish`, which keeps
the signals (A3) and the audit beside the metrics.
- History's drawer: "Audited again since it closed: 1 of 2 pages pass.",
or that none was yet and the result is from the metrics.
- The guide says so.
Stacked on feature/outcome-target-basket (A1).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…akes The A1 drawer test built its metrics with unit 'count', which ActionResultMetric doesn't take: tsc failed on the test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This was referenced Oct 28, 2026
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
Own change. 771bf92 on top of #1688; f849a69 only merges #1688's test commit in, and re-merging its parents gives the same tree. Once #1688 is squashed, this PR's own change applies to main cleanly; GitHub will show conflicts until the branch takes main after that squash.
Checked
- What passes. The detector raises an audit signal only on
fail(detect.js,auditsfamily), so readingpass,naandwarnas gone matches what would raise it again; thejson-ld-validitywarn stays a failure, as the page check reads it. A check missing fromaudit_signal_resultsreads as not passing, which is the safe side. F01's line istotal_score * 100 >= auditLowScore, the same scale and thresholdrecord.jsraises it under. - Matching pages. Targets and audits are both keyed with
pageScope(no scheme, nowww., no query or trailing slash), byurlorfinal_url, and each page takes its newest completed audit aftercompleted_at. Onlyfixdefinitions consume the audit signal kinds that carrychecks, so no other action is judged this way. - One
finish. All four write paths go through it; signals (A3) and the audit are kept beside the metrics, and the verdict falls back to the metrics' when no page was audited again. The sweep picks onlypending_measurementactions, so an error in the new read leaves the action for the next night, as the other reads do. - Tests. On the stack's tree,
audit-recheck.test.jsandvalidate.test.jspass, andhistory-drawer.test.tsxpasses (7). The same holds with #1687–#1689, #1698 and #1693 squashed onto main.
Follow-ups (besides the three you list)
- The verdict is read once. The sweep measures a fix once, the day after its week ends (
validate.js:310), and writes it; it never comes back to it. A fix whose pages haven't been audited again by then is judged on metrics for good, even if the audit lands a day later. That happens whenever auto-audit is off, the run's fixed share is full, or a run falls just after the week (runs are up to 7 days apart). Suggest: whileaudit.audited === 0, returnnull(still pending) for up to a set number of days after the close (say 30, the same span #1698 re-audits within), and only then fall back to the metrics. - "From the metrics" when there are none.
auditNotYet(web/messages/en.json:2570) says "the result is from the metrics", but a fix with no metric reads "Not measurable" under it. Say "not audited again yet" and letoutcomeExplaincarry the rest, or pick the sentence byitem.outcome.
Before the API deploy. Nothing shows. The drawer's audit line needs the deployed sweep's validation.audit; fixes measured before keep their result.
9 of 12 tasks
gkhngyk
added a commit
that referenced
this pull request
Oct 28, 2026
…tion Center (learning D2) (#1709) * feat(action-center): send a page from its Site Audit report to the Action Center as a Fix action Learning D2. A Site Audit report showed what a page fails, but the only way to the Action Center was the nightly pass, a day later and grouped with other pages. A person can now send the page from its report at once. - server from-audit.js: the audit read again within the brand (completed, its page and score), its failing checks (a fail, and a warning for JSON-LD validity only, as the page check reads them) with their names; one Fix action a page (dedup on the page), impact high below the low-score line, F01's plan, the page and its checks as its target (what an audit run again reads), measured on the page (basket kinds), scored as a site fix (priority sentByHand). 404 for another brand's audit, 409 not completed or nothing to fix. - POST /api/action-center/audits { brandId, auditId }. - Web: "Send to Action Center" on the report's header once it fails a check, with a toast that opens the action (or the one already open); audit_page joins the action kinds ("Fix the issues Site Audit found on /path", "the page fails N checks"), its no-signals note in the drawer. - Docs: the Site Audit and Action Center guides. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(action-center): show the report, page and failing checks of an action sent from Site Audit An audit_page action's drawer only said it had no detection signals, so the person had to find the report again to see what to fix. Its Overview tab now shows where it came from with a link to the audit report, the page, and the checks it failed when sent, named by the labels Site Audit gave them. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(action-center): refuse to send an older Site Audit report of a page audited since A report stays open at its own URL after the page is audited again, and sending it named the checks the page failed then, some of them maybe fixed since. The server now looks for a later completed audit of the same page (the Pages list's page key of final_url, else url) and refuses with 409 newer_audit and the latest audit's id; the report's toast says so and opens the latest report. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(action-center): cover the route that sends a Site Audit report to the Action Center POST /api/action-center/audits had no route test. It now pins what the route lets through and how it answers: 400 for an invalid id, 403 not_in_workspace, 201 created and 200 already open, 404, and 409 nothing_to_fix, not_completed and newer_audit with the page's latest audit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(audit): place the report's Send to Action Center where the guide explains it - Site Audit guide: the paragraph on sending one page moves from after the closing card into "How audits feed the Action Center". It says the action is judged like a nightly Site Audit fix, by the page audited again since it closed (learning A2, #1689, on main), and by its metrics until then. - The report's section says what a second send does (a notice naming the open action with Open, not the action opened) and that only a page's latest report can be sent. - Action Center guide: the two Site Audit rows of "Sending work to the Action Center" become one. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(action-center): pin F01's audit tasks, two sends at once and a not-applicable check for a Site Audit send The test's brand had no Site Audit source, so F01's analyze_site_audit and validate_technical_fix left the plan and the test, checking only that some task was planned, didn't notice. Its brand now has its audits and the test names the five tasks in order. It also covers two sends at once (the insert refused by the open-action index returns the other send's action; another refusal fails) and a check that is not applicable to the page, which is neither sent nor enough to send. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(action-center): let the audits route test stub requireFeature, which the route file now uses The Products route (#1642) guards itself with requireFeature, so the router doesn't load in a test whose plan-guard mock has none. The audits route test gets the same pass-through stub as the pages and content-drafts tests on main. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Cihan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Gökhan Geyik <[email protected]>
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
Learning phase A, A2: a Site Audit fix is judged by its pages audited again since it closed.
Stacked on #1688. This PR's own commit: 771bf92.
F01, F03 and F10 had no metric to measure, because their signals name none. So their result always read "could not be measured", and the audit's own answer was never asked: does the page pass now?
audit-recheck.jsgoes through each page target that names the checks that raised it (F03, F10…).warnstill fails, the same way the page check reads it.validation.audit:{ pages, audited, passed }.validate.js, a fix whose pages were audited again is judged by them: all or some passing reads improved, none reads no meaningful change. A4 (feat(action-center): read a result by the action's main metric, and say "mixed" when its metrics moved both ways (learning A4) #1690) makes "some" read mixed.validateAction's four writes now go through onefinish, which keeps the signals (A3) and the audit beside the metrics.Follow-ups:
targetIdstoo; today only thepayload.targetssample is read (10 of 40 low-scored pages);limit(500);nacounts as passing, which is consistent with the detector, but an LLM check failing tonacan read as fixed.Where people see it: Action Center › History › a Site Audit fix › Result.
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
cd server && npx vitest run src/lib/action-center/audit-recheck.test.js src/lib/action-center/validate.test.jsRelated issue
Agentic learning report (artifact; draft in the maintainers' notes), phase A: "measure correctly". No GitHub issue. Learning stays within one brand (product decision).
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Full checks at the top of the phase A stack (A5, 596dba6):
npm test(noSUPABASE_*env, as in CI): 3,359 tests passed.content-people.test.jstimed out under load and passed alone (32/32).vitest(444 files, 4,348 tests) and build: all pass.A pre-push review of the six branches was run, and its before-merge findings are fixed in the stack (A4: 18e00bc, 5500708, c427343, cc1f9c8; A6: 381f5c6, 52a34fb; A5: 639c3a17). Only new measurements change. Actions already measured keep their result; there's no backfill.
🤖 Generated with Claude Code