Skip to content

fix(action-center): leave a call to action task to the person, on its page - #1684

Merged
gkhngyk merged 11 commits into
ansvisor:mainfrom
cihan-gyk:fix/cta-task-manual
Oct 28, 2026
Merged

gkhngyk merged 11 commits into
ansvisor:mainfrom
cihan-gyk:fix/cta-task-manual

Conversation

@cihan-gyk

@cihan-gyk cihan-gyk commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

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_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>, so a rewritten hero and CTA band read "not changed";
  • a CTA edit is too few words for the change rule anyway;
  • its template tasks carry no new text to look for.

The change:

  • 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.
  • Done when reads: "The call to action is live on the page: you confirm it".
  • 0a29cb6: the templates test mocks the supabase client. It now imports task-checks.js, which hard-exits without the SUPABASE_* 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.
  • It's used in the drawer, in the exports (Copy Data, CSV, Excel, Word) and in MCP get_action. No migration.
  • A test keeps MANUAL_TASKS in 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 feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. cd server && npx vitest run src/lib/action-center/tasks/templates.test.js src/lib/action-center/task-checks.test.js (without SUPABASE_* env, as in CI)
  2. cd web && npx vitest run src/lib/action-center/task-details.test.ts

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Full checks were run in one tree with this batch's eight follow-up branches merged (after the review fixes):

  • server format, lint and npm test (no SUPABASE_* env, as in CI): 249 files, 3,365 tests passed;
  • web format, lint (0 errors; 7 warnings already on main), typecheck, 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

cihan-gyk and others added 5 commits October 28, 2026 08:38
…, 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]>
# 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 gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_path is out of CHECKS, 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 in templates.test.js is right: task-checks.js is now imported there.
  • Web. withTemplateCheck is applied in all four places a task's check is shown: the drawer row, the exports and MCP get_action. MANUAL_TASKS has a drift test against templates.js. The drawer test covers both sides: a CTA task planned as Automatic shows Manual with no Last check and no Check now, and refresh_content still shows all three.
  • Tests. On this head, the web's task-details, export, action-priority, action-drawer and display tests pass (248). So do the server's task-checks and templates tests (the latter with web/messages/en.json laid out beside server/).

Follow-ups (low):

  1. A CTA task the check already completed loses its Last check. withTemplateCheck doesn't look at status. A completed improve_cta_path task that a check closed now reads "Manual" with no Last check, even though History says "Checked automatically and done". Keeping lastCheck (and maybe the Automatic label) when the task is completed with a passed check would keep the drawer consistent with History.
  2. add_internal_links has the same gap this PR fixes for the CTA task. Its template is check: 'auto', and its Done when says "fetched again". It isn't in CHECKS, 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 to MANUAL_TASKS' treatment, would close it.
  3. 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.

@gkhngyk
gkhngyk merged commit efe71ed into ansvisor:main Oct 28, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants