Repository navigation
fix(action-center): leave a call to action task to the person, on its page - #1684
Merged
Merged
Conversation
…, cap each brand's night, and check after the task writer Follow-ups C (round 36's items 6, 7 and 11) from ansvisor#1565's round 37. Item 6: tasks the sweep can't check stayed at the head of its queue. Nothing was written when no address could be made (a URL typed as `acme.example pricing`, a path on a brand with no domain) or when reading threw, so those rows kept a null or old triedAt and came first every night. runTaskCheck now writes triedAt first, as a claim on the task as it was read (the bot-log crawler case's own write goes, the claim keeps its try); the result is written on the claim. A run that read the task before another claimed it gets 'changed' and reads nothing, so two runs never check one task. Item 7: one brand could take the night, and the checks didn't wait for the task writer. - The sweep checks at most SWEEP_PER_BRAND (20) of one brand's tasks a night, and reads up to 5 pages of 1,000 rows (ordered by triedAt, then id) to fill its 200. - server.js starts the checks once sweepActionTasks settles: the writer can delete a task a check just completed. Item 11: the sweep's query (the `or` with a JSON path, the order on details->autoCheck->>triedAt, the range) ran against the dev DB, over a seeded demo-brand task with a stub page: claimed, checked, completed, one History line; the temp action and task were deleted after. The guide's Automatic line says 20 of one brand's, least recently tried first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… for each task it can't check, and show it only where the API checks Follow-up C (round 36's item 8) from ansvisor#1565's round 37. Stacked on fix/task-check-sweep-queue: both change runTaskCheck's first lines. - Check now shared pageReadLimiter with Quality's page read, an AI-cost route, so clicks here used up the editor's reads. It has its own taskCheckLimiter (30 per 15 minutes). - "not_checkable" said "a Site Audit fix is checked by your next audit" for every task without a check. runTaskCheck now names why: no_address (no URL, or one that isn't a page's address), no_change_text (a written task with no new text to look for), from_bot_logs (a crawler fix raised from the bot logs, which robots.txt can't show done), and not_checkable for a library task checked elsewhere, as before. Each has its line in checkNot. - The drawer showed Check now on every open Automatic task with a URL. It shows it where the API checks (pageCheckable): a library task in its CHECKS, or a written task with its new text. PAGE_CHECKED_TASKS copies the CHECKS keys; a test reads the server file and fails if they drift. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ch can tell it's done Follow-up C (round 36's item 9) from ansvisor#1565's round 37. improve_cta_path was checked Automatic as "changed since the first look", and it couldn't pass: the content area leaves out a CTA band outside <main> (a rewritten hero and CTA band read "not changed"), and a CTA edit is too few words for the change rule anyway. Its template tasks carry no new text to look for either. Its template is now Manual, on the action's page (the URL still shows), it's out of the API's CHECKS (and the web's PAGE_CHECKED_TASKS, so Check now doesn't show), and its Done when reads "The call to action is live on the page: you confirm it". Stacked on fix/task-check-now-reasons for the web list. Tasks already planned keep check: auto; the sweep and Check now now leave them, and they're marked done by hand. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…which now reads task-checks templates.test.js imports CHECKS from task-checks.js, which reaches the supabase admin client at import time; its config hard-exits when the SUPABASE_* env is absent, as in CI, so the whole file failed there. The test mocks the client, as the other action-center tests do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s Manual, with no automatic check A follow-up to the call-to-action task made Manual. Tasks planned before keep check: auto in their details: the drawer said "How we check: Automatic: we fetch the page again" and their old Last check, beside a Done when that reads "you confirm it". No migration: the web reads them as their template has them now. - task-details.ts's MANUAL_TASKS lists the templates' Manual tasks (a test reads them from server tasks/templates.js, as PAGE_CHECKED_TASKS is read from CHECKS). withTemplateCheck gives such a task's details check: manual and no Last check; a page-checked task, a Site Audit fix (fix_technical_issue) and a written task keep theirs. - The drawer's task (view and edit form), the exports (Copy Data, CSV, Excel, Word) and the MCP's get_action read them through it. Check now already left the task (pageCheckable). - task-checks.js's header no longer lists the call to action among the "changed" checks. Tests: an improve_cta_path task with check: auto and a failed last check shows "Manual: you confirm it", no Automatic, no Last check, no Check now (it failed before); refresh_content keeps all three; the export and MCP give it manual; MANUAL_TASKS matches the server's templates. Co-Authored-By: Claude Opus 5.5 <[email protected]>
8 of 12 tasks
# Conflicts: # server/src/lib/action-center/task-checks.js
The drawer's pageCheckable allowed only a library task it checks on its page or a written task with new text, so the shopping links task (no task key, no new text) lost Check now. Pass the action's kind and allow a shopping_links action's task.
# Conflicts: # server/src/lib/action-center/task-checks.js
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
What I checked:
- Own change. f54858f, 0a29cb6 and 6082c26, on #1683 (which is on #1682). Like those two, it doesn't merge cleanly on main (b591947) until #1682 is rebased (
task-checks.js, #1616). This PR's own commits add no conflict of their own. It inherits #1683's before-merge item 1 (Check now on the shopping links task), so it should merge after #1683's fix. - Server.
improve_cta_pathis out ofCHECKS, so neither the sweep nor Check now reads it. Its template is Manual on its page, and the test pins both. Mocking the supabase client intemplates.test.jsis right:task-checks.jsis now imported there. - Web.
withTemplateCheckis applied in all four places a task's check is shown: the drawer row, the exports and MCPget_action.MANUAL_TASKShas a drift test againsttemplates.js. The drawer test covers both sides: a CTA task planned as Automatic shows Manual with no Last check and no Check now, andrefresh_contentstill shows all three. - Tests. On this head, the web's
task-details,export,action-priority,action-draweranddisplaytests pass (248). So do the server'stask-checksandtemplatestests (the latter withweb/messages/en.jsonlaid out besideserver/).
Follow-ups (low):
- A CTA task the check already completed loses its Last check.
withTemplateCheckdoesn't look at status. A completedimprove_cta_pathtask that a check closed now reads "Manual" with no Last check, even though History says "Checked automatically and done". KeepinglastCheck(and maybe the Automatic label) when the task is completed with a passed check would keep the drawer consistent with History. add_internal_linkshas the same gap this PR fixes for the CTA task. Its template ischeck: 'auto', and its Done when says "fetched again". It isn't inCHECKS, though, so nothing checks it. With #1683, Check now is hidden, but the drawer still says "Automatic: we fetch the page again". Making it Manual, or adding it toMANUAL_TASKS' treatment, would close it.- Someone who sets a Manual-template task (for example
create_content_draft) to Automatic by hand will still see Manual. The API doesn't check those anyway, so this is only a wording note for the edit form.
Before the API deploy: the web shows CTA tasks as Manual with no Check now. The old API's nightly sweep still checks them and can still complete one, which adds "Checked automatically and done" to History for a task the drawer calls Manual. This stops when the API is deployed.
7 of 12 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
Follow-up C from #1565's round 37 (round 36's item 9): an "improve the call to action" task is confirmed by the person, not checked by re-reading the page.
Stacked on #1683 (for the web's
PAGE_CHECKED_TASKS), which is on #1682. This PR's own commits: f54858f, 0a29cb6 and 6082c26.improve_cta_pathwas checked Automatic as "changed since the first look", and it couldn't pass:<main>, so a rewritten hero and CTA band read "not changed";The change:
CHECKSand the web'sPAGE_CHECKED_TASKS, so Check now doesn't show.task-checks.js, which hard-exits without theSUPABASE_*env, as in CI.Pre-push review fix (6082c26): tasks already planned keep
check: 'auto'in their details. The sweep and Check now skip them, but the drawer still said "Automatic: we fetch the page again", with an old "Last check" line, next to "you confirm it".withTemplateCheck(task-details.ts) shows a task whose template is Manual (MANUAL_TASKS) as manual, without the Last check line.get_action. No migration.MANUAL_TASKSin step with the server's templates.Where people see it: Action Center › a CTA task's drawer: "How we check: Manual", with no Check now and no Last check line.
Related issue
Follow-up from #1565 (round 37, item C).
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/tasks/templates.test.js src/lib/action-center/task-checks.test.js(withoutSUPABASE_*env, as in CI)cd web && npx vitest run src/lib/action-center/task-details.test.tsChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Full checks were run in one tree with this batch's eight follow-up branches merged (after the review fixes):
npm test(noSUPABASE_*env, as in CI): 249 files, 3,365 tests passed;vitest(445 files, 4,353 tests) and build: all pass.Browser check (local, 1024 px): Prompts › Topics › Add Topic stops at 100 characters; the Action Center drawer opens without errors, and Check now doesn't show on tasks the API doesn't check.
A pre-push review was run on all eight branches of this batch, and its before-merge findings are fixed.
🤖 Generated with Claude Code