Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

feat(action-center): give tasks the exact page, the change to make and how we check it, and have the task writer fill them (AC-010) (#1561)

Cihan1e024fb8f68f
diff --git a/docs/api-reference/webhooks.mdx b/docs/api-reference/webhooks.mdx
index 744a159d1..68c00645e 100644
--- a/docs/api-reference/webhooks.mdx
+++ b/docs/api-reference/webhooks.mdx
@@ -180,10 +180,13 @@ Every highlight and warning also has a `key` that identifies its subject.
"title": "Update the shipping guide",
"status": "todo",
"type": "content",
+ "url": "/guides/shipping",
"where": "acme.example/guides/shipping",
"why": "The page is missing useful details.",
+ "change": { "before": null, "after": "A table of shipping costs by country." },
"how": ["Add a comparison table."],
"done_when": "The updated page is live.",
+ "check": "auto",
"effort": "~2h",
"role": "Content writer"
},
@@ -205,6 +208,8 @@ Every highlight and warning also has a `key` that identifies its subject.
}
```
+`url` is the exact page, `change` the text to replace (`before`, null when the change adds text) and the new text (`after`), and `check` how the task is checked: `auto` (the page is fetched again), `rerun` (the prompts run again) or `manual` (a person confirms). Each is null when the task has none.
+
### `content_draft.sent`
One request per page:
diff --git a/docs/guides/action-center.mdx b/docs/guides/action-center.mdx
index 2919aac26..0310dcdd0 100644
--- a/docs/guides/action-center.mdx
+++ b/docs/guides/action-center.mdx
@@ -81,7 +81,7 @@ Click a row to open the action. Under its title you set **Status**, **Assignee**
### Tasks
-Each action comes with tasks: concrete steps such as "Refresh content for these prompts" or "Add structured data to these pages". Open a task to see its details: **What**, **Where**, **Why**, **How** (one step per line), **Done when**, **Type** (Content, On-page, Technical, Outreach, PR or Product), **Effort** and **Role**. Click **Edit** to change any of them.
+Each action comes with tasks: concrete steps such as "Refresh content for these prompts" or "Add structured data to these pages". Open a task to see its details: **What**, **URL** (the exact page), **Where**, **Why**, **Change** (the text before and after, or the text to add), **How** (one step per line), **Done when**, **How we check** (Automatic: we fetch the page again; Re-run: the prompts run again; Manual: you confirm it), **Type** (Content, On-page, Technical, Outreach, PR or Product), **Effort** and **Role**. Click **Edit** to change any of them.
A task's status is **To Do**, **In Progress**, **Completed** or **Skipped** (with a reason). Skipped tasks leave the count, so they don't hold an action short of done. Use **Add task** for work of your own, and delete tasks you don't need.
diff --git a/server/src/lib/action-center/task-send.js b/server/src/lib/action-center/task-send.js
index bd503d5c5..e686421e5 100644
--- a/server/src/lib/action-center/task-send.js
+++ b/server/src/lib/action-center/task-send.js
@@ -22,6 +22,7 @@ import { logger } from '../logger.js';
import { dispatchBrandWebhook } from '../webhook-dispatch.js';
import { ownDomainMatcher } from '../response-parser.js';
import { OPPORTUNITY_ACTION_KIND } from './from-opportunity.js';
+import { TASK_CHECKS } from './task-writer/quality.js';
export class TaskSendError extends Error {
constructor(code, message, status = 422) {
@@ -43,6 +44,12 @@ function appOrigin() {
const text = (value) => (typeof value === 'string' ? value.trim() : '');
+/** The change a task makes (AC-010): its new text, and the text it replaces (null when it adds). */
+const changeOf = (value) => {
+ const after = text(value?.after);
+ return after ? { before: text(value?.before) || null, after } : null;
+};
+
/** A task and its action, with what sending needs to know about them. */
export async function loadTask(taskId) {
const { data: task, error } = await supabaseAdmin
@@ -94,7 +101,12 @@ export function ownPageOf(where, brandDomains) {
*/
export function opportunityFromTask({ task, title, action, brandDomains }) {
const d = task.details ?? {};
- const page = ownPageOf(d.where, brandDomains);
+ // The page Where names; else the exact page (AC-010) when the change
+ // replaces its text, so it's there. A URL with a change that only adds may
+ // be a page still to write: that's a new page, as before.
+ const page =
+ ownPageOf(d.where, brandDomains) ??
+ (text(d.change?.before) ? ownPageOf(d.url, brandDomains) : null);
const decision = page ? 'optimize' : 'create';
const targetPages = page ? [{ url: page, title: '' }] : [];
return {
@@ -120,6 +132,8 @@ export function opportunityFromTask({ task, title, action, brandDomains }) {
actionNo: action.action_no,
taskId: task.id,
task: {
+ url: text(d.url),
+ change: changeOf(d.change),
where: text(d.where),
why: text(d.why),
how: Array.isArray(d.how) ? d.how.map(text).filter(Boolean) : [],
@@ -297,10 +311,13 @@ export async function sendTaskToWebhook({ taskId, title, userId, loaded }) {
title: name,
status: task.status,
type: d.type ?? null,
+ url: text(d.url) || null,
where: text(d.where) || null,
why: text(d.why) || null,
+ change: changeOf(d.change),
how: Array.isArray(d.how) ? d.how : [],
done_when: text(d.doneWhen) || null,
+ check: TASK_CHECKS.includes(d.check) ? d.check : null,
effort: text(d.effort) || null,
role: text(d.role) || null,
},
diff --git a/server/src/lib/action-center/task-send.test.js b/server/src/lib/action-center/task-send.test.js
index 6ad510afa..429155e2f 100644
--- a/server/src/lib/action-center/task-send.test.js
+++ b/server/src/lib/action-center/task-send.test.js
@@ -158,6 +158,43 @@ describe('opportunityFromTask', () => {
expect(row.source_data.actions).toEqual({ all: 'a1' });
expect(row.source_data.fromAction).toMatchObject({ actionNo: 12, taskId: 't1' });
});
+
+ describe('with the exact page and the change (AC-010)', () => {
+ const fromTask = (over) =>
+ opportunityFromTask({
+ task: { ...db.action_tasks[0], details: { ...details, check: 'auto', ...over } },
+ title: 'Add a 2026 table',
+ action: db.actions[0],
+ brandDomains: ['acme.example'],
+ });
+ const replaces = { before: 'Old intro', after: 'A 2026 table of countries and costs.' };
+ const adds = { before: null, after: 'A 2026 table of countries and costs.' };
+
+ it('carries them, and works on the page Where names', () => {
+ const row = fromTask({ url: '/guides/shipping-costs', change: replaces });
+ expect(row.source_data.assets[0].pages).toEqual([
+ { url: 'https://acme.example/blog/shipping', title: '' },
+ ]);
+ expect(row.source_data.fromAction.task).toMatchObject({
+ url: '/guides/shipping-costs',
+ change: { before: 'Old intro', after: 'A 2026 table of countries and costs.' },
+ });
+ });
+
+ it('works on the URL when Where names no page and the change replaces its text', () => {
+ const row = fromTask({ where: 'Gemini · 3 prompts', url: '/pricing', change: replaces });
+ expect(row).toMatchObject({ decision: 'optimize' });
+ expect(row.source_data.assets[0].pages).toEqual([
+ { url: 'https://acme.example/pricing', title: '' },
+ ]);
+ });
+
+ it('makes a new page of a URL whose change only adds: it may not be there yet', () => {
+ const row = fromTask({ where: 'Gemini · 3 prompts', url: '/guides/new', change: adds });
+ expect(row).toMatchObject({ decision: 'create' });
+ expect(row.source_data.assets[0].pages).toEqual([]);
+ });
+ });
});
describe('sendTaskToContent', () => {
@@ -206,7 +243,15 @@ describe('sendTaskToWebhook', () => {
expect(brandId).toBe('b1');
expect(payload).toMatchObject({
event: 'action_task.sent',
- task: { id: 't1', type: 'content', done_when: 'Cited again within 14 days.' },
+ task: {
+ id: 't1',
+ type: 'content',
+ done_when: 'Cited again within 14 days.',
+ // AC-010's fields, null when the task has none.
+ url: null,
+ change: null,
+ check: null,
+ },
action: { id: 'a1', action_no: 12, priority_score: 84 },
brand: { name: 'Acme Coffee', domain: 'acme.example' },
});
diff --git a/server/src/lib/action-center/task-writer/index.js b/server/src/lib/action-center/task-writer/index.js
index 74a6a58b8..60a017ef4 100644
--- a/server/src/lib/action-center/task-writer/index.js
+++ b/server/src/lib/action-center/task-writer/index.js
@@ -27,7 +27,7 @@ import { getTask } from '../tasks/registry.js';
import { IMPROVE_ACTION_KIND } from '../from-prompt-improve.js';
import { OPPORTUNITY_ACTION_KIND } from '../from-opportunity.js';
import { buildEvidence, evidenceForPrompt, hasTargets } from './evidence.js';
-import { MAX_TASKS, sameTask, taskProblems } from './quality.js';
+import { MAX_TASKS, pageAddress, sameTask, taskProblems } from './quality.js';
import { buildRetryPrompt, buildTaskWriterPrompt, taskWriterSchema } from './prompt.js';
/** Whether this deployment writes tasks at all. */
@@ -369,10 +369,13 @@ export async function replaceTasks(actionId, tasks, { now = new Date() } = {}) {
mode: 'human',
permission: 'read',
details: {
+ url: pageAddress(task.url),
where: task.where.trim(),
why: task.why.trim(),
+ change: { before: task.change.before.trim() || null, after: task.change.after.trim() },
how: task.how.map((step) => step.trim()).filter(Boolean),
doneWhen: task.doneWhen.trim(),
+ check: task.check.trim().toLowerCase(),
type: task.type,
effort: task.effort.trim(),
role: task.role.trim(),
diff --git a/server/src/lib/action-center/task-writer/index.test.js b/server/src/lib/action-center/task-writer/index.test.js
index e828e3579..15d6f2cdd 100644
--- a/server/src/lib/action-center/task-writer/index.test.js
+++ b/server/src/lib/action-center/task-writer/index.test.js
@@ -104,10 +104,13 @@ const { isTouched, keepsTask, sweepActionTasks, writeTasksForAction } = await im
const task = (over = {}) => ({
title: 'Add a 2026 shipping table to /blog/shipping',
+ url: 'acme.example/blog/shipping',
where: 'acme.example/blog/shipping · lost on ChatGPT',
why: 'Cited #2 until Oct 12.',
+ change: { before: '', after: 'A 2026 table of countries and costs.' },
how: ['Add a table.', 'Put "2026" in the title.'],
doneWhen: 'Cited again within 14 days.',
+ check: 'rerun',
type: 'content',
effort: '~2h',
role: 'Content writer',
@@ -228,6 +231,8 @@ describe('writeTasksForAction', () => {
task({ title: 'Refresh content for 7 prompts', refs: ['page:1'] }),
task({
title: 'Pitch acme to seriouseats.com',
+ url: 'https://seriouseats.com/best',
+ check: 'Manual',
where: 'seriouseats.com/best',
refs: ['domain:1'],
type: 'outreach',
@@ -260,6 +265,14 @@ describe('writeTasksForAction', () => {
[5, 'Link /blog/shipping from the pricing page'],
]);
expect(tasks[2].details).toMatchObject({ source: 'ai', type: 'content', refs: ['page:1'] });
+ // The exact page, the change (nothing it replaces: null) and how it's checked (AC-010).
+ // A host and path as the evidence shows it is stored with its https://.
+ expect(tasks[2].details).toMatchObject({
+ url: 'https://acme.example/blog/shipping',
+ change: { before: null, after: 'A 2026 table of countries and costs.' },
+ check: 'rerun',
+ });
+ expect(tasks[3].details).toMatchObject({ check: 'manual' });
// Held on the budget once, then both calls charged to it.
expect(reserveAiBudget).toHaveBeenCalledWith('o1', {
diff --git a/server/src/lib/action-center/task-writer/prompt.js b/server/src/lib/action-center/task-writer/prompt.js
index 8e0edaf8a..6861e1972 100644
--- a/server/src/lib/action-center/task-writer/prompt.js
+++ b/server/src/lib/action-center/task-writer/prompt.js
@@ -15,10 +15,14 @@ import { MAX_TASKS } from './quality.js';
*/
export const writtenTaskSchema = z.object({
title: z.string().min(1).max(200),
+ url: z.string().max(500),
where: z.string().max(300),
why: z.string().max(600),
+ change: z.object({ before: z.string().max(1000), after: z.string().max(1000) }),
how: z.array(z.string().max(300)).max(8),
doneWhen: z.string().max(300),
+ // A string, not the enum, as type below.
+ check: z.string().max(10),
// A string, not the enum: one unknown type is one refused task (quality.js),
// not a schema miss that throws the whole answer away.
type: z.string().max(20),
@@ -33,18 +37,21 @@ export const taskWriterSchema = z.object({
const SYSTEM = `You turn an AI-visibility action into a short list of concrete tasks a person can do this week.
-Every task answers five questions:
+Every task answers these questions:
- title (What): an imperative sentence naming its target, e.g. "Add a 2026 comparison table to /blog/best-tools". Never "… for 7 prompts" or "across 3 pages": one task, one target.
+- url: the exact page the change is made on, as a full URL or a path starting with "/", from the evidence. For outreach or PR, the other site's page.
- where: the exact page URL, prompt, platform, domain or competitor, from the evidence.
- why: the evidence behind it, with its numbers (positions, dates, visits), from the evidence only.
+- change: the change itself, written out. after: the new text, e.g. an H2 "How accurate is AI search tracking?" with its 50-word answer. before: the text it replaces, quoted from the evidence, or "" when it adds new text or the evidence doesn't show the page's text.
- how: 2 to 5 short steps, in order.
-- doneWhen: a measurable check, e.g. "the citation returns on 2 of 3 platforms within 14 days".
+- doneWhen: a measurable check, e.g. "H2 present · answer under 60 words · page re-fetched" or "the citation returns on 2 of 3 platforms within 14 days".
+- check: how doneWhen is checked: auto (the page is fetched again), rerun (the prompts are run again) or manual (the person confirms).
Also: type (content, on_page, technical, outreach, pr or product), effort (e.g. "~2h") and role (e.g. "Content writer").
Rules:
- One task per page or domain. Prefer the targets with the most evidence.
- Do not write analysis tasks (analyze, identify, review, validate, measure, monitor): the product already did that work and shows it to the user.
-- refs lists the evidence refs the task rests on (e.g. "page:1", "domain:2"). Use only refs that exist. The title or Where must name the target itself: a page by its URL or path, a domain or competitor by name, a prompt by quoting it.
+- refs lists the evidence refs the task rests on (e.g. "page:1", "domain:2"). Use only refs that exist. The title, Where or url must name the target itself: a page by its URL or path, a domain or competitor by name, a prompt by quoting it.
- Use only facts from the evidence. No placeholders, no generic SEO advice.
- Write in English. At most ${MAX_TASKS} tasks.`;
diff --git a/server/src/lib/action-center/task-writer/quality.js b/server/src/lib/action-center/task-writer/quality.js
index 090ed0b5a..ace9b8465 100644
--- a/server/src/lib/action-center/task-writer/quality.js
+++ b/server/src/lib/action-center/task-writer/quality.js
@@ -21,10 +21,28 @@ export const TASK_TYPES = Object.freeze([
'product',
]);
+/**
+ * How we check a task is done (AC-010): the page fetched again (or a Site
+ * Audit), the prompts run again, or the person confirms it.
+ */
+export const TASK_CHECKS = Object.freeze(['auto', 'rerun', 'manual']);
+
/** "… for 7 prompts", "across 3 pages": a count where a target should be. */
const COUNT_IN_TITLE =
/\b(?:for|across|on|in|to)\s+\d+\s+(?:prompts?|pages?|topics?|platforms?|competitors?|domains?|queries)\b/i;
+/**
+ * A page's address: a full URL, a path on the brand's site, or a host and
+ * path as the evidence shows them (pageAddress adds the https://).
+ */
+const PAGE_ADDRESS = /^(?:https?:\/\/\S+|\/\S*|(?:[a-z0-9-]+\.)+[a-z]{2,}(?:[/?#]\S*)?)$/i;
+
+/** A task's URL as stored: a host and path gets its https://. */
+export function pageAddress(url) {
+ const value = text(url);
+ return /^(?:https?:\/\/|\/)/i.test(value) ? value : `https://${value}`;
+}
+
/** Analysis the product does itself and shows in the Affected tab. */
const ANALYSIS_VERB =
/^(?:analy[sz]e|identify|validate|measure|monitor|review|investigate|assess|audit|evaluate|research|track|determine|look into)\b/i;
@@ -41,13 +59,21 @@ const text = (value) => (typeof value === 'string' ? value.trim() : '');
export function taskProblems(task, evidence) {
const problems = [];
const title = text(task?.title);
+ const url = text(task?.url);
const where = text(task?.where);
const steps = (Array.isArray(task?.how) ? task.how : []).map(text).filter(Boolean);
if (!title) problems.push('it has no title');
+ // AC-010: the exact page, the change, Done when and how it's checked.
+ if (!url) problems.push('URL is empty');
+ else if (!PAGE_ADDRESS.test(url)) problems.push('URL is not a page address (https://… or /…)');
if (!where) problems.push('Where is empty');
+ if (!text(task?.change?.after)) problems.push('the change has no after text');
if (steps.length < 2 || steps.length > 5) problems.push('How needs 2 to 5 steps');
if (!text(task?.doneWhen)) problems.push('Done when is empty');
+ if (!TASK_CHECKS.includes(text(task?.check).toLowerCase())) {
+ problems.push('check is not auto, rerun or manual');
+ }
if (!TASK_TYPES.includes(task?.type)) problems.push('its type is not one of the six');
if (COUNT_IN_TITLE.test(title)) {
problems.push('the title counts prompts or pages instead of naming one');
@@ -64,8 +90,8 @@ export function taskProblems(task, evidence) {
problems.push(
`it cites refs the evidence does not have (${refs.filter((r) => !evidence.byRef.has(r)).join(', ')})`,
);
- } else if (!known.some((ref) => names(`${title} ${where}`, evidence.byRef.get(ref)))) {
- problems.push('neither the title nor Where names its target');
+ } else if (!known.some((ref) => names(`${title} ${where} ${url}`, evidence.byRef.get(ref)))) {
+ problems.push('neither the title, Where nor URL names its target');
}
return problems;
}
diff --git a/server/src/lib/action-center/task-writer/quality.test.js b/server/src/lib/action-center/task-writer/quality.test.js
index 00e46627f..59927cb87 100644
--- a/server/src/lib/action-center/task-writer/quality.test.js
+++ b/server/src/lib/action-center/task-writer/quality.test.js
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
import { buildEvidence } from './evidence.js';
-import { sameTask, taskProblems } from './quality.js';
+import { pageAddress, sameTask, taskProblems } from './quality.js';
const evidence = buildEvidence([
{
@@ -17,10 +17,13 @@ const evidence = buildEvidence([
const good = {
title: 'Add a 2026 shipping table to /blog/shipping',
+ url: 'https://acme.example/blog/shipping',
where: 'acme.example/blog/shipping · lost on ChatGPT',
why: 'Cited #2 until Oct 12; seriouseats.com now has a dated table.',
+ change: { before: '', after: 'H2 "Where do we ship?" with a table of 12 countries and costs.' },
how: ['Add a table of countries and costs.', 'Put "2026" in the title.'],
doneWhen: 'Cited again on ChatGPT within 14 days.',
+ check: 'rerun',
type: 'content',
effort: '~2h',
role: 'Content writer',
@@ -61,6 +64,37 @@ describe('taskProblems', () => {
]);
});
+ it('needs the exact page, the change and how it is checked (AC-010)', () => {
+ expect(
+ taskProblems(
+ { ...good, url: '', change: { before: 'Old text', after: ' ' }, check: 'weekly' },
+ evidence,
+ ),
+ ).toEqual([
+ 'URL is empty',
+ 'the change has no after text',
+ 'check is not auto, rerun or manual',
+ ]);
+ expect(taskProblems({ ...good, change: undefined }, evidence)).toEqual([
+ 'the change has no after text',
+ ]);
+ // A page's address: a full URL, a path, or a host and path as the evidence shows them.
+ expect(taskProblems({ ...good, url: 'the shipping guide' }, evidence)).toEqual([
+ 'URL is not a page address (https://… or /…)',
+ ]);
+ expect(taskProblems({ ...good, url: '/blog/shipping', check: 'auto' }, evidence)).toEqual([]);
+ expect(taskProblems({ ...good, url: 'acme.example/blog/shipping?ref=1' }, evidence)).toEqual(
+ [],
+ );
+ expect(taskProblems({ ...good, check: 'Auto' }, evidence)).toEqual([]);
+ });
+
+ it('stores a host and path with its https://', () => {
+ expect(pageAddress(' acme.example/blog/shipping ')).toBe('https://acme.example/blog/shipping');
+ expect(pageAddress('/pricing')).toBe('/pricing');
+ expect(pageAddress('http://acme.example/x')).toBe('http://acme.example/x');
+ });
+
it('needs refs the evidence has, and its target named', () => {
expect(taskProblems({ ...good, refs: [] }, evidence)).toEqual([
'it cites none of the evidence refs',
@@ -68,9 +102,16 @@ describe('taskProblems', () => {
expect(taskProblems({ ...good, refs: ['page:1', 'page:9'] }, evidence)).toEqual([
'it cites refs the evidence does not have (page:9)',
]);
+ expect(
+ taskProblems(
+ { ...good, title: 'Rewrite the shipping guide', where: 'Your blog', url: '/pricing' },
+ evidence,
+ ),
+ ).toEqual(['neither the title, Where nor URL names its target']);
+ // The URL names the page.
expect(
taskProblems({ ...good, title: 'Rewrite the shipping guide', where: 'Your blog' }, evidence),
- ).toEqual(['neither the title nor Where names its target']);
+ ).toEqual([]);
});
});
@@ -93,6 +134,7 @@ describe('a task aimed at a prompt', () => {
const aimed = {
...good,
title: 'Publish a buyer guide that cites acme.example',
+ url: '/guides/coffee-subscriptions',
refs: ['prompt:1'],
};
@@ -108,7 +150,7 @@ describe('a task aimed at a prompt', () => {
it('does not count a paraphrase as naming it', () => {
expect(
taskProblems({ ...aimed, where: 'Gemini · prompts about coffee subscriptions' }, prompts),
- ).toEqual(['neither the title nor Where names its target']);
+ ).toEqual(['neither the title, Where nor URL names its target']);
});
});
diff --git a/web/messages/en.json b/web/messages/en.json
index 63908c036..c9e789bbb 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -1077,10 +1077,15 @@
"link": "Link",
"task": "Task",
"details": "Details",
+ "taskUrl": "URL",
"taskWhere": "Where",
"taskWhy": "Why",
+ "taskChange": "Change",
+ "taskChangeLine": "Before: {before} → After: {after}",
+ "taskChangeAdd": "Add: {after}",
"taskHow": "How",
"taskDoneWhen": "Done when",
+ "taskCheck": "How we check",
"taskEffort": "Effort",
"sentToContent": "Sent to Content",
"sentToWebhook": "Sent to the webhook",
@@ -1330,11 +1335,20 @@
"showDetails": "Show details",
"hideDetails": "Hide details",
"what": "What",
+ "url": "URL",
+ "urlPlaceholder": "e.g. /blog/ai-search-tracking",
"where": "Where",
"why": "Why",
+ "change": "Change",
+ "changeBefore": "Before",
+ "changeBeforeHint": "Leave empty to add new text",
+ "changeAfter": "After",
+ "changeAdd": "Add",
"how": "How",
"howHint": "One step per line, up to {max}",
"doneWhen": "Done when",
+ "check": "How we check",
+ "noCheck": "Not set",
"type": "Type",
"noType": "No type",
"effort": "Effort",
@@ -2363,6 +2377,11 @@
"competitors": "{count, plural, one {# competitor} other {# competitors}}"
}
},
+ "taskChecks": {
+ "auto": "Automatic: we fetch the page again",
+ "rerun": "Re-run: the prompts run again",
+ "manual": "Manual: you confirm it"
+ },
"taskTypes": {
"content": "Content",
"on_page": "On-page",
@@ -5728,8 +5747,13 @@
"fromTask": {
"title": "From a task in {ref}",
"titleNoRef": "From an Action Center task",
+ "url": "URL",
"where": "Where",
"why": "Why",
+ "change": "Change",
+ "changeBefore": "Before",
+ "changeAfter": "After",
+ "changeAdd": "Add",
"how": "How",
"doneWhen": "Done when",
"effort": "Effort"
diff --git a/web/src/components/action-center/action-export-buttons.tsx b/web/src/components/action-center/action-export-buttons.tsx
index 1566fd1df..33b81d514 100644
--- a/web/src/components/action-center/action-export-buttons.tsx
+++ b/web/src/components/action-center/action-export-buttons.tsx
@@ -71,6 +71,7 @@ export function ActionExportButtons({
tasks: useTranslations(EXPORT_NAMESPACES.tasks),
taskStatus: useTranslations(EXPORT_NAMESPACES.taskStatus),
taskTypes: useTranslations(EXPORT_NAMESPACES.taskTypes),
+ taskChecks: useTranslations(EXPORT_NAMESPACES.taskChecks),
signals: useTranslations(EXPORT_NAMESPACES.signals),
signalTexts: useTranslations(EXPORT_NAMESPACES.signalTexts),
signalCategories: useTranslations(EXPORT_NAMESPACES.signalCategories),
diff --git a/web/src/components/action-center/task-detail.test.tsx b/web/src/components/action-center/task-detail.test.tsx
index f121880a6..208316e89 100644
--- a/web/src/components/action-center/task-detail.test.tsx
+++ b/web/src/components/action-center/task-detail.test.tsx
@@ -87,6 +87,48 @@ describe('TaskDetailView', () => {
expect(container.textContent).toContain('~2h · Content writer');
});
+ it('shows the exact page, the change and how it is checked (AC-010)', () => {
+ render(
+ <TaskDetailView
+ details={parseTaskDetails({
+ url: 'https://acme.example/blog/best-tools',
+ where: 'acme.example/blog/best-tools',
+ change: { before: 'Our tools', after: 'The 2026 tools, compared' },
+ doneWhen: 'H2 present · answer under 60 words · page re-fetched',
+ check: 'auto',
+ })}
+ disabled={false}
+ onEdit={() => {}}
+ />,
+ );
+ const terms = [...container.querySelectorAll('dt')].map((dt) => dt.textContent);
+ expect(terms).toEqual(['URL', 'Where', 'Change', 'Done when', 'How we check']);
+ // A full URL opens the page.
+ expect(container.querySelector('a')!.getAttribute('href')).toBe(
+ 'https://acme.example/blog/best-tools',
+ );
+ expect(container.textContent).toContain('Before: Our tools');
+ expect(container.textContent).toContain('After: The 2026 tools, compared');
+ expect(container.textContent).toContain('Automatic: we fetch the page again');
+ });
+
+ it('shows a path as text, and a change that adds as Add', () => {
+ render(
+ <TaskDetailView
+ details={parseTaskDetails({
+ url: '/pricing',
+ change: { before: '', after: 'A table of plans.' },
+ })}
+ disabled={false}
+ onEdit={() => {}}
+ />,
+ );
+ expect(container.querySelector('a')).toBeNull();
+ expect(container.textContent).toContain('/pricing');
+ expect(container.textContent).toContain('Add: A table of plans.');
+ expect(container.textContent).not.toContain('Before:');
+ });
+
it('asks for details when a task has none, and opens the editor', () => {
const onEdit = vi.fn();
render(<TaskDetailView details={null} disabled={false} onEdit={onEdit} />);
@@ -147,16 +189,50 @@ describe('TaskDetailForm', () => {
act(() => button('Save').click());
expect(onSave).toHaveBeenCalledWith({
title: null,
+ url: '',
where: 'acme.example/blog/best-tools · 3 prompts on ChatGPT',
why: 'Cited #2 until Oct 8.',
+ before: '',
+ after: '',
how: ['Add a table.', '', 'Update the title.'],
doneWhen: 'Cited again on 2 of 3 platforms within 14 days.',
+ check: null,
type: 'content',
effort: '~2h',
role: 'Editor',
});
});
+ it('edits the exact page and the change, and keeps how it is checked (AC-010)', () => {
+ const onSave = vi.fn();
+ render(
+ <TaskDetailForm
+ text="Refresh /pricing"
+ details={parseTaskDetails({
+ url: '/pricing',
+ change: { before: 'Old intro', after: 'New intro' },
+ check: 'rerun',
+ })}
+ disabled={false}
+ onSave={onSave}
+ onCancel={() => {}}
+ />,
+ );
+ expect(field('URL').value).toBe('/pricing');
+ expect(field('Change · Before').value).toBe('Old intro');
+ type(field('URL'), '/pricing/plans');
+ type(field('Change · After'), 'A table of plans.');
+ act(() => button('Save').click());
+ expect(onSave).toHaveBeenCalledWith(
+ expect.objectContaining({
+ url: '/pricing/plans',
+ before: 'Old intro',
+ after: 'A table of plans.',
+ check: 'rerun',
+ }),
+ );
+ });
+
it('saves a new text, and refuses an empty one', () => {
const onSave = vi.fn();
render(
diff --git a/web/src/components/action-center/task-detail.tsx b/web/src/components/action-center/task-detail.tsx
index 5e681507b..6c0a2e876 100644
--- a/web/src/components/action-center/task-detail.tsx
+++ b/web/src/components/action-center/task-detail.tsx
@@ -18,9 +18,11 @@ import {
SelectValue,
} from '@/components/ui/select';
import {
+ TASK_CHECKS,
TASK_DETAIL_LIMITS,
TASK_TYPES,
hasTaskSpec,
+ isTaskCheck,
isTaskType,
type ActionTaskDetails,
type TaskDetailsEdit,
@@ -114,7 +116,8 @@ function DraftWorkButtons({ work, disabled }: { work: TaskDraftWork; disabled: b
/**
* An opened task (AC-004): where to do it, why, how, when it counts as done
* and what it takes, where it was sent, and for a task sent from the Improve
- * tab its body, platform and evidence (PROMPT-004).
+ * tab its body, platform and evidence (PROMPT-004); and (AC-010) the exact
+ * page, the change to make there and how we check it.
*/
export function TaskDetailView({
details,
@@ -131,6 +134,7 @@ export function TaskDetailView({
draftWork?: TaskDraftWork;
}) {
const t = useTranslations('actionCenter.actionsPage.drawer.task');
+ const tChecks = useTranslations('actionCenter.taskChecks');
const format = useFormatter();
const effort = [details?.effort, details?.role].filter(Boolean).join(' · ');
const sentContent = details?.sent.content ?? null;
@@ -164,8 +168,43 @@ export function TaskDetailView({
)}
{details && hasTaskSpec(details) ? (
<dl className="grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-1.5 text-xs">
+ {details.url && (
+ <Field label={t('url')}>
+ {/^https?:\/\//i.test(details.url) ? (
+ <a
+ href={details.url}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="break-all underline-offset-2 hover:underline"
+ >
+ {details.url}
+ <ArrowUpRight className="ml-0.5 inline h-3 w-3" />
+ </a>
+ ) : (
+ details.url
+ )}
+ </Field>
+ )}
{details.where && <Field label={t('where')}>{details.where}</Field>}
{details.why && <Field label={t('why')}>{details.why}</Field>}
+ {details.change && (
+ <Field label={t('change')}>
+ {details.change.before ? (
+ <>
+ <span className="text-muted-foreground">{t('changeBefore')}: </span>
+ {details.change.before}
+ <br />
+ <span className="text-muted-foreground">{t('changeAfter')}: </span>
+ {details.change.after}
+ </>
+ ) : (
+ <>
+ <span className="text-muted-foreground">{t('changeAdd')}: </span>
+ {details.change.after}
+ </>
+ )}
+ </Field>
+ )}
{details.how.length > 0 && (
<Field label={t('how')}>
<ol className="list-decimal space-y-0.5 pl-4">
@@ -176,6 +215,7 @@ export function TaskDetailView({
</Field>
)}
{details.doneWhen && <Field label={t('doneWhen')}>{details.doneWhen}</Field>}
+ {details.check && <Field label={t('check')}>{tChecks(details.check)}</Field>}
{effort && <Field label={t('effort')}>{effort}</Field>}
</dl>
) : (
@@ -261,11 +301,12 @@ function Field({ label, children }: { label: string; children: React.ReactNode }
}
const NO_TYPE = 'none';
+const NO_CHECK = 'none';
/**
- * Every field of a task, editable (AC-004). The text is saved only when it
- * changed, so a library task keeps rendering from its template in the
- * reader's language.
+ * Every field of a task, editable (AC-004, AC-010). The text is saved only
+ * when it changed, so a library task keeps rendering from its template in
+ * the reader's language.
*/
export function TaskDetailForm({
text,
@@ -283,12 +324,17 @@ export function TaskDetailForm({
}) {
const t = useTranslations('actionCenter.actionsPage.drawer.task');
const tTypes = useTranslations('actionCenter.taskTypes');
+ const tChecks = useTranslations('actionCenter.taskChecks');
const [draft, setDraft] = useState({
title: text,
+ url: details?.url ?? '',
where: details?.where ?? '',
why: details?.why ?? '',
+ before: details?.change?.before ?? '',
+ after: details?.change?.after ?? '',
how: (details?.how ?? []).join('\n'),
doneWhen: details?.doneWhen ?? '',
+ check: details?.check ?? null,
type: details?.type ?? null,
effort: details?.effort ?? '',
role: details?.role ?? '',
@@ -306,10 +352,14 @@ export function TaskDetailForm({
if (!title) return;
void onSave({
title: title === text ? null : title,
+ url: draft.url,
where: draft.where,
why: draft.why,
+ before: draft.before,
+ after: draft.after,
how: draft.how.split('\n'),
doneWhen: draft.doneWhen,
+ check: draft.check,
type: draft.type,
effort: draft.effort,
role: draft.role,
@@ -333,6 +383,17 @@ export function TaskDetailForm({
onChange={(e) => set('title')(e.target.value)}
/>
</FormField>
+ <FormField id={`${id}-url`} label={t('url')}>
+ <Input
+ id={`${id}-url`}
+ value={draft.url}
+ maxLength={TASK_DETAIL_LIMITS.url}
+ placeholder={t('urlPlaceholder')}
+ disabled={disabled}
+ className="h-8 text-xs"
+ onChange={(e) => set('url')(e.target.value)}
+ />
+ </FormField>
<FormField id={`${id}-where`} label={t('where')}>
<Input
id={`${id}-where`}
@@ -354,6 +415,32 @@ export function TaskDetailForm({
onChange={(e) => set('why')(e.target.value)}
/>
</FormField>
+ <FormField
+ id={`${id}-before`}
+ label={`${t('change')} · ${t('changeBefore')}`}
+ hint={t('changeBeforeHint')}
+ >
+ <Textarea
+ id={`${id}-before`}
+ value={draft.before}
+ rows={2}
+ maxLength={TASK_DETAIL_LIMITS.change}
+ disabled={disabled}
+ className="min-h-0 text-xs"
+ onChange={(e) => set('before')(e.target.value)}
+ />
+ </FormField>
+ <FormField id={`${id}-after`} label={`${t('change')} · ${t('changeAfter')}`}>
+ <Textarea
+ id={`${id}-after`}
+ value={draft.after}
+ rows={2}
+ maxLength={TASK_DETAIL_LIMITS.change}
+ disabled={disabled}
+ className="min-h-0 text-xs"
+ onChange={(e) => set('after')(e.target.value)}
+ />
+ </FormField>
<FormField
id={`${id}-how`}
label={t('how')}
@@ -379,6 +466,31 @@ export function TaskDetailForm({
onChange={(e) => set('doneWhen')(e.target.value)}
/>
</FormField>
+ <FormField id={`${id}-check`} label={t('check')}>
+ <Select
+ value={draft.check ?? NO_CHECK}
+ onValueChange={(value) =>
+ setDraft((current) => ({ ...current, check: isTaskCheck(value) ? value : null }))
+ }
+ disabled={disabled}
+ items={[
+ { value: NO_CHECK, label: t('noCheck') },
+ ...TASK_CHECKS.map((check) => ({ value: check, label: tChecks(check) })),
+ ]}
+ >
+ <SelectTrigger id={`${id}-check`} className="h-8 w-full text-xs">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value={NO_CHECK}>{t('noCheck')}</SelectItem>
+ {TASK_CHECKS.map((check) => (
+ <SelectItem key={check} value={check}>
+ {tChecks(check)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </FormField>
<div className="grid grid-cols-3 gap-2">
<FormField id={`${id}-type`} label={t('type')}>
<Select
diff --git a/web/src/components/content/opportunity-detail.tsx b/web/src/components/content/opportunity-detail.tsx
index beeae8966..8b6df5a83 100644
--- a/web/src/components/content/opportunity-detail.tsx
+++ b/web/src/components/content/opportunity-detail.tsx
@@ -962,6 +962,12 @@ function FromTaskCard({
</CardHeader>
<CardContent>
<dl className="grid grid-cols-[6rem_1fr] gap-x-3 gap-y-1.5 text-sm">
+ {task.url && (
+ <>
+ <dt className="text-muted-foreground">{t('url')}</dt>
+ <dd className="min-w-0 break-words">{task.url}</dd>
+ </>
+ )}
{task.where && (
<>
<dt className="text-muted-foreground">{t('where')}</dt>
@@ -974,6 +980,27 @@ function FromTaskCard({
<dd className="min-w-0 break-words">{task.why}</dd>
</>
)}
+ {task.change && (
+ <>
+ <dt className="text-muted-foreground">{t('change')}</dt>
+ <dd className="min-w-0 break-words">
+ {task.change.before ? (
+ <>
+ <span className="text-muted-foreground">{t('changeBefore')}: </span>
+ {task.change.before}
+ <br />
+ <span className="text-muted-foreground">{t('changeAfter')}: </span>
+ {task.change.after}
+ </>
+ ) : (
+ <>
+ <span className="text-muted-foreground">{t('changeAdd')}: </span>
+ {task.change.after}
+ </>
+ )}
+ </dd>
+ </>
+ )}
{task.how && task.how.length > 0 && (
<>
<dt className="text-muted-foreground">{t('how')}</dt>
diff --git a/web/src/lib/action-center/export-labels.ts b/web/src/lib/action-center/export-labels.ts
index cd0a14ad7..cffe0c2d3 100644
--- a/web/src/lib/action-center/export-labels.ts
+++ b/web/src/lib/action-center/export-labels.ts
@@ -48,6 +48,7 @@ export const EXPORT_NAMESPACES = {
tasks: 'actionCenter.actionTasks',
taskStatus: 'actionCenter.taskStatus',
taskTypes: 'actionCenter.taskTypes',
+ taskChecks: 'actionCenter.taskChecks',
signals: 'actionCenter.signalsPage',
signalTexts: 'actionCenter.signalTexts',
signalCategories: 'actionCenter.signalCategories',
@@ -302,6 +303,11 @@ export function labelActionExport(input: ActionExportInput, t: ExportTranslators
event: (event) => actionEventText(event, t.page, t.tasks),
skipped: (reason) => t.export('skipped', { reason }),
taskType: (type) => t.taskTypes(type),
+ taskCheck: (check) => t.taskChecks(check),
+ taskChange: ({ before, after }) =>
+ before
+ ? t.export('taskChangeLine', { before, after })
+ : t.export('taskChangeAdd', { after }),
taskSent: (to) => t.export(to === 'content' ? 'sentToContent' : 'sentToWebhook'),
answerSource: t.export('answerSource'),
},
diff --git a/web/src/lib/action-center/export.test.ts b/web/src/lib/action-center/export.test.ts
index ed25ac3a8..1ebca2450 100644
--- a/web/src/lib/action-center/export.test.ts
+++ b/web/src/lib/action-center/export.test.ts
@@ -137,6 +137,8 @@ const texts: ExportTexts = {
event: () => 'Action created',
skipped: (reason) => `Skipped: ${reason}`,
taskType: (type) => ({ content: 'Content', outreach: 'Outreach' })[type] ?? type,
+ taskCheck: (check) => `check.${check}`,
+ taskChange: ({ before, after }) => (before ? `${before} → ${after}` : `Add: ${after}`),
taskSent: (to) => (to === 'content' ? 'Sent to Content' : 'Sent to the webhook'),
answerSource: 'AI answer',
};
@@ -379,6 +381,9 @@ describe('the Excel file', () => {
null,
null,
null,
+ null,
+ null,
+ null,
'Skipped: Done by hand',
]);
expect(sheets[3].data[1][6]).toBe('ChatGPT, Gemini');
@@ -400,9 +405,12 @@ describe('a task with AC-004 fields', () => {
platformLabel: null,
sources: [],
where: 'acme.example/blog/best-tools · 3 prompts on ChatGPT',
+ url: '/blog/best-tools',
why: 'Cited #2 until Oct 8.\nThe pages cited now have a dated table.',
+ change: { before: null, after: 'A 2026 feature table.' },
how: ['Add a feature table.', 'Put "2026" in the title.'],
doneWhen: 'Cited again on 2 of 3 platforms within 14 days.',
+ check: 'rerun',
type: 'content',
effort: '~2h',
role: 'Content writer',
@@ -419,10 +427,13 @@ describe('a task with AC-004 fields', () => {
expect(actionMarkdown(concrete, label)).toContain(
[
'1. Add a 2026 comparison table to /blog/best-tools (todo) · Content',
+ ' taskUrl: /blog/best-tools',
' taskWhere: acme.example/blog/best-tools · 3 prompts on ChatGPT',
' taskWhy: Cited #2 until Oct 8. The pages cited now have a dated table.',
+ ' taskChange: Add: A 2026 feature table.',
' taskHow: 1) Add a feature table. 2) Put "2026" in the title.',
' taskDoneWhen: Cited again on 2 of 3 platforms within 14 days.',
+ ' taskCheck: check.rerun',
' taskEffort: ~2h · Content writer',
].join('\n'),
);
@@ -436,6 +447,9 @@ describe('a task with AC-004 fields', () => {
expect(cells.type).toBe('Content,');
expect(cells.how).toBe('"1) Add a feature table. 2) Put ""2026"" in the title.",');
expect(cells.done_when).toBe('Cited again on 2 of 3 platforms within 14 days.,');
+ expect(cells.url).toBe('/blog/best-tools,');
+ expect(cells.change).toBe('Add: A 2026 feature table.,');
+ expect(cells.check).toBe('check.rerun,');
const sheet = actionWorkbook(concrete, label)[2];
expect(sheet.data[1]).toEqual([
@@ -443,10 +457,13 @@ describe('a task with AC-004 fields', () => {
'Add a 2026 comparison table to /blog/best-tools',
'Content',
'todo',
+ '/blog/best-tools',
'acme.example/blog/best-tools · 3 prompts on ChatGPT',
'Cited #2 until Oct 8. The pages cited now have a dated table.',
+ 'Add: A 2026 feature table.',
'1) Add a feature table. 2) Put "2026" in the title.',
'Cited again on 2 of 3 platforms within 14 days.',
+ 'check.rerun',
'~2h · Content writer',
'',
]);
diff --git a/web/src/lib/action-center/export.ts b/web/src/lib/action-center/export.ts
index 521efdc3d..2565b4e46 100644
--- a/web/src/lib/action-center/export.ts
+++ b/web/src/lib/action-center/export.ts
@@ -86,10 +86,16 @@ export interface ExportTask {
status: string;
/** "Content", "Outreach"…; empty when the task has none (AC-004). */
type: string;
+ /** The exact page (AC-010). */
+ url: string;
where: string;
why: string;
+ /** "Before: … → After: …", or "Add: …" (AC-010). */
+ change: string;
how: string[];
doneWhen: string;
+ /** How we check it (AC-010). */
+ check: string;
/** "~2h · Content writer". */
effort: string;
/** What else the task carries (an Improve task's body and evidence), and why it was skipped. */
@@ -144,6 +150,10 @@ export interface ExportTexts {
skipped: (reason: string) => string;
/** "Content", "On-page"…, for a task's type (AC-004). */
taskType: (type: string) => string;
+ /** "Automatic: we fetch the page again"…, for how a task is checked (AC-010). */
+ taskCheck: (check: string) => string;
+ /** "Before: … → After: …", or "Add: …" (AC-010). */
+ taskChange: (change: { before: string | null; after: string }) => string;
/** "Sent to Content", "Sent to the webhook" (AC-004). */
taskSent: (to: 'content' | 'webhook') => string;
/** What an AI answer a task rests on is called; its id means nothing outside. */
@@ -210,10 +220,13 @@ export function buildActionExport(
title: texts.taskTitle(task),
status: texts.taskStatus(task.status),
type: d?.type ? texts.taskType(d.type) : '',
+ url: oneLine(d?.url),
where: oneLine(d?.where),
why: oneLine(d?.why),
+ change: d?.change ? oneLine(texts.taskChange(d.change)) : '',
how: (d?.how ?? []).map(oneLine),
doneWhen: oneLine(d?.doneWhen),
+ check: d?.check ? texts.taskCheck(d.check) : '',
effort: [d?.effort, d?.role].filter(Boolean).join(' · '),
details: details
.filter((part): part is string => !!part)
@@ -315,10 +328,13 @@ export function actionMarkdown(a: ActionExport, label: Labels): string {
lines.push(
`${task.number}. ${task.title} (${task.status})${task.type ? ` · ${task.type}` : ''}`,
);
+ if (task.url) lines.push(` ${label('taskUrl')}: ${task.url}`);
if (task.where) lines.push(` ${label('taskWhere')}: ${task.where}`);
if (task.why) lines.push(` ${label('taskWhy')}: ${task.why}`);
+ if (task.change) lines.push(` ${label('taskChange')}: ${task.change}`);
if (task.how.length) lines.push(` ${label('taskHow')}: ${steps(task.how)}`);
if (task.doneWhen) lines.push(` ${label('taskDoneWhen')}: ${task.doneWhen}`);
+ if (task.check) lines.push(` ${label('taskCheck')}: ${task.check}`);
if (task.effort) lines.push(` ${label('taskEffort')}: ${task.effort}`);
if (task.details) lines.push(` ${task.details}`);
}
@@ -347,10 +363,13 @@ export const ACTION_CSV_HEADERS = [
'type',
'entity',
'details',
+ 'url',
'where',
'why',
+ 'change',
'how',
'done_when',
+ 'check',
'effort',
'status',
'category',
@@ -392,10 +411,13 @@ export function actionCsv(a: ActionExport): string {
title: task.title,
type: task.type,
details: task.details,
+ url: task.url,
where: task.where,
why: task.why,
+ change: task.change,
how: steps(task.how),
done_when: task.doneWhen,
+ check: task.check,
effort: task.effort,
status: task.status,
link: a.link,
@@ -568,9 +590,12 @@ export function actionWorkbook(a: ActionExport, label: Labels): Sheet<Blob>[] {
{ width: 12 },
{ width: 14 },
{ width: 40 },
+ { width: 40 },
{ width: 50 },
{ width: 60 },
+ { width: 60 },
{ width: 40 },
+ { width: 30 },
{ width: 20 },
{ width: 50 },
],
@@ -580,10 +605,13 @@ export function actionWorkbook(a: ActionExport, label: Labels): Sheet<Blob>[] {
label('task'),
label('type'),
label('status'),
+ label('taskUrl'),
label('taskWhere'),
label('taskWhy'),
+ label('taskChange'),
label('taskHow'),
label('taskDoneWhen'),
+ label('taskCheck'),
label('taskEffort'),
label('details'),
].map(bold),
@@ -592,10 +620,13 @@ export function actionWorkbook(a: ActionExport, label: Labels): Sheet<Blob>[] {
task.title,
task.type,
task.status,
+ task.url,
task.where,
task.why,
+ task.change,
steps(task.how),
task.doneWhen,
+ task.check,
task.effort,
task.details,
]),
diff --git a/web/src/lib/action-center/task-details.test.ts b/web/src/lib/action-center/task-details.test.ts
index c395a16a4..d62a5b040 100644
--- a/web/src/lib/action-center/task-details.test.ts
+++ b/web/src/lib/action-center/task-details.test.ts
@@ -12,9 +12,12 @@ const empty = {
platformLabel: null,
sources: [],
where: null,
+ url: null,
+ change: null,
why: null,
how: [],
doneWhen: null,
+ check: null,
type: null,
effort: null,
role: null,
@@ -62,6 +65,27 @@ describe('parseTaskDetails', () => {
});
});
+ it('reads the exact page, the change and how it is checked (AC-010)', () => {
+ expect(
+ parseTaskDetails({
+ url: ' /blog/best-tools ',
+ change: { before: ' ', after: 'H2 "How accurate is it?" with a 50-word answer.' },
+ check: 'auto',
+ }),
+ ).toEqual({
+ ...empty,
+ url: '/blog/best-tools',
+ // Nothing it replaces: it adds.
+ change: { before: null, after: 'H2 "How accurate is it?" with a 50-word answer.' },
+ check: 'auto',
+ });
+ // A change with no new text is none; an unknown check is none.
+ expect(
+ parseTaskDetails({ where: '/x', change: { before: 'Old', after: ' ' }, check: 'weekly' }),
+ ).toEqual({ ...empty, where: '/x' });
+ expect(parseTaskDetails({ change: 'Add an H2' })).toBeNull();
+ });
+
it('ignores what is malformed rather than failing on it', () => {
expect(
parseTaskDetails({
@@ -83,10 +107,14 @@ describe('parseTaskDetails', () => {
describe('cleanTaskDetailsEdit', () => {
const edit = {
+ url: '',
where: '',
why: '',
+ before: '',
+ after: '',
how: [],
doneWhen: '',
+ check: null,
type: null,
effort: '',
role: '',
@@ -96,16 +124,42 @@ describe('cleanTaskDetailsEdit', () => {
expect(
cleanTaskDetailsEdit({ ...edit, where: ' /pricing ', why: ' ', effort: ' ~1h ' }),
).toEqual({
+ url: null,
where: '/pricing',
why: null,
+ change: null,
how: [],
doneWhen: null,
+ check: null,
type: null,
effort: '~1h',
role: null,
});
});
+ it('keeps the change only with its new text, and a known check (AC-010)', () => {
+ expect(
+ cleanTaskDetailsEdit({
+ ...edit,
+ url: ' /pricing ',
+ before: ' Old line ',
+ after: ' New line ',
+ check: 'rerun',
+ }),
+ ).toMatchObject({
+ url: '/pricing',
+ change: { before: 'Old line', after: 'New line' },
+ check: 'rerun',
+ });
+ // Before alone is no change; an empty before adds.
+ expect(cleanTaskDetailsEdit({ ...edit, before: 'Old line' }).change).toBeNull();
+ expect(cleanTaskDetailsEdit({ ...edit, after: 'New line' }).change).toEqual({
+ before: null,
+ after: 'New line',
+ });
+ expect(cleanTaskDetailsEdit({ ...edit, check: 'weekly' as never }).check).toBeNull();
+ });
+
it('drops blank steps and keeps at most the limit', () => {
const how = ['One', '', ' ', ...Array.from({ length: 12 }, (_, i) => `Step ${i}`)];
const cleaned = cleanTaskDetailsEdit({ ...edit, how });
@@ -126,10 +180,14 @@ describe('cleanTaskDetailsEdit', () => {
describe('isTaskDetailsEdit', () => {
const edit = {
+ url: '/pricing',
where: '/pricing',
why: '',
+ before: '',
+ after: 'A table of plans.',
how: ['Add a table.'],
doneWhen: '',
+ check: 'auto',
type: 'content',
effort: '',
role: '',
@@ -146,6 +204,11 @@ describe('isTaskDetailsEdit', () => {
expect(isTaskDetailsEdit({ ...edit, how: [1] })).toBe(false);
expect(isTaskDetailsEdit({ ...edit, where: null })).toBe(false);
expect(isTaskDetailsEdit({ ...edit, type: 'marketing' })).toBe(false);
+ // AC-010's fields, from a form before them or with a wrong check.
+ expect(isTaskDetailsEdit({ ...edit, url: undefined })).toBe(false);
+ expect(isTaskDetailsEdit({ ...edit, after: null })).toBe(false);
+ expect(isTaskDetailsEdit({ ...edit, check: 'weekly' })).toBe(false);
+ expect(isTaskDetailsEdit({ ...edit, check: null })).toBe(true);
});
});
diff --git a/web/src/lib/action-center/task-details.ts b/web/src/lib/action-center/task-details.ts
index 0d4ff759a..6ee7db377 100644
--- a/web/src/lib/action-center/task-details.ts
+++ b/web/src/lib/action-center/task-details.ts
@@ -1,6 +1,8 @@
/**
* What a task carries beyond its title (AC-004): where to do it, why, how,
- * when it counts as done, what kind of work it is and what it takes.
+ * when it counts as done, what kind of work it is and what it takes; and
+ * (AC-010) the exact page, the change to make there, and how we check it's
+ * done.
*
* A task sent from the Improve tab (PROMPT-004) also carries its body,
* platform and evidence; both shapes live in `action_tasks.details` and are
@@ -12,6 +14,16 @@
export const TASK_TYPES = ['content', 'on_page', 'technical', 'outreach', 'pr', 'product'] as const;
export type TaskType = (typeof TASK_TYPES)[number];
+/**
+ * How we check a task is done (AC-010): the page fetched again (or a Site
+ * Audit), the prompts run again, or the person confirms it.
+ */
+export const TASK_CHECKS = ['auto', 'rerun', 'manual'] as const;
+export type TaskCheck = (typeof TASK_CHECKS)[number];
+
+/** The change a task makes (AC-010): the text it replaces (null when it adds), and the new text. */
+export type TaskChange = { before: string | null; after: string };
+
export interface ActionTaskDetails {
/** Improve (PROMPT-004): the suggestion as the user edited it. */
body: string | null;
@@ -20,12 +32,18 @@ export interface ActionTaskDetails {
sources: { type: string; ref: string }[];
/** The exact page, prompt, platform, domain or competitor. */
where: string | null;
+ /** The exact page the change is made on (AC-010): a path or a full URL. */
+ url: string | null;
+ /** The change to make there (AC-010). */
+ change: TaskChange | null;
/** The evidence from the action's signals. */
why: string | null;
/** The steps, in order. */
how: string[];
/** A measurable check. */
doneWhen: string | null;
+ /** How we check it (AC-010). */
+ check: TaskCheck | null;
type: TaskType | null;
/** An estimate, e.g. "~2h". */
effort: string | null;
@@ -42,10 +60,15 @@ export interface TaskSent {
/** The fields a person edits in the drawer. */
export interface TaskDetailsEdit {
+ url: string;
where: string;
why: string;
+ /** The change's text before and after; an empty after clears the change. */
+ before: string;
+ after: string;
how: string[];
doneWhen: string;
+ check: TaskCheck | null;
type: TaskType | null;
effort: string;
role: string;
@@ -53,7 +76,9 @@ export interface TaskDetailsEdit {
/** How long each field may be. Steps are lines of one list. */
export const TASK_DETAIL_LIMITS = {
+ url: 500,
where: 300,
+ change: 1000,
why: 600,
step: 300,
steps: 8,
@@ -69,6 +94,17 @@ export function isTaskType(value: unknown): value is TaskType {
return typeof value === 'string' && (TASK_TYPES as readonly string[]).includes(value);
}
+export function isTaskCheck(value: unknown): value is TaskCheck {
+ return typeof value === 'string' && (TASK_CHECKS as readonly string[]).includes(value);
+}
+
+function parseChange(raw: unknown): TaskChange | null {
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;
+ const c = raw as Record<string, unknown>;
+ const after = text(c.after);
+ return after ? { before: text(c.before), after } : null;
+}
+
/**
* A task's details as stored, read defensively: any field may be missing or
* of the wrong type. Null when there is nothing to show.
@@ -90,11 +126,14 @@ export function parseTaskDetails(raw: unknown): ActionTaskDetails | null {
})
.filter((source) => source.type && source.ref),
where: text(r.where),
+ url: text(r.url),
+ change: parseChange(r.change),
why: text(r.why),
how: (Array.isArray(r.how) ? r.how : [])
.map(text)
.filter((step): step is string => step !== null),
doneWhen: text(r.doneWhen),
+ check: isTaskCheck(r.check) ? r.check : null,
type: isTaskType(r.type) ? r.type : null,
effort: text(r.effort),
role: text(r.role),
@@ -120,13 +159,16 @@ export function hasTaskDetails(details: ActionTaskDetails): boolean {
);
}
-/** Whether the AC-004 fields say something; the Improve ones aside. */
+/** Whether the AC-004 and AC-010 fields say something; the Improve ones aside. */
export function hasTaskSpec(details: ActionTaskDetails): boolean {
return (
+ details.url !== null ||
details.where !== null ||
details.why !== null ||
+ details.change !== null ||
details.how.length > 0 ||
details.doneWhen !== null ||
+ details.check !== null ||
details.type !== null ||
details.effort !== null ||
details.role !== null
@@ -145,11 +187,12 @@ const clip = (value: string, max: number): string | null => {
export function isTaskDetailsEdit(value: unknown): value is TaskDetailsEdit {
if (!value || typeof value !== 'object') return false;
const v = value as Record<string, unknown>;
- const strings = ['where', 'why', 'doneWhen', 'effort', 'role'] as const;
+ const strings = ['url', 'where', 'why', 'before', 'after', 'doneWhen', 'effort', 'role'] as const;
return (
strings.every((key) => typeof v[key] === 'string') &&
Array.isArray(v.how) &&
v.how.every((step) => typeof step === 'string') &&
+ (v.check === null || isTaskCheck(v.check)) &&
(v.type === null || isTaskType(v.type))
);
}
@@ -161,15 +204,22 @@ export function isTaskDetailsEdit(value: unknown): value is TaskDetailsEdit {
*/
export function cleanTaskDetailsEdit(
edit: TaskDetailsEdit,
-): Pick<ActionTaskDetails, 'where' | 'why' | 'how' | 'doneWhen' | 'type' | 'effort' | 'role'> {
+): Pick<
+ ActionTaskDetails,
+ 'url' | 'where' | 'why' | 'change' | 'how' | 'doneWhen' | 'check' | 'type' | 'effort' | 'role'
+> {
+ const after = clip(edit.after, TASK_DETAIL_LIMITS.change);
return {
+ url: clip(edit.url, TASK_DETAIL_LIMITS.url),
where: clip(edit.where, TASK_DETAIL_LIMITS.where),
why: clip(edit.why, TASK_DETAIL_LIMITS.why),
+ change: after ? { before: clip(edit.before, TASK_DETAIL_LIMITS.change), after } : null,
how: edit.how
.map((step) => clip(step, TASK_DETAIL_LIMITS.step))
.filter((step): step is string => step !== null)
.slice(0, TASK_DETAIL_LIMITS.steps),
doneWhen: clip(edit.doneWhen, TASK_DETAIL_LIMITS.doneWhen),
+ check: isTaskCheck(edit.check) ? edit.check : null,
type: isTaskType(edit.type) ? edit.type : null,
effort: clip(edit.effort, TASK_DETAIL_LIMITS.effort),
role: clip(edit.role, TASK_DETAIL_LIMITS.role),
diff --git a/web/src/lib/actions/task-details-edit.test.ts b/web/src/lib/actions/task-details-edit.test.ts
index 1f72e055d..b521af15d 100644
--- a/web/src/lib/actions/task-details-edit.test.ts
+++ b/web/src/lib/actions/task-details-edit.test.ts
@@ -38,10 +38,14 @@ const { updateTaskDetails } = await import('./action-center');
const edit = {
title: null,
+ url: ' /pricing ',
where: ' acme.example/pricing ',
why: '',
+ before: '',
+ after: 'A table of plans and prices.',
how: ['Add a table.', ''],
doneWhen: 'Cited again within 14 days.',
+ check: 'rerun' as const,
type: 'content' as const,
effort: '~1h',
role: '',
@@ -68,10 +72,13 @@ describe('updateTaskDetails', () => {
platform: 'chatgpt-web',
platformLabel: 'ChatGPT',
sources: [{ type: 'domain', ref: 'profound.com' }],
+ url: '/pricing',
where: 'acme.example/pricing',
why: null,
+ change: { before: null, after: 'A table of plans and prices.' },
how: ['Add a table.'],
doneWhen: 'Cited again within 14 days.',
+ check: 'rerun',
type: 'content',
effort: '~1h',
role: null,
diff --git a/web/src/lib/content/opportunity-markdown.ts b/web/src/lib/content/opportunity-markdown.ts
index d7f95e382..644773a24 100644
--- a/web/src/lib/content/opportunity-markdown.ts
+++ b/web/src/lib/content/opportunity-markdown.ts
@@ -92,8 +92,16 @@ export function opportunityDocument(
? `From a task in AC-${sd.fromAction.actionNo}`
: 'From an Action Center task',
[
+ task?.url && field('URL', task.url),
task?.where && field('Where', task.where),
task?.why && field('Why', task.why),
+ task?.change &&
+ field(
+ 'Change',
+ task.change.before
+ ? `Before: ${task.change.before} → After: ${task.change.after}`
+ : `Add: ${task.change.after}`,
+ ),
...(task?.how ?? []).map(
(step, i): OpportunityLine => ({ kind: 'step', n: i + 1, text: step, points: [] }),
),
diff --git a/web/src/lib/mcp/action-priority.test.ts b/web/src/lib/mcp/action-priority.test.ts
index ec2255f52..330d12435 100644
--- a/web/src/lib/mcp/action-priority.test.ts
+++ b/web/src/lib/mcp/action-priority.test.ts
@@ -45,6 +45,7 @@ const ACTIONS = [
];
let actionRows: Record<string, unknown>[] = ACTIONS;
+let taskRows: Record<string, unknown>[] = [];
function builder(table: string) {
const chain = {
@@ -65,7 +66,10 @@ function builder(table: string) {
error: null,
}),
then: (resolve: (v: { data: unknown; error: null }) => void) =>
- resolve({ data: table === 'actions' ? actionRows : [], error: null }),
+ resolve({
+ data: table === 'actions' ? actionRows : table === 'action_tasks' ? taskRows : [],
+ error: null,
+ }),
};
return chain;
}
@@ -133,6 +137,35 @@ describe('listActionsFor', () => {
});
describe('getActionFor', () => {
+ it("gives each task the exact page, the change and how it's checked (AC-010)", async () => {
+ taskRows = [
+ {
+ id: 't1',
+ position: 1,
+ task_key: null,
+ title: 'Add an H2 to /blog/tracking',
+ status: 'todo',
+ details: {
+ url: '/blog/tracking',
+ change: { before: null, after: 'H2 "How accurate is AI search tracking?"' },
+ doneWhen: 'H2 present · answer under 60 words · page re-fetched',
+ check: 'auto',
+ },
+ },
+ ];
+ try {
+ const action = await getActionFor(auth, 'a1');
+ expect(action?.tasks[0].details).toMatchObject({
+ url: '/blog/tracking',
+ change: { before: null, after: 'H2 "How accurate is AI search tracking?"' },
+ done_when: 'H2 present · answer under 60 words · page re-fetched',
+ check: 'auto',
+ });
+ } finally {
+ taskRows = [];
+ }
+ });
+
it('gives the action its priority', async () => {
const action = await getActionFor(auth, 'a1');
expect(action?.priority).toEqual({
diff --git a/web/src/lib/mcp/data.ts b/web/src/lib/mcp/data.ts
index 265e20ea0..3b25aaf96 100644
--- a/web/src/lib/mcp/data.ts
+++ b/web/src/lib/mcp/data.ts
@@ -2992,10 +2992,14 @@ function mcpTaskDetails(raw: unknown) {
const d = parseTaskDetails(raw);
if (!d) return null;
return {
+ // The exact page, the change to make there and how we check it (AC-010).
+ url: d.url,
where: d.where,
why: d.why,
+ change: d.change,
how: d.how,
done_when: d.doneWhen,
+ check: d.check,
type: d.type,
effort: d.effort,
role: d.role,
@@ -3098,7 +3102,8 @@ export async function getActionFor(
mode: t.mode ?? null,
permission: t.permission ?? null,
depends_on: (t.depends_on ?? []) as string[],
- // Where, why, how and done-when (AC-004); an Improve task's body and evidence.
+ // Where, why, how and done-when (AC-004), the exact page, the change and how
+ // it's checked (AC-010); an Improve task's body and evidence.
details: mcpTaskDetails(t.details),
})),
// The join that found them is not part of a signal.
diff --git a/web/src/lib/mcp/server.ts b/web/src/lib/mcp/server.ts
index 70346c5e3..0d1c0145c 100644
--- a/web/src/lib/mcp/server.ts
+++ b/web/src/lib/mcp/server.ts
@@ -1180,7 +1180,7 @@ export function createMcpServer(auth: McpAuthContext): McpServer {
'get_action',
{
description:
- 'Get one Action Center action in full: its priority (score, level and the facts it rests on), its payload (the prompts, pages, competitors or numbers it is about), the signals that triggered it, its task list and its event trail. Each task carries `mode` (who carries it out: system, agent, human or human_or_agent) and `permission` (read, write or execute). Read both before proposing to act on a task — anything beyond read needs a human to approve it in the dashboard. A task is described by `title` when someone wrote one, otherwise by `task_key` with `title_params`. `details` says what the task carries beyond that, or null: `where` (the page, prompt, platform, domain or competitor), `why` (the evidence), `how` (the steps), `done_when` (the check that closes it), `type` (content, on_page, technical, outreach, pr or product), `effort` and `role`; a task sent from the Improve tab also carries `body`, `platform`, `platform_label` and `sources`; `sent_to_content` (the opportunity it became) and `sent_to_webhook` say where it was sent. With `format` "markdown" or "csv" it returns the action as the dashboard\'s Copy Data and Export CSV write it instead (everything its tabs show, labelled in English, dates in UTC): Markdown to paste into a doc, ticket or another agent, CSV with a row per affected item, task and signal.',
+ 'Get one Action Center action in full: its priority (score, level and the facts it rests on), its payload (the prompts, pages, competitors or numbers it is about), the signals that triggered it, its task list and its event trail. Each task carries `mode` (who carries it out: system, agent, human or human_or_agent) and `permission` (read, write or execute). Read both before proposing to act on a task — anything beyond read needs a human to approve it in the dashboard. A task is described by `title` when someone wrote one, otherwise by `task_key` with `title_params`. `details` says what the task carries beyond that, or null: `url` (the exact page), `where` (the page, prompt, platform, domain or competitor), `why` (the evidence), `change` (`before`, null when it adds text, and `after`), `how` (the steps), `done_when` (the check that closes it), `check` (how it is checked: auto, the page fetched again; rerun, the prompts run again; manual, a person confirms), `type` (content, on_page, technical, outreach, pr or product), `effort` and `role`; a task sent from the Improve tab also carries `body`, `platform`, `platform_label` and `sources`; `sent_to_content` (the opportunity it became) and `sent_to_webhook` say where it was sent. With `format` "markdown" or "csv" it returns the action as the dashboard\'s Copy Data and Export CSV write it instead (everything its tabs show, labelled in English, dates in UTC): Markdown to paste into a doc, ticket or another agent, CSV with a row per affected item, task and signal.',
inputSchema: {
action_id: relaxedUuid.describe('Action UUID, from list_actions or list_action_history.'),
format: z
diff --git a/web/src/types/index.ts b/web/src/types/index.ts
index 6c2fdab61..94ef12481 100644
--- a/web/src/types/index.ts
+++ b/web/src/types/index.ts
@@ -252,6 +252,9 @@ export interface ContentOpportunitySourceData {
actionNo: number | null;
taskId: string;
task?: {
+ /** The exact page, and the change to make there (AC-010). */
+ url?: string;
+ change?: { before: string | null; after: string } | null;
where?: string;
why?: string;
how?: string[];