Repository navigation
feat(action-center): give tasks the exact page, the change to make and how we check it (AC-010, part 1) - #1561
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]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This was referenced Oct 26, 2026
8 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.
I'll merge it together with #1562 once 00293 is fixed, so the writer's new checks and the review queue reach the API in the same deploy: with this alone, a written task missing a field is dropped rather than held.
What I checked:
- Where the fields live.
url,changeandcheckgo inaction_tasks.details(jsonb), beside AC-004's fields. On main that column has no check constraint andaction_taskshas no trigger, so the database neither refuses nor rewrites them. There's no migration, andschema.sqlis untouched. - Editing.
- The drawer saves through
updateTaskDetails. That's the same server action, under the same member policy, as the other task fields. isTaskDetailsEditchecks the new fields' types, and checkscheckagainst the three values.cleanTaskDetailsEdittrims and clips each field to the inputs'maxLength: 500 for the URL, 1,000 each for Before and After.- The cleaned fields are merged into the stored details. An Improve task's body and evidence,
source,refsandsentall stay. - The How we check
<Select>has itsitems.
- The drawer saves through
- Rendering.
- The URL is a link only when it starts with
http://orhttps://, and the link hastarget="_blank"andrel="noopener noreferrer". A path, or anything else, shows as text. - Before and After render as plain JSX text, with no
dangerouslySetInnerHTML.whitespace-pre-linekeeps their line breaks. - The Content opportunity's "From a task" card shows the URL as text.
- The URL is a link only when it starts with
- The task writer.
- The schema asks for
url(500),change.beforeandchange.after(1,000 each) andcheck(10), all as strings. - The quality rule refuses a missing URL, a URL that isn't a page address, an empty After and an unknown check. A refused task is asked for once more, as today.
replaceTasksstores a host and path withhttps://, an empty Before as null and the check in lower case.- The answer is longer now. No output cap is set, and both calls are charged at their real usage on the same budget hold, so the extra tokens are metered as before.
- The schema asks for
- Webhook and exports.
action_task.sentgainsurl,changeandcheck, each null when the task has none. No key is renamed or removed. The docs match the code:change.beforeis null when the change adds text.- The CSV gets
url,changeandcheckcolumns between existing ones. Readers that go by header name are unaffected. Readers that go by position see the columns shift, as they did with AC-004's columns.toCsvstill escapes cells that start with a formula character. - The workbook's 13 widths match its 13 columns.
- The MCP export builds its translators from
EXPORT_NAMESPACES, so it getstaskCheckstoo.get_actiongains the three keys, and its description names them.
- Speed.
PAGE_ADDRESSandpageAddressare anchored and have no overlapping repeats. On 100 KB adversarial inputs, each test takes under 1 ms. The schema also holds the model's URL to 500 characters before either one runs. - Tests. These fail without the change:
- the quality cases (URL, change, check, and the URL naming the target);
pageAddress;- the task-send cases (the URL's page when Where names none, and the webhook's null keys);
- the writer's stored details;
parseTaskDetailsandcleanTaskDetailsEdit;- the drawer's view and form;
- the exports and MCP
get_action.
- Merge.
- Before the API deploy.
- The drawer shows and edits URL, Change and How we check right away. The exports and MCP carry them too, since all of that runs in the web app.
- Tasks the writer adds have none of the three fields until the API is deployed. The card shows nothing extra for them.
- URL and Change filled in by hand don't travel yet:
- Send to webhook posts today's payload, though the docs already list the new keys.
- Send to Content ignores the URL, and its card shows no URL or Change.
- "Automatic: we fetch the page again" is only a label until #1565's checks run on the API.
- Nothing that works today breaks.
- Deploy the writer together with #1562. With this PR alone, a written task that misses one of the new fields is refused, and dropped after the second ask. #1562 holds such tasks for review instead.
Follow-ups:
- The writer's Before (
server/src/lib/action-center/task-writer/prompt.js:45,server/src/lib/action-center/task-send.js:107-109).- The evidence carries no page text. Each page comes with its URL, prompts, positions, visits and audit issue labels only. So "quoted from the evidence" can't be met: any non-empty
beforeis the model's own wording, and the card shows it as the page's text. beforenow also decides Send to Content's page. A written task whose Where names no page and whosebeforeis filled becomes "optimize" on its URL, and that URL may be a page still to write.- Until the evidence carries the page's text, ask for the new text only and store no Before:
// prompt.js - change: the change itself, written out. after: the new text, e.g. …. before: always "" (the evidence doesn't carry the page's text yet). // index.js, replaceTasks change: { before: null, after: task.change.after.trim() },
- The same prompt leaves no URL for a page still to write. "From the evidence" can't name such a page, so the task is refused. Say what to give instead, e.g. "for a new page, the path it should have on the brand's site". That's what
quality.test.js's prompt-aimed task already uses.
- The evidence carries no page text. Each page comes with its URL, prompts, positions, visits and audit issue labels only. So "quoted from the evidence" can't be met: any non-empty
- The Content brief doesn't get the change (
server/src/routes/content.js:1257-1267).briefTaskContextgives the brief Where, Why, Steps and Done when, but not the URL or the change. A task sent to Content shows its change on the card, but the brief and the draft are written without it. Add:task.url && `- Page: ${task.url}`, task.change?.after && (task.change.before ? `- Change: replace "${task.change.before}" with "${task.change.after}"` : `- Change: add "${task.change.after}"`),
- Schema bounds (
server/src/lib/action-center/task-writer/prompt.js:18-25).- The comment above the schema says it is looser than the quality rule on purpose, so one bad task doesn't throw the whole answer away. The new limits work against that:
afterat 1,000 characters (an outreach pitch or a written-out table can pass it) andcheckat 10 ("auto (re-fetch)"is 15) are hard limits. - One over-long field fails the whole answer. Both attempts are charged, and the action keeps its template tasks.
- Raise the limits (e.g.
beforeandafter4,000,check40,url2,000). Then havetaskProblemsrefuse what's over the stored limits, so an over-long field costs one task, not the whole answer.
- The comment above the schema says it is looser than the quality rule on purpose, so one bad task doesn't throw the whole answer away. The new limits work against that:
- The drawer's URL and Change (
web/src/lib/action-center/task-details.ts:211-216).- The URL isn't checked.
acme.example/pricingstays as typed and shows as text, while the writer storeshttps://acme.example/pricingand shows it as a link.- Any text goes out as the webhook's
url, which the docs call the exact page. - Keep a URL that is
http(s)://…or/…, addhttps://to a host and path aspageAddressdoes, and show a message on the field for anything else.
- A Before with no After is dropped on save without a word. Add a hint on After saying the change is kept only when After has text.
- The URL isn't checked.
- Bound the work on a long Where or URL in
ownPageOf(server/src/lib/action-center/task-send.js:80-81, on main too). The trim at line 81 grows faster than the token's length. Clip the text to 500 characters before splitting, the same limit the drawer uses:for (const token of text(where).slice(0, 500).split(/[\s·,;()]+/)) {
gkhngyk
approved these changes
Oct 27, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
I'll merge it together with #1562 once 00293 is fixed, so the writer's new checks and the review queue reach the API in the same deploy: with this alone, a written task missing a field is dropped rather than held.
What I checked:
- Where the fields live.
url,changeandcheckgo inaction_tasks.details(jsonb), beside AC-004's fields. On main that column has no check constraint andaction_taskshas no trigger, so the database neither refuses nor rewrites them. There's no migration, andschema.sqlis untouched. - Editing.
- The drawer saves through
updateTaskDetails. That's the same server action, under the same member policy, as the other task fields. isTaskDetailsEditchecks the new fields' types, and checkscheckagainst the three values.cleanTaskDetailsEdittrims and clips each field to the inputs'maxLength: 500 for the URL, 1,000 each for Before and After.- The cleaned fields are merged into the stored details. An Improve task's body and evidence,
source,refsandsentall stay. - The How we check
<Select>has itsitems.
- The drawer saves through
- Rendering.
- The URL is a link only when it starts with
http://orhttps://, and the link hastarget="_blank"andrel="noopener noreferrer". A path, or anything else, shows as text. - Before and After render as plain JSX text, with no
dangerouslySetInnerHTML.whitespace-pre-linekeeps their line breaks. - The Content opportunity's "From a task" card shows the URL as text.
- The URL is a link only when it starts with
- The task writer.
- The schema asks for
url(500),change.beforeandchange.after(1,000 each) andcheck(10), all as strings. - The quality rule refuses a missing URL, a URL that isn't a page address, an empty After and an unknown check. A refused task is asked for once more, as today.
replaceTasksstores a host and path withhttps://, an empty Before as null and the check in lower case.- The answer is longer now. No output cap is set, and both calls are charged at their real usage on the same budget hold, so the extra tokens are metered as before.
- The schema asks for
- Webhook and exports.
action_task.sentgainsurl,changeandcheck, each null when the task has none. No key is renamed or removed. The docs match the code:change.beforeis null when the change adds text.- The CSV gets
url,changeandcheckcolumns between existing ones. Readers that go by header name are unaffected. Readers that go by position see the columns shift, as they did with AC-004's columns.toCsvstill escapes cells that start with a formula character. - The workbook's 13 widths match its 13 columns.
- The MCP export builds its translators from
EXPORT_NAMESPACES, so it getstaskCheckstoo.get_actiongains the three keys, and its description names them.
- Speed.
PAGE_ADDRESSandpageAddressare anchored and have no overlapping repeats. On 100 KB adversarial inputs, each test takes under 1 ms. The schema also holds the model's URL to 500 characters before either one runs. - Tests. These fail without the change:
- the quality cases (URL, change, check, and the URL naming the target);
pageAddress;- the task-send cases (the URL's page when Where names none, and the webhook's null keys);
- the writer's stored details;
parseTaskDetailsandcleanTaskDetailsEdit;- the drawer's view and form;
- the exports and MCP
get_action.
- Merge.
- Before the API deploy.
- The drawer shows and edits URL, Change and How we check right away. The exports and MCP carry them too, since all of that runs in the web app.
- Tasks the writer adds have none of the three fields until the API is deployed. The card shows nothing extra for them.
- URL and Change filled in by hand don't travel yet:
- Send to webhook posts today's payload, though the docs already list the new keys.
- Send to Content ignores the URL, and its card shows no URL or Change.
- "Automatic: we fetch the page again" is only a label until #1565's checks run on the API.
- Nothing that works today breaks.
- Deploy the writer together with #1562. With this PR alone, a written task that misses one of the new fields is refused, and dropped after the second ask. #1562 holds such tasks for review instead.
Follow-ups:
- The writer's Before (
server/src/lib/action-center/task-writer/prompt.js:45,server/src/lib/action-center/task-send.js:107-109).- The evidence carries no page text. Each page comes with its URL, prompts, positions, visits and audit issue labels only. So "quoted from the evidence" can't be met: any non-empty
beforeis the model's own wording, and the card shows it as the page's text. beforenow also decides Send to Content's page. A written task whose Where names no page and whosebeforeis filled becomes "optimize" on its URL, and that URL may be a page still to write.- Until the evidence carries the page's text, ask for the new text only and store no Before:
// prompt.js - change: the change itself, written out. after: the new text, e.g. …. before: always "" (the evidence doesn't carry the page's text yet). // index.js, replaceTasks change: { before: null, after: task.change.after.trim() },
- The same prompt leaves no URL for a page still to write. "From the evidence" can't name such a page, so the task is refused. Say what to give instead, e.g. "for a new page, the path it should have on the brand's site". That's what
quality.test.js's prompt-aimed task already uses.
- The evidence carries no page text. Each page comes with its URL, prompts, positions, visits and audit issue labels only. So "quoted from the evidence" can't be met: any non-empty
- The Content brief doesn't get the change (
server/src/routes/content.js:1257-1267).briefTaskContextgives the brief Where, Why, Steps and Done when, but not the URL or the change. A task sent to Content shows its change on the card, but the brief and the draft are written without it. Add:task.url && `- Page: ${task.url}`, task.change?.after && (task.change.before ? `- Change: replace "${task.change.before}" with "${task.change.after}"` : `- Change: add "${task.change.after}"`),
- Schema bounds (
server/src/lib/action-center/task-writer/prompt.js:18-25).- The comment above the schema says it is looser than the quality rule on purpose, so one bad task doesn't throw the whole answer away. The new limits work against that:
afterat 1,000 characters (an outreach pitch or a written-out table can pass it) andcheckat 10 ("auto (re-fetch)"is 15) are hard limits. - One over-long field fails the whole answer. Both attempts are charged, and the action keeps its template tasks.
- Raise the limits (e.g.
beforeandafter4,000,check40,url2,000). Then havetaskProblemsrefuse what's over the stored limits, so an over-long field costs one task, not the whole answer.
- The comment above the schema says it is looser than the quality rule on purpose, so one bad task doesn't throw the whole answer away. The new limits work against that:
- The drawer's URL and Change (
web/src/lib/action-center/task-details.ts:211-216).- The URL isn't checked.
acme.example/pricingstays as typed and shows as text, while the writer storeshttps://acme.example/pricingand shows it as a link.- Any text goes out as the webhook's
url, which the docs call the exact page. - Keep a URL that is
http(s)://…or/…, addhttps://to a host and path aspageAddressdoes, and show a message on the field for anything else.
- A Before with no After is dropped on save without a word. Add a hint on After saying the change is kept only when After has text.
- The URL isn't checked.
- Bound the work on a long Where or URL in
ownPageOf(server/src/lib/action-center/task-send.js:80-81, on main too). The trim at line 81 grows faster than the token's length. Clip the text to 500 characters before splitting, the same limit the drawer uses:for (const token of text(where).slice(0, 500).split(/[\s·,;()]+/)) {
6 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AC-010 ("Done when" on every task), part 1 of 4: the fields.
AC-010 asks every Action Center task to carry four fields:
This PR adds the three new ones, lets people edit them, and has the AI task writer fill all four.
Plan for the rest:
Where the fields live. They go in
action_tasks.details(jsonb, 00121) beside AC-004's, so there's no migration.url: a full URL or a path.change:{ before, after }.beforeis null when the change adds text.check:auto,rerunormanual.parseTaskDetailsreads each one defensively. A change withoutaftertext, or an unknown check, reads as none.The task card (
task-detail.tsx).The AI task writer (
task-writer/, behindACTION_TASKS_AI).url,changeandcheck.acme.example/blog/x). The last is stored withhttps://, andcheckis stored lowercase.Where the fields travel.
url,changeandcheck, and workbook columns.get_actiontask details.action_task.sent).get_action's description names the new fields. The coach skill's field list follows in a separate docs PR once this merges.Related issue
AC-010 (roadmap), part 1 of 4. Extends AC-004.
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
/pricing), Before/After and How we check, then save. The card shows URL, Change and How we check. A fullhttps://URL is a link.cd server && npx vitest run src/lib/action-center/task-writer src/lib/action-center/task-send.test.jscd web && yarn vitest run src/lib/action-center src/components/action-center src/lib/mcp/action-priority.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(225 files, 2,895 tests); webyarn test(427 files, 4,086 tests) andyarn build, all pass.Checked in the browser (light and dark, 1440 and 1024 px) on a dev task. I edited it, saw URL, Change and How we check on the card (a long URL wraps), then restored the task's details.
🤖 Generated with Claude Code