Repository navigation
feat(action-center): give the Action Center's own tasks their Done when, how they're checked and their page (AC-010, part 3) - #1564
Merged
Conversation
…d how we check it, and have the task writer fill them (AC-010) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…en, how they're checked and their page (AC-010, part 3) 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 |
7 of 12 tasks
7 of 12 tasks
gkhngyk
reviewed
Oct 27, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
It merges with #1561 and #1562 once 00293 is fixed (#1562's review), so the series goes out together.
What I checked:
- Own change.
origin/pr/1561..origin/pr/1564, one commit. That coverstemplates.js,planTasks, the seven writers,isTouched, the drawer, the exports, MCPget_action,updateTaskDetails,en.jsonand the docs. - The page each sender puts in. It comes from the action's own payload, and only from data the brand already has:
- an opportunity's asset pages come from the brand's
site_pages; - a draft's is its
source_url(http(s), at most 2,048 characters, which 00207 checks); - a traffic page's is the primary domain plus the path from
ai_traffic_pages. - Topic gaps, topic opportunities and mentions target prompts, so they get no URL.
- An opportunity that has a new page, or an earned asset, among its assets gets none either. Earned assets are stored with
decision: 'create'. sitenever passesPAGE_ADDRESS.
- an opportunity's asset pages come from the brand's
- On prod:
- About 80 of roughly 800 open actions are about one page.
- 57 actions have a single full-URL page target. All of them are on a brand domain, and the longest is 256 characters.
- Existing tasks. Nothing is backfilled or re-planned, so nothing is duplicated:
generate.jsonly addsdetailsto the insert, anddedup_keystaysdefinition.id.title_paramsdoesn't change, so the counts that 00244/00245'saction_count_driftread don't move.- No SQL function reads
action_tasks.details.
- The task writer.
isTouchedreadssource: 'template'as untouched unlessdetails.sentis set.markSentmerges into the details, so a sent task keeps its mark and counts as touched.keepsTaskstill replaces an untouched library task.- An edit in the drawer drops
source, and theundefinedkey isn't written. updateTaskDetailsis the only code path that writes a library task's details.
- Webhook and exports. Every change adds data and renames nothing:
action_task.sentalready hadurlandcheck(#1561). For a library task they now carry values.- Copy Data, CSV and Excel keep their columns; Done when gets filled from the template.
- In MCP
get_action, a library task'sdetailscan now be an object where it was null.
- Speed.
PAGE_ADDRESSis anchored, and its two alternatives start differently. On 100 KB inputs it runs in under 0.5 ms. The other new loops go over arrays that are already bounded. - Tests. I put #1561's source back under this branch's tests, and four of them fail: the plan,
generate,from-traffic-pagesandisTouchedcases. The web tests call functions and fields that don't exist without the change. All of the PR's server and web tests pass on the head. - Merge.
- Through a temp base, #1561 squashed onto main (main's tree, parents 83f7588 and main), it merges clean. The result equals the PR's own diff, and CI passes.
- With #1562 merged first,
web/messages/en.jsonconflicts: both add a block afteractionTasks. Keep both,reviewPageand thentaskDoneWhen.task-writer/index.js, its test and the docs merge on their own.
- Before and after the API deploy.
- The web part goes out on merge. Every library task with a template shows its Done when right away, existing ones included: in the drawer, in Copy Data, CSV and Excel, and in MCP.
- The old API writes no details, so new tasks show only that.
- Once the API is deployed, new library tasks also show How we check, plus the URL on a one-page action.
- Nothing checks a task automatically until part 4. A task still closes by hand, or through a draft marked ready or a publish, as today.
Follow-ups:
- Internal links on F10 (
server/src/lib/action-center/tasks/templates.js:28,web/messages/en.json:2385).- F10 (
fix_internal_connectivity) comes from Site Audit's Internal linking check. That check counts the links on the audited page itself (audit/signals/structure.js:61-77,classifyLinks), so F10's links go on that page. - The template gives the task no URL, and its Done when ("The pages that should link to it do") points the other way. All 3 open F10 actions are one-page.
- The task's title already says "Add internal links around {targets}". Give it the action's page and a Done when that reads both ways:
add_internal_links: { check: 'auto', page: true },
"add_internal_links": "The page links to related pages, and the pages that should link to it do, fetched again"
- On an opportunity's one optimized page, the links also go around that page, so the URL fits there too. The templates test's "a link task none" case changes with it.
- F10 (
- "Automatic" with no page to fetch (
templates.js:22-34,:93).- About 9 actions in 10 aren't about one page. Their page-change tasks will read "How we check: Automatic: we fetch the page again" with no URL, and no check can fetch anything for them.
- Write
autoon the page-fetch tasks only when there's a URL, andmanualotherwise. The two that a Site Audit checks (fix_technical_issue,validate_technical_fix) keepauto./** Checked by a new Site Audit, which needs no one page. */ const SITE_AUDIT = new Set(['fix_technical_issue', 'validate_technical_fix']); const url = template.page ? onePage(payload) : null; const check = template.check === 'auto' && !url && !SITE_AUDIT.has(taskKey) ? 'manual' : template.check;
- Or keep
auto, and have part 4 report "no page to fetch" for these tasks. Either way, say which one in the PR.
- The outcome task isn't a re-run (
templates.js:45,en.json:2401).validate.jsmeasuresmeasure_action_outcomeover the window after the action closes, on the action's KPIs.- For an action raised from traffic signals, or sent from AI Traffic's Pages, those KPIs include AI-referred visits (
ai_referral_traffic), which no prompt run measures. - Treat it like the three window tasks: no check, and a Done when that names no KPI, e.g. "Measured over the days after the action closes, against its baseline". The docs line's exception then also covers AI visits (
docs/guides/action-center.mdx:84).
onePageguards (templates.js:70-82).- Accept a full URL only on one of the brand's domains, with
ownDomainMatcherastask-send.jsdoes. Load the domains once per brand ingenerateActionsForBrand.- Site Audit takes any address, and the nightly audit signals read every page the brand has audited. So one low-scoring page from another site could become a fix task's URL.
- None does on prod today.
- Return null when
payload.contentExists === false. MCP accepts asource_urlon acreatedraft, and that page would become the URL onpublish_content. - Don't count an earned asset as a new page (
a?.decision === 'create' && a?.channel !== 'earned'). An owned page plus an earned asset then keeps the owned page's URL. - Drop an address longer than 500 characters, the drawer's
TASK_DETAIL_LIMITS.url, rather than storing it.
- Accept a full URL only on one of the brand's domains, with
- The webhook's Done when (
server/src/lib/action-center/task-send.js:319).- The drawer, the exports and MCP show the template's Done when, but
action_task.sentsendsdone_when: nullfor the same task. - Have the web send the Done when it shows along with
title, and use it when the task has none of its own.
- The drawer, the exports and MCP show the template's Done when, but
gkhngyk
approved these changes
Oct 27, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
It merges with #1561 and #1562 once 00293 is fixed (#1562's review), so the series goes out together.
What I checked:
- Own change.
origin/pr/1561..origin/pr/1564, one commit. That coverstemplates.js,planTasks, the seven writers,isTouched, the drawer, the exports, MCPget_action,updateTaskDetails,en.jsonand the docs. - The page each sender puts in. It comes from the action's own payload, and only from data the brand already has:
- an opportunity's asset pages come from the brand's
site_pages; - a draft's is its
source_url(http(s), at most 2,048 characters, which 00207 checks); - a traffic page's is the primary domain plus the path from
ai_traffic_pages. - Topic gaps, topic opportunities and mentions target prompts, so they get no URL.
- An opportunity that has a new page, or an earned asset, among its assets gets none either. Earned assets are stored with
decision: 'create'. sitenever passesPAGE_ADDRESS.
- an opportunity's asset pages come from the brand's
- On prod:
- About 80 of roughly 800 open actions are about one page.
- 57 actions have a single full-URL page target. All of them are on a brand domain, and the longest is 256 characters.
- Existing tasks. Nothing is backfilled or re-planned, so nothing is duplicated:
generate.jsonly addsdetailsto the insert, anddedup_keystaysdefinition.id.title_paramsdoesn't change, so the counts that 00244/00245'saction_count_driftread don't move.- No SQL function reads
action_tasks.details.
- The task writer.
isTouchedreadssource: 'template'as untouched unlessdetails.sentis set.markSentmerges into the details, so a sent task keeps its mark and counts as touched.keepsTaskstill replaces an untouched library task.- An edit in the drawer drops
source, and theundefinedkey isn't written. updateTaskDetailsis the only code path that writes a library task's details.
- Webhook and exports. Every change adds data and renames nothing:
action_task.sentalready hadurlandcheck(#1561). For a library task they now carry values.- Copy Data, CSV and Excel keep their columns; Done when gets filled from the template.
- In MCP
get_action, a library task'sdetailscan now be an object where it was null.
- Speed.
PAGE_ADDRESSis anchored, and its two alternatives start differently. On 100 KB inputs it runs in under 0.5 ms. The other new loops go over arrays that are already bounded. - Tests. I put #1561's source back under this branch's tests, and four of them fail: the plan,
generate,from-traffic-pagesandisTouchedcases. The web tests call functions and fields that don't exist without the change. All of the PR's server and web tests pass on the head. - Merge.
- Through a temp base, #1561 squashed onto main (main's tree, parents 83f7588 and main), it merges clean. The result equals the PR's own diff, and CI passes.
- With #1562 merged first,
web/messages/en.jsonconflicts: both add a block afteractionTasks. Keep both,reviewPageand thentaskDoneWhen.task-writer/index.js, its test and the docs merge on their own.
- Before and after the API deploy.
- The web part goes out on merge. Every library task with a template shows its Done when right away, existing ones included: in the drawer, in Copy Data, CSV and Excel, and in MCP.
- The old API writes no details, so new tasks show only that.
- Once the API is deployed, new library tasks also show How we check, plus the URL on a one-page action.
- Nothing checks a task automatically until part 4. A task still closes by hand, or through a draft marked ready or a publish, as today.
Follow-ups:
- Internal links on F10 (
server/src/lib/action-center/tasks/templates.js:28,web/messages/en.json:2385).- F10 (
fix_internal_connectivity) comes from Site Audit's Internal linking check. That check counts the links on the audited page itself (audit/signals/structure.js:61-77,classifyLinks), so F10's links go on that page. - The template gives the task no URL, and its Done when ("The pages that should link to it do") points the other way. All 3 open F10 actions are one-page.
- The task's title already says "Add internal links around {targets}". Give it the action's page and a Done when that reads both ways:
add_internal_links: { check: 'auto', page: true },
"add_internal_links": "The page links to related pages, and the pages that should link to it do, fetched again"
- On an opportunity's one optimized page, the links also go around that page, so the URL fits there too. The templates test's "a link task none" case changes with it.
- F10 (
- "Automatic" with no page to fetch (
templates.js:22-34,:93).- About 9 actions in 10 aren't about one page. Their page-change tasks will read "How we check: Automatic: we fetch the page again" with no URL, and no check can fetch anything for them.
- Write
autoon the page-fetch tasks only when there's a URL, andmanualotherwise. The two that a Site Audit checks (fix_technical_issue,validate_technical_fix) keepauto./** Checked by a new Site Audit, which needs no one page. */ const SITE_AUDIT = new Set(['fix_technical_issue', 'validate_technical_fix']); const url = template.page ? onePage(payload) : null; const check = template.check === 'auto' && !url && !SITE_AUDIT.has(taskKey) ? 'manual' : template.check;
- Or keep
auto, and have part 4 report "no page to fetch" for these tasks. Either way, say which one in the PR.
- The outcome task isn't a re-run (
templates.js:45,en.json:2401).validate.jsmeasuresmeasure_action_outcomeover the window after the action closes, on the action's KPIs.- For an action raised from traffic signals, or sent from AI Traffic's Pages, those KPIs include AI-referred visits (
ai_referral_traffic), which no prompt run measures. - Treat it like the three window tasks: no check, and a Done when that names no KPI, e.g. "Measured over the days after the action closes, against its baseline". The docs line's exception then also covers AI visits (
docs/guides/action-center.mdx:84).
onePageguards (templates.js:70-82).- Accept a full URL only on one of the brand's domains, with
ownDomainMatcherastask-send.jsdoes. Load the domains once per brand ingenerateActionsForBrand.- Site Audit takes any address, and the nightly audit signals read every page the brand has audited. So one low-scoring page from another site could become a fix task's URL.
- None does on prod today.
- Return null when
payload.contentExists === false. MCP accepts asource_urlon acreatedraft, and that page would become the URL onpublish_content. - Don't count an earned asset as a new page (
a?.decision === 'create' && a?.channel !== 'earned'). An owned page plus an earned asset then keeps the owned page's URL. - Drop an address longer than 500 characters, the drawer's
TASK_DETAIL_LIMITS.url, rather than storing it.
- Accept a full URL only on one of the brand's domains, with
- The webhook's Done when (
server/src/lib/action-center/task-send.js:319).- The drawer, the exports and MCP show the template's Done when, but
action_task.sentsendsdone_when: nullfor the same task. - Have the web send the Done when it shows along with
title, and use it when the task has none of its own.
- The drawer, the exports and MCP show the template's Done when, but
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
AC-010 ("Done when" on every task), part 3 of 4: the Action Center's own tasks get Done when, How we check and their page.
Stacked on #1561 (it uses the fields #1561 adds). Independent of #1562.
The nightly engine's library tasks are the ones people see today. They carry no details: only a title from their template. As decided for the rollout, they now get their AC-010 fields from that template and stay visible. Part 2's review queue is for agent-written tasks only.
How we check, and the page (
server/.../tasks/templates.js), written into a library task's details when it's planned:auto: the page is fetched again, or a Site Audit runs. For the 12 tasks that change a page: optimize, refresh, strengthen, internal links, CTA, publish, the crawler/structured-data/broken-page/technical fixes and their re-check.rerun: the prompts run again. For the 9 visibility, mention, citation, share-of-voice, platform, country, competitor and third-party-citation checks, and the outcome measure.manual: the person confirms. For the 7 brief, draft, outreach, contribution and third-party-status tasks.site).source: 'template'.Done when, in the reader's language (
web/messages/en.json,actionCenter.taskDoneWhen.<task key>).withTemplateDoneWhengives a library task its template's Done when until someone writes one. The drawer, the exports (Copy Data, CSV, Excel) and MCPget_action(in English) read it there.withoutTemplateDoneWhen), as an unchanged title does. It isn't stored as the person's English text.en.json, and that no sentence names a task that doesn't exist.validate.jscounts improvement.Wiring.
planTasksadds each task'sdetails, and the seven places that write library tasks (generate.jsand thefrom-*.jssent kinds) write them.detailsis the jsonb from 00121.The task writer still writes over untouched plans.
isTouchednow reads a template's details as no one's work, unless the task was sent (details.sent).templatemark (updateTaskDetails), so an edited task counts as the person's, as before.Not here.
action_task.sentwebhook still sendsdone_whenonly for a task that has its own.Related issue
AC-010 (roadmap), part 3 of 4. Stacked on #1561.
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 src/lib/action-center/generate.test.js src/lib/action-center/task-writer/index.test.jscd web && yarn vitest run src/lib/actions/task-details-edit.test.tsChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run: server
npm run format,npm run lint,npm test(226 files, 2,901 tests); webyarn test(427 files, 4,091 tests) andyarn build, all pass.🤖 Generated with Claude Code