8000 Runbook restates the points formula, which now has a single source · Issue #387 · jra3/mulm · GitHub
[go: up one dir, main page]

Skip to content

Runbook restates the points formula, which now has a single source #387

Open

Description

@jra3

Problem

steve-prod-sync-RUNBOOK.md:44 hand-writes the points formula inside a flyctl ssh verification one-liner:

SUM(points + IFNULL(article_points,0) + IFNULL(first_time_species,0)*5 + IFNULL(cares_species,0)*5 + IFNULL(flowered,0)*points + IFNULL(sexual_reproduction,0)*points)

Since #381, the rule has exactly one source — src/points.ts, exported as a SQL fragment and a TypeScript function. Every query in the codebase composes it. This runbook copy is now the only hand-written instance left, and nothing will fail if it drifts: it is a shell string in a Markdown file, so a future change to the rule leaves it silently wrong while still returning a plausible number.

Why it matters

The runbook's purpose is verification — it exists to confirm a production data patch landed correctly. A verification step computing the total by a stale rule would confirm the wrong thing, which is worse than having no check.

Options

  1. Replace the inline SQL with a small script that imports totalPointsSql from src/points.ts, so the runbook and the app cannot disagree.
  2. Have the runbook hit an existing endpoint (it already suggests eyeballing /member/13) and drop the SQL entirely.
  3. Leave the SQL but add a comment pointing at src/points.ts as the source of truth, accepting that it can drift.

Option 2 is probably cheapest — the runbook already says "Optionally eyeball https://basny-bap-staging.fly.dev/member/13", and that page now reports the same total as everything else.

Context

Found during review of #381. Out of scope there, which was limited to the codebase.

Activity

  1. added
    documentationImprovements or additions to documentation
    priority:lowLow priority - nice to have
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpriority:lowLow priority - nice to have

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0