Skip to content

feat(action-center): plan a task list instead of copying one - #830

Merged
gkhngyk merged 1 commit into
mainfrom
feature/task-registry
Sep 25, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/task-registry

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 5 of #818. The task list stops being a constant.

Every action of a given kind was given the same list of tasks, written inline
in its definition, regardless of what the brand actually had. A brand with no
analytics connection was still told to measure what a visibility drop cost in
sessions — a question it has no way to answer.

Task text is now a primitive with an identity. The registry holds 24 of them,
each declaring:

requires the sources a brand needs before the task is worth planning
mode agent when the work is reading data we already hold, manual when it changes something we do not own
permission approval when carrying it out reaches outside Ansvisor
dependsOn what must finish first — previously implied by array position and enforced by nobody
outputs the keys its result carries, so one task's finding can feed the next
version bumped when what the task asks for changes, recorded on the rows it planned

Definitions now list task ids and nothing else. The planner selects.

The exit condition, against production

Two brands, the same definition, their real connected sources:

with analytics   sources=[tracking,competitors,site_audits,analytics]
  analyze_losses -> measure_traffic_impact -> coverage_gaps -> update_content
  -> internal_links -> validate

without          sources=[tracking,competitors]
  analyze_losses -> coverage_gaps -> update_content -> internal_links -> validate

Three tasks exist only for a connected source — measure_traffic_impact
(analytics), competitor_pressure (competitors), page_readiness (audits).
They are what makes the plans differ, and the difference is not theoretical:
of 151 brands, 7 have analytics connected, 20 have audits, 126 have
competitors.

This also gives phase 4's optional source declarations their first reader.
They were declared with nothing consuming them; the planner is what consumes
them.

Dependencies follow the plan, not the registry

A dropped task takes its name out of everyone's dependsOn. A dependency
that is not in the plan is not a dependency — leaving the name behind would
block a task on work nobody was asked to do.

Tasks name what they are about

Compare how gemini-web answers the affected prompts against chatgpt-web
rather than Compare how each engine answers the affected prompts.

The values travel as i18n parameters, not as resolved text, so a planned task
stays translatable — the same reasoning as resolving task text at creation in
phase 1, arrived at from the other side. Half a title is worse than none, so
the planner names nothing unless the payload resolves every value the
message needs; a partially filled payload falls back to the plain message
rather than rendering "against undefined".

Two tests guard the pair that can only fail in front of a user: every task
has a message, every target-aware task has a _target variant, and no
message names a value the planner does not supply. They read
web/messages/en.json directly, because a missing key is silent until
someone sees it.

Nothing executes yet

mode and permission are declarations phase 7 reads. Deciding them task by
task now is safer than deciding them in a hurry later. Outreach is the single
task marked as needing approval, because it is the one that reaches outside.

Deferred

Third-party outreach state (prepared → sent → accepted → placed). The
product has no outreach feature; identify_sources and strengthen_sources
are research and relationship work a person does today. A four-state machine
with no producer and no consumer would be a schema for a feature that does
not exist. It returns with the feature.

Related issue

Refs #818

Type of change

  • feat — New feature

How to test

cd server && yarn test     # 564 tests, 45 new
cd web && yarn test && yarn typecheck && yarn lint && yarn build

On the next nightly run, action_tasks rows carry mode, permission,
depends_on, task_version and title_params; a brand with an analytics
connection receives one more task on a recovery than a brand without.

Migration 00088 is applied to the hosted database. Every column is additive
with a default that reproduces today's behaviour, so the 111 existing tasks
are unchanged.

Checklist

  • Branch follows the naming convention (feature/)
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj

Every action of a given kind got the same task list, written inline in its
definition, regardless of what the brand had. A brand with no analytics
connection was still told to measure what a visibility drop cost in sessions.
Both specifications rule that out: the plan should follow from the action's
targets and the data the workspace holds.

Task text stops being a string in a definition and becomes a primitive with
an identity — a registry of 24, each declaring the sources it needs, who can
carry it out, whether carrying it out reaches outside Ansvisor, what must
finish first, and what its result carries. The planner selects from that per
action; definitions list task ids and nothing else.

Against production sources, the same definition for two brands:

  with analytics     analyze_losses -> measure_traffic_impact -> coverage_gaps
                     -> update_content -> internal_links -> validate
  without            analyze_losses -> coverage_gaps -> update_content
                     -> internal_links -> validate

Three tasks exist only for a connected source, which is what makes the plans
differ. Seven brands of 151 have analytics, 20 have audits, 126 have
competitors — so this is not a theoretical difference.

A dropped task takes its name out of everyone's dependsOn. A dependency that
is not in the plan is not a dependency; leaving the name behind would block a
task on work nobody was asked to do.

Tasks that can name what they are about now do — the platform, the
competitor, the count — as i18n parameters rather than resolved text, so a
planned task stays translatable. Half a title is worse than none, so the
planner names nothing unless the payload resolves every value the message
needs.

Nothing executes yet. `mode` and `permission` are declarations phase 7 reads,
decided task by task now rather than in a hurry later: outreach is the one
task marked as needing approval, because it is the one that reaches outside.

Refs #818

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj
@github-actions github-actions Bot added the needs-migration Adds or edits a migration — apply it to the hosted database label Sep 25, 2026
@gkhngyk gkhngyk mentioned this pull request Sep 25, 2026
33 of 37 tasks
@gkhngyk
gkhngyk merged commit de56270 into main Sep 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-migration Adds or edits a migration — apply it to the hosted database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant