No description
Find a file
Cursor Agent c278268519
Fix Cred scoring integrity for information-only use
Exclusions now cover contribution ids and whole accounts, and an
excluded review no longer attests a merge. Explanations use the
published post-attribution score and do not divide by zero. Reviews
that mint nothing stay out of the graph. Triage caps are per epoch
and chosen by id. Invalid shares, points, and duplicate event ids are
rejected. Project alpha must be in [0.1, 0.3], and a run that does not
converge publishes no score.

Example scores are unchanged. Dollar tables stay behind --legacy-payouts.
Cred does not determine TSW payments.
2026-11-08 07:35:54 +00:00
docs Fix Cred scoring integrity for information-only use 2026-11-08 07:35:54 +00:00
tests Fix Cred scoring integrity for information-only use 2026-11-08 07:35:54 +00:00
.gitignore Initial import of merit-scoring 2026-09-29 14:26:09 -05:00
credrank.py Fix Cred scoring integrity for information-only use 2026-11-08 07:35:54 +00:00
example_events.json Scorer prints 'Taskuler Forge' with SUPERSEDED payout banner; pool demo labelled superseded scenario; example_output.txt regenerated; README/design doc 2026-10-12 notes 2026-10-12 21:44:14 -05:00
example_output.txt Scoring v0: information-only by default; payout/pool paths behind --legacy-payouts (SUPERSEDED); add unit tests; regenerate example output 2026-10-22 17:10:18 -05:00
LICENSE Add GPL-3.0-or-later LICENSE and SECURITY.md 2026-10-28 13:04:35 -05:00
README.md Fix Cred scoring integrity for information-only use 2026-11-08 07:35:54 +00:00
SECURITY.md Docs: current status block in README; SECURITY.md notes git.taskuler.com is live 2026-10-30 14:53:19 -05:00

Taskuler Forge scoring: reference implementation

Status (2026-10-29)

  • Project: Taskuler Forge (formerly MeritForge) is open-source Git hosting built on Forgejo, a Taskuler project. Landing page: forge.taskuler.com. Forge: git.taskuler.com (live since 2026-10-28, pre-launch, no users yet).
  • This repo: a reference implementation of Cred, an information-only reputation score (a public record of who did checked work). Cred never converts to money.
  • License: GPL-3.0-or-later. Security reports: see SECURITY.md.
  • History: an earlier design included a contributor payout pipeline. It was dropped on 2026-10-11 and is kept in the code only behind --legacy-payouts, labelled SUPERSEDED.

A small, runnable model of information-only Cred, as described in docs/scoring-design.md. Cred is a public record of checked work and never converts to money. Contributor payments are Taskuler TSW-funded tasks, not Cred. The dropped payout tables remain available only with --legacy-payouts, labelled SUPERSEDED, and are not a payment instruction. This is a reference implementation to read, run, and argue about. It is not production code.

  • credrank.py: pure Python 3, standard library only (no numpy or other packages).
  • example_events.json: a fictional small project (example-org/libwidget) with a maintainer, a core dev, a reviewer, a triager, an occasional contributor, a brand-new account, a PR-farming account, and the farmer's sock puppet. All numbers are example data.
  • example_output.txt: the exact output quoted in the design doc's worked example.

Run

Superseded (2026-10-11): the dollar outputs (--pool, --pool-demo, --balance) model the dropped payouts. See the notice at the top.

Scoring v0 (2026-10-22): information-only

credrank.py now defaults to scoring v0: it prints trust levels, flags, v0 points and v1 Cred shares and nothing in dollars. Cred is a public record of checked work and never converts to money. The dropped payout pipeline (--pool, --pool-demo, --balance, payout table) only runs with --legacy-payouts, labelled SUPERSEDED, and is kept as history. Tests: python3 -m unittest discover -s tests -v.

python3 credrank.py                                   # scoring v0: Cred only, no money
# history only: python3 credrank.py --legacy-payouts [--pool N --pool-demo --balance id=N]
python3 credrank.py --explain rae,farmer             # "why is my score X"
python3 credrank.py --legacy-payouts --pool 150 --no-sensitivity --balance olga=12.40   # SUPERSEDED history: tiny treasury: min threshold + accrual
python3 credrank.py --defaults-only                   # ignore the project's weight overrides
python3 credrank.py --alpha 0.1                       # radiation; allowed range is [0.1, 0.3]
python3 credrank.py --events my_events.json           # your own data (same schema)

What it does

  1. Trust levels are set by simple rules: TL0 if the account is under 60 days old or has no accepted work; TL2 at 180 days or more with at least 10 accepted contributions; TL3 if the project made you a maintainer; TL1 otherwise.
  2. Eligibility filters run before any scoring:
    • Only merged PRs mint Cred.
    • A PR mints half as much without an approval from an independent reviewer at TL2 or above.
    • A trivial PR mints ×0.25, and only the first 2 per author per epoch count.
    • Reviews from TL0 accounts and self-reviews mint nothing.
    • A possible rubber-stamp approval mints ×0.5.
    • Invalid or duplicate issues mint nothing, and triage is capped.
    • Low-effort comments are dropped.
    • Maintainer exclusions are applied.
    • Weight overrides are clamped to the 0.5× to 2× guardrail.
  3. Scores, three ways:
    • Naive points: the Payout Stress weights applied to raw counts, shown only for comparison.
    • v0 points: the same weights applied to eligible work only.
    • v1 CredRank: a seed node, radiation alpha, synthetic self-loops, and power iteration to a stationary distribution. Scores are normalized so that total user Cred equals total minted Cred.
  4. Personal attributions are applied after scoring. Each is logged, and a person can give away at most 50% of their Cred.
  5. Payouts (superseded 2026-10-11, kept as history):
    • The pool is split in proportion to v1 Cred.
    • Each person is capped at 35% of the pool, with the excess redistributed.
    • The minimum payout is $25. Smaller amounts accrue until they reach it.
    • Accounts younger than 60 days have their money held (cool-down).
    • Accounts with 2 or more serious anomaly flags are held for review.
    • 20% of each payout is held back for 60 days as a clawback window.
    • Amounts are floored to the cent, and the leftover cents roll over.
  6. Anomaly flags: trivial-heavy, low-merge-rate, review-thin, untrusted-approvals, reaction-ring, invalid-issues, low-effort-comments, new-account.

The default parameters are in the PARAMS, V0_WEIGHTS, V1_NODE_WEIGHTS, and V1_EDGE_WEIGHTS blocks at the top of credrank.py. Where a default comes from SourceCred (the CredRank alpha of 0.1, the convergence threshold of 1e-7, 255 iterations, the 1e-3 synthetic loop weight, and the GitHub plugin weights), the comment says so. The rest are Taskuler Forge example defaults to calibrate during the pilot.

Differences from SourceCred (on purpose)

  • There is no time fibration (user-epoch nodes, beta, or gamma webbing). Recency comes from decaying mint weights over a 3-epoch lookback instead.
  • Personal attributions are applied after scoring. SourceCred applies them inside the Markov chain.
  • Power iteration starts with all mass on the seed rather than from a uniform vector. The fixed point is the same.
  • Rejected work (closed PRs, invalid issues, exclusions) is removed from the graph, not just given zero mint.

Event schema (short)

Each event has type and epoch (YYYY-MM), plus type-specific fields:

  • pr: id, author, state (merged/open/closed), merged_by, lines_changed, trivial, fixes[], references[], commits[{id, authors[]}]
  • review: id, pr, author, verdict (approved/changes_requested/comment), inline_comments
  • issue: id, author, state (closed_fixed/open_accepted/open_untriaged/closed_invalid/closed_duplicate/closed_spam)
  • triage: id, author, issue, action
  • comment: id, author, parent, chars, references[]
  • reaction: author, target, content
  • release: id, author, includes[]
  • initiative: id, title, points, approved_by, beneficiaries{user: share}
  • attribution: from, to, share, reason

overrides[] supports {"type": "exclude", "target", "by", "reason"} and {"type": "weight", "category", "multiplier", "by", "reason"}.

In production, the trivial flag and comment length would come from a diff and text classifier. Here they are hand-labeled.