← back to Link Ranker dashboard

Link Ranker — Overview

What: Tiny 2-layer MLP (tinygrad) that scores content-review follow-ups into 4 labels.
Where: Sidecar at /var/lib/jarvis/knowledge/ml/integration/c2-link-ranker/
When: Hourly cron link-ranker-score via sentinel
Mode: Shadow validation — predictions write to follow_ups.review_note; routing untouched.
Status: Shipped 2026-05-27. Dashboard live 2026-06-03.

How it works

  1. Hourly cron (0 * * * *) picks pending follow_ups with source='content-review'.
  2. The model featurizes (title, description, created_at, priority) via features.py.
  3. Predicts one of four labels with calibrated probability p:
  4. Writes ranker: LABEL p=0.XX [v1 YYYY-MM-DD] into the review_note column.
  5. Rob (or downstream policy) sets status to approved / rejected — that's ground truth.
  6. Calibration, drift, and the next retraining round use those labels.

Approve / Reject — what it does

The dashboard's items table writes the ground truth labels the ranker needs. Until Rob (or an automated reviewer) marks items, the calibration and drift panels show "awaiting ground truth".

ActionMeaningDB effect
ApproveContent was worth attention — ranker should have predicted high pstatus = 'approved'
RejectContent was not worth attention — ranker should have predicted low pstatus = 'rejected'
ClearUndo a previous decisionstatus = 'pending'

Performance baseline

Test AUC0.863
Shadow accuracy76.5%
Recall93.6%
Precision51.8%
Feature versionv1

Recall is high (catches almost all real positives); precision is the bottleneck. The next retrain wave depends on accumulating ~100+ approve/reject labels.

File map

PathRole
/var/lib/jarvis/knowledge/ml/integration/c2-link-ranker/train_ranker.pyTrains MLP on labeled data
/var/lib/jarvis/knowledge/ml/integration/c2-link-ranker/infer_and_score.pyHourly cron — featurize + predict + write
/var/lib/jarvis/knowledge/ml/integration/c2-link-ranker/features.pyText encoding, FEATURE_VERSION
/var/lib/jarvis/knowledge/ml/integration/c2-link-ranker/model_weights.npzTrained W1/b1/W2/b2 + metadata
sentinel/src/config.ts (line ~315)Cron schedule link-ranker-score
jarvis-bot/src/index.tsProcessor handler — spawns inference script
dashboard/public/link-ranker.htmlThis dashboard's UI
dashboard/server.mjs (handlers handleLinkRankerStats/Items/Decide)Three API endpoints
/var/lib/jarvis/data/activity.db · follow_upsStorage table; review_note + status

Related docs

Open questions / next steps