Skip to main content
Internal Service β€” This is not an HTTP endpoint. It’s called directly by the generate-all orchestrator.

Purpose

Copies the pre-payment ranking score to the visibility_score_history table. This preserves the initial score so users can see their progress over time. Runs in GROUP 1e (parallel with scrape, fire-and-forget). Doesn’t need scraped pages.

Function Signature

async def run_materialize_score(url: str, org_slug: str) -> StepResult

Parameters

ParameterTypeDescription
urlstrThe website URL
org_slugstrThe Clerk organization slug

Returns

{
  "name": "materialize_score",
  "status": "success",
  "data": {
    "score": 72,
    "entity_id": "uuid-..."
  }
}

What It Does

  1. Fetches the pre-payment ranking score from the ranking database
  2. Creates a history entry in visibility_score_history
  3. This becomes the β€œDay 0” baseline for tracking improvement

Database Schema

INSERT INTO visibility_score_history (
  entity_id,
  score,
  recorded_at
) VALUES (
  'uuid-...',
  72,
  NOW()
);

Code Location

src/app/apis/onboarding/generate_all/
β”œβ”€β”€ scoring.py          # materialize_score function
└── tasks/
    └── scoring.py      # run_materialize_score task wrapper