Echo/Docs

CLI command

market-size

A product's market sizing model: sourced assumptions beside the tracking metrics that measure them, with each ended week's measured value kept.

Invocation#

Shell
echo-cli market-size show --product <id> --days <days>
echo-cli market-size add --product <id> --name <text> --value <number> --unit <text> --source <link-or-citation> [--metric <metric-id>] --by <name>
echo-cli market-size remove --id <assumption-id>
echo-cli market-size weeks --product <id>
echo-cli market-size record [--week <YYYY-MM-DD>] --by <name>

Inputs and output#

show writes product_id, since (the start of the window) and assumptions, each with id, product_id, name, value, unit, source, metric_id, created_by, created_at and measured: null when no metric measures it, else the metric (as tracking metrics list prints it), its value over the window and share_of_assumed, the value over the assumed value. add and remove write the assumption they made or removed. weeks writes every kept week of the product's measured assumptions, newest first, as assumption_id, week_start (its Monday), metric_id, assumed, measured, recorded_by and recorded_at; record writes week_start, week_end, recorded (the rows kept now) and already (how many were kept for that week before).

State effect#

Every verb calls Echo Web's authenticated /api/analytics/market-size (weeks and record: /api/analytics/market-size/weeks) with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL; the Market sizing section of the tracking screen and the Market sizing section of Echo Desktop's GEO screen call the same operations, and echo-mcp reads the model (echo_market_size) but cannot change it, and reads and keeps weeks (echo_market_size_weeks, echo_market_size_week_record). An assumption names what it counts (such as companies in the market, reachable teams or winnable accounts), the value assumed, its unit and where the value comes from; one nobody can trace is not kept. --metric names the product's tracking metric (see tracking metrics define) that measures the same thing; its value is counted from the stored web and mobile events of the last --days days on every show, as metrics tree counts it, and never stored. A metric cannot be removed while an assumption is measured by it. A name is used once per product whatever its case; remove an assumption to state it again. Every Monday at 05:47 UTC /api/cron/market-size-weeks keeps the ISO week that just ended (Monday 00:00 UTC up to the next Monday) for every measured assumption of every product: the metric counted over that week's stored events beside the value assumed then, in market_size_weeks; record does the same now for the week holding --week, or the last week ended. A week already kept for an assumption keeps its first row, so the history is never rewritten.

Refusals#

  • A wrong invocation is refused before anything is sent: "market-size takes <every verb's usage, separated by semicolons>; got <word>", "market-size <verb> does not take <flag>; it takes …", "<flag> needs a value", "market-size <verb> needs <flag>" for each flag the verb needs, and "--value must be a number; got <text>".
  • record is refused with "week_of must be a YYYY-MM-DD day; got <value>" and "the week of <Monday> ends at <time> and is not over; its measurement would still move"; weeks with "product_id is required: the product whose kept sizing weeks to read"; and recorded_by like created_by.
  • Echo Web answers a bad request with "product_id is required: …", "days is required: …", "days must be a positive whole number: the window to read", "name is required: …", "value must be a positive number: what is assumed; got <value>", "unit is required: …", "source is required: where the value comes from, as a link or a citation; an assumption nobody can trace is not kept", "metric_id must be the tracking metric that measures the assumption, or null when none does" or "created_by is required: an internal caller has no signed-in user, so it names who is acting"; not found with "no product has id <id>; echo-cli products lists the ones that exist", "product <id> has no metric <id>; echo-cli tracking metrics list --product <id> lists them" or "no assumption has id <id>; …"; and a conflict with "product <id> already assumes <name> as <id>; remove it to state it again". The command prints Echo Web's sentence and exits non-zero.