Repository navigation
feat(action-center): score every action's priority on the server - #1071
Merged
Merged
Conversation
…ls by platform
The Signals list never said which AI platform or location a signal was
about, and named platforms by their raw ids ("Visibility dropped on
gemini-web", "Weak in JP"). Part one of AC-002:
- Each row's Affected cell gets a line with the engines and locations the
signal is about: from the payload for platform and country signals, and
from the prompts' tracked platforms and locations for prompt and topic
signals. A line rather than a column keeps the table within the page
beside a pinned sidebar.
- Platforms and locations read as people know them ("Gemini", "Japan").
- Descriptions carry the measured fact instead of a generic sentence, e.g.
"Your mention rate fell from 34% to 18% against the week before."
- A Platform filter, search over platform and location names, and
platforms and locations columns in the CSV export.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every action's drawer gets Copy Data, Export CSV and Export Excel (AC-005). Copy Data opens the whole action as Markdown, every tab of the drawer, to copy a part or all of it with one click; the copy falls back to the browser's copy command where the clipboard API is blocked. The CSV (action-AC-52.csv, UTF-8 with a BOM) has a row per task and per signal marked by a section column; the Excel workbook has a sheet each for the action, its tasks, its signals and its history. Adds the write-excel-file package, loaded only when a workbook is asked for. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each action gets a priority score from 0 to 100 with a level (critical, high, medium, low), and the facts behind it for "Why this priority?" (AC-006). The score weighs impact, the demand of the most searched prompts, queries or pages, how severe the change is, commercial intent, independent kinds and sources of evidence, whether the ground was held before, and how recent it is, never how many signals repeat. It is worked out when an action is created and again every night, stored in new columns (migration 00144), and orders the queue of waiting findings too, with a little added for each day waited. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
@gkhngyk AC-006 part 1 (server) ready for review: a 0–100 priority score with a level and its reasons on every action, worked out nightly and on create, and used to order the queue of waiting findings. Adds migration 00144 with schema.sql regenerated. Stacked on #1070; the web part follows in a second PR. |
7 of 12 tasks
…rity-score # Conflicts: # supabase/schema.sql
This was referenced Oct 15, 2026
# Conflicts: # web/src/components/action-center/action-drawer.tsx
…ed event text Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # server/src/lib/action-center/from-prompt-improve.js # supabase/schema.sql # web/src/types/supabase.ts
# Conflicts: # supabase/schema.sql
# Conflicts: # supabase/schema.sql
…ure/action-export
…ure/action-priority-score # Conflicts: # supabase/schema.sql
…ure/action-export
…ure/action-priority-score # Conflicts: # supabase/schema.sql
…ure/action-export
…ure/action-priority-score # Conflicts: # supabase/schema.sql
…rity-score # Conflicts: # supabase/schema.sql
…rity-score # Conflicts: # web/src/lib/action-center/display.test.ts
…rity-score # Conflicts: # supabase/schema.sql
gkhngyk
approved these changes
Oct 17, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Reviewed. Merged main into the branch (conflicts in from-prompt-improve.js and the generated types kept both sides; schema.sql regenerated). Migration 00144 is applied to production. Scoring stays on the server and the app falls back to impact while a row is unscored.
Merged
5 of 12 tasks
gkhngyk
pushed a commit
that referenced
this pull request
Oct 18, 2026
…backfill unscored ones (#1145) Priority scores (#1071, migration 00144) are worked out when an action is created and again by the nightly generator. Actions opened before then show "—" in the Priority Score column until the next nightly pass, and completed or dismissed ones never get a score. The generator also doesn't run when a brand's signal pass is skipped for no fresh results, so such a brand's actions stayed unscored, or kept old scores. - rescoreBrandActions (priority-data.js) scores a brand's actions in one go: their open signals and the prompts' demand are read once. - A skipped signal pass now rescores the brand's active actions, best effort; the ledger row records how many. - scripts/rescore-actions.js scores every action with no score yet, in any status, for one brand or --all. Safe to re-run. Co-authored-by: Cihan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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-006, part 1 of 2 (server). Every action gets a priority score from 0 to 100, a level and the facts behind it. The web part (the list column and default sort, Top Actions limited to 5, the drawer header, "Why this priority?", the CSV, Copy Data and MCP) follows in a second PR.
Stacked on #1070, which sits on #1058; please review the third commit,
feat(action-center): score every action's priority on the server, or merge those first. Nothing in this PR depends on their code; the second PR does.Spec:
AC-006-priority-score.mdandAC-spec-priority-score-signal-intelligence.md§2–7.Why
Impact (high / medium / low) was the only thing actions were ordered by, so a brand with eleven high-impact actions had eleven "top" ones and no order among them. Priority answers the other question the spec asks: what to do first.
The score (
lib/action-center/priority.js, pure)Seven factors, each read as 0–1 and weighted to 100. The weights live in
config/action-engine.js→priority.prompt_volumes), search impressions, or AI-traffic sessions, on a log scale."Why this priority?" as facts
priority_reasonstores the facts, not a sentence, so the app can write the sentence in the reader's language:change, the subject (entity,count), anddayssince the evidence.high/medium/low, or null when unmeasured, with thesearchesbehind it.commercial, andheldBefore(ground the brand held and lost).kindsandsources.When it is worked out
generate.js)Prompt demand is read once per brand per night (
priority-data.js, chunked and paged). If that read fails, actions are still scored, with demand unknown.The queue uses the same number (your decision)
The queue of waiting findings, and so which actions open each day, used to be ordered by impact plus how many targets an action covered (the opposite of quantity ≠ priority). It is now ordered by the priority score, plus 1 point per day waited up to 14. Nothing starves: two weeks of patience is worth about one level.
Database: migration
00144_action_priority_score.sqlactions.priority_score(smallint, 0–100),priority_level,priority_reason(jsonb),priority_updated_at.schema.sqlandweb/src/types/supabase.ts.Review
I ran a code review before opening this. Six of eight findings are fixed:
Two are left as is, by design:
Related issue
None. Product spec AC-006 (Action Center), part 1.
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
00144_action_priority_score.sql.priority_score,priority_levelandpriority_reason.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): onlytypes/supabase.tschanged on the web sideyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
server:npm run format,npm run lint(clean), andnpm test1193/1193. New and changed tests:priority.test.js:priority-data.test.js: largest volume and newest intent, chunking and paging, scoring on create when demand cannot be read.generate.test.js:updated_at;candidates.test.js: rewritten for priority plus wait.bash supabase/build-schema.sh: run.🤖 Generated with Claude Code