Repository navigation
feat(content): rank the Content Plan by the Action Center's Priority Score model - #1356
Conversation
…Score model Step 2 of the Plan's Priority Score (spec v2): the score follows AC-006's model, weighted factors with an unknown value neutral, not zero: 40 severity (a drop 0.6–1 by its share or the citations lost, a new page 0.5, a page to improve 0.35, one to protect 0.2), 30 opportunity (its score, 0.4 without one), 20 page value (AI visits on a log scale, 1,000 counting in full; 0.5 for a new page or a brand with no AI traffic data) and 10 citation strength (citations / 30). Points are kept to one decimal so pages a citation apart don't tie; the badge shows the whole score. Drops rank first, then new and existing pages, protecting last. The score's tooltip lists the four parts and their points. Priority marks, hidden rows, MAX_PROTECT and MAX_ROWS are unchanged; the old bases and caps go. Conversions per page are left for a follow-up (they need content_plan_pages to read them). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk this is step 2 of the Plan's Priority Score: AC-006's weighted model (40 severity, 30 opportunity, 20 page value, 10 citation strength), with an unknown value counted as neutral. You reviewed the old weights on #1308; the before/after on demo data is in the body. The user asked to go ahead without waiting on the weights, so any change you'd like can follow here or in a later PR. Conversions per page are a follow-up, since they need content_plan_pages to read them. |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good on the mechanics:
- The list is ranked by the same
scorethe badge shows (Math.round, which keeps the order). - The tooltip's parts add up to it.
- Unknown values are neutral.
- Nothing else used the removed
citationsDownScore/protectScore. - There's no SQL change: page value reads the
aiVisitsthatcontent_plan_pages(00238) already returns.
One thing to settle before merge:
-
Almost every row now reads "Low". The badge keeps the Action Center's level cut-offs (
_plan-table.tsx:258,priorityLevelOf: 50 / 75 / 90). Under these weights (web/src/lib/content/plan.ts:134-140) the scores have ceilings:Row Highest score New page 60 Existing page with no drop 74 Protected page 50 So only a page losing citations can reach High. In the demo table, 8 of the 9 rows are Low, where #1342 showed Medium or High.
Either give the Plan its own cut-offs that fit this range, or leave the level word off the Plan's badge until the weights settle. Then update thepage.test.tsxexpectations to match.
Optional: once a row goes to the Action Center as a task, that task gets its own Priority Score from priority.js, a different number for the same work. A line in the tooltip ("ranks the Plan; the Action Center scores its tasks on its own") would head off the question.
…offs Review fix: under the Plan's weights a new page tops out at 60, an existing page with no drop at 74 and a top page with no opportunity at 50, so the Action Center's 90/75/50 read nearly every row Low. The Plan's badge now reads Critical from 75, High from 55 (a new page from an opportunity score of about 82), Medium from 40. The tooltip adds that the score ranks the Plan and the Action Center scores its tasks on its own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk fixed in 5415120: the Plan's badge has its own cut-offs (
In the demo table the rows now read 52 Medium, 48 Medium and 35 Low. The optional line is in the tooltip too: "This score ranks the Plan. The Action Center scores its tasks on its own." Checks: web lint (0 errors), typecheck, 2,633 tests, format:check and build. |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good. Both earlier items are done in 5415120a:
-
Levels. The badge uses
planPriorityLevel(web/src/lib/content/plan.ts:146-153): Critical from 75, High from 55, Medium from 40. The ceilings in its comment match the weights:Row Highest score Highest level New page (20 + 30 + 10 neutral) 60 High, from an opportunity score of 82 Existing page, no drop (14 + 30 + 20 + 10) 74 High Defend opportunity, no drop (8 + 30 + 20 + 10) 68 High Top page, no opportunity (8 + 12 + 20 + 10) 50 Medium Any page losing citations (severity 24 to 40) 82 to 100 Critical So only a page losing citations can reach Critical.
-
Where the level shows.
ScoreBadge(_plan-table.tsx:265) is the only place the Plan shows a level. It passes the same rounded score it displays, which is also what the test uses. Nothing filters or sorts by level: the list still ranks byscore. Merged on main, the table has nopriorityLevelOfleft. -
Tooltip. The "ranks the Plan" line is in, and
page.test.tsxchecks it.
Optional: the comment at web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.test.tsx:214 says "High from 60". The cut-off is 55.
Merge notes
- It merges cleanly on current main (
401558db), with no conflicts. It contains no other open PR and adds no migration.
Summary
Step 2 of the Plan's Priority Score (step 1, the column and its breakdown, was #1342). The spec asks for the Plan's ranking to follow the Action Center's Priority Score (AC-006) plus page value. The user asked not to wait for weight input on #1342 (comment 6336864974) and to build it with the weights below. Comments on the weights are welcome; this doesn't block on them.
Score = 40·Severity + 30·Opportunity + 20·Page value + 10·Citation strength (
web/src/lib/content/plan.ts). As inpriority.js, each factor is 0–1, and an unknown value is neutral, not zero.0.6 + 0.4·max(drop%, min(1, lost/20)), so 0.6–1. A new page 0.5, an existing page from an opportunity 0.35, a page to protect 0.2.log10(1+v)/log10(1001), so 1,000 a period counts in full. A new page: 0.5. A brand with no AI traffic data (no page with an AI visit): 0.5, so brands without GA or the snippet aren't penalised.planPriorityLevel). The Action Center's 90 / 75 / 50 left almost every row Low under these weights. A new page tops out at 60, an existing page with no drop at 74 and a top page with no opportunity at 50.defendopportunity can reach High.MAX_PROTECT,MAX_ROWS, ties by title.DROP_BASE,PROTECT_BASE,MAX_PROTECT_SCORE,citationsDownScore,protectScore.content_plan_pagesto read them, a migration of its own, so they're a follow-up. Page value then becomes 60% visits + 40% conversions.Demo data, 30 days, before → after:
Drops rank first (none in the demo), then new and existing pages, with protecting last. In unit tests, a page down 75% outranks an 80-point new page, which outranks a 70-point optimize, then the top page.
Related issue
Content Plan Priority Score, step 2 (follows #1342).
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
yarn test src/lib/content/plan.test.tscovers each factor, the neutral values, the order (drop → create → optimize → protect), the five protected pages and the drop cap.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
yarn test(2631 tests pass) andyarn build. Checked at 1024 px, light and dark.🤖 Generated with Claude Code